From 0da3e7a0e77120670cb69c55ad5418f2bf2afb9d Mon Sep 17 00:00:00 2001 From: Dave Brolley Date: Wed, 25 Nov 2009 14:14:03 -0500 Subject: - Allow root, the owner of the uprobes build directory and the members of the group owner of the uprobes buld directory to build uprobes.ko. - When building uprobes.ko, make all generated files writable by the group owner of the uprobes build directory. - Don't change the group owner of the uprobes build directory during 'make install' --- util.cxx | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'util.cxx') diff --git a/util.cxx b/util.cxx index 6d461446..319af098 100644 --- a/util.cxx +++ b/util.cxx @@ -189,24 +189,13 @@ remove_file_or_dir (const char *name) return 0; } -// Determine whether the current user is in the given group. +// Determine whether the current user is in the given group +// by gid. bool -in_group (const char *gname) +in_group_id (gid_t target_gid) { gid_t gid, gidlist[NGROUPS_MAX]; - gid_t target_gid; int i, ngids; - struct group *group; - - // Lookup the gid for the target group - errno = 0; - group = getgrnam(gname); - - // If we couldn't find the group, then we can't be part of it. - if (group == NULL) - return false; - - target_gid = group->gr_gid; // According to the getgroups() man page, getgroups() may not // return the effective gid, so try to match it first. */ -- cgit