rpc_secdes.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. Unix SMB/Netbios implementation.
  3. Version 1.9.
  4. SMB parameters and setup
  5. Copyright (C) Andrew Tridgell 1992-1997
  6. Copyright (C) Luke Kenneth Casson Leighton 1996-1997
  7. Copyright (C) Paul Ashton 1997
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2 of the License, or
  11. (at your option) any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20. #ifndef _RPC_SECDES_H /* _RPC_SECDES_H */
  21. #define _RPC_SECDES_H
  22. #define SEC_RIGHTS_QUERY_VALUE 0x00000001
  23. #define SEC_RIGHTS_SET_VALUE 0x00000002
  24. #define SEC_RIGHTS_CREATE_SUBKEY 0x00000004
  25. #define SEC_RIGHTS_ENUM_SUBKEYS 0x00000008
  26. #define SEC_RIGHTS_NOTIFY 0x00000010
  27. #define SEC_RIGHTS_CREATE_LINK 0x00000020
  28. #define SEC_RIGHTS_DELETE 0x00010000
  29. #define SEC_RIGHTS_READ_CONTROL 0x00020000
  30. #define SEC_RIGHTS_WRITE_DAC 0x00040000
  31. #define SEC_RIGHTS_WRITE_OWNER 0x00080000
  32. #define SEC_RIGHTS_READ 0x00020019
  33. #define SEC_RIGHTS_FULL_CONTROL 0x000f003f
  34. #define SEC_ACE_TYPE_ACCESS_ALLOWED 0x0
  35. #define SEC_ACE_TYPE_ACCESS_DENIED 0x1
  36. #define SEC_ACE_TYPE_SYSTEM_AUDIT 0x2
  37. #define SEC_ACE_TYPE_SYSTEM_ALARM 0x3
  38. #define SEC_ACE_FLAG_OBJECT_INHERIT 0x1
  39. #define SEC_ACE_FLAG_CONTAINER_INHERIT 0x2
  40. #define SEC_ACE_FLAG_NO_PROPAGATE_INHERIT 0x4
  41. #define SEC_ACE_FLAG_INHERIT_ONLY 0x8
  42. #define SEC_ACE_FLAG_VALID_INHERIT 0xf
  43. #define SEC_ACE_FLAG_SUCCESSFUL_ACCESS 0x40
  44. #define SEC_ACE_FLAG_FAILED_ACCESS 0x80
  45. #define SEC_DESC_OWNER_DEFAULTED 0x0001
  46. #define SEC_DESC_GROUP_DEFAULTED 0x0002
  47. #define SEC_DESC_DACL_PRESENT 0x0004
  48. #define SEC_DESC_DACL_DEFAULTED 0x0008
  49. #define SEC_DESC_SACL_PRESENT 0x0010
  50. #define SEC_DESC_SACL_DEFAULTED 0x0020
  51. #define SEC_DESC_SELF_RELATIVE 0x8000
  52. /* security information */
  53. #define OWNER_SECURITY_INFORMATION 0x00000001
  54. #define GROUP_SECURITY_INFORMATION 0x00000002
  55. #define DACL_SECURITY_INFORMATION 0x00000004
  56. #define SACL_SECURITY_INFORMATION 0x00000008
  57. /* SEC_ACCESS */
  58. typedef struct security_info_info
  59. {
  60. uint32 mask;
  61. } SEC_ACCESS;
  62. /* SEC_ACE */
  63. typedef struct security_ace_info
  64. {
  65. uint8 type; /* xxxx_xxxx_ACE_TYPE - e.g allowed / denied etc */
  66. uint8 flags; /* xxxx_INHERIT_xxxx - e.g OBJECT_INHERIT_ACE */
  67. uint16 size;
  68. SEC_ACCESS info;
  69. DOM_SID sid;
  70. } SEC_ACE;
  71. /* SEC_ACL */
  72. typedef struct security_acl_info
  73. {
  74. uint16 revision; /* 0x0002 */
  75. uint16 size; /* size in bytes of the entire ACL structure */
  76. uint32 num_aces; /* number of Access Control Entries */
  77. SEC_ACE *ace_list;
  78. } SEC_ACL;
  79. /* SEC_DESC */
  80. typedef struct security_descriptor_info
  81. {
  82. uint16 revision; /* 0x0001 */
  83. uint16 type; /* SEC_DESC_xxxx flags */
  84. uint32 off_owner_sid; /* offset to owner sid */
  85. uint32 off_grp_sid ; /* offset to group sid */
  86. uint32 off_sacl ; /* offset to system list of permissions */
  87. uint32 off_dacl ; /* offset to list of permissions */
  88. SEC_ACL *dacl; /* user ACL */
  89. SEC_ACL *sacl; /* system ACL */
  90. DOM_SID *owner_sid;
  91. DOM_SID *grp_sid;
  92. } SEC_DESC;
  93. /* SEC_DESC_BUF */
  94. typedef struct sec_desc_buf_info
  95. {
  96. uint32 max_len;
  97. uint32 undoc;
  98. uint32 len;
  99. SEC_DESC *sec;
  100. } SEC_DESC_BUF;
  101. #endif /* _RPC_SECDES_H */