ports/134535: sysutils/e2fsprogs uuidd is broken [patch]

Mark Andrews Mark_Andrews at isc.org
Thu May 14 11:10:02 UTC 2009


>Number:         134535
>Category:       ports
>Synopsis:       sysutils/e2fsprogs uuidd is broken [patch]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 14 11:10:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Mark Andrews
>Release:        FreeBSD 6.4-STABLE i386
>Organization:
ISC
>Environment:
System: FreeBSD drugs.dv.isc.org 6.4-STABLE FreeBSD 6.4-STABLE #31: Thu Apr 30 07:41:29 EST 2009 marka at drugs.dv.isc.org:/usr/obj/usr/src/sys/DRUGS i386

>Description:

	uuidd can clobber it's operating socket when invoked from
	libuuid.  libuuid closes all the descriptors and uuidd
	doesn't ensure that the socket descriptor is not one that
	will be closes when it becomes a daemon.

>How-To-Repeat:

	Try to build misc/e2fsprogs-libuuid with the existing
	version installed.  See also ports/134526 for related
	fix.

Fix:

--- a/misc/uuidd.c	2009-04-16 02:59:57.000000000 +1000
+++ b/misc/uuidd.c	2009-05-14 20:33:49.000000000 +1000
@@ -419,6 +419,18 @@
 	}
 }
 
+void devnull() {
+	int i, fd;
+
+	for (i = 0; i < 3; i++) {
+		fd = open("/dev/null", O_RDWR);
+		if (fd >= 3) {
+			close(fd);
+			return;
+		}
+	}
+}
+
 int main(int argc, char **argv)
 {
 	const char	*socket_path = UUIDD_SOCKET_PATH;
@@ -486,6 +498,9 @@
 			usage(argv[0]);
 		}
 	}
+
+	devnull();
+
 	uid = getuid();
 	if (uid && drop_privs) {
 		gid = getgid();

>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list