From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Subject: bug#35553: getlogin and getlogin_r fail with error ENXIO Date: Tue, 07 May 2019 12:18:09 +0200 Message-ID: <87v9ym7ela.fsf@gnu.org> References: <5210151.GY8qDU4yXC@omega> <20190504151310.317c7f7b@scratchpost.org> <2692256.Dr6YohQPPZ@omega> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:55067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNxBf-0004gA-N4 for bug-guix@gnu.org; Tue, 07 May 2019 06:19:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNxBe-0006ie-I1 for bug-guix@gnu.org; Tue, 07 May 2019 06:19:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44686) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNxBe-0006iT-Ew for bug-guix@gnu.org; Tue, 07 May 2019 06:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hNxBe-0004qQ-8S for bug-guix@gnu.org; Tue, 07 May 2019 06:19:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <2692256.Dr6YohQPPZ@omega> (Bruno Haible's message of "Sat, 04 May 2019 15:26:16 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Bruno Haible Cc: 35553@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Bruno! Bruno Haible skribis: > Danny Milosavljevic wrote: >> Are you logging in using gdm? > > I'm using the guix-1.0 installation image > (guix-system-vm-image-1.0.0.x86_64-linux). It shows a screen "Logging in.= .." > for less than one second and then starts the user's desktop immediately. This is the VM image (not the installation image), and it uses SLiM: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/examples/vm-im= age.tmpl Danny wrote: > We don't refer to pam_loginuid.so anywhere, so it's understandable that > /proc/self/loginuid is not set either. Is it the only way to get that done? (That something has to write some number to /proc/self/loginuid looks very clunky to me.) I=E2=80=99ve tested the patch below and confirmed that after logging in at = the tty, running Guile and calling =E2=80=98getlogin=E2=80=99 at the REPL now r= eturns the right thing. We=E2=80=99d have to do that for all the relevant services (graphical log-in managers, SSH daemons, anything else?). Perhaps we can simply add a keyword to =E2=80=98unix-pam-service=E2=80=99 to make it less verbose. Thoughts? Thanks for the bug report, Bruno! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 952f6f9ab2..30e50f4b9a 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -829,11 +829,18 @@ Return a service that sets up Unicode support in @var{tty} and loads (define (login-pam-service config) "Return the list of PAM service needed for CONF." ;; Let 'login' be known to PAM. - (list (unix-pam-service "login" - #:allow-empty-passwords? - (login-configuration-allow-empty-passwords? config) - #:motd - (login-configuration-motd config)))) + (let ((base (unix-pam-service + "login" + #:allow-empty-passwords? + (login-configuration-allow-empty-passwords? config) + #:motd + (login-configuration-motd config)))) + (list (pam-service + (inherit base) + (session (cons (pam-entry + (control "required") + (module "pam_loginuid.so")) + (pam-service-session base))))))) (define login-service-type (service-type (name 'login) --=-=-=--