From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 5A1093858D1E for ; Tue, 14 Feb 2023 09:00:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5A1093858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676365207; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4iRtjwtRb/b65mAOIKam0Lkzyvp+hg3G3YZD6GvwAJ8=; b=BqkDNJA7DoFZhFiIYzAGNIhZzuBfZUyogTjS9XmsMPG+2mMPtjmzBJiffsBP78NkX5tEt9 jjYg8OpaoqMVwTUdRzuqZeIAW9iTGiTy9AL7hdCGDmHIro6vrTc341IpRpEQ5XuNfHC0T4 YwGAcguXwYUKLnpfB6r7XaKwdjH/WPE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-65-RtG_wbdVPzOY7AD-QogniA-1; Tue, 14 Feb 2023 04:00:05 -0500 X-MC-Unique: RtG_wbdVPzOY7AD-QogniA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C9FCA18A6477; Tue, 14 Feb 2023 09:00:01 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 488A02026D4B; Tue, 14 Feb 2023 09:00:01 +0000 (UTC) From: Florian Weimer To: Thorsten Kukuk via Libc-alpha Cc: Thorsten Kukuk Subject: Re: 64-bit time_t and __WORDSIZE_TIME64_COMPAT32 References: <20230208091821.GA2282@suse.com> <0869a6f98f29405eb431f63db593c490@DB6PR04MB3255.eurprd04.prod.outlook.com> <20230208101125.GA5099@suse.com> <20230208102225.GA5543@suse.com> <7485b79473614eaa994d3ea79c91629a@DB6PR04MB3255.eurprd04.prod.outlook.com> <20230208103819.GA6177@suse.com> <901005ca-640f-3a8f-a199-c1374f3cf141@linaro.org> <20230214082409.GA29974@suse.com> Date: Tue, 14 Feb 2023 09:59:59 +0100 In-Reply-To: <20230214082409.GA29974@suse.com> (Thorsten Kukuk via Libc-alpha's message of "Tue, 14 Feb 2023 09:24:09 +0100") Message-ID: <873578bp0w.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Thorsten Kukuk via Libc-alpha: > I think we don't lose anything if btmp and lastlog don't exist anymore. > Querying utmp for the runlevel in systemd times is also obsolete. > Statistical data how many users are logged in if you login or if you > call uptime is also only nice to have, nothing more. This is something that systemd could do, in a far more reliable fashion (or the kernel audit subsystem, I assume). > So the main consumer of utmp is glibc itself: getlogin()/getlogin_r() > Is there any idea how to replace that, if utmp/wtmp gets deprecated? We use /proc/self/loginuid already, and try to resolve that UID using NSS. We still have fallback to __getutline_r. I think it would be really helpful if you could discover why that fallback is used. I would have thought it's dead code. Is it because /proc/self/loginuid is missing, or because NSS fails for some reason? If it's about /proc/self/loginuid, maybe we can look at the owner of /dev/tty instead. > That's the only use case for which I don't see an alternate currently. > The musl libc way to use an environment variable is really not safe... The manual page has strong guidance that getlogin is not to be trusted. /proc/self/loginuid is probably quite hard to fool, though, but the fallback code is another matter. > Another real usecase is to find the TTYs for wall and wall alike > messages by tools like shutdown, systemd and similar. Again, this seems to be more in the realm of the init service. > Functions like login()/logout() are only used by openssh. So should be > solveable, too. Also FTP servers. But we have seen quite a few problems due to account database updates because the data structure isn't great, and isn't really suitable to handling PTYs. Thanks, Florian