Skip to content
Snippets Groups Projects
Commit 340bd14e authored by Kamil Dudka's avatar Kamil Dudka
Browse files

config: explicitly map root UID/GID to 0 on Cygwin

Closes #133
parent f6249df5
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -260,6 +260,12 @@ static char *readPath(const char *configFile, int lineNum, const char *key,
static int resolveUid(const char *userName, uid_t *pUid)
{
struct passwd *pw;
#ifdef __CYGWIN__
if (strcmp(userName, "root") == 0) {
*pUid = 0;
return 0;
}
#endif
pw = getpwnam(userName);
if (!pw)
return -1;
Loading
Loading
@@ -272,6 +278,12 @@ static int resolveUid(const char *userName, uid_t *pUid)
static int resolveGid(const char *groupName, gid_t *pGid)
{
struct group *gr;
#ifdef __CYGWIN__
if (strcmp(groupName, "root") == 0) {
*pGid = 0;
return 0;
}
#endif
gr = getgrnam(groupName);
if (!gr)
return -1;
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment