From: "Ludovic Courtès" <ludo@gnu.org>
To: Bruno Haible <bruno@clisp.org>
Cc: 35553@debbugs.gnu.org
Subject: bug#35553: getlogin and getlogin_r fail with error ENXIO
Date: Tue, 07 May 2019 12:18:09 +0200 [thread overview]
Message-ID: <87v9ym7ela.fsf@gnu.org> (raw)
In-Reply-To: <2692256.Dr6YohQPPZ@omega> (Bruno Haible's message of "Sat, 04 May 2019 15:26:16 +0200")
[-- Attachment #1: Type: text/plain, Size: 1183 bytes --]
Hi Bruno!
Bruno Haible <bruno@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’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1187 bytes --]
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)
next prev parent reply other threads:[~2019-05-07 10:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 23:03 bug#35553: getlogin and getlogin_r fail with error ENXIO Bruno Haible
2019-05-04 13:13 ` Danny Milosavljevic
2019-05-04 13:26 ` Bruno Haible
2019-05-07 10:18 ` Ludovic Courtès [this message]
2019-05-09 10:13 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v9ym7ela.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=35553@debbugs.gnu.org \
--cc=bruno@clisp.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).