Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:mskibbe
ntp-dev
ntp-devd-using_wrong_group.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ntp-devd-using_wrong_group.patch of Package ntp-dev
--- ntpd/ntpd.c +++ ntpd/ntpd.c @@ -874,10 +874,18 @@ sw_uid = (uid_t)strtoul(user, &endp, 0); if (*endp != '\0') goto getuser; + + if ((pw = getpwuid(sw_uid)) != NULL) { + user = strdup(pw->pw_name); + } else { + user = (char *)-1; + } + } else { getuser: if ((pw = getpwnam(user)) != NULL) { sw_uid = pw->pw_uid; + sw_gid = pw->pw_gid; } else { errno = 0; msyslog(LOG_ERR, "Cannot find user `%s'", user); @@ -913,6 +921,13 @@ exit (-1); } } + + if (user && (user != (char *)-1) && initgroups(user, sw_gid)) { + msyslog(LOG_ERR, "Cannot initgroups() to user `%s': %m", user); + exit (-1); + } + + if (group && setgid(sw_gid)) { msyslog(LOG_ERR, "Cannot setgid() to group `%s': %m", group); exit (-1);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor