8a8cfb
commit 1a7fe2ebe52b3c8bf465d1756e69452d05c1c103
8a8cfb
Author: Florian Weimer <fweimer@redhat.com>
8a8cfb
Date:   Mon Aug 5 15:54:10 2019 +0200
8a8cfb
8a8cfb
    login: Remove utmp backend jump tables [BZ #23518]
8a8cfb
    
8a8cfb
    There is just one file-based implementation, so this dispatch
8a8cfb
    mechanism is unnecessary.  Instead of the vtable pointer
8a8cfb
    __libc_utmp_jump_table, use a non-negative file_fd as the indicator
8a8cfb
    that the backend is initialized.
8a8cfb
8a8cfb
diff --git a/login/getutent_r.c b/login/getutent_r.c
8a8cfb
index 6a244ba6e0b86da7..44239ecb81bacea4 100644
8a8cfb
--- a/login/getutent_r.c
8a8cfb
+++ b/login/getutent_r.c
8a8cfb
@@ -23,115 +23,16 @@
8a8cfb
 
8a8cfb
 #include "utmp-private.h"
8a8cfb
 
8a8cfb
-
8a8cfb
-/* Functions defined here.  */
8a8cfb
-static int setutent_unknown (void);
8a8cfb
-static int getutent_r_unknown (struct utmp *buffer, struct utmp **result);
8a8cfb
-static int getutid_r_unknown (const struct utmp *line, struct utmp *buffer,
8a8cfb
-			      struct utmp **result);
8a8cfb
-static int getutline_r_unknown (const struct utmp *id, struct utmp *buffer,
8a8cfb
-				struct utmp **result);
8a8cfb
-static struct utmp *pututline_unknown (const struct utmp *data);
8a8cfb
-static void endutent_unknown (void);
8a8cfb
-
8a8cfb
-/* Initial Jump table.  */
8a8cfb
-const struct utfuncs __libc_utmp_unknown_functions =
8a8cfb
-{
8a8cfb
-  setutent_unknown,
8a8cfb
-  getutent_r_unknown,
8a8cfb
-  getutid_r_unknown,
8a8cfb
-  getutline_r_unknown,
8a8cfb
-  pututline_unknown,
8a8cfb
-  endutent_unknown,
8a8cfb
-  NULL
8a8cfb
-};
8a8cfb
-
8a8cfb
-/* Currently selected backend.  */
8a8cfb
-const struct utfuncs *__libc_utmp_jump_table = &__libc_utmp_unknown_functions;
8a8cfb
-
8a8cfb
 /* We need to protect the opening of the file.  */
8a8cfb
 __libc_lock_define_initialized (, __libc_utmp_lock attribute_hidden)
8a8cfb
 
8a8cfb
 
8a8cfb
-static int
8a8cfb
-setutent_unknown (void)
8a8cfb
-{
8a8cfb
-  int result;
8a8cfb
-
8a8cfb
-  result = (*__libc_utmp_file_functions.setutent) ();
8a8cfb
-  if (result)
8a8cfb
-    __libc_utmp_jump_table = &__libc_utmp_file_functions;
8a8cfb
-
8a8cfb
-  return result;
8a8cfb
-}
8a8cfb
-
8a8cfb
-
8a8cfb
-static int
8a8cfb
-getutent_r_unknown (struct utmp *buffer, struct utmp **result)
8a8cfb
-{
8a8cfb
-  /* The backend was not yet initialized.  */
8a8cfb
-  if (setutent_unknown ())
8a8cfb
-    return (*__libc_utmp_jump_table->getutent_r) (buffer, result);
8a8cfb
-
8a8cfb
-  /* Not available.  */
8a8cfb
-  *result = NULL;
8a8cfb
-  return -1;
8a8cfb
-}
8a8cfb
-
8a8cfb
-
8a8cfb
-static int
8a8cfb
-getutid_r_unknown (const struct utmp *id, struct utmp *buffer,
8a8cfb
-		   struct utmp **result)
8a8cfb
-{
8a8cfb
-  /* The backend was not yet initialized.  */
8a8cfb
-  if (setutent_unknown ())
8a8cfb
-    return (*__libc_utmp_jump_table->getutid_r) (id, buffer, result);
8a8cfb
-
8a8cfb
-  /* Not available.  */
8a8cfb
-  *result = NULL;
8a8cfb
-  return -1;
8a8cfb
-}
8a8cfb
-
8a8cfb
-
8a8cfb
-static int
8a8cfb
-getutline_r_unknown (const struct utmp *line, struct utmp *buffer,
8a8cfb
-		     struct utmp **result)
8a8cfb
-{
8a8cfb
-  /* The backend was not yet initialized.  */
8a8cfb
-  if (setutent_unknown ())
8a8cfb
-    return (*__libc_utmp_jump_table->getutline_r) (line, buffer, result);
8a8cfb
-
8a8cfb
-  /* Not available.  */
8a8cfb
-  *result = NULL;
8a8cfb
-  return -1;
8a8cfb
-}
8a8cfb
-
8a8cfb
-
8a8cfb
-static struct utmp *
8a8cfb
-pututline_unknown (const struct utmp *data)
8a8cfb
-{
8a8cfb
-  /* The backend was not yet initialized.  */
8a8cfb
-  if (setutent_unknown ())
8a8cfb
-    return (*__libc_utmp_jump_table->pututline) (data);
8a8cfb
-
8a8cfb
-  /* Not available.  */
8a8cfb
-  return NULL;
8a8cfb
-}
8a8cfb
-
8a8cfb
-
8a8cfb
-static void
8a8cfb
-endutent_unknown (void)
8a8cfb
-{
8a8cfb
-  /* Nothing to do.  */
8a8cfb
-}
8a8cfb
-
8a8cfb
-
8a8cfb
 void
8a8cfb
 __setutent (void)
8a8cfb
 {
8a8cfb
   __libc_lock_lock (__libc_utmp_lock);
8a8cfb
 
8a8cfb
-  (*__libc_utmp_jump_table->setutent) ();
8a8cfb
+  __libc_setutent ();
8a8cfb
 
8a8cfb
   __libc_lock_unlock (__libc_utmp_lock);
8a8cfb
 }
8a8cfb
@@ -145,7 +46,7 @@ __getutent_r (struct utmp *buffer, struct utmp **result)
8a8cfb
 
8a8cfb
   __libc_lock_lock (__libc_utmp_lock);
8a8cfb
 
8a8cfb
-  retval = (*__libc_utmp_jump_table->getutent_r) (buffer, result);
8a8cfb
+  retval = __libc_getutent_r (buffer, result);
8a8cfb
 
8a8cfb
   __libc_lock_unlock (__libc_utmp_lock);
8a8cfb
 
8a8cfb
@@ -162,7 +63,7 @@ __pututline (const struct utmp *data)
8a8cfb
 
8a8cfb
   __libc_lock_lock (__libc_utmp_lock);
8a8cfb
 
8a8cfb
-  buffer = (*__libc_utmp_jump_table->pututline) (data);
8a8cfb
+  buffer = __libc_pututline (data);
8a8cfb
 
8a8cfb
   __libc_lock_unlock (__libc_utmp_lock);
8a8cfb
 
8a8cfb
@@ -177,8 +78,7 @@ __endutent (void)
8a8cfb
 {
8a8cfb
   __libc_lock_lock (__libc_utmp_lock);
8a8cfb
 
8a8cfb
-  (*__libc_utmp_jump_table->endutent) ();
8a8cfb
-  __libc_utmp_jump_table = &__libc_utmp_unknown_functions;
8a8cfb
+  __libc_endutent ();
8a8cfb
 
8a8cfb
   __libc_lock_unlock (__libc_utmp_lock);
8a8cfb
 }
8a8cfb
diff --git a/login/getutid_r.c b/login/getutid_r.c
8a8cfb
index b7d3dbac75774b0a..8cb6b16d735e8265 100644
8a8cfb
--- a/login/getutid_r.c
8a8cfb
+++ b/login/getutid_r.c
8a8cfb
@@ -49,7 +49,7 @@ __getutid_r (const struct utmp *id, struct utmp *buffer, struct utmp **result)
8a8cfb
 
8a8cfb
   __libc_lock_lock (__libc_utmp_lock);
8a8cfb
 
8a8cfb
-  retval = (*__libc_utmp_jump_table->getutid_r) (id, buffer, result);
8a8cfb
+  retval = __libc_getutid_r (id, buffer, result);
8a8cfb
 
8a8cfb
   __libc_lock_unlock (__libc_utmp_lock);
8a8cfb
 
8a8cfb
diff --git a/login/getutline_r.c b/login/getutline_r.c
8a8cfb
index 6996887f76b28816..5607c19ed2e1ca66 100644
8a8cfb
--- a/login/getutline_r.c
8a8cfb
+++ b/login/getutline_r.c
8a8cfb
@@ -36,7 +36,7 @@ __getutline_r (const struct utmp *line, struct utmp *buffer,
8a8cfb
 
8a8cfb
   __libc_lock_lock (__libc_utmp_lock);
8a8cfb
 
8a8cfb
-  retval = (*__libc_utmp_jump_table->getutline_r) (line, buffer, result);
8a8cfb
+  retval = __libc_getutline_r (line, buffer, result);
8a8cfb
 
8a8cfb
   __libc_lock_unlock (__libc_utmp_lock);
8a8cfb
 
8a8cfb
diff --git a/login/updwtmp.c b/login/updwtmp.c
8a8cfb
index 56fb41916a776c0a..7ae96224ca789b6d 100644
8a8cfb
--- a/login/updwtmp.c
8a8cfb
+++ b/login/updwtmp.c
8a8cfb
@@ -29,7 +29,7 @@ __updwtmp (const char *wtmp_file, const struct utmp *utmp)
8a8cfb
 {
8a8cfb
   const char *file_name = TRANSFORM_UTMP_FILE_NAME (wtmp_file);
8a8cfb
 
8a8cfb
-  (*__libc_utmp_file_functions.updwtmp) (file_name, utmp);
8a8cfb
+  __libc_updwtmp (file_name, utmp);
8a8cfb
 }
8a8cfb
 libc_hidden_def (__updwtmp)
8a8cfb
 weak_alias (__updwtmp, updwtmp)
8a8cfb
diff --git a/login/utmp-private.h b/login/utmp-private.h
8a8cfb
index bd8773984cfc56de..5c2048ee52dc3cee 100644
8a8cfb
--- a/login/utmp-private.h
8a8cfb
+++ b/login/utmp-private.h
8a8cfb
@@ -24,24 +24,17 @@
8a8cfb
 #include <utmp.h>
8a8cfb
 #include <libc-lock.h>
8a8cfb
 
8a8cfb
-/* The structure describing the functions in a backend.  */
8a8cfb
-struct utfuncs
8a8cfb
-{
8a8cfb
-  int (*setutent) (void);
8a8cfb
-  int (*getutent_r) (struct utmp *, struct utmp **);
8a8cfb
-  int (*getutid_r) (const struct utmp *, struct utmp *, struct utmp **);
8a8cfb
-  int (*getutline_r) (const struct utmp *, struct utmp *, struct utmp **);
8a8cfb
-  struct utmp *(*pututline) (const struct utmp *);
8a8cfb
-  void (*endutent) (void);
8a8cfb
-  int (*updwtmp) (const char *, const struct utmp *);
8a8cfb
-};
8a8cfb
-
8a8cfb
-/* The tables from the services.  */
8a8cfb
-extern const struct utfuncs __libc_utmp_file_functions attribute_hidden;
8a8cfb
-extern const struct utfuncs __libc_utmp_unknown_functions attribute_hidden;
8a8cfb
-
8a8cfb
-/* Currently selected backend.  */
8a8cfb
-extern const struct utfuncs *__libc_utmp_jump_table attribute_hidden;
8a8cfb
+/* These functions check for initialization, but not perform any
8a8cfb
+   locking.  */
8a8cfb
+int __libc_setutent (void) attribute_hidden;
8a8cfb
+int __libc_getutent_r (struct utmp *, struct utmp **) attribute_hidden;
8a8cfb
+int __libc_getutid_r (const struct utmp *, struct utmp *, struct utmp **)
8a8cfb
+  attribute_hidden;
8a8cfb
+int __libc_getutline_r (const struct utmp *, struct utmp *, struct utmp **)
8a8cfb
+  attribute_hidden;
8a8cfb
+struct utmp *__libc_pututline (const struct utmp *) attribute_hidden;
8a8cfb
+void __libc_endutent (void) attribute_hidden;
8a8cfb
+int __libc_updwtmp (const char *, const struct utmp *) attribute_hidden;
8a8cfb
 
8a8cfb
 /* Current file name.  */
8a8cfb
 extern const char *__libc_utmp_file_name attribute_hidden;
8a8cfb
diff --git a/login/utmp_file.c b/login/utmp_file.c
8a8cfb
index 040a5057116bb69d..069e6d0452e333ad 100644
8a8cfb
--- a/login/utmp_file.c
8a8cfb
+++ b/login/utmp_file.c
8a8cfb
@@ -105,37 +105,12 @@ static void timeout_handler (int signum) {};
8a8cfb
     alarm (old_timeout);						      \
8a8cfb
 } while (0)
8a8cfb
 
8a8cfb
-
8a8cfb
-/* Functions defined here.  */
8a8cfb
-static int setutent_file (void);
8a8cfb
-static int getutent_r_file (struct utmp *buffer, struct utmp **result);
8a8cfb
-static int getutid_r_file (const struct utmp *key, struct utmp *buffer,
8a8cfb
-			   struct utmp **result);
8a8cfb
-static int getutline_r_file (const struct utmp *key, struct utmp *buffer,
8a8cfb
-			     struct utmp **result);
8a8cfb
-static struct utmp *pututline_file (const struct utmp *data);
8a8cfb
-static void endutent_file (void);
8a8cfb
-static int updwtmp_file (const char *file, const struct utmp *utmp);
8a8cfb
-
8a8cfb
-/* Jump table for file functions.  */
8a8cfb
-const struct utfuncs __libc_utmp_file_functions =
8a8cfb
-{
8a8cfb
-  setutent_file,
8a8cfb
-  getutent_r_file,
8a8cfb
-  getutid_r_file,
8a8cfb
-  getutline_r_file,
8a8cfb
-  pututline_file,
8a8cfb
-  endutent_file,
8a8cfb
-  updwtmp_file
8a8cfb
-};
8a8cfb
-
8a8cfb
-
8a8cfb
 #ifndef TRANSFORM_UTMP_FILE_NAME
8a8cfb
 # define TRANSFORM_UTMP_FILE_NAME(file_name) (file_name)
8a8cfb
 #endif
8a8cfb
 
8a8cfb
-static int
8a8cfb
-setutent_file (void)
8a8cfb
+int
8a8cfb
+__libc_setutent (void)
8a8cfb
 {
8a8cfb
   if (file_fd < 0)
8a8cfb
     {
8a8cfb
@@ -166,15 +141,19 @@ setutent_file (void)
8a8cfb
   return 1;
8a8cfb
 }
8a8cfb
 
8a8cfb
+/* Preform initialization if necessary.  */
8a8cfb
+static bool
8a8cfb
+maybe_setutent (void)
8a8cfb
+{
8a8cfb
+  return file_fd >= 0 || __libc_setutent ();
8a8cfb
+}
8a8cfb
 
8a8cfb
-static int
8a8cfb
-getutent_r_file (struct utmp *buffer, struct utmp **result)
8a8cfb
+int
8a8cfb
+__libc_getutent_r (struct utmp *buffer, struct utmp **result)
8a8cfb
 {
8a8cfb
   ssize_t nbytes;
8a8cfb
 
8a8cfb
-  assert (file_fd >= 0);
8a8cfb
-
8a8cfb
-  if (file_offset == -1l)
8a8cfb
+  if (!maybe_setutent () || file_offset == -1l)
8a8cfb
     {
8a8cfb
       /* Not available.  */
8a8cfb
       *result = NULL;
8a8cfb
@@ -279,13 +258,11 @@ unlock_return:
8a8cfb
 
8a8cfb
 /* For implementing this function we don't use the getutent_r function
8a8cfb
    because we can avoid the reposition on every new entry this way.  */
8a8cfb
-static int
8a8cfb
-getutid_r_file (const struct utmp *id, struct utmp *buffer,
8a8cfb
-		struct utmp **result)
8a8cfb
+int
8a8cfb
+__libc_getutid_r (const struct utmp *id, struct utmp *buffer,
8a8cfb
+		  struct utmp **result)
8a8cfb
 {
8a8cfb
-  assert (file_fd >= 0);
8a8cfb
-
8a8cfb
-  if (file_offset == -1l)
8a8cfb
+  if (!maybe_setutent () || file_offset == -1l)
8a8cfb
     {
8a8cfb
       *result = NULL;
8a8cfb
       return -1;
8a8cfb
@@ -309,13 +286,11 @@ getutid_r_file (const struct utmp *id, struct utmp *buffer,
8a8cfb
 
8a8cfb
 /* For implementing this function we don't use the getutent_r function
8a8cfb
    because we can avoid the reposition on every new entry this way.  */
8a8cfb
-static int
8a8cfb
-getutline_r_file (const struct utmp *line, struct utmp *buffer,
8a8cfb
-		  struct utmp **result)
8a8cfb
+int
8a8cfb
+__libc_getutline_r (const struct utmp *line, struct utmp *buffer,
8a8cfb
+		    struct utmp **result)
8a8cfb
 {
8a8cfb
-  assert (file_fd >= 0);
8a8cfb
-
8a8cfb
-  if (file_offset == -1l)
8a8cfb
+  if (!maybe_setutent () || file_offset == -1l)
8a8cfb
     {
8a8cfb
       *result = NULL;
8a8cfb
       return -1;
8a8cfb
@@ -361,15 +336,16 @@ unlock_return:
8a8cfb
 }
8a8cfb
 
8a8cfb
 
8a8cfb
-static struct utmp *
8a8cfb
-pututline_file (const struct utmp *data)
8a8cfb
+struct utmp *
8a8cfb
+__libc_pututline (const struct utmp *data)
8a8cfb
 {
8a8cfb
+  if (!maybe_setutent ())
8a8cfb
+    return NULL;
8a8cfb
+
8a8cfb
   struct utmp buffer;
8a8cfb
   struct utmp *pbuf;
8a8cfb
   int found;
8a8cfb
 
8a8cfb
-  assert (file_fd >= 0);
8a8cfb
-
8a8cfb
   if (! file_writable)
8a8cfb
     {
8a8cfb
       /* We must make the file descriptor writable before going on.  */
8a8cfb
@@ -467,18 +443,19 @@ pututline_file (const struct utmp *data)
8a8cfb
 }
8a8cfb
 
8a8cfb
 
8a8cfb
-static void
8a8cfb
-endutent_file (void)
8a8cfb
+void
8a8cfb
+__libc_endutent (void)
8a8cfb
 {
8a8cfb
-  assert (file_fd >= 0);
8a8cfb
-
8a8cfb
-  __close_nocancel_nostatus (file_fd);
8a8cfb
-  file_fd = -1;
8a8cfb
+  if (file_fd >= 0)
8a8cfb
+    {
8a8cfb
+      __close_nocancel_nostatus (file_fd);
8a8cfb
+      file_fd = -1;
8a8cfb
+    }
8a8cfb
 }
8a8cfb
 
8a8cfb
 
8a8cfb
-static int
8a8cfb
-updwtmp_file (const char *file, const struct utmp *utmp)
8a8cfb
+int
8a8cfb
+__libc_updwtmp (const char *file, const struct utmp *utmp)
8a8cfb
 {
8a8cfb
   int result = -1;
8a8cfb
   off64_t offset;
8a8cfb
diff --git a/login/utmpname.c b/login/utmpname.c
8a8cfb
index 21cb890a1a2fdc92..73b19c33ceab4dd7 100644
8a8cfb
--- a/login/utmpname.c
8a8cfb
+++ b/login/utmpname.c
8a8cfb
@@ -42,8 +42,7 @@ __utmpname (const char *file)
8a8cfb
   __libc_lock_lock (__libc_utmp_lock);
8a8cfb
 
8a8cfb
   /* Close the old file.  */
8a8cfb
-  (*__libc_utmp_jump_table->endutent) ();
8a8cfb
-  __libc_utmp_jump_table = &__libc_utmp_unknown_functions;
8a8cfb
+  __libc_endutent ();
8a8cfb
 
8a8cfb
   if (strcmp (file, __libc_utmp_file_name) != 0)
8a8cfb
     {
8a8cfb
diff --git a/manual/users.texi b/manual/users.texi
8a8cfb
index 4ed79ba26fc8e9d0..a006bb58acfd0568 100644
8a8cfb
--- a/manual/users.texi
8a8cfb
+++ b/manual/users.texi
8a8cfb
@@ -894,9 +894,9 @@ The @code{getlogin} function is declared in @file{unistd.h}, while
8a8cfb
 @c   ttyname_r dup @ascuheap @acsmem @acsfd
8a8cfb
 @c   strncpy dup ok
8a8cfb
 @c   libc_lock_lock dup @asulock @aculock
8a8cfb
-@c   *libc_utmp_jump_table->setutent dup @mtasurace:utent @acsfd
8a8cfb
-@c   *libc_utmp_jump_table->getutline_r dup @mtasurace:utent @mtascusig:ALRM @mtascutimer
8a8cfb
-@c   *libc_utmp_jump_table->endutent dup @mtasurace:utent @asulock @aculock
8a8cfb
+@c   __libc_setutent dup @mtasurace:utent @acsfd
8a8cfb
+@c   __libc_getutline_r dup @mtasurace:utent @mtascusig:ALRM @mtascutimer
8a8cfb
+@c   __libc_endutent dup @mtasurace:utent @asulock @aculock
8a8cfb
 @c   libc_lock_unlock dup ok
8a8cfb
 @c   strlen dup ok
8a8cfb
 @c   memcpy dup ok
8a8cfb
@@ -1111,7 +1111,7 @@ compatibility only, @file{utmp.h} defines @code{ut_time} as an alias for
8a8cfb
 
8a8cfb
 @c setutent @mtasurace:utent @asulock @aculock @acsfd
8a8cfb
 @c  libc_lock_lock dup @asulock @aculock
8a8cfb
-@c  *libc_utmp_jump_table->setutent @mtasurace:utent @acsfd
8a8cfb
+@c  __libc_setutent @mtasurace:utent @acsfd
8a8cfb
 @c   setutent_unknown @mtasurace:utent @acsfd
8a8cfb
 @c    *libc_utmp_file_functions.setutent = setutent_file @mtasurace:utent @acsfd
8a8cfb
 @c      open_not_cancel_2 dup @acsfd
8a8cfb
@@ -1152,7 +1152,7 @@ A null pointer is returned in case no further entry is available.
8a8cfb
 @safety{@prelim{}@mtunsafe{@mtasurace{:utent}}@asunsafe{@asulock{}}@acunsafe{@aculock{} @acsfd{}}}
8a8cfb
 @c endutent @mtasurace:utent @asulock @aculock @acsfd
8a8cfb
 @c  libc_lock_lock dup @asulock @aculock
8a8cfb
-@c  *libc_utmp_jump_table->endutent @mtasurace:utent @acsfd
8a8cfb
+@c  __libc_endutent @mtasurace:utent @acsfd
8a8cfb
 @c   endutent_unknown ok
8a8cfb
 @c   endutent_file @mtasurace:utent @acsfd
8a8cfb
 @c    close_not_cancel_no_status dup @acsfd
8a8cfb
@@ -1230,7 +1230,7 @@ over again.
8a8cfb
 @safety{@prelim{}@mtunsafe{@mtasurace{:utent} @mtascusig{:ALRM} @mtascutimer{}}@asunsafe{@asulock{}}@acunsafe{@aculock{} @acsfd{}}}
8a8cfb
 @c pututline @mtasurace:utent @mtascusig:ALRM @mtascutimer @asulock @aculock @acsfd
8a8cfb
 @c  libc_lock_lock dup @asulock @aculock
8a8cfb
-@c  *libc_utmp_jump_table->pututline @mtasurace:utent @mtascusig:ALRM @mtascutimer @acsfd
8a8cfb
+@c  __libc_pututline @mtasurace:utent @mtascusig:ALRM @mtascutimer @acsfd
8a8cfb
 @c   pututline_unknown @mtasurace:utent @acsfd
8a8cfb
 @c    setutent_unknown dup @mtasurace:utent @acsfd
8a8cfb
 @c   pututline_file @mtascusig:ALRM @mtascutimer @acsfd
8a8cfb
@@ -1282,7 +1282,7 @@ user-provided buffer.
8a8cfb
 @safety{@prelim{}@mtunsafe{@mtasurace{:utent} @mtascusig{:ALRM} @mtascutimer{}}@asunsafe{@asulock{}}@acunsafe{@aculock{} @acsfd{}}}
8a8cfb
 @c getutent_r @mtasurace:utent @mtascusig:ALRM @mtascutimer @asulock @aculock @acsfd
8a8cfb
 @c  libc_lock_lock dup @asulock @aculock
8a8cfb
-@c  *libc_utmp_jump_table->getutent_r @mtasurace:utent @mtascusig:ALRM @mtascutimer @acsfd
8a8cfb
+@c  __libc_getutent_r @mtasurace:utent @mtascusig:ALRM @mtascutimer @acsfd
8a8cfb
 @c   getutent_r_unknown @mtasurace:utent @acsfd
8a8cfb
 @c    setutent_unknown dup @mtasurace:utent @acsfd
8a8cfb
 @c   getutent_r_file @mtasurace:utent @mtascusig:ALRM @mtascutimer
8a8cfb
@@ -1319,7 +1319,7 @@ This function is a GNU extension.
8a8cfb
 @safety{@prelim{}@mtunsafe{@mtasurace{:utent} @mtascusig{:ALRM} @mtascutimer{}}@asunsafe{@asulock{}}@acunsafe{@aculock{} @acsfd{}}}
8a8cfb
 @c getutid_r @mtasurace:utent @mtascusig:ALRM @mtascutimer @asulock @aculock @acsfd
8a8cfb
 @c  libc_lock_lock dup @asulock @aculock
8a8cfb
-@c  *libc_utmp_jump_table->getutid_r @mtasurace:utent @mtascusig:ALRM @mtascutimer @acsfd
8a8cfb
+@c  __libc_getutid_r @mtasurace:utent @mtascusig:ALRM @mtascutimer @acsfd
8a8cfb
 @c   getutid_r_unknown @mtasurace:utent @acsfd
8a8cfb
 @c    setutent_unknown dup @mtasurace:utent @acsfd
8a8cfb
 @c   getutid_r_file @mtascusig:ALRM @mtascutimer
8a8cfb
@@ -1349,7 +1349,7 @@ This function is a GNU extension.
8a8cfb
 @safety{@prelim{}@mtunsafe{@mtasurace{:utent} @mtascusig{:ALRM} @mtascutimer{}}@asunsafe{@asulock{}}@acunsafe{@aculock{} @acsfd{}}}
8a8cfb
 @c getutline_r @mtasurace:utent @mtascusig:ALRM @mtascutimer @asulock @aculock @acsfd
8a8cfb
 @c  libc_lock_lock dup @asulock @aculock
8a8cfb
-@c  *libc_utmp_jump_table->getutline_r @mtasurace:utent @mtascusig:ALRM @mtascutimer @acsfd
8a8cfb
+@c  __libc_getutline_r @mtasurace:utent @mtascusig:ALRM @mtascutimer @acsfd
8a8cfb
 @c   getutline_r_unknown @mtasurace:utent @acsfd
8a8cfb
 @c    setutent_unknown dup @mtasurace:utent @acsfd
8a8cfb
 @c   getutline_r_file @mtasurace:utent @mtascusig:ALRM @mtascutimer
8a8cfb
@@ -1393,7 +1393,7 @@ be used.
8a8cfb
 @safety{@prelim{}@mtunsafe{@mtasurace{:utent}}@asunsafe{@asulock{} @ascuheap{}}@acunsafe{@aculock{} @acsmem{}}}
8a8cfb
 @c utmpname @mtasurace:utent @asulock @ascuheap @aculock @acsmem
8a8cfb
 @c  libc_lock_lock dup @asulock @aculock
8a8cfb
-@c  *libc_utmp_jump_table->endutent dup @mtasurace:utent
8a8cfb
+@c  __libc_endutent dup @mtasurace:utent
8a8cfb
 @c  strcmp dup ok
8a8cfb
 @c  free dup @ascuheap @acsmem
8a8cfb
 @c  strdup dup @ascuheap @acsmem
8a8cfb
diff --git a/sysdeps/unix/getlogin_r.c b/sysdeps/unix/getlogin_r.c
8a8cfb
index 444df7e4d3210cf6..180c0bbca13d0f87 100644
8a8cfb
--- a/sysdeps/unix/getlogin_r.c
8a8cfb
+++ b/sysdeps/unix/getlogin_r.c
8a8cfb
@@ -64,8 +64,8 @@ __getlogin_r (char *name, size_t name_len)
8a8cfb
      held so that our search is thread-safe.  */
8a8cfb
 
8a8cfb
   __libc_lock_lock (__libc_utmp_lock);
8a8cfb
-  (*__libc_utmp_jump_table->setutent) ();
8a8cfb
-  result = (*__libc_utmp_jump_table->getutline_r) (&line, &buffer, &ut);
8a8cfb
+  __libc_setutent ();
8a8cfb
+  result = __libc_getutline_r (&line, &buffer, &ut);
8a8cfb
   if (result < 0)
8a8cfb
     {
8a8cfb
       if (errno == ESRCH)
8a8cfb
@@ -74,8 +74,7 @@ __getlogin_r (char *name, size_t name_len)
8a8cfb
       else
8a8cfb
 	result = errno;
8a8cfb
     }
8a8cfb
-  (*__libc_utmp_jump_table->endutent) ();
8a8cfb
-  __libc_utmp_jump_table = &__libc_utmp_unknown_functions;
8a8cfb
+  __libc_endutent ();
8a8cfb
   __libc_lock_unlock (__libc_utmp_lock);
8a8cfb
 
8a8cfb
   if (result == 0)