Changeset 79742 in vbox for trunk/src/VBox/Main/src-server/MediumImpl.cpp
- Timestamp:
- Jul 12, 2019 4:11:19 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132104
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r79479 r79742 847 847 m->vdIfConfig.pfnQuerySize = i_vdConfigQuerySize; 848 848 m->vdIfConfig.pfnQuery = i_vdConfigQuery; 849 m->vdIfConfig.pfnUpdate = i_vdConfigUpdate; 849 850 m->vdIfConfig.pfnQueryBytes = NULL; 850 851 … … 4674 4675 const Utf8Str &name = it->first; 4675 4676 const Utf8Str &value = it->second; 4676 /* do NOT store the plain InitiatorSecret */ 4677 if ( !fHaveInitiatorSecretEncrypted 4678 || !name.equals("InitiatorSecret")) 4679 data.properties[name] = value; 4680 } 4677 bool fCreateOnly = false; 4678 for (MediumFormat::PropertyArray::const_iterator itf = m->formatObj->i_getProperties().begin(); 4679 itf != m->formatObj->i_getProperties().end(); 4680 ++itf) 4681 { 4682 if (itf->strName.equals(name) && 4683 (itf->flags & VD_CFGKEY_CREATEONLY)) 4684 { 4685 fCreateOnly = true; 4686 break; 4687 } 4688 } 4689 if (!fCreateOnly) 4690 /* do NOT store the plain InitiatorSecret */ 4691 if ( !fHaveInitiatorSecretEncrypted 4692 || !name.equals("InitiatorSecret")) 4693 data.properties[name] = value; } 4681 4694 } 4682 4695 if (fHaveInitiatorSecretEncrypted) … … 8018 8031 memcpy(pszValue, psz, cch + 1); 8019 8032 return VINF_SUCCESS; 8033 } 8034 8035 DECLCALLBACK(int) Medium::i_vdConfigUpdate(void *pvUser, 8036 bool fCreate, 8037 const char *pszName, 8038 const char *pszValue) 8039 { 8040 int rv = VINF_SUCCESS; 8041 Utf8Str pName = Utf8Str(pszName); 8042 Medium *that = (Medium *)pvUser; 8043 AutoWriteLock mlock(that COMMA_LOCKVAL_SRC_POS); 8044 settings::StringsMap::const_iterator it = that->m->mapProperties.find(pName); 8045 if (it == that->m->mapProperties.end() && !fCreate) 8046 rv = VERR_CFGM_VALUE_NOT_FOUND; 8047 else 8048 that->m->mapProperties[pName] = Utf8Str(pszValue); 8049 mlock.release(); 8050 return rv; 8020 8051 } 8021 8052
Note:
See TracChangeset
for help on using the changeset viewer.