diff --git a/ChangeLog b/ChangeLog index 6326af00..828b33b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-06-13 Nicolas François + + * libmisc/sulog.c: Ignore the return value of umask() when the + mask is restored. + * libmisc/sulog.c: Add brackets. + * libmisc/sulog.c: Ignore return value of time() when use with a + non NULL argument. + 2008-06-13 Nicolas François * libmisc/log.c: Avoid assignments in comparisons. diff --git a/libmisc/sulog.c b/libmisc/sulog.c index bb1d2a5e..a0664795 100644 --- a/libmisc/sulog.c +++ b/libmisc/sulog.c @@ -76,7 +76,7 @@ void sulog (const char *tty, bool success, const char *oldname, const char *name oldgid = 0; } fp = fopen (sulog_file, "a+"); - umask (oldmask); + (void) umask (oldmask); if ((oldgid != 0) && (setgid (oldgid) != 0)) { perror ("setgid"); SYSLOG ((LOG_ERR, @@ -85,10 +85,11 @@ void sulog (const char *tty, bool success, const char *oldname, const char *name /* Do not return if the group permission were raised. */ exit (1); } - if (fp == (FILE *) 0) + if (fp == (FILE *) 0) { return; /* can't open or create logfile */ + } - time (&now); + (void) time (&now); tm = localtime (&now); fprintf (fp, "SU %.02d/%.02d %.02d:%.02d %c %s %s-%s\n",