[Pkg-shadow-commits] r2453 - in upstream/trunk: . libmisc

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Sun Nov 23 00:05:42 UTC 2008


Author: nekral-guest
Date: 2008-11-23 00:05:39 +0000 (Sun, 23 Nov 2008)
New Revision: 2453

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/libmisc/chowntty.c
Log:
	* libmisc/chowntty.c: Improve the logs for fchown and fchmod
	failures.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-11-22 23:56:51 UTC (rev 2452)
+++ upstream/trunk/ChangeLog	2008-11-23 00:05:39 UTC (rev 2453)
@@ -1,5 +1,10 @@
 2008-11-23  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* libmisc/chowntty.c: Improve the logs for fchown and fchmod
+	failures.
+
+2008-11-23  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* NEWS, libmisc/chowntty.c: Fix a race condition that could lead to
 	gaining ownership or changing mode of arbitrary files.
 	* NEWS, libmisc/chowntty.c, libmisc/utmp.c: is_my_tty() moved from

Modified: upstream/trunk/libmisc/chowntty.c
===================================================================
--- upstream/trunk/libmisc/chowntty.c	2008-11-22 23:56:51 UTC (rev 2452)
+++ upstream/trunk/libmisc/chowntty.c	2008-11-23 00:05:39 UTC (rev 2453)
@@ -83,13 +83,12 @@
 	    || (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);
 		}




More information about the Pkg-shadow-commits mailing list