Changeset 66632 in vbox for trunk/src/VBox/HostDrivers
- Timestamp:
- Apr 20, 2017 2:43:46 PM (8 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPLibInternal.h
r66526 r66632 449 449 DECLHIDDEN(int) supR3HardenedVerifyFile(const char *pszFilename, RTHCUINTPTR hNativeFile, bool fMaybe3rdParty, 450 450 PRTERRINFO pErrInfo); 451 #if def RT_OS_DARWIN451 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) 452 452 DECLHIDDEN(int) supR3HardenedVerifyFileFollowSymlinks(const char *pszFilename, RTHCUINTPTR hNativeFile, bool fMaybe3rdParty, 453 453 PRTERRINFO pErrInfo); -
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
r66627 r66632 1036 1036 } 1037 1037 1038 #ifdef RT_OS_DARWIN 1038 1039 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) 1039 1040 /** 1040 1041 * Copies the four messages into the error buffer and returns @a rc. … … 1053 1054 return supR3HardenedSetErrorN(rc, pErrInfo, 4, pszMsg1, pszMsg2, pszMsg3, pszMsg4); 1054 1055 } 1055 #endif /* RT_OS_DARWIN */1056 #endif 1056 1057 1057 1058 … … 1072 1073 } 1073 1074 1075 1074 1076 #ifdef SOME_UNUSED_FUNCTION 1075 1076 1077 /** 1077 1078 * Copies the two messages into the error buffer and returns @a rc. … … 1088 1089 return supR3HardenedSetErrorN(rc, pErrInfo, 2, pszMsg1, pszMsg2); 1089 1090 } 1090 1091 #endif /* SOME_UNUSED_FUNCTION */ 1092 1093 #ifdef RT_OS_DARWIN 1094 1091 #endif 1092 1093 1094 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) 1095 1095 /** 1096 1096 * Copies the error message to the error buffer and returns @a rc. … … 1105 1105 return supR3HardenedSetErrorN(rc, pErrInfo, 1, pszMsg); 1106 1106 } 1107 1108 1107 #endif 1109 1108 … … 1501 1500 /* 1502 1501 * World must not have write access. There is no relaxing this rule. 1503 */ 1504 if (pFsObjState->Stat.st_mode & S_IWOTH) 1502 * Linux exception: Symbolic links are always give permission 0777, there 1503 * is no lchmod or lchown APIs. The permissions on parent 1504 * directory that contains the symbolic link is what is 1505 * decising wrt to modifying it. (Caller is expected not 1506 * to allow symbolic links in the first path component.) 1507 */ 1508 if ( (pFsObjState->Stat.st_mode & S_IWOTH) 1509 # ifdef RT_OS_LINUX 1510 && ( !S_ISLNK(pFsObjState->Stat.st_mode) 1511 || !fSymlinksAllowed /* paranoia */) 1512 # endif 1513 ) 1505 1514 return supR3HardenedSetError3(VERR_SUPLIB_WORLD_WRITABLE, pErrInfo, 1506 1515 "World writable: '", pszPath, "'"); … … 1846 1855 1847 1856 1848 #if def RT_OS_DARWIN1857 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) 1849 1858 /** 1850 1859 * Verfies a file following symlinks. … … 2001 2010 return VINF_SUCCESS; 2002 2011 } 2003 #endif /* RT_OS_DARWIN */2012 #endif /* RT_OS_DARWIN || RT_OS_LINUX */ 2004 2013 2005 2014 -
trunk/src/VBox/HostDrivers/Support/posix/SUPR3HardenedMain-posix.cpp
r66605 r66632 190 190 && strchr(pszFilename, '/') != NULL) 191 191 { 192 #if def RT_OS_DARWIN192 #if defined(RT_OS_DARWIN) || defined(RT_OS_LINUX) 193 193 int rc = supR3HardenedVerifyFileFollowSymlinks(pszFilename, RTHCUINTPTR_MAX, true /* fMaybe3rdParty */, 194 194 NULL /* pErrInfo */);
Note:
See TracChangeset
for help on using the changeset viewer.