Changeset 98817 in vbox
- Timestamp:
- Mar 2, 2023 1:16:17 PM (21 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuestLib.h
r98813 r98817 1152 1152 VBGLR3DECL(int) VbglR3GuestCtrlDirCbOpen(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, uint32_t uFileHandle); 1153 1153 VBGLR3DECL(int) VbglR3GuestCtrlDirCbClose(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc); 1154 VBGLR3DECL(int) VbglR3GuestCtrlDirCbReadEx(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, PGSTCTLDIRENTRYEX pEntry, uint32_t cbSize, c har *pszUser,char *pszGroups);1154 VBGLR3DECL(int) VbglR3GuestCtrlDirCbReadEx(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, PGSTCTLDIRENTRYEX pEntry, uint32_t cbSize, const char *pszUser, const char *pszGroups); 1155 1155 VBGLR3DECL(int) VbglR3GuestCtrlDirCbRead(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, PGSTCTLDIRENTRYEX pEntry, uint32_t cbSize); 1156 1156 VBGLR3DECL(int) VbglR3GuestCtrlDirCbRewind(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc); … … 1174 1174 * @{ 1175 1175 */ 1176 VBGLR3DECL(int) VbglR3GuestCtrlFsCbQueryInfoEx(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, PGSTCTLFSOBJINFO pObjInfo, c har *pszUser,char *pszGroups);1176 VBGLR3DECL(int) VbglR3GuestCtrlFsCbQueryInfoEx(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, PGSTCTLFSOBJINFO pObjInfo, const char *pszUser, const char *pszGroups); 1177 1177 VBGLR3DECL(int) VbglR3GuestCtrlFsCbQueryInfo(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, PGSTCTLFSOBJINFO pObjInfo); 1178 1178 VBGLR3DECL(int) VbglR3GuestCtrlFsCbCreateTemp(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, const char *pszPath); -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibGuestCtrl.cpp
r98813 r98817 2283 2283 */ 2284 2284 VBGLR3DECL(int) VbglR3GuestCtrlDirCbReadEx(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, PGSTCTLDIRENTRYEX pEntry, uint32_t cbSize, 2285 c har *pszUser,char *pszGroups)2285 const char *pszUser, const char *pszGroups) 2286 2286 { 2287 2287 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); … … 2601 2601 */ 2602 2602 VBGLR3DECL(int) VbglR3GuestCtrlFsCbQueryInfoEx(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, PGSTCTLFSOBJINFO pFsObjInfo, 2603 c har *pszUser,char *pszGroups)2603 const char *pszUser, const char *pszGroups) 2604 2604 { 2605 2605 AssertPtrReturn(pCtx, VERR_INVALID_POINTER); … … 2632 2632 VBGLR3DECL(int) VbglR3GuestCtrlFsCbQueryInfo(PVBGLR3GUESTCTRLCMDCTX pCtx, uint32_t uRc, PGSTCTLFSOBJINFO pFsObjInfo) 2633 2633 { 2634 char szIgnored[1] ;2634 char szIgnored[1] = { 0 }; 2635 2635 return VbglR3GuestCtrlFsCbQueryInfoEx(pCtx, uRc, pFsObjInfo, szIgnored /* pszUser */, szIgnored /* pszGroups */); 2636 2636 } -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControl.h
r98709 r98817 221 221 /** How many processes do we allow keeping around at a time? */ 222 222 uint32_t uProcsMaxKept; 223 /** The uid/gid cache for this session. */ 224 VGSVCIDCACHE IdCache; 223 /** The uid cache for this session. */ 224 VGSVCIDCACHE UidCache; 225 /** The gid cache for this session. */ 226 VGSVCIDCACHE GidCache; 225 227 } VBOXSERVICECTRLSESSION; 226 228 /** Pointer to guest session. */ -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlSession.cpp
r98813 r98817 1170 1170 pDir->pszPathAbs, RT_SUCCESS(rc) ? DirEntryEx.szName : "<None>", rc); 1171 1171 1172 char *pszUser = RT_SUCCESS(rc) 1173 ? RTStrDup(VGSvcIdCacheGetUidName(&pSession->IdCache, 1174 DirEntryEx.Info.Attr.u.Unix.uid, DirEntryEx.szName, pDir->pszPathAbs)) 1175 : NULL; 1176 1177 char *pszGroup = RT_SUCCESS(rc) 1178 ? RTStrDup(VGSvcIdCacheGetGidName(&pSession->IdCache, 1179 DirEntryEx.Info.Attr.u.Unix.gid, DirEntryEx.szName, pDir->pszPathAbs)) 1180 : NULL; 1172 const char *pszUser = VGSvcIdCacheGetUidName(&pSession->UidCache, DirEntryEx.Info.Attr.u.Unix.uid, DirEntryEx.szName, 1173 pDir->pszPathAbs); 1174 const char *pszGroup = VGSvcIdCacheGetGidName(&pSession->GidCache, DirEntryEx.Info.Attr.u.Unix.gid, DirEntryEx.szName, 1175 pDir->pszPathAbs); 1181 1176 1182 1177 VGSvcVerbose(2, "[Dir %s] Entry '%s': %zu bytes, uid=%s (%d), gid=%s (%d)\n", … … 1185 1180 pszGroup ? pszGroup : "", DirEntryEx.Info.Attr.u.UnixGroup.gid); 1186 1181 1187 char szIgnored[] = "???";1188 1182 int rc2 = VbglR3GuestCtrlDirCbReadEx(pHostCtx, rc, 1189 1183 &DirEntryEx, (uint32_t)(sizeof(GSTCTLDIRENTRYEX) + cbDirEntry), 1190 pszUser ? pszUser : szIgnored, pszGroup ? pszGroup : szIgnored); 1191 RTStrFree(pszUser); 1192 RTStrFree(pszGroup); 1193 1184 pszUser, pszGroup); 1194 1185 if (RT_FAILURE(rc2)) 1195 1186 VGSvcError("Failed to report directory read status (%Rrc), rc=%Rrc\n", rc, rc2); … … 1859 1850 PGSTCTLFSOBJINFO pObjInfo = (PGSTCTLFSOBJINFO)&objInfoRuntime; 1860 1851 1861 char *pszUser = RTStrDup( RT_SUCCESS(rc) 1862 ? VGSvcIdCacheGetUidName(&pSession->IdCache, pObjInfo->Attr.u.Unix.uid, szPath, NULL /* pszRelativeTo */) 1863 : "<error>"); 1864 AssertStmt(pszUser != NULL, rc = VERR_NO_MEMORY); 1865 1866 char *pszGroup = RTStrDup( RT_SUCCESS(rc) 1867 ? VGSvcIdCacheGetGidName(&pSession->IdCache, pObjInfo->Attr.u.Unix.gid, szPath, NULL /* pszRelativeTo */) 1868 : "<error>"); 1869 AssertStmt(pszGroup != NULL, rc = VERR_NO_MEMORY); 1852 const char *pszUser = VGSvcIdCacheGetUidName(&pSession->UidCache, pObjInfo->Attr.u.Unix.uid, szPath, NULL /* pszRelativeTo */); 1853 const char *pszGroup = VGSvcIdCacheGetGidName(&pSession->GidCache, pObjInfo->Attr.u.Unix.gid, szPath, NULL /* pszRelativeTo */); 1870 1854 1871 1855 int rc2 = VbglR3GuestCtrlFsCbQueryInfoEx(pHostCtx, rc, pObjInfo, pszUser, pszGroup); 1872 RTStrFree(pszUser);1873 RTStrFree(pszGroup);1874 1875 1856 if (RT_FAILURE(rc2)) 1876 1857 { … … 2765 2746 pSession->fFlags = fFlags; 2766 2747 2767 RT_ZERO(pSession->IdCache); 2748 RT_ZERO(pSession->UidCache); 2749 RT_ZERO(pSession->GidCache); 2768 2750 2769 2751 /* Init critical section for protecting the thread lists. */
Note:
See TracChangeset
for help on using the changeset viewer.