Disable UID/GID checks on "single user OS"
Don't abort on "single user operating systems" that don't know more than one user account and therefore can't change user and group IDs. Currently, the only such system supported by ngIRCd is Haiku, a BeOS clone.
This commit is contained in:
parent
cdaaae0cb2
commit
e0da56fc7b
|
@ -567,6 +567,8 @@ Setup_FDStreams(int fd)
|
||||||
} /* Setup_FDStreams */
|
} /* Setup_FDStreams */
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(SINGLE_USER_OS)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get user and group ID of unprivileged "nobody" user.
|
* Get user and group ID of unprivileged "nobody" user.
|
||||||
*
|
*
|
||||||
|
@ -606,6 +608,8 @@ NGIRCd_getNobodyID(uid_t *uid, gid_t *gid )
|
||||||
return true;
|
return true;
|
||||||
} /* NGIRCd_getNobodyID */
|
} /* NGIRCd_getNobodyID */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
Random_Init_Kern(const char *file)
|
Random_Init_Kern(const char *file)
|
||||||
|
@ -692,6 +696,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(SINGLE_USER_OS)
|
||||||
/* Check user ID */
|
/* Check user ID */
|
||||||
if (Conf_UID == 0) {
|
if (Conf_UID == 0) {
|
||||||
pwd = getpwuid(0);
|
pwd = getpwuid(0);
|
||||||
|
@ -718,6 +723,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Change user ID */
|
/* Change user ID */
|
||||||
if (getuid() != Conf_UID) {
|
if (getuid() != Conf_UID) {
|
||||||
|
|
|
@ -112,7 +112,6 @@ typedef unsigned char bool;
|
||||||
|
|
||||||
/* SPLint */
|
/* SPLint */
|
||||||
|
|
||||||
|
|
||||||
#ifdef S_SPLINT_S
|
#ifdef S_SPLINT_S
|
||||||
#include "splint.h"
|
#include "splint.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -132,6 +131,9 @@ typedef unsigned char bool;
|
||||||
#define HOST_VENDOR "unknown"
|
#define HOST_VENDOR "unknown"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __HAIKU__
|
||||||
|
#define SINGLE_USER_OS
|
||||||
|
#endif
|
||||||
|
|
||||||
/* configure options */
|
/* configure options */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue