summaryrefslogtreecommitdiffstats
path: root/common/os_calls.c
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2006-10-28 03:28:59 +0000
committerjsorg71 <jsorg71>2006-10-28 03:28:59 +0000
commitcf00c1707d0cfc3bde2d6bff9a1c73123375abe9 (patch)
tree9457f0f73e5ba3b1233902cbea2b61c7390a2639 /common/os_calls.c
parentfe292cec2017ce10e4fdd42646cc4a2f8c8a19a6 (diff)
downloadxrdp-proprietary-cf00c1707d0cfc3bde2d6bff9a1c73123375abe9.tar.gz
xrdp-proprietary-cf00c1707d0cfc3bde2d6bff9a1c73123375abe9.zip
g_chmod to g_chmod_hex
Diffstat (limited to 'common/os_calls.c')
-rw-r--r--common/os_calls.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/common/os_calls.c b/common/os_calls.c
index 44a2e39f..2295745d 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -651,12 +651,27 @@ g_set_file_rights(char* filename, int read, int write)
/*****************************************************************************/
/* returns error */
int
-g_chmod(char* filename, int flags)
+g_chmod_hex(char* filename, int flags)
{
#if defined(_WIN32)
return 0;
#else
- return chmod(filename, flags);
+ int fl;
+
+ fl = 0;
+ fl |= (flags & 0x4000) ? S_ISUID : 0;
+ fl |= (flags & 0x2000) ? S_ISGID : 0;
+ fl |= (flags & 0x1000) ? S_ISVTX : 0;
+ fl |= (flags & 0x0400) ? S_IRUSR : 0;
+ fl |= (flags & 0x0200) ? S_IWUSR : 0;
+ fl |= (flags & 0x0100) ? S_IXUSR : 0;
+ fl |= (flags & 0x0040) ? S_IRGRP : 0;
+ fl |= (flags & 0x0020) ? S_IWGRP : 0;
+ fl |= (flags & 0x0010) ? S_IXGRP : 0;
+ fl |= (flags & 0x0004) ? S_IROTH : 0;
+ fl |= (flags & 0x0002) ? S_IWOTH : 0;
+ fl |= (flags & 0x0001) ? S_IXOTH : 0;
+ return chmod(filename, fl);
#endif
}