]> granicus.if.org Git - shadow/commitdiff
* libmisc/chowntty.c: Improve the logs for fchown and fchmod
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 23 Nov 2008 00:05:39 +0000 (00:05 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 23 Nov 2008 00:05:39 +0000 (00:05 +0000)
failures.

ChangeLog
libmisc/chowntty.c

index 7c551c5cb019b5a00286fdc60e8e04c2edf220ea..18c1ee12683fbdcec6583087c7bc64ae417657a3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-23  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * libmisc/chowntty.c: Improve the logs for fchown and fchmod
+       failures.
+
 2008-11-23  Nicolas François  <nicolas.francois@centraliens.net>
 
        * NEWS, libmisc/chowntty.c: Fix a race condition that could lead to
index 89ebb0e816260423eac81302ffe22b3a30f60298..b43931e320702f4ac852ed5eea460eb8313d7b47 100644 (file)
@@ -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);
                }