Changeset 35708 in vbox for trunk/src/VBox/Main/src-helper-apps
- Timestamp:
- Jan 25, 2011 12:58:25 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 69642
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp
r35699 r35708 5 5 6 6 /* 7 * Copyright (C) 2010 Oracle Corporation7 * Copyright (C) 2010-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 347 347 static RTEXITCODE UnpackExtPackDir(const char *pszDstDirName, RTVFSOBJ hVfsObj) 348 348 { 349 int rc = RTDirCreate(pszDstDirName, 0755); 349 /* 350 * Get the mode mask before creating the directory. 351 */ 352 RTFSOBJINFO ObjInfo; 353 int rc = RTVfsObjQueryInfo(hVfsObj, &ObjInfo, RTFSOBJATTRADD_NOTHING); 354 if (RT_FAILURE(rc)) 355 return RTMsgErrorExit(RTEXITCODE_FAILURE, "RTVfsObjQueryInfo failed on '%s': %Rrc", pszDstDirName, rc); 356 ObjInfo.Attr.fMode &= ~(RTFS_UNIX_IWOTH | RTFS_UNIX_IWGRP); 357 358 rc = RTDirCreate(pszDstDirName, ObjInfo.Attr.fMode); 350 359 if (RT_FAILURE(rc)) 351 360 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create directory '%s': %Rrc", pszDstDirName, rc); 352 #if !defined(RT_OS_WINDOWS) 353 /* This is necessary because of umask! */ 354 rc = RTPathSetMode(pszDstDirName, 0755); 355 if (RT_FAILURE(rc)) 356 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to set directory permissions: %Rrc ('%s')", rc, pszDstDirName); 361 362 #ifndef RT_OS_WINDOWS 363 /* 364 * Because of umask, we have to apply the mode again. 365 */ 366 rc = RTPathSetMode(pszDstDirName, ObjInfo.Attr.fMode); 367 if (RT_FAILURE(rc)) 368 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to set directory permissions on '%s': %Rrc", pszDstDirName, rc); 357 369 #else 358 370 /** @todo Ownership tricks on windows? */
Note:
See TracChangeset
for help on using the changeset viewer.