cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * IPRT - File System Helpers, POSIX, Part 3.
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * Copyright (C) 2006-2010 Oracle Corporation
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * available from http://www.virtualbox.org. This file is free software;
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * you can redistribute it and/or modify it under the terms of the GNU
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * General Public License (GPL) as published by the Free Software
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * The contents of this file may alternatively be used under the terms
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * of the Common Development and Distribution License Version 1.0
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * VirtualBox OSE distribution, in which case the provisions of the
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * CDDL are applicable instead of those of the GPL.
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * You may elect to license modified versions of this file under the
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * terms and conditions of either the GPL or the CDDL or both.
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync/*******************************************************************************
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync* Header Files *
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync*******************************************************************************/
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * Set user-owner additional attributes.
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * @param pObjInfo The object info to fill add attrs for.
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * @param uid The user id.
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsyncvoid rtFsObjInfoAttrSetUnixOwner(PRTFSOBJINFO pObjInfo, RTUID uid)
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync pObjInfo->Attr.enmAdditional = RTFSOBJATTRADD_UNIX_OWNER;
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync int rc = getpwuid_r(uid, &Pwd, achBuf, sizeof(achBuf), &pPwd);
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync RTStrCopy(pObjInfo->Attr.u.UnixOwner.szName, sizeof(pObjInfo->Attr.u.UnixOwner.szName), pPwd->pw_name);
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * Set user-group additional attributes.
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * @param pObjInfo The object info to fill add attrs for.
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync * @param gid The group id.
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsyncvoid rtFsObjInfoAttrSetUnixGroup(PRTFSOBJINFO pObjInfo, RTUID gid)
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync pObjInfo->Attr.enmAdditional = RTFSOBJATTRADD_UNIX_GROUP;
cb058427ba3e482de214d42efdd8effaa2b670c7vboxsync int rc = getgrgid_r(gid, &Grp, achBuf, sizeof(achBuf), &pGrp);