[PATCH] sysutils/gnome-volume-manager: inifite loop on startup
Marcin Wisnicki
mwisnicki+freebsd at gmail.com
Thu Aug 23 16:24:56 PDT 2007
>Submitter-Id: current-users
>Originator: Marcin Wisnicki
>Organization:
>Confidential: no
>Synopsis: [PATCH] sysutils/gnome-volume-manager: inifite loop on startup
>Severity: non-critical
>Priority: low
>Category: ports
>Class: change-request
>Release: FreeBSD 6.2-STABLE i386
>Environment:
System: FreeBSD ghost.pnet.one.pl 6.2-STABLE FreeBSD 6.2-STABLE #8: Tue Aug 7 15:03:32 CEST
>Description:
Integer underflow will cause "while (!local && --len >= 0)" to be always true
if no local entry was found in the loop.
I have also changed wtmp to utmp as we are looking for current users.
With this patch g-v-m no longer hangs in my Xvnc-based jail.
Port maintainer (gnome at FreeBSD.org) is cc'd.
Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:
--- gnome-volume-manager-2.17.0_5.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/sysutils/gnome-volume-manager.orig/Makefile /usr/ports/sysutils/gnome-volume-manager/Makefile
--- /usr/ports/sysutils/gnome-volume-manager.orig/Makefile 2007-05-28 01:14:14.000000000 +0200
+++ /usr/ports/sysutils/gnome-volume-manager/Makefile 2007-08-24 00:23:44.000000000 +0200
@@ -8,7 +8,7 @@
PORTNAME= gnome-volume-manager
PORTVERSION= 2.17.0
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= sysutils gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/${PORTNAME}/${PORTVERSION:R}
diff -ruN --exclude=CVS /usr/ports/sysutils/gnome-volume-manager.orig/files/patch-src_manager.c /usr/ports/sysutils/gnome-volume-manager/files/patch-src_manager.c
--- /usr/ports/sysutils/gnome-volume-manager.orig/files/patch-src_manager.c 2007-03-25 05:05:54.000000000 +0200
+++ /usr/ports/sysutils/gnome-volume-manager/files/patch-src_manager.c 2007-08-24 00:23:26.000000000 +0200
@@ -205,14 +205,14 @@
endutent ();
}
+#else
-+ if ((fd = open (_PATH_WTMP, O_RDONLY, 0)) < 0 || fstat(fd, &sb) == -1) {
++ if ((fd = open (_PATH_UTMP, O_RDONLY, 0)) < 0 || fstat(fd, &sb) == -1) {
+ close (fd);
+ return TRUE;
+ }
+
+ len = (sb.st_size + sizeof(buf) - 1) / sizeof(buf);
+
-+ while (!local && --len >= 0) {
++ while (!local && len-- > 0) {
+ if (lseek(fd, (off_t) (len * sizeof(buf)), L_SET) == -1 ||
+ (bytes = read (fd, buf, sizeof(buf))) == -1) {
+ close (fd);
--- gnome-volume-manager-2.17.0_5.patch ends here ---
More information about the freebsd-gnome
mailing list