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.

87 lines
2.6 KiB

  1. //+------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1995, Microsoft Corporation.
  4. //
  5. // File: accacc.cxx
  6. //
  7. // Classes: CAccountAccess
  8. //
  9. // History: Nov-93 DaveMont Created.
  10. //
  11. //-------------------------------------------------------------------
  12. #include <accacc.hxx>
  13. #if DBG
  14. extern ULONG Debug;
  15. #endif
  16. //+---------------------------------------------------------------------------
  17. //
  18. // Member: CAccountAccess::CAccountAccess, public
  19. //
  20. // Synopsis: initializes data members, constructor will not throw
  21. //
  22. // Arguments: IN - [Name] - principal
  23. // IN - [System] - server/domain
  24. //
  25. //----------------------------------------------------------------------------
  26. CAccountAccess::CAccountAccess(WCHAR *Name, WCHAR *System)
  27. : _mask(0),
  28. _savemask(0),
  29. _foundinheritance(0),
  30. _acetype(0xff),
  31. CAccount(Name, System)
  32. {
  33. }
  34. //+---------------------------------------------------------------------------
  35. //
  36. // Member: CAccountAccess::Init, public
  37. //
  38. // Synopsis: initializes access mask
  39. //
  40. // Arguments: IN [access] - access mask
  41. //
  42. //----------------------------------------------------------------------------
  43. ULONG CAccountAccess::Init(ULONG access)
  44. {
  45. if (access == 0)
  46. {
  47. _savemask = GENERIC_ALL;
  48. _mask = GENERIC_ALL;
  49. _acetype = ACCESS_DENIED_ACE_TYPE;
  50. } else
  51. {
  52. _acetype = ACCESS_ALLOWED_ACE_TYPE;
  53. _savemask = access;
  54. _mask = access;
  55. }
  56. return(ERROR_SUCCESS);
  57. }
  58. //+---------------------------------------------------------------------------
  59. //
  60. // Member: CAccountAccess::AddInheritance, public
  61. //
  62. // Synopsis: accumulates inheritance of ACEs with matching SIDS
  63. //
  64. // Arguments: inheritance flags
  65. //
  66. //--------------------------------------------------------------------
  67. void CAccountAccess::AddInheritance(BYTE Flags)
  68. {
  69. if (!(Flags & NO_PROPAGATE_INHERIT_ACE))
  70. {
  71. if (Flags & INHERIT_ONLY_ACE)
  72. {
  73. if (Flags & CONTAINER_INHERIT_ACE)
  74. _foundinheritance |= CONTAINER_INHERIT_ACE;
  75. if (Flags & OBJECT_INHERIT_ACE)
  76. _foundinheritance |= OBJECT_INHERIT_ACE;
  77. } else
  78. {
  79. _foundinheritance |= APPLIES_TO_CONTAINER;
  80. if (Flags & CONTAINER_INHERIT_ACE)
  81. _foundinheritance |= CONTAINER_INHERIT_ACE;
  82. if (Flags & OBJECT_INHERIT_ACE)
  83. _foundinheritance |= OBJECT_INHERIT_ACE;
  84. }
  85. }
  86. }