VirtualBox

Changeset 34230 in vbox


Ignore:
Timestamp:
Nov 22, 2010 10:06:48 AM (14 years ago)
Author:
vboxsync
Message:

iprt,VBoxServiceAutoMount.cpp: RTPathSetOwner[Ex] should take NIL_RTUID/GID not -1 / ~0, the only excuse is that NIL_RT[UG]ID probably didn't exist when it was written. Ditto for the RTFileSetOwner API (not realized yet).

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/file.h

    r33540 r34230  
    763763 * @returns iprt status code.
    764764 * @param   File        Handle to the file.
    765  * @param   uid         The new file owner user id. Use -1 (or ~0) to leave this unchanged.
    766  * @param   gid         The new group id. Use -1 (or ~0) to leave this unchanged.
     765 * @param   uid         The new file owner user id.  Pass NIL_RTUID to leave
     766 *                      this unchanged.
     767 * @param   gid         The new group id.  Pass NIL_RTGID to leave this
     768 *                      unchanged.
    767769 */
    768770RTR3DECL(int) RTFileSetOwner(RTFILE File, uint32_t uid, uint32_t gid);
  • trunk/include/iprt/path.h

    r34214 r34230  
    811811 * @returns iprt status code.
    812812 * @param   pszPath     Path to the file system object.
    813  * @param   uid         The new file owner user id. Use -1 (or ~0) to leave this unchanged.
    814  * @param   gid         The new group id. Use -1 (or ~0) to leave this unchanged.
     813 * @param   uid         The new file owner user id.  Pass NIL_RTUID to leave
     814 *                      this unchanged.
     815 * @param   gid         The new group id.  Pass NIL_RTGUID to leave this
     816 *                      unchanged.
    815817 */
    816818RTR3DECL(int) RTPathSetOwner(const char *pszPath, uint32_t uid, uint32_t gid);
     
    821823 * @returns iprt status code.
    822824 * @param   pszPath     Path to the file system object.
    823  * @param   uid         The new file owner user id. Use -1 (or ~0) to leave this unchanged.
    824  * @param   gid         The new group id. Use -1 (or ~0) to leave this unchanged.
     825 * @param   uid         The new file owner user id.  Pass NIL_RTUID to leave
     826 *                      this unchanged.
     827 * @param   gid         The new group id.  Pass NIL_RTGID to leave this
     828 *                      unchanged.
    825829 * @param   fFlags      RTPATH_F_ON_LINK or RTPATH_F_FOLLOW_LINK.
    826830 */
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp

    r33922 r34230  
    179179    if (RT_SUCCESS(rc))
    180180    {
    181         rc = RTPathSetOwnerEx(pszMountPoint, ~0 /* Owner, unchanged */, pOpts->gid, RTPATH_F_ON_LINK);
     181        rc = RTPathSetOwnerEx(pszMountPoint, NIL_RTUID /* Owner, unchanged */, pOpts->gid, RTPATH_F_ON_LINK);
    182182        if (RT_SUCCESS(rc))
    183183        {
  • trunk/src/VBox/Runtime/r3/posix/path2-posix.cpp

    r34015 r34230  
    244244    AssertReturn(*pszPath, VERR_INVALID_PARAMETER);
    245245    AssertMsgReturn(RTPATH_F_IS_VALID(fFlags, 0), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);
    246     uid_t uidNative = uid != UINT32_MAX ? (uid_t)uid : (uid_t)-1;
     246    uid_t uidNative = uid != NIL_RTUID ? (uid_t)uid : (uid_t)-1;
    247247    AssertReturn(uid == uidNative, VERR_INVALID_PARAMETER);
    248     gid_t gidNative = gid != UINT32_MAX ? (gid_t)gid : (uid_t)-1;
     248    gid_t gidNative = gid != NIL_RTGID ? (gid_t)gid : (uid_t)-1;
    249249    AssertReturn(gid == gidNative, VERR_INVALID_PARAMETER);
    250250
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette