From 864eef14ea8b63c905801edba77ac65d8ef019e3 Mon Sep 17 00:00:00 2001 From: Jonghyun Park Date: Tue, 21 Mar 2017 09:14:02 +0900 Subject: [PATCH] 'root' as a special case in UTIL_IsExecuteBitsSet (dotnet/coreclr#10246) Commit migrated from https://github.com/dotnet/coreclr/commit/cd9b5e782f6e9b1f392e028c819ed538546311eb --- src/coreclr/src/pal/src/misc/utils.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/coreclr/src/pal/src/misc/utils.cpp b/src/coreclr/src/pal/src/misc/utils.cpp index f0ff634..4eefd74 100644 --- a/src/coreclr/src/pal/src/misc/utils.cpp +++ b/src/coreclr/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 ) ) -- 2.7.4