Changeset 740 for vendor/current/source3/include/ads.h
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/include/ads.h
r414 r740 7 7 */ 8 8 9 #include "../libds/common/flags.h" 10 11 /* 12 * This should be under the HAVE_KRB5 flag but since they're used 13 * in lp_kerberos_method(), they ned to be always available 14 */ 15 #define KERBEROS_VERIFY_SECRETS 0 16 #define KERBEROS_VERIFY_SYSTEM_KEYTAB 1 17 #define KERBEROS_VERIFY_DEDICATED_KEYTAB 2 18 #define KERBEROS_VERIFY_SECRETS_AND_KEYTAB 3 19 20 /* 21 * If you add any entries to the above, please modify the below expressions 22 * so they remain accurate. 23 */ 24 #define USE_KERBEROS_KEYTAB (KERBEROS_VERIFY_SECRETS != lp_kerberos_method()) 25 #define USE_SYSTEM_KEYTAB \ 26 ((KERBEROS_VERIFY_SECRETS_AND_KEYTAB == lp_kerberos_method()) || \ 27 (KERBEROS_VERIFY_SYSTEM_KEYTAB == lp_kerberos_method())) 28 29 #define TOK_ID_KRB_AP_REQ ((const uint8_t *)"\x01\x00") 30 #define TOK_ID_KRB_AP_REP ((const uint8_t *)"\x02\x00") 31 #define TOK_ID_KRB_ERROR ((const uint8_t *)"\x03\x00") 32 #define TOK_ID_GSS_GETMIC ((const uint8_t *)"\x01\x01") 33 #define TOK_ID_GSS_WRAP ((const uint8_t *)"\x02\x01") 34 35 enum wb_posix_mapping { 36 WB_POSIX_MAP_UNKNOWN = -1, 37 WB_POSIX_MAP_TEMPLATE = 0, 38 WB_POSIX_MAP_SFU = 1, 39 WB_POSIX_MAP_SFU20 = 2, 40 WB_POSIX_MAP_RFC2307 = 3, 41 WB_POSIX_MAP_UNIXINFO = 4 42 }; 43 44 /* there are 5 possible types of errors the ads subsystem can produce */ 45 enum ads_error_type {ENUM_ADS_ERROR_KRB5, ENUM_ADS_ERROR_GSS, 46 ENUM_ADS_ERROR_LDAP, ENUM_ADS_ERROR_SYSTEM, ENUM_ADS_ERROR_NT}; 47 48 typedef struct { 49 enum ads_error_type error_type; 50 union err_state{ 51 int rc; 52 NTSTATUS nt_status; 53 } err; 54 /* For error_type = ENUM_ADS_ERROR_GSS minor_status describe GSS API error */ 55 /* Where rc represents major_status of GSS API error */ 56 int minor_status; 57 } ADS_STATUS; 9 #include "libads/ads_status.h" 10 #include "smb_ldap.h" 58 11 59 12 struct ads_struct; … … 116 69 LDAP *ld; 117 70 struct sockaddr_storage ss; /* the ip of the active connection, if any */ 118 time_t last_attempt; /* last attempt to reconnect */71 time_t last_attempt; /* last attempt to reconnect, monotonic clock */ 119 72 int port; 120 73 … … 150 103 } ADS_STRUCT; 151 104 152 /* used to remember the names of the posix attributes in AD */153 /* see the rfc2307 & sfu nss backends */154 155 struct posix_schema {156 char *posix_homedir_attr;157 char *posix_shell_attr;158 char *posix_uidnumber_attr;159 char *posix_gidnumber_attr;160 char *posix_gecos_attr;161 char *posix_uid_attr;162 };163 164 165 166 105 #ifdef HAVE_ADS 167 106 typedef LDAPMod **ADS_MODLIST; … … 169 108 typedef void **ADS_MODLIST; 170 109 #endif 171 172 /* macros to simplify error returning */173 #define ADS_ERROR(rc) ADS_ERROR_LDAP(rc)174 #define ADS_ERROR_LDAP(rc) ads_build_error(ENUM_ADS_ERROR_LDAP, rc, 0)175 #define ADS_ERROR_SYSTEM(rc) ads_build_error(ENUM_ADS_ERROR_SYSTEM, rc?rc:EINVAL, 0)176 #define ADS_ERROR_KRB5(rc) ads_build_error(ENUM_ADS_ERROR_KRB5, rc, 0)177 #define ADS_ERROR_GSS(rc, minor) ads_build_error(ENUM_ADS_ERROR_GSS, rc, minor)178 #define ADS_ERROR_NT(rc) ads_build_nt_error(ENUM_ADS_ERROR_NT,rc)179 180 #define ADS_ERR_OK(status) ((status.error_type == ENUM_ADS_ERROR_NT) ? NT_STATUS_IS_OK(status.err.nt_status):(status.err.rc == 0))181 #define ADS_SUCCESS ADS_ERROR(0)182 183 #define ADS_ERROR_HAVE_NO_MEMORY(x) do { \184 if (!(x)) {\185 return ADS_ERROR(LDAP_NO_MEMORY);\186 }\187 } while (0)188 189 110 190 111 /* time between reconnect attempts */ … … 200 121 #define ADS_SD_FLAGS_OID "1.2.840.113556.1.4.801" 201 122 202 /* ldap attribute oids (Services for Unix 3.0, 3.5) */203 #define ADS_ATTR_SFU_UIDNUMBER_OID "1.2.840.113556.1.6.18.1.310"204 #define ADS_ATTR_SFU_GIDNUMBER_OID "1.2.840.113556.1.6.18.1.311"205 #define ADS_ATTR_SFU_HOMEDIR_OID "1.2.840.113556.1.6.18.1.344"206 #define ADS_ATTR_SFU_SHELL_OID "1.2.840.113556.1.6.18.1.312"207 #define ADS_ATTR_SFU_GECOS_OID "1.2.840.113556.1.6.18.1.337"208 #define ADS_ATTR_SFU_UID_OID "1.2.840.113556.1.6.18.1.309"209 210 /* ldap attribute oids (Services for Unix 2.0) */211 #define ADS_ATTR_SFU20_UIDNUMBER_OID "1.2.840.113556.1.4.7000.187.70"212 #define ADS_ATTR_SFU20_GIDNUMBER_OID "1.2.840.113556.1.4.7000.187.71"213 #define ADS_ATTR_SFU20_HOMEDIR_OID "1.2.840.113556.1.4.7000.187.106"214 #define ADS_ATTR_SFU20_SHELL_OID "1.2.840.113556.1.4.7000.187.72"215 #define ADS_ATTR_SFU20_GECOS_OID "1.2.840.113556.1.4.7000.187.97"216 #define ADS_ATTR_SFU20_UID_OID "1.2.840.113556.1.4.7000.187.102"217 218 219 /* ldap attribute oids (RFC2307) */220 #define ADS_ATTR_RFC2307_UIDNUMBER_OID "1.3.6.1.1.1.1.0"221 #define ADS_ATTR_RFC2307_GIDNUMBER_OID "1.3.6.1.1.1.1.1"222 #define ADS_ATTR_RFC2307_HOMEDIR_OID "1.3.6.1.1.1.1.3"223 #define ADS_ATTR_RFC2307_SHELL_OID "1.3.6.1.1.1.1.4"224 #define ADS_ATTR_RFC2307_GECOS_OID "1.3.6.1.1.1.1.2"225 #define ADS_ATTR_RFC2307_UID_OID "0.9.2342.19200300.100.1.1"226 227 123 /* ldap bitwise searches */ 228 124 #define ADS_LDAP_MATCHING_RULE_BIT_AND "1.2.840.113556.1.4.803" … … 230 126 231 127 #define ADS_PINGS 0x0000FFFF /* Ping response */ 232 #define ADS_DNS_CONTROLLER 0x20000000 /* DomainControllerName is a DNS name*/233 #define ADS_DNS_DOMAIN 0x40000000 /* DomainName is a DNS name */234 #define ADS_DNS_FOREST 0x80000000 /* DnsForestName is a DNS name */235 128 236 129 /* ads auth control flags */ … … 244 137 #define ADS_AUTH_SASL_FORCE 0x0080 245 138 #define ADS_AUTH_USER_CREDS 0x0100 246 247 /* Kerberos environment variable names */248 #define KRB5_ENV_CCNAME "KRB5CCNAME"249 250 #define WELL_KNOWN_GUID_COMPUTERS "AA312825768811D1ADED00C04FD8D5CD"251 #define WELL_KNOWN_GUID_USERS "A9D1CA15768811D1ADED00C04FD8D5CD"252 139 253 140 enum ads_extended_dn_flags { … … 265 152 } ads_control; 266 153 267 #define ADS_IGNORE_PRINCIPAL "not_defined_in_RFC4178@please_ignore" 154 #include "libads/ads_proto.h" 155 156 #ifdef HAVE_LDAP 157 #include "libads/ads_ldap_protos.h" 158 #endif 159 160 #include "libads/kerberos_proto.h" 268 161 269 162 #endif /* _INCLUDE_ADS_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.