2009-02-10 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / io-layer / security.c
index 3a5c622de9d08c7620e4cbc3b215a2604e047bf4..6486839d0aa40d98650ed4ad9f1080368d619002 100644 (file)
 #include <config.h>
 #include <mono/io-layer/io-layer.h>
 
+#ifdef HAVE_PWD_H
 #include <pwd.h>
+#endif
+
 #include <string.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <unistd.h>
 
 
@@ -54,6 +58,8 @@ gboolean RevertToSelf (void)
 #ifdef HAVE_SETRESUID
        if (setresuid (-1, suid, -1) < 0)
                return FALSE;
+#else
+       return TRUE;
 #endif
        return (geteuid () == suid);
 }