Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/pppd/pppd don't try to chmod if fchmod fails when r...



details:   https://anonhg.NetBSD.org/src/rev/2e74d8f71203
branches:  trunk
changeset: 534651:2e74d8f71203
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jul 31 14:59:10 2002 +0000

description:
don't try to chmod if fchmod fails when restoring the original tty modes.
It could cause a symlink race. Just report the fchmod failure. Reported
by itojun, found in FreeBSD.

diffstat:

 usr.sbin/pppd/pppd/tty.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 80b34b42bf32 -r 2e74d8f71203 usr.sbin/pppd/pppd/tty.c
--- a/usr.sbin/pppd/pppd/tty.c  Wed Jul 31 14:52:49 2002 +0000
+++ b/usr.sbin/pppd/pppd/tty.c  Wed Jul 31 14:59:10 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty.c,v 1.2 2002/05/29 19:06:33 christos Exp $ */
+/*     $NetBSD: tty.c,v 1.3 2002/07/31 14:59:10 christos Exp $ */
 
 /*
  * tty.c - code for handling serial ports in pppd.
@@ -27,7 +27,7 @@
 #if 0
 #define RCSID  "Id: tty.c,v 1.6 2001/03/12 22:59:01 paulus Exp "
 #else
-__RCSID("$NetBSD: tty.c,v 1.2 2002/05/29 19:06:33 christos Exp $");
+__RCSID("$NetBSD: tty.c,v 1.3 2002/07/31 14:59:10 christos Exp $");
 #endif
 #endif
 
@@ -756,8 +756,7 @@
 
        if (tty_mode != (mode_t) -1) {
                if (fchmod(real_ttyfd, tty_mode) != 0) {
-                       /* XXX if devnam is a symlink, this will change the link */
-                       chmod(devnam, tty_mode);
+                   warn("couldn't restore tty permissions: %m");
                }
        }
 



Home | Main Index | Thread Index | Old Index