From: nekral-guest Date: Sun, 23 Nov 2008 00:05:39 +0000 (+0000) Subject: * libmisc/chowntty.c: Improve the logs for fchown and fchmod X-Git-Tag: 4.1.3~144 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cf31f05cfba680a19ad39b806be0404f4f54dee2;p=shadow * libmisc/chowntty.c: Improve the logs for fchown and fchmod failures. --- diff --git a/ChangeLog b/ChangeLog index 7c551c5c..18c1ee12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-23 Nicolas François + + * libmisc/chowntty.c: Improve the logs for fchown and fchmod + failures. + 2008-11-23 Nicolas François * NEWS, libmisc/chowntty.c: Fix a race condition that could lead to diff --git a/libmisc/chowntty.c b/libmisc/chowntty.c index 89ebb0e8..b43931e3 100644 --- a/libmisc/chowntty.c +++ b/libmisc/chowntty.c @@ -83,13 +83,12 @@ void chown_tty (const struct passwd *info) || (fchmod (STDIN_FILENO, getdef_num ("TTYPERM", 0600)) != 0)) { int err = errno; - snprintf (buf, sizeof buf, _("Unable to change tty stdin")); - perror (buf); + fprintf (stderr, + _("Unable to change owner or mode of tty stdin: %s"), + strerror (err)); SYSLOG ((LOG_WARN, - "unable to change tty stdin for user `%s'\n", - info->pw_name)); - closelog (); - + "unable to change owner or mode of tty stdin for user `%s': %s\n", + info->pw_name, strerror (err))); if (EROFS != err) { exit (1); }