]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/ngircd.c
This patch implements a (maybe) compliant WHOWAS command.
[ngircd-alex.git] / src / ngircd / ngircd.c
index 626b8b235245b21f43bf17749cb22d2b9182e5d1..d839618fefb8174de42c96fd008318efe6e56cd2 100644 (file)
@@ -671,6 +671,19 @@ NGIRCd_getNobodyID(uid_t *uid, gid_t *gid )
 {
        struct passwd *pwd;
 
+#ifdef __CYGWIN__
+       /* Cygwin kludge.
+        * It can return EINVAL instead of EPERM
+        * so, if we are already unprivileged,
+        * use id of current user.
+        */
+       if (geteuid() && getuid()) {
+               *uid = getuid();
+               *gid = getgid();
+               return true;
+       }
+#endif
+
        pwd = getpwnam("nobody");
        if (!pwd) return false;