ports/63302: Velovity doesn't use the full list of groups on FreeBSD
Henri Michelon
hmichelon at e-cml.org
Tue Feb 24 11:50:16 UTC 2004
>Number: 63302
>Category: ports
>Synopsis: Velovity doesn't use the full list of groups on FreeBSD
>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: Tue Feb 24 03:50:15 PST 2004
>Closed-Date:
>Last-Modified:
>Originator: Henri Michelon
>Release: 5.2-RELEASE
>Organization:
ECML
>Environment:
FreeBSD fo01 5.2.1-RC2 FreeBSD 5.2.1-RC2 #7: Wed Feb 11 11:02:39 MET 2004 root at fo01:/usr/src/sys/i386/compile/PXEKERNEL i386
>Description:
Velovity doesn't use the full list of groups, it only use getgid(). This patch haven't been sent to velocity's author since it use the getgroups() BSD call and I don't known if it works under others OSes. It's a BSD only patch.
>How-To-Repeat:
Run velocity
>Fix:
--- src/velocity-vfs.c.orig Tue Feb 24 12:28:14 2004
+++ src/velocity-vfs.c Tue Feb 24 12:40:39 2004
@@ -31,6 +31,7 @@
#include <config.h>
#include <unistd.h>
#include <sys/types.h>
+#include <sys/param.h> /* for NGROUPS */
#include <glib.h>
#include <libgnome/gnome-desktop-item.h>
#include "velocity-vfs.h"
@@ -240,7 +241,18 @@
return((vfsobj->info->uid==getuid()));
}
gboolean velocity_vfs_is_in_group(velocity_vfs_obj*vfsobj){
- return ((vfsobj->info->gid==getgid()));
+/* 24 feb 2004 : Henri Michelon hmichelon at e-cml dot org
+ A patch to use the full list of groups on *BSD */
+ int cnt, ngroups;
+ gid_t groups[NGROUPS];
+ if ((ngroups = getgroups(NGROUPS, groups))) {
+ for (cnt = 0; cnt < ngroups; cnt++) {
+ if (vfsobj->info->gid==groups[cnt]) {
+ return(TRUE);
+ }
+ }
+ }
+ return(FALSE);
}
gboolean velocity_vfs_is_local(velocity_vfs_obj*vfsobj){
return(GNOME_VFS_FILE_INFO_LOCAL(vfsobj->info));
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list