projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[xbuild] Log build errors and raise events even if a build fails.
[mono.git]
/
mono
/
io-layer
/
security.c
diff --git
a/mono/io-layer/security.c
b/mono/io-layer/security.c
index 3a5c622de9d08c7620e4cbc3b215a2604e047bf4..1d702d3188f274c02c319c8f3d59bc805d9ccbf4 100644
(file)
--- a/
mono/io-layer/security.c
+++ b/
mono/io-layer/security.c
@@
-10,9
+10,13
@@
#include <config.h>
#include <mono/io-layer/io-layer.h>
#include <config.h>
#include <mono/io-layer/io-layer.h>
+#ifdef HAVE_PWD_H
#include <pwd.h>
#include <pwd.h>
+#endif
+
#include <string.h>
#include <sys/types.h>
#include <string.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <unistd.h>
#include <unistd.h>
@@
-31,7
+35,7
@@
gboolean
ImpersonateLoggedOnUser (gpointer handle)
{
gboolean
ImpersonateLoggedOnUser (gpointer handle)
{
- uid_t token = (uid_t)
handle
;
+ uid_t token = (uid_t)
GPOINTER_TO_INT (handle)
;
#ifdef HAVE_SETRESUID
if (setresuid (-1, token, getuid ()) < 0)
return FALSE;
#ifdef HAVE_SETRESUID
if (setresuid (-1, token, getuid ()) < 0)
return FALSE;
@@
-54,6
+58,8
@@
gboolean RevertToSelf (void)
#ifdef HAVE_SETRESUID
if (setresuid (-1, suid, -1) < 0)
return FALSE;
#ifdef HAVE_SETRESUID
if (setresuid (-1, suid, -1) < 0)
return FALSE;
+#else
+ return TRUE;
#endif
return (geteuid () == suid);
}
#endif
return (geteuid () == suid);
}