Changeset 96885 in vbox
- Timestamp:
- Sep 26, 2022 7:09:42 PM (2 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxGuestLib.h
r96407 r96885 826 826 /** @name DRM client handling 827 827 * @{ */ 828 /** Guest property names pattern which is used by Guest Additions DRM services. */ 829 # define VBGLR3DRMPROPPTR "/VirtualBox/GuestAdd/DRM*" 828 830 /** Guest property that defines if the DRM IPC server access should be restricted to a specific user group. */ 829 831 # define VBGLR3DRMIPCPROPRESTRICT "/VirtualBox/GuestAdd/DRMIpcRestricted" -
trunk/src/VBox/Additions/x11/VBoxClient/display-drm.cpp
r96407 r96885 1085 1085 * 1086 1086 * @param hIpcServer IPC server handle. 1087 */ 1088 static void vbDrmSetIpcServerAccessPermissions(RTLOCALIPCSERVER hIpcServer) 1087 * @param fRestrict Whether to restrict access to socket or not. 1088 */ 1089 static void vbDrmSetIpcServerAccessPermissions(RTLOCALIPCSERVER hIpcServer, bool fRestrict) 1089 1090 { 1090 1091 int rc; 1091 1092 1092 ASMAtomicWriteBool(&g_fDrmIpcRestricted, VbglR3DrmRestrictedIpcAccessIsNeeded()); 1093 1094 if (g_fDrmIpcRestricted) 1093 if (fRestrict) 1095 1094 { 1096 1095 struct group *pGrp; … … 1119 1118 VBClLogError("unable to grant IPC server socket access to all users, rc=%Rrc\n", rc); 1120 1119 } 1120 1121 /* Set flag for the thread which serves incomming IPC connections. */ 1122 ASMAtomicWriteBool(&g_fDrmIpcRestricted, fRestrict); 1121 1123 } 1122 1124 … … 1138 1140 do 1139 1141 { 1140 /* Buffer should be big enough to fit guest property data layout: Name\0Value\0Flags\0 . */1142 /* Buffer should be big enough to fit guest property data layout: Name\0Value\0Flags\0fWasDeleted\0. */ 1141 1143 static char achBuf[GUEST_PROP_MAX_NAME_LEN]; 1144 char *pszName = NULL; 1145 char *pszValue = NULL; 1146 char *pszFlags = NULL; 1147 bool fWasDeleted = false; 1142 1148 uint64_t u64Timestamp = 0; 1143 1149 1144 rc = VbglR3GuestPropWait(idClient, VBGLR3DRMIPCPROPRESTRICT, achBuf, sizeof(achBuf), u64Timestamp, 1145 VBOX_DRMIPC_RX_TIMEOUT_MS, NULL, NULL, &u64Timestamp, NULL, NULL, NULL); 1150 rc = VbglR3GuestPropWait(idClient, VBGLR3DRMPROPPTR, achBuf, sizeof(achBuf), u64Timestamp, 1151 VBOX_DRMIPC_RX_TIMEOUT_MS, &pszName, &pszValue, &u64Timestamp, 1152 &pszFlags, NULL, &fWasDeleted); 1146 1153 if (RT_SUCCESS(rc)) 1147 vbDrmSetIpcServerAccessPermissions(hIpcServer); 1148 else if ( rc != VERR_TIMEOUT 1154 { 1155 uint32_t fFlags = 0; 1156 1157 VBClLogVerbose(1, "guest property change: name: %s, val: %s, flags: %s, fWasDeleted: %RTbool\n", 1158 pszName, pszValue, pszFlags, fWasDeleted); 1159 1160 if (RT_SUCCESS(GuestPropValidateFlags(pszFlags, &fFlags))) 1161 { 1162 if (RTStrNCmp(pszName, VBGLR3DRMIPCPROPRESTRICT, GUEST_PROP_MAX_NAME_LEN) == 0) 1163 { 1164 /* Enforce restricted socket access until guest property exist and READ-ONLY for the guest. */ 1165 vbDrmSetIpcServerAccessPermissions(hIpcServer, !fWasDeleted && fFlags & GUEST_PROP_F_RDONLYGUEST); 1166 } 1167 1168 } else 1169 VBClLogError("guest property change: name: %s, val: %s, flags: %s, fWasDeleted: %RTbool: bad flags\n", 1170 pszName, pszValue, pszFlags, fWasDeleted); 1171 1172 } else if ( rc != VERR_TIMEOUT 1149 1173 && rc != VERR_INTERRUPTED) 1150 1174 { … … 1284 1308 1285 1309 /* Set IPC server socket access permissions according to VM configuration. */ 1286 vbDrmSetIpcServerAccessPermissions(hIpcServer );1310 vbDrmSetIpcServerAccessPermissions(hIpcServer, VbglR3DrmRestrictedIpcAccessIsNeeded()); 1287 1311 1288 1312 /* Attempt to start DRM resize task. */
Note:
See TracChangeset
for help on using the changeset viewer.