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.

89 lines
1.5 KiB

  1. /*
  2. * List of accounts we allow file access for
  3. */
  4. #define MAX_ACCOUNT_NAME 32
  5. #define CURRENT_USER L"%user%"
  6. // These are the accounts we want to have access to the directory
  7. #define ADMIN_ACCOUNT 0
  8. #define SYSTEM_ACCOUNT 1
  9. #define USER_ACCOUNT 2
  10. typedef struct _ADMIN_ACCOUNTS {
  11. WCHAR Name[MAX_ACCOUNT_NAME];
  12. PSID pSid;
  13. } ADMIN_ACCOUNTS, *PADMIN_ACCOUNTS;
  14. /*
  15. * Operation result codes to allow a separate reporting module
  16. */
  17. typedef enum _FILE_RESULT {
  18. FileOk, // File can not be written by users
  19. FileAccessError, // Error occured, disposition unknown
  20. FileAccessErrorUserFormat // Error, user formatted message
  21. } FILE_RESULT;
  22. BOOL
  23. InitSecurity(
  24. );
  25. BOOL
  26. IsAllowSid(
  27. PSID pSid
  28. );
  29. BOOL
  30. xxxLookupAccountName(
  31. PWCHAR pSystemName,
  32. PWCHAR pAccountName,
  33. PSID *ppSid
  34. );
  35. BOOLEAN
  36. SetFileTree(
  37. PWCHAR pRoot,
  38. PWCHAR pAvoidDir
  39. );
  40. BOOL
  41. ReportFileResult(
  42. FILE_RESULT Code,
  43. ACCESS_MASK Access,
  44. PWCHAR pFile,
  45. PWCHAR pAccountName,
  46. PWCHAR pDomainName,
  47. PCHAR UserFormat,
  48. ...
  49. );
  50. PACL
  51. GetSecureAcl();
  52. PSID
  53. GetLocalAdminSid();
  54. PSID
  55. GetAdminSid();
  56. PSID
  57. GetLocalAdminGroupSid();
  58. BOOL
  59. CheckUserSid();
  60. #if DBG
  61. void
  62. DumpSecurityDescriptor(
  63. PSECURITY_DESCRIPTOR pSD
  64. );
  65. void
  66. DumpAcl(
  67. PACL pAcl,
  68. PCHAR pBase,
  69. PULONG pSize
  70. );
  71. #endif