[uClibc-cvs] uClibc/libutil login.c,1.1,1.2

Erik Andersen andersen at uclibc.org
Tue Jun 24 03:14:22 UTC 2003


Update of /var/cvs/uClibc/libutil
In directory winder:/tmp/cvs-serv20082

Modified Files:
	login.c 
Log Message:
Make login actually write out utmp and wtmp junk (even
though such things are completly unreliable crap)


Index: login.c
===================================================================
RCS file: /var/cvs/uClibc/libutil/login.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- login.c	8 May 2001 19:58:19 -0000	1.1
+++ login.c	24 Jun 2003 03:14:19 -0000	1.2
@@ -8,7 +8,18 @@
 /* Write the given entry into utmp and wtmp.  */
 void login (const struct utmp *entry)
 {
-    return;
+    struct utmp copy = *entry;
+
+    utmpname(_PATH_UTMP);
+    setutent();
+#if _HAVE_UT_TYPE - 0 
+    copy.ut_type = USER_PROCESS;
+#endif  
+#if _HAVE_UT_PID - 0
+    copy.ut_pid = getpid();
+#endif
+    strncpy (copy.ut_line, entry->ut_line, UT_LINESIZE);
+    pututline(entry);
+    endutent();
 }
-link_warning (login, "the `login' function is stubbed out and will not write utmp or wtmp.")
 



More information about the uClibc-cvs mailing list