* libmisc/chowntty.c: Improve the logs for fchown and fchmod
failures.
This commit is contained in:
parent
2b290e7abb
commit
cf31f05cfb
@ -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>
|
2008-11-23 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* NEWS, libmisc/chowntty.c: Fix a race condition that could lead to
|
* NEWS, libmisc/chowntty.c: Fix a race condition that could lead to
|
||||||
|
@ -83,13 +83,12 @@ void chown_tty (const struct passwd *info)
|
|||||||
|| (fchmod (STDIN_FILENO, getdef_num ("TTYPERM", 0600)) != 0)) {
|
|| (fchmod (STDIN_FILENO, getdef_num ("TTYPERM", 0600)) != 0)) {
|
||||||
int err = errno;
|
int err = errno;
|
||||||
|
|
||||||
snprintf (buf, sizeof buf, _("Unable to change tty stdin"));
|
fprintf (stderr,
|
||||||
perror (buf);
|
_("Unable to change owner or mode of tty stdin: %s"),
|
||||||
|
strerror (err));
|
||||||
SYSLOG ((LOG_WARN,
|
SYSLOG ((LOG_WARN,
|
||||||
"unable to change tty stdin for user `%s'\n",
|
"unable to change owner or mode of tty stdin for user `%s': %s\n",
|
||||||
info->pw_name));
|
info->pw_name, strerror (err)));
|
||||||
closelog ();
|
|
||||||
|
|
||||||
if (EROFS != err) {
|
if (EROFS != err) {
|
||||||
exit (1);
|
exit (1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user