GNU bug report logs -
#35553
getlogin and getlogin_r fail with error ENXIO
Previous Next
Reported by: Bruno Haible <bruno <at> clisp.org>
Date: Fri, 3 May 2019 23:04:01 UTC
Severity: normal
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Hi Bruno!
Bruno Haible <bruno <at> clisp.org> 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-image.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’ve tested the patch below and confirmed that after logging in at the
tty, running Guile and calling ‘getlogin’ at the REPL now returns the
right thing.
We’d 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 ‘unix-pam-service’ to make it less verbose.
Thoughts?
Thanks for the bug report, Bruno!
Ludo’.
[Message part 2 (text/x-patch, 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)
This bug report was last modified 6 years and 11 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.