net-tools/net-tools-1.60-slattach-fchown.patch
Jiří Popelka 4a78a731c3 - netplug moved to separate package
- #319981 and #322901 - minor man pages changes
- applied changes from berlios cvs, which fix: Berlios #16232, Gentoo
    #283759 and polish Makefile and slattach
2009-09-30 13:23:57 +00:00

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);