Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

742 lines
28 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation
  4. //
  5. // SYNOPSIS
  6. //
  7. // Win2k and early Whistler DB to Whistler DB Migration
  8. //
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #include "stdafx.h"
  11. #include "GlobalData.h"
  12. #include "migratecontent.h"
  13. #include "MigrateEapConfig.h"
  14. #include "Objects.h"
  15. #include "Properties.h"
  16. #include "updatemschap.h"
  17. //////////////////////////////////////////////////////////////////////////////
  18. // CopyTree
  19. //
  20. // Param:
  21. // - the Id in the Reference (Ref) database: place to read from (iasold.mdb)
  22. // - the parent of that same node but in the Standard (Std) database:
  23. // the place to write to (ias.mdb)
  24. //
  25. //////////////////////////////////////////////////////////////////////////////
  26. HRESULT CMigrateContent::CopyTree(LONG RefId, LONG ParentParam)
  27. {
  28. /////////////////////////////////////////
  29. // get the name and Parent in the Ref DB
  30. /////////////////////////////////////////
  31. _bstr_t Name;
  32. LONG Parent;
  33. HRESULT hr = m_GlobalData.m_pRefObjects->GetObjectIdentity(
  34. Name,
  35. Parent,
  36. RefId
  37. );
  38. if ( FAILED(hr) )
  39. {
  40. return hr;
  41. }
  42. ///////////////////////////////////////////////////////
  43. // insert the object (gives an Identity) in the Std DB
  44. ///////////////////////////////////////////////////////
  45. LONG NewIdentity;
  46. BOOL InsertOk = m_GlobalData.m_pObjects->InsertObject(
  47. Name,
  48. ParentParam,
  49. NewIdentity
  50. );
  51. if ( !InsertOk )
  52. {
  53. ///////////////////////////////////////////////
  54. // the object already exists don't do anything
  55. ///////////////////////////////////////////////
  56. return S_OK;
  57. }
  58. _bstr_t PropertyName;
  59. _bstr_t StrVal;
  60. LONG Type;
  61. /////////////////////////////////////////////////////////////////
  62. // Copy the properties of that object from the Ref to the Std DB
  63. /////////////////////////////////////////////////////////////////
  64. hr = m_GlobalData.m_pRefProperties->GetProperty(
  65. RefId,
  66. PropertyName,
  67. Type,
  68. StrVal
  69. );
  70. LONG IndexProperty = 1;
  71. while ( hr == S_OK )
  72. {
  73. m_GlobalData.m_pProperties->InsertProperty(
  74. NewIdentity,
  75. PropertyName,
  76. Type,
  77. StrVal
  78. );
  79. hr = m_GlobalData.m_pRefProperties->GetNextProperty(
  80. RefId,
  81. PropertyName,
  82. Type,
  83. StrVal,
  84. IndexProperty
  85. );
  86. ++IndexProperty;
  87. }
  88. // here safely ignore hr
  89. //////////////////////////////////////////////////////////
  90. // get all the childs of the object in the Ref DB (RefId)
  91. //////////////////////////////////////////////////////////
  92. _bstr_t ObjectName;
  93. LONG ObjectIdentity;
  94. hr = m_GlobalData.m_pRefObjects->GetObject(
  95. ObjectName,
  96. ObjectIdentity,
  97. RefId
  98. );
  99. LONG IndexObject = 1;
  100. while ( SUCCEEDED(hr) )
  101. {
  102. ///////////////////////////////////////////////////////////
  103. // and for each, call CopyTree(ChildIdentity, NewIdentity)
  104. ///////////////////////////////////////////////////////////
  105. hr = CopyTree(ObjectIdentity, NewIdentity);
  106. if ( FAILED(hr) ){return hr;}
  107. hr = m_GlobalData.m_pRefObjects->GetNextObject(
  108. ObjectName,
  109. ObjectIdentity,
  110. RefId,
  111. IndexObject
  112. );
  113. ++IndexObject;
  114. }
  115. ///////////////////////////////////////////////
  116. // if no child: return S_Ok. hr safely ignored
  117. ///////////////////////////////////////////////
  118. return S_OK;
  119. }
  120. //////////////////////////////////////////////////////////////////////////////
  121. // MigrateXXX functions
  122. // Description:
  123. // These functions follow the same model:
  124. // - Get the ID of a container in iasold.mdb
  125. // - Get the ID of the same container in ias.mdb
  126. // - Get the ID of that container's parent in ias.mdb
  127. // - Recursively deletes the container in ias.mdb
  128. // - Then copy the content of that container from iasold.mdb into ias.mdb
  129. // using the parent's container as the place to attach the result.
  130. //
  131. // Some functions also update some specific properties without doing
  132. // a full copy
  133. //
  134. //////////////////////////////////////////////////////////////////////////////
  135. //////////////////////////////////////////////////////////////////////////////
  136. // MigrateClients
  137. //////////////////////////////////////////////////////////////////////////////
  138. void CMigrateContent::MigrateClients()
  139. {
  140. const WCHAR ClientPath[] = L"Root\0"
  141. L"Microsoft Internet Authentication Service\0"
  142. L"Protocols\0"
  143. L"Microsoft Radius Protocol\0"
  144. L"Clients\0";
  145. LONG ClientIdentity;
  146. m_GlobalData.m_pRefObjects->WalkPath(ClientPath, ClientIdentity);
  147. const WCHAR RadiusProtocolPath[] =
  148. L"Root\0"
  149. L"Microsoft Internet Authentication Service\0"
  150. L"Protocols\0"
  151. L"Microsoft Radius Protocol\0";
  152. LONG RadiusProtocolIdentity;
  153. m_GlobalData.m_pObjects->WalkPath(
  154. RadiusProtocolPath,
  155. RadiusProtocolIdentity
  156. );
  157. // delete the clients container and its content
  158. LONG DestClientIdentity;
  159. m_GlobalData.m_pObjects->WalkPath(ClientPath, DestClientIdentity);
  160. _com_util::CheckError(m_GlobalData.m_pObjects->DeleteObject(
  161. DestClientIdentity));
  162. // for each client in src, copy it in dest with its properties.
  163. _com_util::CheckError(CopyTree(ClientIdentity, RadiusProtocolIdentity));
  164. }
  165. //////////////////////////////////////////////////////////////////////////////
  166. // MigrateProfilesPolicies
  167. //////////////////////////////////////////////////////////////////////////////
  168. void CMigrateContent::MigrateProfilesPolicies()
  169. {
  170. const WCHAR ProfilesPath[] =
  171. L"Root\0"
  172. L"Microsoft Internet Authentication Service\0"
  173. L"RadiusProfiles\0";
  174. LONG DestProfilesIdentity;
  175. m_GlobalData.m_pObjects->WalkPath(ProfilesPath, DestProfilesIdentity);
  176. const WCHAR PoliciesPath[] =
  177. L"Root\0"
  178. L"Microsoft Internet Authentication Service\0"
  179. L"NetworkPolicy\0";
  180. LONG DestPoliciesIdentity;
  181. m_GlobalData.m_pObjects->WalkPath(PoliciesPath, DestPoliciesIdentity);
  182. // Delete the profiles and policies containers from ias.mdb
  183. _com_util::CheckError(m_GlobalData.m_pObjects->DeleteObject(
  184. DestProfilesIdentity));
  185. _com_util::CheckError(m_GlobalData.m_pObjects->DeleteObject(
  186. DestPoliciesIdentity));
  187. // default profiles and policies deleted from now on
  188. LONG ProfilesIdentity;
  189. m_GlobalData.m_pRefObjects->WalkPath(ProfilesPath, ProfilesIdentity);
  190. LONG PoliciesIdentity;
  191. m_GlobalData.m_pRefObjects->WalkPath(PoliciesPath, PoliciesIdentity);
  192. const WCHAR IASPath[] = L"Root\0"
  193. L"Microsoft Internet Authentication Service\0";
  194. LONG IASIdentity;
  195. m_GlobalData.m_pObjects->WalkPath(IASPath, IASIdentity);
  196. // for each profiles and policies in iasold.mdb,
  197. // copy it in dest with its properties.
  198. _com_util::CheckError(CopyTree(ProfilesIdentity, IASIdentity));
  199. _com_util::CheckError(CopyTree(PoliciesIdentity, IASIdentity));
  200. }
  201. //////////////////////////////////////////////////////////////////////////////
  202. // MigrateProxyProfilesPolicies
  203. //////////////////////////////////////////////////////////////////////////////
  204. void CMigrateContent::MigrateProxyProfilesPolicies()
  205. {
  206. const WCHAR ProfilesPath[] =
  207. L"Root\0"
  208. L"Microsoft Internet Authentication Service\0"
  209. L"Proxy Profiles\0";
  210. LONG DestProfilesIdentity;
  211. m_GlobalData.m_pObjects->WalkPath(ProfilesPath, DestProfilesIdentity);
  212. const WCHAR PoliciesPath[] =
  213. L"Root\0"
  214. L"Microsoft Internet Authentication Service\0"
  215. L"Proxy Policies\0";
  216. LONG DestPoliciesIdentity;
  217. m_GlobalData.m_pObjects->WalkPath(PoliciesPath, DestPoliciesIdentity);
  218. // Delete the profiles and policies containers from ias.mdb
  219. _com_util::CheckError(m_GlobalData.m_pObjects->DeleteObject(
  220. DestProfilesIdentity));
  221. _com_util::CheckError(m_GlobalData.m_pObjects->DeleteObject(
  222. DestPoliciesIdentity));
  223. // default profiles and policies deleted from now on
  224. LONG ProfilesIdentity;
  225. m_GlobalData.m_pRefObjects->WalkPath(ProfilesPath, ProfilesIdentity);
  226. LONG PoliciesIdentity;
  227. m_GlobalData.m_pRefObjects->WalkPath(PoliciesPath, PoliciesIdentity);
  228. const WCHAR IASPath[] = L"Root\0"
  229. L"Microsoft Internet Authentication Service\0";
  230. LONG IASIdentity;
  231. m_GlobalData.m_pObjects->WalkPath(IASPath, IASIdentity);
  232. // for each profiles and policies in iasold.mdb,
  233. // copy it in dest with its properties.
  234. _com_util::CheckError(CopyTree(ProfilesIdentity, IASIdentity));
  235. _com_util::CheckError(CopyTree(PoliciesIdentity, IASIdentity));
  236. }
  237. //////////////////////////////////////////////////////////////////////////////
  238. // MigrateAccounting
  239. //////////////////////////////////////////////////////////////////////////////
  240. void CMigrateContent::MigrateAccounting()
  241. {
  242. const WCHAR AccountingPath[] =
  243. L"Root\0"
  244. L"Microsoft Internet Authentication Service\0"
  245. L"RequestHandlers\0"
  246. L"Microsoft Accounting\0";
  247. LONG AccountingIdentity;
  248. m_GlobalData.m_pRefObjects->WalkPath(AccountingPath, AccountingIdentity);
  249. const WCHAR RequestHandlerPath[] =
  250. L"Root\0"
  251. L"Microsoft Internet Authentication Service\0"
  252. L"RequestHandlers\0";
  253. LONG RequestHandlerIdentity;
  254. m_GlobalData.m_pObjects->WalkPath(
  255. RequestHandlerPath,
  256. RequestHandlerIdentity
  257. );
  258. // delete the Accounting container and its content in ias.mdb
  259. LONG DestAccountingIdentity;
  260. m_GlobalData.m_pObjects->WalkPath(
  261. AccountingPath,
  262. DestAccountingIdentity
  263. );
  264. _com_util::CheckError(m_GlobalData.m_pObjects->DeleteObject(
  265. DestAccountingIdentity));
  266. // for each accounting in src, copy it in dest with its properties.
  267. _com_util::CheckError(CopyTree(
  268. AccountingIdentity,
  269. RequestHandlerIdentity
  270. ));
  271. }
  272. //////////////////////////////////////////////////////////////////////////////
  273. // MigrateEventLog
  274. //////////////////////////////////////////////////////////////////////////////
  275. void CMigrateContent::MigrateEventLog()
  276. {
  277. const WCHAR EventLogPath[] = L"Root\0"
  278. L"Microsoft Internet Authentication Service\0"
  279. L"Auditors\0"
  280. L"Microsoft NT Event Log Auditor\0";
  281. LONG EventLogIdentity;
  282. m_GlobalData.m_pRefObjects->WalkPath(EventLogPath, EventLogIdentity);
  283. const WCHAR AuditorsPath[] = L"Root\0"
  284. L"Microsoft Internet Authentication Service\0"
  285. L"Auditors\0";
  286. LONG AuditorsIdentity;
  287. m_GlobalData.m_pObjects->WalkPath(AuditorsPath, AuditorsIdentity);
  288. // delete the Auditors container and its content in ias.mdb
  289. LONG DestEventLogIdentity;
  290. m_GlobalData.m_pObjects->WalkPath(EventLogPath, DestEventLogIdentity);
  291. _com_util::CheckError(m_GlobalData.m_pObjects->DeleteObject(
  292. DestEventLogIdentity));
  293. // for each EventLog in src, copy it in dest with its properties.
  294. _com_util::CheckError(CopyTree(EventLogIdentity, AuditorsIdentity));
  295. }
  296. //////////////////////////////////////////////////////////////////////////////
  297. // MigrateService
  298. //////////////////////////////////////////////////////////////////////////////
  299. void CMigrateContent::MigrateService()
  300. {
  301. const LONG PORT_SIZE_MAX = 34;
  302. const WCHAR ServicePath[] = L"Root\0"
  303. L"Microsoft Internet Authentication Service\0"
  304. L"Protocols\0"
  305. L"Microsoft Radius Protocol\0";
  306. LONG RefServiceIdentity;
  307. m_GlobalData.m_pRefObjects->WalkPath(ServicePath, RefServiceIdentity);
  308. LONG DestServiceIdentity;
  309. m_GlobalData.m_pObjects->WalkPath(ServicePath, DestServiceIdentity);
  310. _bstr_t PropertyName = L"Authentication Port";
  311. _bstr_t RadiusPort;
  312. LONG Type = 0;
  313. m_GlobalData.m_pRefProperties->GetPropertyByName(
  314. RefServiceIdentity,
  315. PropertyName,
  316. Type,
  317. RadiusPort
  318. );
  319. if ( Type != VT_BSTR )
  320. {
  321. _com_issue_error(E_UNEXPECTED);
  322. }
  323. m_GlobalData.m_pProperties->UpdateProperty(
  324. DestServiceIdentity,
  325. PropertyName,
  326. VT_BSTR,
  327. RadiusPort
  328. );
  329. _bstr_t AcctPort;
  330. PropertyName = L"Accounting Port";
  331. Type = 0;
  332. m_GlobalData.m_pRefProperties->GetPropertyByName(
  333. RefServiceIdentity,
  334. PropertyName,
  335. Type,
  336. AcctPort
  337. );
  338. if ( Type != VT_BSTR )
  339. {
  340. _com_issue_error(E_UNEXPECTED);
  341. }
  342. m_GlobalData.m_pProperties->UpdateProperty(
  343. DestServiceIdentity,
  344. PropertyName,
  345. VT_BSTR,
  346. AcctPort
  347. );
  348. // Now update the service description (name)
  349. const WCHAR IASPath[] =
  350. L"Root\0"
  351. L"Microsoft Internet Authentication Service\0";
  352. LONG RefIASIdentity;
  353. m_GlobalData.m_pRefObjects->WalkPath(IASPath, RefIASIdentity);
  354. LONG DestIASIdentity;
  355. m_GlobalData.m_pObjects->WalkPath(IASPath, DestIASIdentity);
  356. PropertyName = L"Description";
  357. _bstr_t Description;
  358. Type = 0;
  359. m_GlobalData.m_pRefProperties->GetPropertyByName(
  360. RefIASIdentity,
  361. PropertyName,
  362. Type,
  363. Description
  364. );
  365. if ( Type != VT_BSTR )
  366. {
  367. _com_issue_error(E_UNEXPECTED);
  368. }
  369. m_GlobalData.m_pProperties->UpdateProperty(
  370. DestIASIdentity,
  371. PropertyName,
  372. VT_BSTR,
  373. Description
  374. );
  375. }
  376. //////////////////////////////////////////////////////////////////////////////
  377. // MigrateWin2kRealms
  378. //
  379. // Not used: msUserIdentityAlgorithm
  380. // msManipulationRule
  381. // msManipulationTarget (enum: 1, 30 or 31)
  382. //////////////////////////////////////////////////////////////////////////////
  383. void CMigrateContent::MigrateWin2kRealms()
  384. {
  385. const WCHAR DEFAULT_REALM_TARGET[] = L"1";
  386. const int MAX_LONG_SIZE = 32;
  387. /////////////////////////////////////////////////
  388. // Get the Microsoft Realms Evaluator's Identity
  389. /////////////////////////////////////////////////
  390. LPCWSTR RealmPath = L"Root\0"
  391. L"Microsoft Internet Authentication Service\0"
  392. L"RequestHandlers\0"
  393. L"Microsoft Realms Evaluator\0";
  394. LONG RealmIdentity;
  395. m_GlobalData.m_pRefObjects->WalkPath(RealmPath, RealmIdentity);
  396. ///////////////////////////////////////////////
  397. // Get the Proxy Profiles container's Identity
  398. ///////////////////////////////////////////////
  399. LPCWSTR ProxyProfilePath =
  400. L"Root\0"
  401. L"Microsoft Internet Authentication Service\0"
  402. L"Proxy Profiles\0";
  403. LONG ProxyContainerIdentity;
  404. m_GlobalData.m_pObjects->WalkPath(
  405. ProxyProfilePath,
  406. ProxyContainerIdentity
  407. );
  408. //////////////////////////////////////////////////////////////////////
  409. // Now get the first Object with the above container as parent.
  410. // this is the default proxy profile (it's localized: I can't search
  411. // for the name directly).
  412. //////////////////////////////////////////////////////////////////////
  413. _bstr_t ObjectName;
  414. LONG ProxyProfileIdentity;
  415. HRESULT hr = m_GlobalData.m_pObjects->GetObject(
  416. ObjectName,
  417. ProxyProfileIdentity,
  418. ProxyContainerIdentity
  419. );
  420. _com_util::CheckError(hr);
  421. _bstr_t PropertyName;
  422. LONG Type;
  423. _bstr_t StrVal;
  424. //////////////////////////
  425. // get all the properties
  426. //////////////////////////
  427. _com_util::CheckError(m_GlobalData.m_pRefProperties->GetProperty(
  428. RealmIdentity,
  429. PropertyName,
  430. Type,
  431. StrVal
  432. ));
  433. LONG IndexProperty = 1;
  434. LONG NbPropertiesInserted = 0;
  435. _bstr_t NewName = L"msManipulationRule";
  436. while ( hr == S_OK )
  437. {
  438. /////////////////////////////////////////
  439. // for each, if Name == L"Realms"
  440. // then add to the default proxy profile
  441. /////////////////////////////////////////
  442. if (_wcsicmp(PropertyName, L"Realms") == 0)
  443. {
  444. m_GlobalData.m_pProperties->InsertProperty(
  445. ProxyProfileIdentity,
  446. NewName,
  447. Type,
  448. StrVal
  449. );
  450. ++NbPropertiesInserted;
  451. }
  452. hr = m_GlobalData.m_pRefProperties->GetNextProperty(
  453. RealmIdentity,
  454. PropertyName,
  455. Type,
  456. StrVal,
  457. IndexProperty
  458. );
  459. ++IndexProperty;
  460. };
  461. hr = S_OK;
  462. ////////////////////////////////////////////////////////////////
  463. // Check that an even number of msManipulationRule was inserted
  464. ////////////////////////////////////////////////////////////////
  465. if ( (NbPropertiesInserted % 2) )
  466. {
  467. /////////////////////////
  468. // Inconsistent database
  469. /////////////////////////
  470. _com_issue_error(E_FAIL);
  471. }
  472. //////////////////////////////////////////
  473. // No realm migrated: nothing else to set.
  474. //////////////////////////////////////////
  475. if ( !NbPropertiesInserted )
  476. {
  477. return;
  478. }
  479. /////////////////////////////////////
  480. // Now process the reg keys settings
  481. /////////////////////////////////////
  482. BOOL OverRide = m_Utils.OverrideUserNameSet();
  483. DWORD IdentityAtt = m_Utils.GetUserIdentityAttribute();
  484. BOOL UserIdentSet = m_Utils.UserIdentityAttributeSet();
  485. if ( (IdentityAtt != 1) && (!OverRide) )
  486. {
  487. // log a warning / error for the user?
  488. // the new behavior will not be exactly the same as before
  489. }
  490. //////////////////////////////////////////////////
  491. // insert the UserIdentityAttribute if it was set.
  492. //////////////////////////////////////////////////
  493. _bstr_t TargetName = L"msManipulationTarget";
  494. _bstr_t TargetStrVal;
  495. if ( UserIdentSet )
  496. {
  497. WCHAR TempString[MAX_LONG_SIZE];
  498. _ltow(IdentityAtt, TempString, 10); // base 10 will never change
  499. // Add the msManipulationTarget Property based on the reg key
  500. // "SYSTEM\\CurrentControlSet\\Services\\RemoteAccess\\Policy";
  501. // "User Identity Attribute"; // Attribute used to identify the user.
  502. // If not set then default to RADIUS_ATTRIBUTE_USER_NAME
  503. // (1: "User-Name")
  504. TargetStrVal = TempString;
  505. }
  506. else
  507. {
  508. // Not set in the registry: write the default
  509. TargetStrVal = DEFAULT_REALM_TARGET;
  510. }
  511. m_GlobalData.m_pProperties->InsertProperty(
  512. ProxyProfileIdentity,
  513. TargetName,
  514. VT_I4,
  515. TargetStrVal
  516. );
  517. }
  518. //////////////////////////////////////////////////////////////////////////////
  519. // MigrateServerGroups
  520. //////////////////////////////////////////////////////////////////////////////
  521. void CMigrateContent::MigrateServerGroups()
  522. {
  523. const WCHAR SvrGroupPath[] =
  524. L"Root\0"
  525. L"Microsoft Internet Authentication Service\0"
  526. L"RADIUS Server Groups\0";
  527. LONG SvrGroupIdentity;
  528. m_GlobalData.m_pRefObjects->WalkPath(SvrGroupPath, SvrGroupIdentity);
  529. const WCHAR IASPath[] = L"Root\0"
  530. L"Microsoft Internet Authentication Service\0";
  531. LONG IASIdentity;
  532. m_GlobalData.m_pObjects->WalkPath(IASPath, IASIdentity);
  533. // delete the SvrGroups container and its content
  534. LONG DestSvrGroupIdentity;
  535. m_GlobalData.m_pObjects->WalkPath(SvrGroupPath, DestSvrGroupIdentity);
  536. _com_util::CheckError(m_GlobalData.m_pObjects->DeleteObject(
  537. DestSvrGroupIdentity));
  538. // for each SvrGroup in src, copy it in dest with its properties.
  539. _com_util::CheckError(CopyTree(SvrGroupIdentity, IASIdentity));
  540. }
  541. //////////////////////////////////////////////////////////////////////////////
  542. // Migrate
  543. // migrate the content of a Win2k or Whistler DB before the proxy feature
  544. // into a whistler DB.
  545. //////////////////////////////////////////////////////////////////////////////
  546. void CMigrateContent::Migrate()
  547. {
  548. MigrateClients();
  549. MigrateProfilesPolicies();
  550. MigrateAccounting();
  551. MigrateEventLog();
  552. MigrateService();
  553. MigrateWin2kRealms();
  554. //////////////////////////////////////////////////////
  555. // Update the MSChap Authentication types (password)
  556. //////////////////////////////////////////////////////
  557. CUpdateMSCHAP UpdateMSCHAP(m_GlobalData);
  558. UpdateMSCHAP.Execute();
  559. MigrateEapConfig(m_GlobalData).Execute();
  560. }
  561. //////////////////////////////////////////////////////////////////////////////
  562. // UpdateWhistler
  563. // migrate the content from a Whistler DB to a whistler DB.
  564. // This is used by the netshell aaaa context
  565. //////////////////////////////////////////////////////////////////////////////
  566. void CMigrateContent::UpdateWhistler(DWORD flags)
  567. {
  568. // the configType parameter was introducet after .Net Server Beta3
  569. // therefore, it cannot be set to anything meaningful for any script
  570. // created before that.
  571. switch(m_ConfigType)
  572. {
  573. case CLIENTS:
  574. {
  575. MigrateClients();
  576. break;
  577. }
  578. case REMOTE_ACCESS_POLICIES:
  579. {
  580. MigrateProfilesPolicies();
  581. ApplyProfileFlags(flags);
  582. break;
  583. }
  584. case LOGGING:
  585. {
  586. MigrateAccounting();
  587. break;
  588. }
  589. case SERVER_SETTINGS:
  590. {
  591. MigrateEventLog();
  592. MigrateService();
  593. break;
  594. }
  595. case CONNECTION_REQUEST_POLICIES:
  596. {
  597. MigrateProxyProfilesPolicies();
  598. MigrateServerGroups();
  599. break;
  600. }
  601. case CONFIG:
  602. {
  603. MigrateClients();
  604. MigrateProfilesPolicies();
  605. MigrateAccounting();
  606. MigrateEventLog();
  607. MigrateService();
  608. MigrateProxyProfilesPolicies();
  609. MigrateServerGroups();
  610. ApplyProfileFlags(flags);
  611. break;
  612. }
  613. default:
  614. {
  615. _ASSERT(FALSE);
  616. }
  617. }
  618. }
  619. void CMigrateContent::ApplyProfileFlags(DWORD flags)
  620. {
  621. if ((flags & updateChangePassword) != 0)
  622. {
  623. CUpdateMSCHAP(m_GlobalData).Execute();
  624. }
  625. if ((flags & migrateEapConfig) != 0)
  626. {
  627. MigrateEapConfig(m_GlobalData).Execute();
  628. }
  629. }