summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils/ChangeLog5
-rw-r--r--utils/login.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/utils/ChangeLog b/utils/ChangeLog
index fb252178..f9ead0f4 100644
--- a/utils/ChangeLog
+++ b/utils/ChangeLog
@@ -1,3 +1,8 @@
+Fri Mar 12 15:22:02 1999 Thomas Bushnell, BSG <tb@mit.edu>
+
+ * login.c (add_utmp_entry): Properly call setutent and endutent
+ around the getutline call.
+
1999-03-11 Roland McGrath <roland@baalperazim.frob.com>
* portinfo.c (main): Grok -E and inhibit error msg for
diff --git a/utils/login.c b/utils/login.c
index cc368e5b..096aaeeb 100644
--- a/utils/login.c
+++ b/utils/login.c
@@ -187,7 +187,9 @@ add_utmp_entry (char *args, unsigned args_len, int inherit_host)
{
struct utmp *old_utmp;
strncpy (utmp.ut_line, basename (tty), sizeof (utmp.ut_line));
+ setutent ();
old_utmp = getutline (&utmp);
+ endutent ();
if (old_utmp)
{
if (! host)