]> git.ipfire.org Git - people/pmueller/ipfire-3.x.git/blobdiff - net-tools/patches/net-tools-1.60-slattach-fchown.patch
Move all packages to root.
[people/pmueller/ipfire-3.x.git] / net-tools / patches / net-tools-1.60-slattach-fchown.patch
diff --git a/net-tools/patches/net-tools-1.60-slattach-fchown.patch b/net-tools/patches/net-tools-1.60-slattach-fchown.patch
new file mode 100644 (file)
index 0000000..50edf85
--- /dev/null
@@ -0,0 +1,24 @@
+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);