From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68040 invoked by alias); 30 Nov 2018 18:47:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 68029 invoked by uid 89); 30 Nov 2018 18:47:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Database, login, nonnegative, non-negative X-HELO: mx1.redhat.com From: Florian Weimer To: libc-alpha@sourceware.org Subject: Re: [PATCH] login: Remove utmp backend jump tables [BZ #23518] References: <20180817144443.0993E4028A8FC@oldenburg.str.redhat.com> Date: Fri, 30 Nov 2018 18:47:00 -0000 In-Reply-To: <20180817144443.0993E4028A8FC@oldenburg.str.redhat.com> (Florian Weimer's message of "Fri, 17 Aug 2018 16:44:42 +0200") Message-ID: <874lbyqu75.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-11/txt/msg00936.txt.bz2 * Florian Weimer: > There is just one file-based implementation, so this dispatch > mechanism is unnecessary. Instead of the vtable pointer > __libc_utmp_jump_table, use a non-negative file_fd as the indicator > that the backend is initialized. > > 2018-08-15 Florian Weimer > > [BZ #23518] > * login/uptmp-private.h (struct ufuncs): Remove definition. > (__libc_utmp_file_functions, __libc_utmp_unknown_functions) > (__libc_utmp_jump_table): Remove declarations. > (__libc_setutent, __libc_getutent_r, __libc_getutid_r) > (__libc_getutline_r, __libc_pututline, __libc_endutent) > (__libc_updwtmp): Declare. > * login/getutent_r.c (__libc_utmp_unknown_functions) > (__libc_utmp_jump_table, setutent_unknown, getutent_r_unknown) > (getutid_r_unknown, getutline_r_unknown, pututline_unknown) > (endutent_unknown): Remove definitions. > (__setutent): Call __libc_setutent. > (__getutent_r): Call __libc_getutent_r. > (__pututline): Call __libc_pututline. > (__endutent): Call __libc_endutent. > * login/getutid_r.c (__getutid_r): Call __libc_getutid_r. > * login/getutline_r.c (__getutline_r): Call __libc_getutline_r. > * login/updwtmp.c (__updwtmp): Call __libc_updwtmp. > * login/utmp_file.c (__libc_utmp_file_functions): Remove definition > (__libc_setutent): Rename from stetutent_file. Drop static. > (maybe_setutent): New function. > (__libc_getutent_r): Rename from getutent_r_file. Drop static. > Check for initialization. > (__libc_getutid_r): Rename from getutid_r_file. Drop static. > Check for initialization. > (__libc_getutline_r): Rename from getutline_r_file. Drop static. > Check for initialization. > (__libc_pututline): Rename from pututline_file. Drop static. > Check for initialization. > (__libc_endutent): Rename from endutent_file. Drop static. Check > for initialization. > (__libc_updwtmp): Rename from updwtmp_file. Drop static. > * login/utmpname.c (__utmpname): Call __libc_endutent. > * sysdeps/unix/getlogin_r (__getlogin_r): Call __libc_setutent, > __libc_getutlien_r, __libc_endutent. > * manual/users.texi (Who Logged In, Manipulating the Database): > Adjust. Ping. This patch still applies to master: Thanks, Florian