Changeset 35403 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Jan 5, 2011 11:23:09 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
r35188 r35403 1151 1151 1152 1152 /* 1153 * The object type must be directory or file, no symbolic links or other 1154 * risky stuff (sorry dude, but we're paranoid on purpose here). 1155 */ 1156 if ( !S_ISDIR(pFsObjState->Stat.st_mode) 1157 && !S_ISREG(pFsObjState->Stat.st_mode)) 1158 { 1159 if (S_ISLNK(pFsObjState->Stat.st_mode)) 1160 return supR3HardenedSetError3(VERR_SUPLIB_SYMLINKS_ARE_NOT_PERMITTED, pErrInfo, 1161 "Symlinks are not permitted: '", pszPath, "'"); 1162 return supR3HardenedSetError3(VERR_SUPLIB_NOT_DIR_NOT_FILE, pErrInfo, 1163 "Not regular file or directory: '", pszPath, "'"); 1164 } 1165 if (fDir != !!S_ISDIR(pFsObjState->Stat.st_mode)) 1166 { 1167 if (S_ISDIR(pFsObjState->Stat.st_mode)) 1168 return supR3HardenedSetError3(VERR_SUPLIB_IS_DIRECTORY, pErrInfo, 1169 "Expected file but found directory: '", pszPath, "'"); 1170 return supR3HardenedSetError3(VERR_SUPLIB_IS_FILE, pErrInfo, 1171 "Expected directory but found file: '", pszPath, "'"); 1172 } 1173 1174 /* 1153 1175 * The group does not matter if it does not have write access, if it has 1154 1176 * write access it must be group 0 (root/wheel/whatever). … … 1181 1203 */ 1182 1204 /** @todo */ 1183 1184 /*1185 * Check the object type.1186 */1187 if ( !S_ISDIR(pFsObjState->Stat.st_mode)1188 && !S_ISREG(pFsObjState->Stat.st_mode))1189 {1190 if (S_ISLNK(pFsObjState->Stat.st_mode))1191 return supR3HardenedSetError3(VERR_SUPLIB_SYMLINKS_ARE_NOT_PERMITTED, pErrInfo,1192 "Symlinks are not permitted: '", pszPath, "'");1193 return supR3HardenedSetError3(VERR_SUPLIB_NOT_DIR_NOT_FILE, pErrInfo,1194 "Not regular file or directory: '", pszPath, "'");1195 }1196 if (fDir != !!S_ISDIR(pFsObjState->Stat.st_mode))1197 {1198 if (S_ISDIR(pFsObjState->Stat.st_mode))1199 return supR3HardenedSetError3(VERR_SUPLIB_IS_DIRECTORY, pErrInfo,1200 "Expected file but found directory: '", pszPath, "'");1201 return supR3HardenedSetError3(VERR_SUPLIB_IS_FILE, pErrInfo,1202 "Expected directory but found file: '", pszPath, "'");1203 }1204 1205 1205 1206 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.