diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-22 22:13:17 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-23 04:44:33 +1000 |
commit | 251687097b60bad7a88de930576b7177f34fa975 (patch) | |
tree | 79e04bf5487a27e1915f29778f6bff577a3a223b /applets | |
parent | d791e72dc28009f36da26703fc007e40cfa79414 (diff) | |
download | busybox-w32-251687097b60bad7a88de930576b7177f34fa975.tar.gz busybox-w32-251687097b60bad7a88de930576b7177f34fa975.tar.bz2 busybox-w32-251687097b60bad7a88de930576b7177f34fa975.zip |
adapt it to be buildable
Diffstat (limited to 'applets')
-rw-r--r-- | applets/applets.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/applets/applets.c b/applets/applets.c index bd3704394..72a9d9f5e 100644 --- a/applets/applets.c +++ b/applets/applets.c | |||
@@ -140,9 +140,11 @@ static void parse_config_file(void) | |||
140 | 140 | ||
141 | assert(!suid_config); /* Should be set to NULL by bss init. */ | 141 | assert(!suid_config); /* Should be set to NULL by bss init. */ |
142 | 142 | ||
143 | #ifndef __MINGW32__ | ||
143 | ruid = getuid(); | 144 | ruid = getuid(); |
144 | if (ruid == 0) /* run by root - don't need to even read config file */ | 145 | if (ruid == 0) /* run by root - don't need to even read config file */ |
145 | return; | 146 | return; |
147 | #endif | ||
146 | 148 | ||
147 | if ((stat(config_file, &st) != 0) /* No config file? */ | 149 | if ((stat(config_file, &st) != 0) /* No config file? */ |
148 | || !S_ISREG(st.st_mode) /* Not a regular file? */ | 150 | || !S_ISREG(st.st_mode) /* Not a regular file? */ |
@@ -281,6 +283,7 @@ static void parse_config_file(void) | |||
281 | /* We can't use get_ug_id here since it would exit() | 283 | /* We can't use get_ug_id here since it would exit() |
282 | * if a uid or gid was not found. Oh well... */ | 284 | * if a uid or gid was not found. Oh well... */ |
283 | sct->m_uid = bb_strtoul(s, NULL, 10); | 285 | sct->m_uid = bb_strtoul(s, NULL, 10); |
286 | #ifndef __MINGW32__ | ||
284 | if (errno) { | 287 | if (errno) { |
285 | struct passwd *pwd = getpwnam(s); | 288 | struct passwd *pwd = getpwnam(s); |
286 | if (!pwd) { | 289 | if (!pwd) { |
@@ -288,8 +291,10 @@ static void parse_config_file(void) | |||
288 | } | 291 | } |
289 | sct->m_uid = pwd->pw_uid; | 292 | sct->m_uid = pwd->pw_uid; |
290 | } | 293 | } |
294 | #endif | ||
291 | 295 | ||
292 | sct->m_gid = bb_strtoul(e, NULL, 10); | 296 | sct->m_gid = bb_strtoul(e, NULL, 10); |
297 | #ifndef __MINGW32__ | ||
293 | if (errno) { | 298 | if (errno) { |
294 | struct group *grp; | 299 | struct group *grp; |
295 | grp = getgrnam(e); | 300 | grp = getgrnam(e); |
@@ -298,6 +303,7 @@ static void parse_config_file(void) | |||
298 | } | 303 | } |
299 | sct->m_gid = grp->gr_gid; | 304 | sct->m_gid = grp->gr_gid; |
300 | } | 305 | } |
306 | #endif | ||
301 | } | 307 | } |
302 | continue; | 308 | continue; |
303 | } | 309 | } |