25 lines
803 B
Diff
25 lines
803 B
Diff
|
diff -up net-tools-1.60/slattach.c.slattach-fchown net-tools-1.60/slattach.c
|
||
|
--- net-tools-1.60/slattach.c.slattach-fchown 2000-10-28 12:59:41.000000000 +0200
|
||
|
+++ net-tools-1.60/slattach.c 2009-09-15 18:17:01.000000000 +0200
|
||
|
@@ -195,15 +195,17 @@ tty_lock(char *path, int mode)
|
||
|
return(-1);
|
||
|
}
|
||
|
|
||
|
- (void) close(fd);
|
||
|
-
|
||
|
/* Make sure UUCP owns the lockfile. Required by some packages. */
|
||
|
if ((pw = getpwnam(_UID_UUCP)) == NULL) {
|
||
|
if (opt_q == 0) fprintf(stderr, _("slattach: tty_lock: UUCP user %s unknown!\n"),
|
||
|
_UID_UUCP);
|
||
|
+ (void) close(fd);
|
||
|
return(0); /* keep the lock anyway */
|
||
|
}
|
||
|
- (void) chown(saved_path, pw->pw_uid, pw->pw_gid);
|
||
|
+ (void) fchown(fd, pw->pw_uid, pw->pw_gid);
|
||
|
+
|
||
|
+ (void) close(fd);
|
||
|
+
|
||
|
saved_lock = 1;
|
||
|
} else { /* unlock */
|
||
|
if (saved_lock != 1) return(0);
|