Date: Tue, 24 Feb 2004 03:47:40 -0800 (PST) From: Henri Michelon <hmichelon@e-cml.org> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/63302: Velovity doesn't use the full list of groups on FreeBSD Message-ID: <200402241147.i1OBleZV037641@www.freebsd.org> Resent-Message-ID: <200402241150.i1OBoGWi017216@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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@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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402241147.i1OBleZV037641>