diff options
author | Jonghyun Park <parjong@gmail.com> | 2017-03-21 09:14:02 +0900 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-03-20 17:14:02 -0700 |
commit | cd9b5e782f6e9b1f392e028c819ed538546311eb (patch) | |
tree | 06c4468cea5fc3d8923da5a2615ed576de323f81 | |
parent | 8fb9a5e2f77dbd88a6d6a564ff91f5f1d87e4b65 (diff) | |
download | coreclr-cd9b5e782f6e9b1f392e028c819ed538546311eb.tar.gz coreclr-cd9b5e782f6e9b1f392e028c819ed538546311eb.tar.bz2 coreclr-cd9b5e782f6e9b1f392e028c819ed538546311eb.zip |
'root' as a special case in UTIL_IsExecuteBitsSet (#10246)
-rw-r--r-- | src/pal/src/misc/utils.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pal/src/misc/utils.cpp b/src/pal/src/misc/utils.cpp index f0ff63439f..4eefd749ed 100644 --- a/src/pal/src/misc/utils.cpp +++ b/src/pal/src/misc/utils.cpp @@ -124,7 +124,12 @@ BOOL UTIL_IsExecuteBitsSet( struct stat * stat_data ) } /* Check for read permissions. */ - if ( stat_data->st_uid == geteuid() ) + if ( 0 == geteuid() ) + { + /* The process owner is root */ + bRetVal = TRUE; + } + else if ( stat_data->st_uid == geteuid() ) { /* The process owner is the file owner as well. */ if ( ( stat_data->st_mode & S_IXUSR ) ) |