patch from Benoit.Boissinot@ens-lyon.fr to remove getgroups and setgroups
git-svn-id: https://svn.musicpd.org/mpd/trunk@2028 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
15
src/main.c
15
src/main.c
@@ -230,9 +230,6 @@ void establishListen(Options * options) {
|
|||||||
void changeToUser(Options * options) {
|
void changeToUser(Options * options) {
|
||||||
if (options->usr && strlen(options->usr)) {
|
if (options->usr && strlen(options->usr)) {
|
||||||
int uid, gid;
|
int uid, gid;
|
||||||
#ifdef _BSD_SOURCE
|
|
||||||
gid_t gid_list[NGROUPS_MAX];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* get uid */
|
/* get uid */
|
||||||
struct passwd * userpwd;
|
struct passwd * userpwd;
|
||||||
@@ -258,18 +255,6 @@ void changeToUser(Options * options) {
|
|||||||
"of user %s: %s\n", options->usr,
|
"of user %s: %s\n", options->usr,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
}
|
}
|
||||||
else if(getgroups(NGROUPS_MAX, gid_list) == -1) {
|
|
||||||
ERROR("cannot get groups "
|
|
||||||
"of user %s: %s\n", options->usr,
|
|
||||||
strerror(errno));
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
else if(setgroups(NGROUPS_MAX, gid_list) == -1) {
|
|
||||||
ERROR("cannot set groups "
|
|
||||||
"of user %s: %s\n", options->usr,
|
|
||||||
strerror(errno));
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* set uid */
|
/* set uid */
|
||||||
|
Reference in New Issue
Block a user