# HG changeset patch # User Eric Warmenhoven # Date 968887991 0 # Node ID 88d1edcd7cd63da6bdd0c30f74ecb69c82ceb963 # Parent a0b3dc2d5d23b9f33d32bdda2d3a4cfe686b8fc7 [gaim-migrate @ 909] thanks again to bmiller, this time for doing this check properly. (in my defense i thought about this but was too lazy to implement it) committer: Tailor Script diff -r a0b3dc2d5d23 -r 88d1edcd7cd6 src/sound.c --- a/src/sound.c Wed Sep 13 23:04:38 2000 +0000 +++ b/src/sound.c Wed Sep 13 23:33:11 2000 +0000 @@ -52,13 +52,23 @@ { struct stat stat_buf; uid_t user = getuid(); - gid_t group = getgid(); + gid_t group = getgid(), + other_groups[32]; + int i, numgroups; + + if ((numgroups = getgroups (32, other_groups)) == -1) + return 0; if (stat(dev, &stat_buf)) return 0; if (user == stat_buf.st_uid && stat_buf.st_mode & S_IWUSR) return 1; - if (group == stat_buf.st_gid && stat_buf.st_mode & S_IWGRP) - return 1; + if (stat_buf.st_mode & S_IWGRP) { + if (group == stat_buf.st_gid) + return 1; + for (i = 0; i < numgroups; i++) + if (other_groups[i] == stat_buf.st_gid) + return 1; + } if (stat_buf.st_mode & S_IWOTH) return 1; return 0;