Changeset 94714 in vbox for trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp
- Timestamp:
- Apr 27, 2022 7:41:12 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp
r94643 r94714 103 103 i_setVRDEAuthLibrary(Utf8Str::Empty); 104 104 i_setDefaultVRDEExtPack(Utf8Str::Empty); 105 i_setDefaultCryptoExtPack(Utf8Str::Empty); 105 106 106 107 m->uLogHistoryCount = 3; … … 1157 1158 1158 1159 1160 HRESULT SystemProperties::getDefaultCryptoExtPack(com::Utf8Str &aExtPack) 1161 { 1162 HRESULT hrc = S_OK; 1163 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1164 Utf8Str strExtPack(m->strDefaultCryptoExtPack); 1165 if (strExtPack.isNotEmpty()) 1166 { 1167 if (strExtPack.equals(VBOXPUELCRYPTO_KLUDGE_EXTPACK_NAME)) 1168 hrc = S_OK; 1169 else 1170 #ifdef VBOX_WITH_EXTPACK 1171 hrc = mParent->i_getExtPackManager()->i_checkCryptoExtPack(&strExtPack); 1172 #else 1173 hrc = setError(E_FAIL, tr("The extension pack '%s' does not exist"), strExtPack.c_str()); 1174 #endif 1175 } 1176 else 1177 { 1178 #ifdef VBOX_WITH_EXTPACK 1179 hrc = mParent->i_getExtPackManager()->i_getDefaultCryptoExtPack(&strExtPack); 1180 #endif 1181 if (strExtPack.isEmpty()) 1182 { 1183 /* 1184 * Klugde - check if VBoxPuelCrypto.dll/.so/.dylib is installed. 1185 * This is hardcoded uglyness, sorry. 1186 */ 1187 char szPath[RTPATH_MAX]; 1188 int vrc = RTPathAppPrivateArch(szPath, sizeof(szPath)); 1189 if (RT_SUCCESS(vrc)) 1190 vrc = RTPathAppend(szPath, sizeof(szPath), "VBoxPuelCrypto"); 1191 if (RT_SUCCESS(vrc)) 1192 vrc = RTStrCat(szPath, sizeof(szPath), RTLdrGetSuff()); 1193 if (RT_SUCCESS(vrc) && RTFileExists(szPath)) 1194 { 1195 /* Illegal extpack name, so no conflict. */ 1196 strExtPack = VBOXPUELCRYPTO_KLUDGE_EXTPACK_NAME; 1197 } 1198 } 1199 } 1200 1201 if (SUCCEEDED(hrc)) 1202 aExtPack = strExtPack; 1203 1204 return S_OK; 1205 } 1206 1207 1208 HRESULT SystemProperties::setDefaultCryptoExtPack(const com::Utf8Str &aExtPack) 1209 { 1210 HRESULT hrc = S_OK; 1211 if (aExtPack.isNotEmpty()) 1212 { 1213 if (aExtPack.equals(VBOXPUELCRYPTO_KLUDGE_EXTPACK_NAME)) 1214 hrc = S_OK; 1215 else 1216 #ifdef VBOX_WITH_EXTPACK 1217 hrc = mParent->i_getExtPackManager()->i_checkCryptoExtPack(&aExtPack); 1218 #else 1219 hrc = setError(E_FAIL, tr("The extension pack '%s' does not exist"), aExtPack.c_str()); 1220 #endif 1221 } 1222 if (SUCCEEDED(hrc)) 1223 { 1224 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1225 hrc = i_setDefaultCryptoExtPack(aExtPack); 1226 if (SUCCEEDED(hrc)) 1227 { 1228 /* VirtualBox::i_saveSettings() needs the VirtualBox write lock. */ 1229 alock.release(); 1230 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); 1231 hrc = mParent->i_saveSettings(); 1232 } 1233 } 1234 1235 return hrc; 1236 } 1237 1238 1159 1239 HRESULT SystemProperties::getLogHistoryCount(ULONG *count) 1160 1240 { … … 1853 1933 if (FAILED(rc)) return rc; 1854 1934 1935 rc = i_setDefaultCryptoExtPack(data.strDefaultCryptoExtPack); 1936 if (FAILED(rc)) return rc; 1937 1855 1938 m->uLogHistoryCount = data.uLogHistoryCount; 1856 1939 m->fExclusiveHwVirt = data.fExclusiveHwVirt; … … 2118 2201 { 2119 2202 m->strDefaultVRDEExtPack = aExtPack; 2203 2204 return S_OK; 2205 } 2206 2207 HRESULT SystemProperties::i_setDefaultCryptoExtPack(const com::Utf8Str &aExtPack) 2208 { 2209 m->strDefaultCryptoExtPack = aExtPack; 2120 2210 2121 2211 return S_OK;
Note:
See TracChangeset
for help on using the changeset viewer.