diff options
author | Karolin Seeger <kseeger@samba.org> | 2008-02-29 10:44:38 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2008-02-29 10:44:38 +0100 |
commit | c4fbe2846231a6b322c1094c6a1dbf93b7305768 (patch) | |
tree | 09eb77a294f4acda131b41fe4c9bec4ed175eb16 /source3/include | |
parent | 1a6415fc77c708b87c8e2ce6e7828f486ffc87ac (diff) | |
parent | 695b6662abe64a40061bfa05ede12173fc4b1945 (diff) | |
download | samba-c4fbe2846231a6b322c1094c6a1dbf93b7305768.tar.gz samba-c4fbe2846231a6b322c1094c6a1dbf93b7305768.tar.bz2 samba-c4fbe2846231a6b322c1094c6a1dbf93b7305768.zip |
Merge commit 'origin/v3-2-test' into v3-2-stable
Conflicts:
WHATSNEW.txt
(This used to be commit a390bcf9403df4cf4d5eef42b35ebccbe253882e)
Diffstat (limited to 'source3/include')
33 files changed, 471 insertions, 4942 deletions
diff --git a/source3/include/MacExtensions.h b/source3/include/MacExtensions.h index 006b814037..6e911feea2 100644 --- a/source3/include/MacExtensions.h +++ b/source3/include/MacExtensions.h @@ -235,7 +235,7 @@ enum { ** that contains the icon data, icon size, icon type, the file type, and file creator. ** ** -** The server returns only that the call was succesfull or not. +** The server returns only that the call was successful or not. */ #define SMB_MAC_DT_ADD_ICON 0x309 diff --git a/source3/include/ads.h b/source3/include/ads.h index a75eaf80fc..d5ce88babe 100644 --- a/source3/include/ads.h +++ b/source3/include/ads.h @@ -319,11 +319,6 @@ typedef void **ADS_MODLIST; #define ADS_DNS_DOMAIN 0x40000000 /* DomainName is a DNS name */ #define ADS_DNS_FOREST 0x80000000 /* DnsForestName is a DNS name */ -/* DomainControllerAddressType */ -#define ADS_INET_ADDRESS 0x00000001 -#define ADS_NETBIOS_ADDRESS 0x00000002 - - /* ads auth control flags */ #define ADS_AUTH_DISABLE_KERBEROS 0x01 #define ADS_AUTH_NO_BIND 0x02 @@ -396,4 +391,11 @@ typedef struct { #define ADS_IGNORE_PRINCIPAL "not_defined_in_RFC4178@please_ignore" +/* Settings for the domainFunctionality attribute in the rootDSE */ + +#define DS_DOMAIN_FUNCTION_2000 0 +#define DS_DOMAIN_FUCNTION_2003_MIXED 1 +#define DS_DOMAIN_FUNCTION_2003 2 +#define DS_DOMAIN_FUNCTION_2008 3 + #endif /* _INCLUDE_ADS_H_ */ diff --git a/source3/include/async_req.h b/source3/include/async_req.h new file mode 100644 index 0000000000..6df53602b2 --- /dev/null +++ b/source3/include/async_req.h @@ -0,0 +1,89 @@ +/* + Unix SMB/CIFS implementation. + Infrastructure for async requests + Copyright (C) Volker Lendecke 2008 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __ASYNC_REQ_H__ +#define __ASYNC_REQ_H__ + +#include "includes.h" + +/* + * An async request moves between the following 4 states. + */ +enum async_req_state { + ASYNC_REQ_INIT, /* we are creating the request */ + ASYNC_REQ_IN_PROGRESS, /* we are waiting the request to complete */ + ASYNC_REQ_DONE, /* the request is finished */ + ASYNC_REQ_ERROR }; /* an error has occured */ + +struct async_req { + /* the external state - will be queried by the caller */ + enum async_req_state state; + + /* a private pointer for use by the async function implementation */ + void *private_data; + + /* print yourself, for debugging purposes */ + char *(*print)(TALLOC_CTX *mem_ctx, struct async_req *); + + /* status code when finished */ + NTSTATUS status; + + /* the event context we are using */ + struct event_context *event_ctx; + + /* information on what to do on completion */ + struct { + void (*fn)(struct async_req *); + void *priv; + } async; +}; + +/* + * Print an async_req structure for debugging purposes + */ +char *async_req_print(TALLOC_CTX *mem_ctx, struct async_req *req); + +/* + * Create an async request + */ +struct async_req *async_req_new(TALLOC_CTX *mem_ctx, struct event_context *ev); + +/* + * An async request has successfully finished, invoke the callback + */ +void async_req_done(struct async_req *req); + +/* + * An async request has seen an error, invoke the callback + */ +void async_req_error(struct async_req *req, NTSTATUS status); + +/* + * Convenience helper to easily check alloc failure within a callback. + * + * Call pattern would be + * p = talloc(mem_ctx, bla); + * if (async_req_nomem(p, req)) { + * return; + * } + * + */ +bool async_req_nomem(const void *p, struct async_req *req); + +#endif diff --git a/source3/include/async_smb.h b/source3/include/async_smb.h new file mode 100644 index 0000000000..19408be74b --- /dev/null +++ b/source3/include/async_smb.h @@ -0,0 +1,62 @@ +/* + Unix SMB/CIFS implementation. + Infrastructure for async SMB client requests + Copyright (C) Volker Lendecke 2008 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "includes.h" + +/* + * Create a fresh async smb request + */ + +struct async_req *cli_request_new(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct cli_state *cli, + uint8_t num_words, size_t num_bytes, + struct cli_request **preq); + +/* + * Convenience function to get the SMB part out of an async_req + */ + +struct cli_request *cli_request_get(struct async_req *req); + +/* + * Fetch an error out of a NBT packet + */ + +NTSTATUS cli_pull_error(char *buf); + +/* + * Compatibility helper for the sync APIs: Fake NTSTATUS in cli->inbuf + */ + +void cli_set_error(struct cli_state *cli, NTSTATUS status); + +/* + * Create a temporary event context for use in the sync helper functions + */ + +struct cli_tmp_event *cli_tmp_event_ctx(TALLOC_CTX *mem_ctx, + struct cli_state *cli); + +/* + * Attach an event context permanently to a cli_struct + */ + +NTSTATUS cli_add_event_ctx(struct cli_state *cli, + struct event_context *event_ctx); diff --git a/source3/include/authdata.h b/source3/include/authdata.h index 8125f05639..59f07fb42d 100644 --- a/source3/include/authdata.h +++ b/source3/include/authdata.h @@ -19,7 +19,7 @@ */ #ifndef _AUTHDATA_H -#define _AUTHDATA_H +#define _AUTHDATA_H #include "rpc_misc.h" #include "rpc_netlogon.h" @@ -37,136 +37,4 @@ #define KRB5_AUTHDATA_IF_RELEVANT 1 #endif - -typedef struct pac_logon_name { - NTTIME logon_time; - uint16 len; - uint8 *username; /* Actually always little-endian. might not be null terminated, so not UNISTR */ -} PAC_LOGON_NAME; - -typedef struct pac_signature_data { - uint32 type; - RPC_DATA_BLOB signature; /* this not the on-wire-format (!) */ -} PAC_SIGNATURE_DATA; - -typedef struct group_membership { - uint32 rid; - uint32 attrs; -} GROUP_MEMBERSHIP; - -typedef struct group_membership_array { - uint32 count; - GROUP_MEMBERSHIP *group_membership; -} GROUP_MEMBERSHIP_ARRAY; - -#if 0 /* Unused, replaced by NET_USER_INFO_3 - Guenther */ - -typedef struct krb_sid_and_attrs { - uint32 sid_ptr; - uint32 attrs; - DOM_SID2 *sid; -} KRB_SID_AND_ATTRS; - -typedef struct krb_sid_and_attr_array { - uint32 count; - KRB_SID_AND_ATTRS *krb_sid_and_attrs; -} KRB_SID_AND_ATTR_ARRAY; - - -/* This is awfully similar to a samr_user_info_23, but not identical. - Many of the field names have been swiped from there, because it is - so similar that they are likely the same, but many have been verified. - Some are in a different order, though... */ -typedef struct pac_logon_info { - NTTIME logon_time; /* logon time */ - NTTIME logoff_time; /* logoff time */ - NTTIME kickoff_time; /* kickoff time */ - NTTIME pass_last_set_time; /* password last set time */ - NTTIME pass_can_change_time; /* password can change time */ - NTTIME pass_must_change_time; /* password must change time */ - - UNIHDR hdr_user_name; /* user name unicode string header */ - UNIHDR hdr_full_name; /* user's full name unicode string header */ - UNIHDR hdr_logon_script; /* these last 4 appear to be in a different */ - UNIHDR hdr_profile_path; /* order than in the info23 */ - UNIHDR hdr_home_dir; - UNIHDR hdr_dir_drive; - - uint16 logon_count; /* number of times user has logged onto domain */ - uint16 bad_password_count; /* samba4 idl */ - - uint32 user_rid; - uint32 group_rid; - uint32 group_count; - uint32 group_membership_ptr; - uint32 user_flags; - - uint8 session_key[16]; /* samba4 idl */ - UNIHDR hdr_dom_controller; - UNIHDR hdr_dom_name; - - uint32 ptr_dom_sid; - - uint8 lm_session_key[8]; /* samba4 idl */ - uint32 acct_flags; /* samba4 idl */ - uint32 unknown[7]; - - uint32 sid_count; - uint32 ptr_extra_sids; - - uint32 ptr_res_group_dom_sid; - uint32 res_group_count; - uint32 ptr_res_groups; - - UNISTR2 uni_user_name; /* user name unicode string header */ - UNISTR2 uni_full_name; /* user's full name unicode string header */ - UNISTR2 uni_logon_script; /* these last 4 appear to be in a different*/ - UNISTR2 uni_profile_path; /* order than in the info23 */ - UNISTR2 uni_home_dir; - UNISTR2 uni_dir_drive; - UNISTR2 uni_dom_controller; - UNISTR2 uni_dom_name; - DOM_SID2 dom_sid; - GROUP_MEMBERSHIP_ARRAY groups; - KRB_SID_AND_ATTR_ARRAY extra_sids; - DOM_SID2 res_group_dom_sid; - GROUP_MEMBERSHIP_ARRAY res_groups; - -} PAC_LOGON_INFO; -#endif - -typedef struct pac_logon_info { - NET_USER_INFO_3 info3; - DOM_SID2 res_group_dom_sid; - GROUP_MEMBERSHIP_ARRAY res_groups; - -} PAC_LOGON_INFO; - -typedef struct pac_info_ctr -{ - union - { - PAC_LOGON_INFO *logon_info; - PAC_SIGNATURE_DATA *srv_cksum; - PAC_SIGNATURE_DATA *privsrv_cksum; - PAC_LOGON_NAME *logon_name; - } pac; -} PAC_INFO_CTR; - -typedef struct pac_buffer { - uint32 type; - uint32 size; - uint32 offset; - uint32 offsethi; - PAC_INFO_CTR *ctr; - uint32 pad; -} PAC_BUFFER; - -typedef struct pac_data { - uint32 num_buffers; - uint32 version; - PAC_BUFFER *pac_buffer; -} PAC_DATA; - - #endif diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 32138a89ce..9ced9cea3a 100644 --- a/source3/include/byteorder.h +++ b/source3/include/byteorder.h @@ -167,4 +167,10 @@ it also defines lots of intermediate macros, just ignore those :-) #define ALIGN4(p,base) ((p) + ((4 - (PTR_DIFF((p), (base)) & 3)) & 3)) #define ALIGN2(p,base) ((p) + ((2 - (PTR_DIFF((p), (base)) & 1)) & 1)) +/* 64 bit macros */ +#define BVAL(p, ofs) (IVAL(p,ofs) | (((uint64_t)IVAL(p,(ofs)+4)) << 32)) +#define BVALS(p, ofs) ((int64_t)BVAL(p,ofs)) +#define SBVAL(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,((uint64_t)(v))>>32)) +#define SBVALS(p, ofs, v) (SBVAL(p,ofs,(uint64_t)v)) + #endif /* _BYTEORDER_H */ diff --git a/source3/include/client.h b/source3/include/client.h index f8adf567de..52dc513d65 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -82,7 +82,12 @@ struct rpc_pipe_client { }; /* Transport encryption state. */ -enum smb_trans_enc_type { SMB_TRANS_ENC_NTLM, SMB_TRANS_ENC_GSS }; +enum smb_trans_enc_type { + SMB_TRANS_ENC_NTLM +#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) + , SMB_TRANS_ENC_GSS +#endif +}; #if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) struct smb_tran_enc_state_gss { @@ -187,6 +192,36 @@ struct cli_state { bool force_dos_errors; bool case_sensitive; /* False by default. */ + + struct event_context *event_ctx; + struct fd_event *fd_event; + char *evt_inbuf; + + struct cli_request *outstanding_requests; +}; + +struct cli_request { + struct cli_request *prev, *next; + struct async_req *async; + + struct cli_state *cli; + + struct smb_trans_enc_state *enc_state; + + uint16_t mid; + + char *outbuf; + size_t sent; + char *inbuf; + + union { + struct { + off_t ofs; + size_t size; + ssize_t received; + uint8_t *rcvbuf; + } read; + } data; }; typedef struct file_info { diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index 425cc65a00..6e1b2f737a 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -17,6 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#ifndef _CTDBD_CONN_H +#define _CTDBD_CONN_H + struct ctdbd_connection; NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx, @@ -62,3 +65,6 @@ NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn, NTSTATUS ctdbd_register_reconfigure(struct ctdbd_connection *conn); +NTSTATUS ctdbd_persistent_store(struct ctdbd_connection *conn, uint32_t db_id, TDB_DATA key, TDB_DATA data); + +#endif /* _CTDBD_CONN_H */ diff --git a/source3/include/dbwrap.h b/source3/include/dbwrap.h index 3bb378c841..4eb174fef1 100644 --- a/source3/include/dbwrap.h +++ b/source3/include/dbwrap.h @@ -43,6 +43,7 @@ struct db_context { void *private_data); int (*get_seqnum)(struct db_context *db); void *private_data; + bool persistent; }; struct db_context *db_open(TALLOC_CTX *mem_ctx, diff --git a/source3/include/debug.h b/source3/include/debug.h index 284671c730..d8dafcbd45 100644 --- a/source3/include/debug.h +++ b/source3/include/debug.h @@ -176,11 +176,14 @@ extern bool *DEBUGLEVEL_CLASS_ISSET; #define unlikely(x) (x) #endif -#define DEBUGLVL( level ) \ +#define CHECK_DEBUGLVL( level ) \ ( ((level) <= MAX_DEBUG_LEVEL) && \ unlikely((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \ (!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \ - DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \ + DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) ) + +#define DEBUGLVL( level ) \ + ( CHECK_DEBUGLVL(level) \ && dbghdr( level, DBGC_CLASS, __FILE__, FUNCTION_MACRO, (__LINE__) ) ) diff --git a/source3/include/doserr.h b/source3/include/doserr.h index 08f5b3e39d..5794fbe71c 100644 --- a/source3/include/doserr.h +++ b/source3/include/doserr.h @@ -202,6 +202,7 @@ #define WERR_SERVICE_ALREADY_RUNNING W_ERROR(1056) #define WERR_SERVICE_DISABLED W_ERROR(1058) #define WERR_SERVICE_NEVER_STARTED W_ERROR(1077) +#define WERR_INVALID_COMPUTER_NAME W_ERROR(1210) #define WERR_MACHINE_LOCKED W_ERROR(1271) #define WERR_NO_LOGON_SERVERS W_ERROR(1311) #define WERR_NO_SUCH_LOGON_SESSION W_ERROR(1312) @@ -213,12 +214,17 @@ #define WERR_SERVER_UNAVAILABLE W_ERROR(1722) #define WERR_INVALID_FORM_NAME W_ERROR(1902) #define WERR_INVALID_FORM_SIZE W_ERROR(1903) +#define WERR_PASSWORD_MUST_CHANGE W_ERROR(1907) +#define WERR_DOMAIN_CONTROLLER_NOT_FOUND W_ERROR(1908) +#define WERR_ACCOUNT_LOCKED_OUT W_ERROR(1909) + +/* should these go down to NERR_BASE ? */ #define WERR_BUF_TOO_SMALL W_ERROR(2123) #define WERR_JOB_NOT_FOUND W_ERROR(2151) #define WERR_DEST_NOT_FOUND W_ERROR(2152) #define WERR_USER_EXISTS W_ERROR(2224) #define WERR_NOT_LOCAL_DOMAIN W_ERROR(2320) -#define WERR_DOMAIN_CONTROLLER_NOT_FOUND W_ERROR(2453) +#define WERR_DC_NOT_FOUND W_ERROR(2453) #define WERR_SETUP_ALREADY_JOINED W_ERROR(2691) #define WERR_SETUP_NOT_JOINED W_ERROR(2692) diff --git a/source3/include/dynconfig.h b/source3/include/dynconfig.h index bb7e2c20f4..57909bc614 100644 --- a/source3/include/dynconfig.h +++ b/source3/include/dynconfig.h @@ -41,42 +41,60 @@ extern char dyn_PRIVATE_DIR[1024]; const char *get_dyn_SBINDIR(void); const char *set_dyn_SBINDIR(const char *newpath); +bool is_default_dyn_SBINDIR(void); const char *get_dyn_BINDIR(void); const char *set_dyn_BINDIR(const char *newpath); +bool is_default_dyn_BINDIR(void); const char *get_dyn_SWATDIR(void); const char *set_dyn_SWATDIR(const char *newpath); +bool is_default_dyn_SWATDIR(void); const char *get_dyn_CONFIGFILE(void); const char *set_dyn_CONFIGFILE(const char *newpath); +bool is_default_dyn_CONFIGFILE(void); -const char *get_dyn_dyn_LOGFILEBASE(void); -const char *set_dyn_dyn_LOGFILEBASE(const char *newpath); +const char *get_dyn_LOGFILEBASE(void); +const char *set_dyn_LOGFILEBASE(const char *newpath); +bool is_default_dyn_LOGFILEBASE(void); const char *get_dyn_LMHOSTSFILE(void); const char *set_dyn_LMHOSTSFILE(const char *newpath); +bool is_default_dyn_LMHOSTSFILE(void); const char *get_dyn_CODEPAGEDIR(void); const char *set_dyn_CODEPAGEDIR(const char *newpath); +bool is_default_dyn_CODEPAGEDIR(void); const char *get_dyn_LIBDIR(void); const char *set_dyn_LIBDIR(const char *newpath); +bool is_default_dyn_LIBDIR(void); const char *get_dyn_SHLIBEXT(void); const char *set_dyn_SHLIBEXT(const char *newpath); +bool is_default_dyn_SHLIBEXT(void); const char *get_dyn_LOCKDIR(void); const char *set_dyn_LOCKDIR(const char *newpath); +bool is_default_dyn_LOCKDIR(void); const char *get_dyn_PIDDIR(void); const char *set_dyn_PIDDIR(const char *newpath); +bool is_default_dyn_PIDDIR(void); const char *get_dyn_SMB_PASSWD_FILE(void); const char *set_dyn_SMB_PASSWD_FILE(const char *newpath); +bool is_default_dyn_SMB_PASSWD_FILE(void); const char *get_dyn_PRIVATE_DIR(void); const char *set_dyn_PRIVATE_DIR(const char *newpath); +bool is_default_dyn_PRIVATE_DIR(void); const char *get_dyn_STATEDIR(void); +const char *set_dyn_STATEDIR(const char *newpath); +bool is_default_dyn_STATEDIR(void); + const char *get_dyn_CACHEDIR(void); +const char *set_dyn_CACHEDIR(const char *newpath); +bool is_default_dyn_CACHEDIR(bool); diff --git a/source3/include/includes.h b/source3/include/includes.h index e9477d8ba1..269baa5a9c 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -250,6 +250,10 @@ typedef int ber_int_t; #include <langinfo.h> #endif +#if HAVE_NETGROUP_H +#include <netgroup.h> +#endif + #if defined(HAVE_AIO_H) && defined(WITH_AIO) #include <aio.h> #endif @@ -694,14 +698,13 @@ typedef char fstring[FSTRING_LEN]; #include "rpc_netlogon.h" #include "reg_objects.h" #include "reg_db.h" -#include "rpc_samr.h" #include "rpc_srvsvc.h" #include "rpc_spoolss.h" #include "rpc_eventlog.h" -#include "rpc_ds.h" #include "rpc_perfcount.h" #include "rpc_perfcount_defs.h" #include "librpc/gen_ndr/notify.h" +#include "librpc/gen_ndr/xattr.h" #include "nt_printing.h" #include "idmap.h" #include "client.h" @@ -720,6 +723,8 @@ typedef char fstring[FSTRING_LEN]; #include "ctdbd_conn.h" #include "talloc_stack.h" #include "memcache.h" +#include "async_req.h" +#include "async_smb.h" /* used in net.c */ struct functable { @@ -1107,6 +1112,14 @@ char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...) PRINTF_ATT #define VXFS_QUOTA #endif +#ifndef XATTR_CREATE +#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */ +#endif + +#ifndef XATTR_REPLACE +#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ +#endif + #if defined(HAVE_KRB5) krb5_error_code smb_krb5_parse_name(krb5_context context, @@ -1158,15 +1171,15 @@ bool kerberos_compatible_enctypes(krb5_context context, krb5_enctype enctype1, k void kerberos_free_data_contents(krb5_context context, krb5_data *pdata); NTSTATUS decode_pac_data(TALLOC_CTX *mem_ctx, DATA_BLOB *pac_data_blob, - krb5_context context, + krb5_context context, krb5_keyblock *service_keyblock, krb5_const_principal client_principal, time_t tgs_authtime, - PAC_DATA **pac_data); + struct PAC_DATA **pac_data_out); void smb_krb5_checksum_from_pac_sig(krb5_checksum *cksum, - PAC_SIGNATURE_DATA *sig); + struct PAC_SIGNATURE_DATA *sig); krb5_error_code smb_krb5_verify_checksum(krb5_context context, - krb5_keyblock *keyblock, + const krb5_keyblock *keyblock, krb5_keyusage usage, krb5_checksum *cksum, uint8 *data, @@ -1194,7 +1207,6 @@ bool smb_krb5_principal_compare_any_realm(krb5_context context, krb5_const_principal princ2); int cli_krb5_get_ticket(const char *principal, time_t time_offset, DATA_BLOB *ticket, DATA_BLOB *session_key_krb5, uint32 extra_ap_opts, const char *ccname, time_t *tgs_expire); -PAC_LOGON_INFO *get_logon_info_from_pac(PAC_DATA *pac_data); krb5_error_code smb_krb5_renew_ticket(const char *ccache_string, const char *client_string, const char *service_string, time_t *expire_time); krb5_error_code kpasswd_err_to_krb5_err(krb5_error_code res_code); krb5_error_code smb_krb5_gen_netbios_krb5_address(smb_krb5_addresses **kerb_addr); diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h index dbc115429b..6c7dc80da8 100644 --- a/source3/include/libsmb_internal.h +++ b/source3/include/libsmb_internal.h @@ -15,6 +15,7 @@ struct _SMBCSRV { bool no_pathinfo; bool no_pathinfo2; bool no_nt_session; + POLICY_HND pol; SMBCSRV *next, *prev; diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h index 07242f7956..64afc09499 100644 --- a/source3/include/libsmbclient.h +++ b/source3/include/libsmbclient.h @@ -427,6 +427,8 @@ struct _SMBCCTX { off_t (*lseek) (SMBCCTX *c, SMBCFILE * file, off_t offset, int whence); int (*stat) (SMBCCTX *c, const char *fname, struct stat *st); int (*fstat) (SMBCCTX *c, SMBCFILE *file, struct stat *st); + /* ftruncate added near _internal for ABI compatibility */ + int (*close_fn) (SMBCCTX *c, SMBCFILE *file); /** callable functions for dirs @@ -520,6 +522,12 @@ struct _SMBCCTX { int flags; /** user options selections that apply to this session + * + * NEW OPTIONS ARE NOT ADDED HERE! + * + * We must maintain ABI backward compatibility. We now use + * smbc_option_set() and smbc_option_get() for all newly added + * options. */ struct _smbc_options { @@ -580,6 +588,9 @@ struct _SMBCCTX { int one_share_per_server; } options; + /* Add additional functions here for ABI backward compatibility */ + int (*ftruncate)(SMBCCTX *c, SMBCFILE *f, off_t size); + /** INTERNAL DATA * do _NOT_ touch this from your program ! */ @@ -1193,6 +1204,26 @@ int smbc_stat(const char *url, struct stat *st); int smbc_fstat(int fd, struct stat *st); +/**@ingroup attribute + * Truncate a file given a file descriptor + * + * @param fd Open file handle from smbc_open() or smbc_creat() + * + * @param size size to truncate the file to + * + * @return EBADF filedes is bad. + * - EACCES Permission denied. + * - EBADF fd is not a valid file descriptor + * - EINVAL Problems occurred in the underlying routines + * or smbc_init not called. + * - ENOMEM Out of memory + * + * @see , Unix ftruncate() + * + */ +int smbc_ftruncate(int fd, off_t size); + + /**@ingroup attribue * Change the ownership of a file or directory. * diff --git a/source3/include/messages.h b/source3/include/messages.h index 8de41ca049..c97ad982b3 100644 --- a/source3/include/messages.h +++ b/source3/include/messages.h @@ -97,6 +97,7 @@ #define MSG_WINBIND_TRY_TO_GO_ONLINE 0x0406 #define MSG_WINBIND_FAILED_TO_GO_ONLINE 0x0407 #define MSG_WINBIND_VALIDATE_CACHE 0x0408 +#define MSG_WINBIND_DUMP_DOMAIN_LIST 0x0409 /* event messages */ #define MSG_DUMP_EVENT_LIST 0x0500 diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 6537d5a7fb..b89b0fea3a 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -135,9 +135,9 @@ struct handle_list { /* Domain controller authentication protocol info */ struct dcinfo { uint32 sequence; /* "timestamp" from client. */ - DOM_CHAL seed_chal; - DOM_CHAL clnt_chal; /* Client credential */ - DOM_CHAL srv_chal; /* Server credential */ + struct netr_Credential seed_chal; + struct netr_Credential clnt_chal; /* Client credential */ + struct netr_Credential srv_chal; /* Server credential */ unsigned char sess_key[16]; /* Session key - 8 bytes followed by 8 zero bytes */ unsigned char mach_pw[16]; /* md4(machine password) */ diff --git a/source3/include/passdb.h b/source3/include/passdb.h index b72ec6b0ba..8d5934df52 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -25,40 +25,13 @@ /* - * fields_present flags meanings - * same names as found in samba4 idl files + * in samba4 idl + * ACCT_NT_PWD_SET == SAMR_FIELD_PASSWORD and + * ACCT_LM_PWD_SET == SAMR_FIELD_PASSWORD2 */ -#define ACCT_USERNAME 0x00000001 -#define ACCT_FULL_NAME 0x00000002 -#define ACCT_RID 0x00000004 -#define ACCT_PRIMARY_GID 0x00000008 -#define ACCT_DESCRIPTION 0x00000010 -#define ACCT_COMMENT 0x00000020 -#define ACCT_HOME_DIR 0x00000040 -#define ACCT_HOME_DRIVE 0x00000080 -#define ACCT_LOGON_SCRIPT 0x00000100 -#define ACCT_PROFILE 0x00000200 -#define ACCT_WORKSTATIONS 0x00000400 -#define ACCT_LAST_LOGON 0x00000800 -#define ACCT_LAST_LOGOFF 0x00001000 -#define ACCT_LOGON_HOURS 0x00002000 -#define ACCT_BAD_PWD_COUNT 0x00004000 -#define ACCT_NUM_LOGONS 0x00008000 -#define ACCT_ALLOW_PWD_CHANGE 0x00010000 -#define ACCT_FORCE_PWD_CHANGE 0x00020000 -#define ACCT_LAST_PWD_CHANGE 0x00040000 -#define ACCT_EXPIRY 0x00080000 -#define ACCT_FLAGS 0x00100000 -#define ACCT_CALLBACK 0x00200000 -#define ACCT_COUNTRY_CODE 0x00400000 -#define ACCT_CODE_PAGE 0x00800000 #define ACCT_NT_PWD_SET 0x01000000 #define ACCT_LM_PWD_SET 0x02000000 -#define ACCT_PRIVATEDATA 0x04000000 -#define ACCT_EXPIRED_FLAG 0x08000000 -#define ACCT_SEC_DESC 0x10000000 -#define ACCT_OWF_PWD 0x20000000 /* * bit flags representing initialized fields in struct samu diff --git a/source3/include/reg_objects.h b/source3/include/reg_objects.h index 23a14e6757..3df701f61c 100644 --- a/source3/include/reg_objects.h +++ b/source3/include/reg_objects.h @@ -94,11 +94,17 @@ typedef struct { #define KEY_HKCU "HKCU" #define KEY_HKDD "HKDD" #define KEY_SERVICES "HKLM\\SYSTEM\\CurrentControlSet\\Services" +#define KEY_EVENTLOG "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog" +#define KEY_SHARES "HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Shares" +#define KEY_NETLOGON_PARAMS "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Netlogon\\Parameters" +#define KEY_TCPIP_PARAMS "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters" +#define KEY_PROD_OPTIONS "HKLM\\SYSTEM\\CurrentControlSet\\Control\\ProductOptions" #define KEY_PRINTING "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Print" #define KEY_PRINTING_2K "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\Printers" #define KEY_PRINTING_PORTS "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Ports" -#define KEY_EVENTLOG "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog" -#define KEY_SHARES "HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Shares" +#define KEY_CURRENT_VERSION "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" +#define KEY_PERFLIB "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib" +#define KEY_PERFLIB_009 "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib\\009" #define KEY_SMBCONF "HKLM\\SOFTWARE\\Samba\\smbconf" #define KEY_TREE_ROOT "" diff --git a/source3/include/rpc_brs.h b/source3/include/rpc_brs.h deleted file mode 100644 index 62ee86050f..0000000000 --- a/source3/include/rpc_brs.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - Unix SMB/CIFS implementation. - SMB parameters and setup - Copyright (C) Andrew Tridgell 1992-1999 - Copyright (C) Luke Kenneth Casson Leighton 1996-1999 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef _RPC_BRS_H /* _RPC_BRS_H */ -#define _RPC_BRS_H - - -/* brssvc pipe */ -#define BRS_QUERY_INFO 0x02 - - -/* BRS_Q_QUERY_INFO - probably a capabilities request */ -typedef struct q_brs_query_info_info -{ - uint32 ptr_srv_name; /* pointer (to server name?) */ - UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */ - - uint16 switch_value1; /* info level 100 (0x64) */ - /* align */ - uint16 switch_value2; /* info level 100 (0x64) */ - - uint32 ptr; - uint32 pad1; - uint32 pad2; - -} BRS_Q_QUERY_INFO; - - -/* BRS_INFO_100 - level 100 info */ -typedef struct brs_info_100_info -{ - uint32 pad1; - uint32 ptr2; - uint32 pad2; - uint32 pad3; - -} BRS_INFO_100; - - -/* BRS_R_QUERY_INFO - probably a capabilities request */ -typedef struct r_brs_query_info_info -{ - uint16 switch_value1; /* 100 (0x64) - switch value */ - /* align */ - uint16 switch_value2; /* info level 100 (0x64) */ - - /* for now, only level 100 is supported. this should be an enum container */ - uint32 ptr_1; /* pointer 1 */ - - union - { - BRS_INFO_100 *brs100; /* browser info level 100 */ - void *id; - - } info; - - NTSTATUS status; /* return status */ - -} BRS_R_QUERY_INFO; - -#endif /* _RPC_BRS_H */ - diff --git a/source3/include/rpc_client.h b/source3/include/rpc_client.h index 66c4f58987..e1ebb2509d 100644 --- a/source3/include/rpc_client.h +++ b/source3/include/rpc_client.h @@ -31,6 +31,10 @@ #include "librpc/gen_ndr/cli_initshutdown.h" #include "librpc/gen_ndr/cli_winreg.h" #include "librpc/gen_ndr/cli_srvsvc.h" +#include "librpc/gen_ndr/cli_samr.h" +#include "librpc/gen_ndr/cli_netlogon.h" +#include "librpc/gen_ndr/cli_dssetup.h" +#include "librpc/gen_ndr/cli_ntsvcs.h" /* macro to expand cookie-cutter code in cli_xxx() using rpc_api_pipe_req() */ diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index 7ea3fcbc23..ec08eb5f8f 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -98,11 +98,6 @@ enum RPC_PKT_TYPE { #define RPC_AUTH_SCHANNEL_SIGN_OR_SEAL_CHK_LEN 0x20 #define RPC_AUTH_SCHANNEL_SIGN_ONLY_CHK_LEN 0x18 - -#define NETLOGON_NEG_ARCFOUR 0x00000004 -#define NETLOGON_NEG_128BIT 0x00004000 -#define NETLOGON_NEG_SCHANNEL 0x40000000 - /* The 7 here seems to be required to get Win2k not to downgrade us to NT4. Actually, anything other than 1ff would seem to do... */ #define NETLOGON_NEG_AUTH2_FLAGS 0x000701ff @@ -111,6 +106,8 @@ enum RPC_PKT_TYPE { /* these are the flags that ADS clients use */ #define NETLOGON_NEG_AUTH2_ADS_FLAGS (0x200fbffb | NETLOGON_NEG_ARCFOUR | NETLOGON_NEG_128BIT | NETLOGON_NEG_SCHANNEL) +#define NETLOGON_NEG_SELECT_AUTH2_FLAGS ((lp_security() == SEC_ADS) ? NETLOGON_NEG_AUTH2_ADS_FLAGS : NETLOGON_NEG_AUTH2_FLAGS) + enum schannel_direction { SENDER_IS_INITIATOR, SENDER_IS_ACCEPTOR diff --git a/source3/include/rpc_ds.h b/source3/include/rpc_ds.h deleted file mode 100644 index 1ba02aede0..0000000000 --- a/source3/include/rpc_ds.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - Unix SMB/CIFS implementation. - SMB parameters and setup - Copyright (C) Gerald Carter 2002 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef _RPC_DS_H /* _RPC_LSA_H */ -#define _RPC_DS_H - -/* Opcodes available on PIPE_LSARPC_DS */ - -#define DS_GETPRIMDOMINFO 0x00 -#define DS_NOP 0xFF /* no op -- placeholder */ - -/* Opcodes available on PIPE_NETLOGON */ - -#define DS_ENUM_DOM_TRUSTS 0x28 - -/* macros for RPC's */ - -/* DSROLE_PRIMARY_DOMAIN_INFO_BASIC */ - -/* flags */ - -#define DSROLE_PRIMARY_DS_RUNNING 0x00000001 -#define DSROLE_PRIMARY_DS_MIXED_MODE 0x00000002 -#define DSROLE_UPGRADE_IN_PROGRESS 0x00000004 -#define DSROLE_PRIMARY_DOMAIN_GUID_PRESENT 0x01000000 - -/* machine role */ - -#define DSROLE_DOMAIN_MEMBER_WKS 1 -#define DSROLE_STANDALONE_SRV 2 -#define DSROLE_DOMAIN_MEMBER_SRV 3 -#define DSROLE_BDC 4 -#define DSROLE_PDC 5 - -/* Settings for the domainFunctionality attribute in the rootDSE */ - -#define DS_DOMAIN_FUNCTION_2000 0 -#define DS_DOMAIN_FUCNTION_2003_MIXED 1 -#define DS_DOMAIN_FUNCTION_2003 2 - -typedef struct -{ - uint16 machine_role; - uint32 flags; - uint32 netbios_ptr; - uint32 dnsname_ptr; - uint32 forestname_ptr; - - struct GUID domain_guid; - UNISTR2 netbios_domain; - UNISTR2 dns_domain; /* our dns domain */ - UNISTR2 forest_domain; /* root domain of the forest to which we belong */ -} DSROLE_PRIMARY_DOMAIN_INFO_BASIC; - -typedef struct -{ - DSROLE_PRIMARY_DOMAIN_INFO_BASIC *basic; -} DS_DOMINFO_CTR; - -/* info levels for ds_getprimdominfo() */ - -#define DsRolePrimaryDomainInfoBasic 1 - -/* DS_Q_GETPRIMDOMINFO - DsGetPrimaryDomainInformation() request */ -typedef struct -{ - uint16 level; -} DS_Q_GETPRIMDOMINFO; - -/* DS_R_GETPRIMDOMINFO - DsGetPrimaryDomainInformation() response */ -typedef struct -{ - uint32 ptr; - - uint16 level; - uint16 unknown0; /* 0x455c -- maybe just alignment? */ - - DS_DOMINFO_CTR info; - - NTSTATUS status; -} DS_R_GETPRIMDOMINFO; - -typedef struct { - /* static portion of structure */ - uint32 netbios_ptr; - uint32 dns_ptr; - uint32 flags; - uint32 parent_index; - uint32 trust_type; - uint32 trust_attributes; - uint32 sid_ptr; - struct GUID guid; - - UNISTR2 netbios_domain; - UNISTR2 dns_domain; - DOM_SID2 sid; - -} DS_DOMAIN_TRUSTS; - -struct ds_domain_trust { - /* static portion of structure */ - uint32 flags; - uint32 parent_index; - uint32 trust_type; - uint32 trust_attributes; - struct GUID guid; - - DOM_SID sid; - char *netbios_domain; - char *dns_domain; -}; - -typedef struct { - - uint32 ptr; - uint32 max_count; - DS_DOMAIN_TRUSTS *trusts; - -} DS_DOMAIN_TRUSTS_CTR; - -/* Trust flags */ - -#define DS_DOMAIN_IN_FOREST 0x0001 /* domains in the forest to which - we belong; even different domain trees */ -#define DS_DOMAIN_DIRECT_OUTBOUND 0x0002 /* trusted domains */ -#define DS_DOMAIN_TREE_ROOT 0x0004 /* root of a forest */ -#define DS_DOMAIN_PRIMARY 0x0008 /* our domain */ -#define DS_DOMAIN_NATIVE_MODE 0x0010 /* native mode AD servers */ -#define DS_DOMAIN_DIRECT_INBOUND 0x0020 /* trusting domains */ - -/* Trust types */ - -#define DS_DOMAIN_TRUST_TYPE_DOWNLEVEL 0x00000001 -#define DS_DOMAIN_TRUST_TYPE_UPLEVEL 0x00000002 - -/* Trust attributes */ - -#define DS_DOMAIN_TRUST_ATTRIB_NON_TRANSITIVE 0x00000001 -#define DS_DOMAIN_TRUST_ATTRIB_UPLEVEL_ONLY 0x00000002 -#define DS_DOMAIN_TRUST_ATTRIB_QUARANTINED_DOMAIN 0x00000004 -#define DS_DOMAIN_TRUST_ATTRIB_FOREST_TRANSITIVE 0x00000008 -#define DS_DOMAIN_TRUST_ATTRIB_CROSS_ORG 0x00000010 -#define DS_DOMAIN_TRUST_ATTRIB_IN_FOREST 0x00000020 -#define DS_DOMAIN_TRUST_ATTRIB_EXTERNAL 0x00000040 - - - -/* DS_Q_ENUM_DOM_TRUSTS - DsEnumerateDomainTrusts() request */ -typedef struct -{ - uint32 server_ptr; - UNISTR2 server; - uint32 flags; - -} DS_Q_ENUM_DOM_TRUSTS; - -/* DS_R_ENUM_DOM_TRUSTS - DsEnumerateDomainTrusts() response */ -typedef struct -{ - uint32 num_domains; - DS_DOMAIN_TRUSTS_CTR domains; - - NTSTATUS status; - -} DS_R_ENUM_DOM_TRUSTS; - - -#endif /* _RPC_DS_H */ diff --git a/source3/include/rpc_eventlog.h b/source3/include/rpc_eventlog.h index 9ec76a071c..3f5d03ed63 100644 --- a/source3/include/rpc_eventlog.h +++ b/source3/include/rpc_eventlog.h @@ -60,51 +60,6 @@ typedef struct elog_tdb { /***********************************/ -typedef struct { - uint16 unknown1; - uint16 unknown2; -} EVENTLOG_OPEN_UNKNOWN0; - -typedef struct { - EVENTLOG_OPEN_UNKNOWN0 *unknown0; - UNISTR4 logname; - UNISTR4 servername; - uint32 unknown1; - uint32 unknown2; -} EVENTLOG_Q_OPEN_EVENTLOG; - -typedef struct { - POLICY_HND handle; - NTSTATUS status; -} EVENTLOG_R_OPEN_EVENTLOG; - - -/***********************************/ - -typedef struct { - POLICY_HND handle; -} EVENTLOG_Q_GET_NUM_RECORDS; - -typedef struct { - uint32 num_records; - NTSTATUS status; -} EVENTLOG_R_GET_NUM_RECORDS; - - -/***********************************/ - -typedef struct { - POLICY_HND handle; -} EVENTLOG_Q_GET_OLDEST_ENTRY; - -typedef struct { - uint32 oldest_entry; - NTSTATUS status; -} EVENTLOG_R_GET_OLDEST_ENTRY; - - -/***********************************/ - typedef struct { POLICY_HND handle; @@ -165,16 +120,4 @@ typedef struct { NTSTATUS status; } EVENTLOG_R_READ_EVENTLOG; - -/***********************************/ - -typedef struct { - POLICY_HND handle; - UNISTR4 backupfile; -} EVENTLOG_Q_CLEAR_EVENTLOG; - -typedef struct { - NTSTATUS status; -} EVENTLOG_R_CLEAR_EVENTLOG; - #endif /* _RPC_EVENTLOG_H */ diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h index ef6ff6db28..b4021afd0a 100644 --- a/source3/include/rpc_lsa.h +++ b/source3/include/rpc_lsa.h @@ -23,1058 +23,37 @@ #ifndef _RPC_LSA_H /* _RPC_LSA_H */ #define _RPC_LSA_H -/* Opcodes available on PIPE_LSARPC */ - -#define LSA_CLOSE 0x00 -#define LSA_DELETE 0x01 -#define LSA_ENUM_PRIVS 0x02 -#define LSA_QUERYSECOBJ 0x03 -#define LSA_SETSECOBJ 0x04 -#define LSA_CHANGEPASSWORD 0x05 -#define LSA_OPENPOLICY 0x06 -#define LSA_QUERYINFOPOLICY 0x07 -#define LSA_SETINFOPOLICY 0x08 -#define LSA_CLEARAUDITLOG 0x09 -#define LSA_CREATEACCOUNT 0x0a -#define LSA_ENUM_ACCOUNTS 0x0b -#define LSA_CREATETRUSTDOM 0x0c /* TODO: implement this one -- jerry */ -#define LSA_ENUMTRUSTDOM 0x0d -#define LSA_LOOKUPNAMES 0x0e -#define LSA_LOOKUPSIDS 0x0f -#define LSA_CREATESECRET 0x10 /* TODO: implement this one -- jerry */ -#define LSA_OPENACCOUNT 0x11 -#define LSA_ENUMPRIVSACCOUNT 0x12 -#define LSA_ADDPRIVS 0x13 -#define LSA_REMOVEPRIVS 0x14 -#define LSA_GETQUOTAS 0x15 -#define LSA_SETQUOTAS 0x16 -#define LSA_GETSYSTEMACCOUNT 0x17 -#define LSA_SETSYSTEMACCOUNT 0x18 -#define LSA_OPENTRUSTDOM 0x19 -#define LSA_QUERYTRUSTDOMINFO 0x1a -#define LSA_SETINFOTRUSTDOM 0x1b -#define LSA_OPENSECRET 0x1c /* TODO: implement this one -- jerry */ -#define LSA_SETSECRET 0x1d /* TODO: implement this one -- jerry */ -#define LSA_QUERYSECRET 0x1e -#define LSA_LOOKUPPRIVVALUE 0x1f -#define LSA_LOOKUPPRIVNAME 0x20 -#define LSA_PRIV_GET_DISPNAME 0x21 -#define LSA_DELETEOBJECT 0x22 /* TODO: implement this one -- jerry */ -#define LSA_ENUMACCTWITHRIGHT 0x23 /* TODO: implement this one -- jerry */ -#define LSA_ENUMACCTRIGHTS 0x24 -#define LSA_ADDACCTRIGHTS 0x25 -#define LSA_REMOVEACCTRIGHTS 0x26 -#define LSA_QUERYTRUSTDOMINFOBYSID 0x27 -#define LSA_SETTRUSTDOMINFO 0x28 -#define LSA_DELETETRUSTDOM 0x29 -#define LSA_STOREPRIVDATA 0x2a -#define LSA_RETRPRIVDATA 0x2b -#define LSA_OPENPOLICY2 0x2c -#define LSA_UNK_GET_CONNUSER 0x2d /* LsaGetConnectedCredentials ? */ -#define LSA_QUERYINFO2 0x2e -#define LSA_QUERYTRUSTDOMINFOBYNAME 0x30 -#define LSA_QUERYDOMINFOPOL 0x35 -#define LSA_OPENTRUSTDOMBYNAME 0x37 - -#define LSA_LOOKUPSIDS2 0x39 -#define LSA_LOOKUPNAMES2 0x3a -#define LSA_LOOKUPNAMES3 0x44 -#define LSA_LOOKUPSIDS3 0x4c -#define LSA_LOOKUPNAMES4 0x4d - -/* XXXX these are here to get a compile! */ -#define LSA_LOOKUPRIDS 0xFD - -#define LSA_AUDIT_NUM_CATEGORIES_NT4 7 -#define LSA_AUDIT_NUM_CATEGORIES_WIN2K 9 - -#define LSA_AUDIT_NUM_CATEGORIES LSA_AUDIT_NUM_CATEGORIES_NT4 - -#define LSA_AUDIT_POLICY_NONE 0x00 -#define LSA_AUDIT_POLICY_SUCCESS 0x01 -#define LSA_AUDIT_POLICY_FAILURE 0x02 -#define LSA_AUDIT_POLICY_ALL (LSA_AUDIT_POLICY_SUCCESS|LSA_AUDIT_POLICY_FAILURE) -#define LSA_AUDIT_POLICY_CLEAR 0x04 - -enum lsa_audit_categories { - LSA_AUDIT_CATEGORY_SYSTEM = 0, - LSA_AUDIT_CATEGORY_LOGON = 1, - LSA_AUDIT_CATEGORY_FILE_AND_OBJECT_ACCESS, - LSA_AUDIT_CATEGORY_USE_OF_USER_RIGHTS, - LSA_AUDIT_CATEGORY_PROCCESS_TRACKING, - LSA_AUDIT_CATEGORY_SECURITY_POLICY_CHANGES, - LSA_AUDIT_CATEGORY_ACCOUNT_MANAGEMENT, - LSA_AUDIT_CATEGORY_DIRECTORY_SERVICE_ACCESS, /* only in win2k/2k3 */ - LSA_AUDIT_CATEGORY_ACCOUNT_LOGON /* only in win2k/2k3 */ -}; - -/* level 1 is auditing settings */ -typedef struct dom_query_1 -{ - uint32 percent_full; - uint32 log_size; - NTTIME retention_time; - uint8 shutdown_in_progress; - NTTIME time_to_shutdown; - uint32 next_audit_record; - uint32 unknown; -} DOM_QUERY_1; - - -/* level 2 is auditing settings */ -typedef struct dom_query_2 -{ - uint32 auditing_enabled; - uint32 count1; /* usualy 7, at least on nt4sp4 */ - uint32 count2; /* the same */ - uint32 ptr; - uint32 *auditsettings; -} DOM_QUERY_2; - -/* DOM_QUERY - info class 3 and 5 LSA Query response */ -typedef struct dom_query_info_3 -{ - uint16 uni_dom_max_len; /* domain name string length * 2 */ - uint16 uni_dom_str_len; /* domain name string length * 2 */ - uint32 buffer_dom_name; /* undocumented domain name string buffer pointer */ - uint32 buffer_dom_sid; /* undocumented domain SID string buffer pointer */ - UNISTR2 uni_domain_name; /* domain name (unicode string) */ - DOM_SID2 dom_sid; /* domain SID */ - -} DOM_QUERY_3; - -/* level 5 is same as level 3. */ -typedef DOM_QUERY_3 DOM_QUERY_5; - -/* level 6 is server role information */ -typedef struct dom_query_6 -{ - uint16 server_role; /* 2=backup, 3=primary */ -} DOM_QUERY_6; - -/* level 10 is audit full set info */ -typedef struct dom_query_10 -{ - uint8 shutdown_on_full; -} DOM_QUERY_10; - -/* level 11 is audit full query info */ -typedef struct dom_query_11 -{ - uint16 unknown; - uint8 shutdown_on_full; - uint8 log_is_full; -} DOM_QUERY_11; - -/* level 12 is DNS domain info */ -typedef struct lsa_dns_dom_info -{ - UNIHDR hdr_nb_dom_name; /* netbios domain name */ - UNIHDR hdr_dns_dom_name; - UNIHDR hdr_forest_name; - - struct GUID dom_guid; /* domain GUID */ - - UNISTR2 uni_nb_dom_name; - UNISTR2 uni_dns_dom_name; - UNISTR2 uni_forest_name; - - uint32 ptr_dom_sid; - DOM_SID2 dom_sid; /* domain SID */ -} DOM_QUERY_12; - -typedef struct seq_qos_info -{ - uint32 len; /* 12 */ - uint16 sec_imp_level; /* 0x02 - impersonation level */ - uint8 sec_ctxt_mode; /* 0x01 - context tracking mode */ - uint8 effective_only; /* 0x00 - effective only */ - -} LSA_SEC_QOS; - -typedef struct obj_attr_info -{ - uint32 len; /* 0x18 - length (in bytes) inc. the length field. */ - uint32 ptr_root_dir; /* 0 - root directory (pointer) */ - uint32 ptr_obj_name; /* 0 - object name (pointer) */ - uint32 attributes; /* 0 - attributes (undocumented) */ - uint32 ptr_sec_desc; /* 0 - security descriptior (pointer) */ - uint32 ptr_sec_qos; /* security quality of service */ - LSA_SEC_QOS *sec_qos; - -} LSA_OBJ_ATTR; - -/* LSA_Q_OPEN_POL - LSA Query Open Policy */ -typedef struct lsa_q_open_pol_info -{ - uint32 ptr; /* undocumented buffer pointer */ - uint16 system_name; /* 0x5c - system name */ - LSA_OBJ_ATTR attr ; /* object attributes */ - - uint32 des_access; /* desired access attributes */ - -} LSA_Q_OPEN_POL; - -/* LSA_R_OPEN_POL - response to LSA Open Policy */ -typedef struct lsa_r_open_pol_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return code */ - -} LSA_R_OPEN_POL; - -/* LSA_Q_OPEN_POL2 - LSA Query Open Policy */ -typedef struct lsa_q_open_pol2_info -{ - uint32 ptr; /* undocumented buffer pointer */ - UNISTR2 uni_server_name; /* server name, starting with two '\'s */ - LSA_OBJ_ATTR attr ; /* object attributes */ - - uint32 des_access; /* desired access attributes */ - -} LSA_Q_OPEN_POL2; - -/* LSA_R_OPEN_POL2 - response to LSA Open Policy */ -typedef struct lsa_r_open_pol2_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return code */ - -} LSA_R_OPEN_POL2; - - -#define POLICY_VIEW_LOCAL_INFORMATION 0x00000001 -#define POLICY_VIEW_AUDIT_INFORMATION 0x00000002 -#define POLICY_GET_PRIVATE_INFORMATION 0x00000004 -#define POLICY_TRUST_ADMIN 0x00000008 -#define POLICY_CREATE_ACCOUNT 0x00000010 -#define POLICY_CREATE_SECRET 0x00000020 -#define POLICY_CREATE_PRIVILEGE 0x00000040 -#define POLICY_SET_DEFAULT_QUOTA_LIMITS 0x00000080 -#define POLICY_SET_AUDIT_REQUIREMENTS 0x00000100 -#define POLICY_AUDIT_LOG_ADMIN 0x00000200 -#define POLICY_SERVER_ADMIN 0x00000400 -#define POLICY_LOOKUP_NAMES 0x00000800 - -#define POLICY_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS |\ - POLICY_VIEW_LOCAL_INFORMATION |\ - POLICY_VIEW_AUDIT_INFORMATION |\ - POLICY_GET_PRIVATE_INFORMATION |\ - POLICY_TRUST_ADMIN |\ - POLICY_CREATE_ACCOUNT |\ - POLICY_CREATE_SECRET |\ - POLICY_CREATE_PRIVILEGE |\ - POLICY_SET_DEFAULT_QUOTA_LIMITS |\ - POLICY_SET_AUDIT_REQUIREMENTS |\ - POLICY_AUDIT_LOG_ADMIN |\ - POLICY_SERVER_ADMIN |\ - POLICY_LOOKUP_NAMES ) - - -#define POLICY_READ ( STANDARD_RIGHTS_READ_ACCESS |\ - POLICY_VIEW_AUDIT_INFORMATION |\ - POLICY_GET_PRIVATE_INFORMATION) - -#define POLICY_WRITE ( STD_RIGHT_READ_CONTROL_ACCESS |\ - POLICY_TRUST_ADMIN |\ - POLICY_CREATE_ACCOUNT |\ - POLICY_CREATE_SECRET |\ - POLICY_CREATE_PRIVILEGE |\ - POLICY_SET_DEFAULT_QUOTA_LIMITS |\ - POLICY_SET_AUDIT_REQUIREMENTS |\ - POLICY_AUDIT_LOG_ADMIN |\ - POLICY_SERVER_ADMIN) - -#define POLICY_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS |\ - POLICY_VIEW_LOCAL_INFORMATION |\ - POLICY_LOOKUP_NAMES ) - -/* LSA_Q_QUERY_SEC_OBJ - LSA query security */ -typedef struct lsa_query_sec_obj_info -{ - POLICY_HND pol; /* policy handle */ - uint32 sec_info; - -} LSA_Q_QUERY_SEC_OBJ; - -/* LSA_R_QUERY_SEC_OBJ - probably an open */ -typedef struct r_lsa_query_sec_obj_info -{ - uint32 ptr; - SEC_DESC_BUF *buf; - - NTSTATUS status; /* return status */ - -} LSA_R_QUERY_SEC_OBJ; - -/* LSA_Q_QUERY_INFO - LSA query info policy */ -typedef struct lsa_query_info -{ - POLICY_HND pol; /* policy handle */ - uint16 info_class; /* info class */ - -} LSA_Q_QUERY_INFO; - -/* LSA_INFO_CTR */ -typedef struct lsa_info_ctr -{ - uint16 info_class; - union { - DOM_QUERY_1 id1; - DOM_QUERY_2 id2; - DOM_QUERY_3 id3; - DOM_QUERY_5 id5; - DOM_QUERY_6 id6; - DOM_QUERY_10 id10; - DOM_QUERY_11 id11; - DOM_QUERY_12 id12; - } info; - -} LSA_INFO_CTR; - -typedef LSA_INFO_CTR LSA_INFO_CTR2; - -/* LSA_R_QUERY_INFO - response to LSA query info policy */ -typedef struct lsa_r_query_info -{ - uint32 dom_ptr; /* undocumented buffer pointer */ - LSA_INFO_CTR ctr; - NTSTATUS status; /* return code */ - -} LSA_R_QUERY_INFO; - -typedef LSA_Q_QUERY_INFO LSA_Q_QUERY_INFO2; -typedef LSA_R_QUERY_INFO LSA_R_QUERY_INFO2; - -/*******************************************************/ - -typedef struct { - POLICY_HND pol; - uint32 enum_context; - uint32 preferred_len; /* preferred maximum length */ -} LSA_Q_ENUM_TRUST_DOM; - -typedef struct { - UNISTR4 name; - DOM_SID2 *sid; -} DOMAIN_INFO; - -typedef struct { - uint32 count; - DOMAIN_INFO *domains; -} DOMAIN_LIST; - -typedef struct { - uint32 enum_context; - uint32 count; - DOMAIN_LIST *domlist; - NTSTATUS status; -} LSA_R_ENUM_TRUST_DOM; - -/*******************************************************/ - -/* LSA_Q_CLOSE */ -typedef struct lsa_q_close_info -{ - POLICY_HND pol; /* policy handle */ - -} LSA_Q_CLOSE; - -/* LSA_R_CLOSE */ -typedef struct lsa_r_close_info -{ - POLICY_HND pol; /* policy handle. should be all zeros. */ - - NTSTATUS status; /* return code */ - -} LSA_R_CLOSE; - - -#define MAX_REF_DOMAINS 32 - -/* DOM_TRUST_HDR */ -typedef struct dom_trust_hdr -{ - UNIHDR hdr_dom_name; /* referenced domain unicode string headers */ - uint32 ptr_dom_sid; - -} DOM_TRUST_HDR; - -/* DOM_TRUST_INFO */ -typedef struct dom_trust_info -{ - UNISTR2 uni_dom_name; /* domain name unicode string */ - DOM_SID2 ref_dom ; /* referenced domain SID */ - -} DOM_TRUST_INFO; - -/* DOM_R_REF */ -typedef struct dom_ref_info -{ - uint32 num_ref_doms_1; /* num referenced domains */ - uint32 ptr_ref_dom; /* pointer to referenced domains */ - uint32 max_entries; /* 32 - max number of entries */ - uint32 num_ref_doms_2; /* num referenced domains */ - - DOM_TRUST_HDR hdr_ref_dom[MAX_REF_DOMAINS]; /* referenced domains */ - DOM_TRUST_INFO ref_dom [MAX_REF_DOMAINS]; /* referenced domains */ - -} DOM_R_REF; - -/* the domain_idx points to a SID associated with the name */ - -/* LSA_TRANS_NAME - translated name */ -typedef struct lsa_trans_name_info -{ - uint16 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */ - UNIHDR hdr_name; - uint32 domain_idx; /* index into DOM_R_REF array of SIDs */ - -} LSA_TRANS_NAME; - -/* LSA_TRANS_NAME2 - translated name */ -typedef struct lsa_trans_name_info2 -{ - uint16 sid_name_use; /* value is 5 for a well-known group; 2 for a domain group; 1 for a user... */ - UNIHDR hdr_name; - uint32 domain_idx; /* index into DOM_R_REF array of SIDs */ - uint32 unknown; - -} LSA_TRANS_NAME2; - -/* This number is based on Win2k and later maximum response allowed */ -#define MAX_LOOKUP_SIDS 20480 /* 0x5000 */ - -/* LSA_TRANS_NAME_ENUM - LSA Translated Name Enumeration container */ -typedef struct lsa_trans_name_enum_info -{ - uint32 num_entries; - uint32 ptr_trans_names; - uint32 num_entries2; - - LSA_TRANS_NAME *name; /* translated names */ - UNISTR2 *uni_name; - -} LSA_TRANS_NAME_ENUM; - -/* LSA_TRANS_NAME_ENUM2 - LSA Translated Name Enumeration container 2 */ -typedef struct lsa_trans_name_enum_info2 -{ - uint32 num_entries; - uint32 ptr_trans_names; - uint32 num_entries2; - - LSA_TRANS_NAME2 *name; /* translated names */ - UNISTR2 *uni_name; - -} LSA_TRANS_NAME_ENUM2; - -/* LSA_SID_ENUM - LSA SID enumeration container */ -typedef struct lsa_sid_enum_info -{ - uint32 num_entries; - uint32 ptr_sid_enum; - uint32 num_entries2; - - uint32 *ptr_sid; /* domain SID pointers to be looked up. */ - DOM_SID2 *sid; /* domain SIDs to be looked up. */ - -} LSA_SID_ENUM; - -/* LSA_Q_LOOKUP_SIDS - LSA Lookup SIDs */ -typedef struct lsa_q_lookup_sids -{ - POLICY_HND pol; /* policy handle */ - LSA_SID_ENUM sids; - LSA_TRANS_NAME_ENUM names; - uint16 level; - uint32 mapped_count; - -} LSA_Q_LOOKUP_SIDS; - -/* LSA_R_LOOKUP_SIDS - response to LSA Lookup SIDs */ -typedef struct lsa_r_lookup_sids -{ - uint32 ptr_dom_ref; - DOM_R_REF *dom_ref; /* domain reference info */ - - LSA_TRANS_NAME_ENUM names; - uint32 mapped_count; - - NTSTATUS status; /* return code */ - -} LSA_R_LOOKUP_SIDS; - -/* LSA_Q_LOOKUP_SIDS2 - LSA Lookup SIDs 2*/ -typedef struct lsa_q_lookup_sids2 -{ - POLICY_HND pol; /* policy handle */ - LSA_SID_ENUM sids; - LSA_TRANS_NAME_ENUM2 names; - uint16 level; - uint32 mapped_count; - uint32 unknown1; - uint32 unknown2; - -} LSA_Q_LOOKUP_SIDS2; - -/* LSA_R_LOOKUP_SIDS2 - response to LSA Lookup SIDs 2*/ -typedef struct lsa_r_lookup_sids2 -{ - uint32 ptr_dom_ref; - DOM_R_REF *dom_ref; /* domain reference info */ - - LSA_TRANS_NAME_ENUM2 names; - uint32 mapped_count; - - NTSTATUS status; /* return code */ - -} LSA_R_LOOKUP_SIDS2; - -/* LSA_Q_LOOKUP_SIDS3 - LSA Lookup SIDs 3 */ -typedef struct lsa_q_lookup_sids3 -{ - LSA_SID_ENUM sids; - LSA_TRANS_NAME_ENUM2 names; - uint16 level; - uint32 mapped_count; - uint32 unknown1; - uint32 unknown2; - -} LSA_Q_LOOKUP_SIDS3; - -/* LSA_R_LOOKUP_SIDS3 - response to LSA Lookup SIDs 3 */ -typedef struct lsa_r_lookup_sids3 -{ - uint32 ptr_dom_ref; - DOM_R_REF *dom_ref; /* domain reference info */ - - LSA_TRANS_NAME_ENUM2 names; - uint32 mapped_count; - - NTSTATUS status; /* return code */ - -} LSA_R_LOOKUP_SIDS3; - -/* LSA_Q_LOOKUP_NAMES - LSA Lookup NAMEs */ -typedef struct lsa_q_lookup_names -{ - POLICY_HND pol; /* policy handle */ - uint32 num_entries; - uint32 num_entries2; - UNIHDR *hdr_name; /* name buffer pointers */ - UNISTR2 *uni_name; /* names to be looked up */ - - uint32 num_trans_entries; - uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */ - uint16 lookup_level; - uint32 mapped_count; - -} LSA_Q_LOOKUP_NAMES; - -/* LSA_R_LOOKUP_NAMES - response to LSA Lookup NAMEs by name */ -typedef struct lsa_r_lookup_names -{ - uint32 ptr_dom_ref; - DOM_R_REF *dom_ref; /* domain reference info */ - - uint32 num_entries; - uint32 ptr_entries; - uint32 num_entries2; - DOM_RID *dom_rid; /* domain RIDs being looked up */ - - uint32 mapped_count; - - NTSTATUS status; /* return code */ -} LSA_R_LOOKUP_NAMES; - -/* LSA_Q_LOOKUP_NAMES2 - LSA Lookup NAMEs 2*/ -typedef struct lsa_q_lookup_names2 -{ - POLICY_HND pol; /* policy handle */ - uint32 num_entries; - uint32 num_entries2; - UNIHDR *hdr_name; /* name buffer pointers */ - UNISTR2 *uni_name; /* names to be looked up */ - - uint32 num_trans_entries; - uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */ - uint16 lookup_level; - uint32 mapped_count; - uint32 unknown1; - uint32 unknown2; - -} LSA_Q_LOOKUP_NAMES2; - -/* LSA_R_LOOKUP_NAMES2 - response to LSA Lookup NAMEs by name 2 */ -typedef struct lsa_r_lookup_names2 -{ - uint32 ptr_dom_ref; - DOM_R_REF *dom_ref; /* domain reference info */ - - uint32 num_entries; - uint32 ptr_entries; - uint32 num_entries2; - DOM_RID2 *dom_rid; /* domain RIDs being looked up */ - - uint32 mapped_count; - - NTSTATUS status; /* return code */ -} LSA_R_LOOKUP_NAMES2; - -/* LSA_Q_LOOKUP_NAMES3 - LSA Lookup NAMEs 3 */ -typedef struct lsa_q_lookup_names3 -{ - POLICY_HND pol; /* policy handle */ - uint32 num_entries; - uint32 num_entries2; - UNIHDR *hdr_name; /* name buffer pointers */ - UNISTR2 *uni_name; /* names to be looked up */ - - uint32 num_trans_entries; - uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */ - uint16 lookup_level; - uint32 mapped_count; - uint32 unknown1; - uint32 unknown2; - -} LSA_Q_LOOKUP_NAMES3; - -/* Sid type used in lookupnames3 and lookupnames4. */ -typedef struct lsa_translatedsid3 { - uint8 sid_type; - DOM_SID2 *sid2; - uint32 sid_idx; - uint32 unknown; -} LSA_TRANSLATED_SID3; - -/* LSA_R_LOOKUP_NAMES3 - response to LSA Lookup NAMEs by name 3 */ -typedef struct lsa_r_lookup_names3 -{ - uint32 ptr_dom_ref; - DOM_R_REF *dom_ref; /* domain reference info */ - - uint32 num_entries; - uint32 ptr_entries; - uint32 num_entries2; - LSA_TRANSLATED_SID3 *trans_sids; - - uint32 mapped_count; - - NTSTATUS status; /* return code */ -} LSA_R_LOOKUP_NAMES3; - -/* LSA_Q_LOOKUP_NAMES4 - LSA Lookup NAMEs 4 */ -typedef struct lsa_q_lookup_names4 -{ - uint32 num_entries; - uint32 num_entries2; - UNIHDR *hdr_name; /* name buffer pointers */ - UNISTR2 *uni_name; /* names to be looked up */ - - uint32 num_trans_entries; - uint32 ptr_trans_sids; /* undocumented domain SID buffer pointer */ - uint16 lookup_level; - uint32 mapped_count; - uint32 unknown1; - uint32 unknown2; - -} LSA_Q_LOOKUP_NAMES4; - -/* LSA_R_LOOKUP_NAMES3 - response to LSA Lookup NAMEs by name 4 */ -typedef struct lsa_r_lookup_names4 -{ - uint32 ptr_dom_ref; - DOM_R_REF *dom_ref; /* domain reference info */ - - uint32 num_entries; - uint32 ptr_entries; - uint32 num_entries2; - LSA_TRANSLATED_SID3 *trans_sids; - - uint32 mapped_count; - - NTSTATUS status; /* return code */ -} LSA_R_LOOKUP_NAMES4; - -typedef struct lsa_enum_priv_entry -{ - UNIHDR hdr_name; - uint32 luid_low; - uint32 luid_high; - UNISTR2 name; - -} LSA_PRIV_ENTRY; - -/* LSA_Q_ENUM_PRIVS - LSA enum privileges */ -typedef struct lsa_q_enum_privs -{ - POLICY_HND pol; /* policy handle */ - uint32 enum_context; - uint32 pref_max_length; -} LSA_Q_ENUM_PRIVS; - -typedef struct lsa_r_enum_privs -{ - uint32 enum_context; - uint32 count; - uint32 ptr; - uint32 count1; - - LSA_PRIV_ENTRY *privs; - - NTSTATUS status; -} LSA_R_ENUM_PRIVS; - -/* LSA_Q_ENUM_ACCT_RIGHTS - LSA enum account rights */ -typedef struct -{ - POLICY_HND pol; /* policy handle */ - DOM_SID2 sid; -} LSA_Q_ENUM_ACCT_RIGHTS; - -/* LSA_R_ENUM_ACCT_RIGHTS - LSA enum account rights */ -typedef struct -{ - uint32 count; - UNISTR4_ARRAY *rights; - NTSTATUS status; -} LSA_R_ENUM_ACCT_RIGHTS; - - -/* LSA_Q_ADD_ACCT_RIGHTS - LSA add account rights */ -typedef struct -{ - POLICY_HND pol; /* policy handle */ - DOM_SID2 sid; - uint32 count; - UNISTR4_ARRAY *rights; -} LSA_Q_ADD_ACCT_RIGHTS; - -/* LSA_R_ADD_ACCT_RIGHTS - LSA add account rights */ -typedef struct -{ - NTSTATUS status; -} LSA_R_ADD_ACCT_RIGHTS; - - -/* LSA_Q_REMOVE_ACCT_RIGHTS - LSA remove account rights */ -typedef struct -{ - POLICY_HND pol; /* policy handle */ - DOM_SID2 sid; - uint32 removeall; - uint32 count; - UNISTR4_ARRAY *rights; -} LSA_Q_REMOVE_ACCT_RIGHTS; - -/* LSA_R_REMOVE_ACCT_RIGHTS - LSA remove account rights */ -typedef struct -{ - NTSTATUS status; -} LSA_R_REMOVE_ACCT_RIGHTS; - - -/* LSA_Q_PRIV_GET_DISPNAME - LSA get privilege display name */ -typedef struct lsa_q_priv_get_dispname -{ - POLICY_HND pol; /* policy handle */ - UNIHDR hdr_name; - UNISTR2 name; - uint16 lang_id; - uint16 lang_id_sys; -} LSA_Q_PRIV_GET_DISPNAME; - -typedef struct lsa_r_priv_get_dispname -{ - uint32 ptr_info; - UNIHDR hdr_desc; - UNISTR2 desc; - /* Don't align ! */ - uint16 lang_id; - /* align */ - NTSTATUS status; -} LSA_R_PRIV_GET_DISPNAME; - -/* LSA_Q_ENUM_ACCOUNTS */ -typedef struct lsa_q_enum_accounts -{ - POLICY_HND pol; /* policy handle */ - uint32 enum_context; - uint32 pref_max_length; -} LSA_Q_ENUM_ACCOUNTS; - -/* LSA_R_ENUM_ACCOUNTS */ -typedef struct lsa_r_enum_accounts -{ - uint32 enum_context; - LSA_SID_ENUM sids; - NTSTATUS status; -} LSA_R_ENUM_ACCOUNTS; - -/* LSA_Q_UNK_GET_CONNUSER - gets username\domain of connected user - called when "Take Ownership" is clicked -SK */ -typedef struct lsa_q_unk_get_connuser -{ - uint32 ptr_srvname; - UNISTR2 uni2_srvname; - uint32 unk1; /* 3 unknown uint32's are seen right after uni2_srvname */ - uint32 unk2; /* unk2 appears to be a ptr, unk1 = unk3 = 0 usually */ - uint32 unk3; -} LSA_Q_UNK_GET_CONNUSER; - -/* LSA_R_UNK_GET_CONNUSER */ -typedef struct lsa_r_unk_get_connuser -{ - uint32 ptr_user_name; - UNIHDR hdr_user_name; - UNISTR2 uni2_user_name; - - uint32 unk1; - - uint32 ptr_dom_name; - UNIHDR hdr_dom_name; - UNISTR2 uni2_dom_name; - - NTSTATUS status; -} LSA_R_UNK_GET_CONNUSER; - - -typedef struct lsa_q_createaccount -{ - POLICY_HND pol; /* policy handle */ - DOM_SID2 sid; - uint32 access; /* access */ -} LSA_Q_CREATEACCOUNT; - -typedef struct lsa_r_createaccount -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; -} LSA_R_CREATEACCOUNT; - - -typedef struct lsa_q_openaccount -{ - POLICY_HND pol; /* policy handle */ - DOM_SID2 sid; - uint32 access; /* desired access */ -} LSA_Q_OPENACCOUNT; - -typedef struct lsa_r_openaccount -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; -} LSA_R_OPENACCOUNT; - -typedef struct lsa_q_enumprivsaccount -{ - POLICY_HND pol; /* policy handle */ -} LSA_Q_ENUMPRIVSACCOUNT; - -typedef struct lsa_r_enumprivsaccount -{ - uint32 ptr; - uint32 count; - PRIVILEGE_SET set; - NTSTATUS status; -} LSA_R_ENUMPRIVSACCOUNT; - -typedef struct lsa_q_getsystemaccount -{ - POLICY_HND pol; /* policy handle */ -} LSA_Q_GETSYSTEMACCOUNT; - -typedef struct lsa_r_getsystemaccount -{ - uint32 access; - NTSTATUS status; -} LSA_R_GETSYSTEMACCOUNT; - - -typedef struct lsa_q_setsystemaccount -{ - POLICY_HND pol; /* policy handle */ - uint32 access; -} LSA_Q_SETSYSTEMACCOUNT; - -typedef struct lsa_r_setsystemaccount -{ - NTSTATUS status; -} LSA_R_SETSYSTEMACCOUNT; - -typedef struct { - UNIHDR hdr; - UNISTR2 unistring; -} LSA_STRING; - -typedef struct { - POLICY_HND pol; /* policy handle */ - LSA_STRING privname; -} LSA_Q_LOOKUP_PRIV_VALUE; - -typedef struct { - LUID luid; - NTSTATUS status; -} LSA_R_LOOKUP_PRIV_VALUE; - -typedef struct lsa_q_addprivs -{ - POLICY_HND pol; /* policy handle */ - uint32 count; - PRIVILEGE_SET set; -} LSA_Q_ADDPRIVS; - -typedef struct lsa_r_addprivs -{ - NTSTATUS status; -} LSA_R_ADDPRIVS; - - -typedef struct lsa_q_removeprivs -{ - POLICY_HND pol; /* policy handle */ - uint32 allrights; - uint32 ptr; - uint32 count; - PRIVILEGE_SET set; -} LSA_Q_REMOVEPRIVS; - -typedef struct lsa_r_removeprivs -{ - NTSTATUS status; -} LSA_R_REMOVEPRIVS; - -/*******************************************************/ -#if 0 /* jerry, I think this not correct - gd */ -typedef struct { - POLICY_HND handle; - uint32 count; /* ??? this is what ethereal calls it */ - DOM_SID sid; -} LSA_Q_OPEN_TRUSTED_DOMAIN; -#endif - -/* LSA_Q_OPEN_TRUSTED_DOMAIN - LSA Query Open Trusted Domain */ -typedef struct lsa_q_open_trusted_domain -{ - POLICY_HND pol; /* policy handle */ - DOM_SID2 sid; /* domain sid */ - uint32 access_mask; /* access mask */ - -} LSA_Q_OPEN_TRUSTED_DOMAIN; - -/* LSA_R_OPEN_TRUSTED_DOMAIN - response to LSA Query Open Trusted Domain */ -typedef struct { - POLICY_HND handle; /* trustdom policy handle */ - NTSTATUS status; /* return code */ -} LSA_R_OPEN_TRUSTED_DOMAIN; - - -/*******************************************************/ - -typedef struct { - POLICY_HND handle; - UNISTR4 secretname; - uint32 access; -} LSA_Q_OPEN_SECRET; - -typedef struct { - POLICY_HND handle; - NTSTATUS status; -} LSA_R_OPEN_SECRET; - - -/*******************************************************/ - -typedef struct { - POLICY_HND handle; -} LSA_Q_DELETE_OBJECT; - -typedef struct { - NTSTATUS status; -} LSA_R_DELETE_OBJECT; - - -/*******************************************************/ - -typedef struct { - POLICY_HND handle; - UNISTR4 secretname; - uint32 access; -} LSA_Q_CREATE_SECRET; - -typedef struct { - POLICY_HND handle; - NTSTATUS status; -} LSA_R_CREATE_SECRET; - - -/*******************************************************/ - -typedef struct { - POLICY_HND handle; - UNISTR4 secretname; - uint32 access; -} LSA_Q_CREATE_TRUSTED_DOMAIN; - -typedef struct { - POLICY_HND handle; - NTSTATUS status; -} LSA_R_CREATE_TRUSTED_DOMAIN; - - -/*******************************************************/ - -typedef struct { - uint32 size; /* size is written on the wire twice so I - can only assume that one is supposed to - be a max length and one is a size */ - UNISTR2 *data; /* not really a UNICODE string but the parsing - is the same */ -} LSA_DATA_BLOB; - -typedef struct { - POLICY_HND handle; - LSA_DATA_BLOB *old_value; - LSA_DATA_BLOB *new_value; -} LSA_Q_SET_SECRET; - -typedef struct { - NTSTATUS status; -} LSA_R_SET_SECRET; - -typedef struct dom_info_kerberos { - uint32 enforce_restrictions; - NTTIME service_tkt_lifetime; - NTTIME user_tkt_lifetime; - NTTIME user_tkt_renewaltime; - NTTIME clock_skew; - NTTIME unknown6; -} LSA_DOM_INFO_POLICY_KERBEROS; - -typedef struct dom_info_efs { - uint32 blob_len; - UNISTR2 efs_blob; -} LSA_DOM_INFO_POLICY_EFS; - -typedef struct lsa_dom_info_union { - uint16 info_class; - LSA_DOM_INFO_POLICY_EFS efs_policy; - LSA_DOM_INFO_POLICY_KERBEROS krb_policy; -} LSA_DOM_INFO_UNION; - -/* LSA_Q_QUERY_DOM_INFO_POLICY - LSA query info */ -typedef struct lsa_q_query_dom_info_policy -{ - POLICY_HND pol; /* policy handle */ - uint16 info_class; /* info class */ -} LSA_Q_QUERY_DOM_INFO_POLICY; - -typedef struct lsa_r_query_dom_info_policy -{ - LSA_DOM_INFO_UNION *info; - NTSTATUS status; -} LSA_R_QUERY_DOM_INFO_POLICY; - +#define LSA_POLICY_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS |\ + LSA_POLICY_VIEW_LOCAL_INFORMATION |\ + LSA_POLICY_VIEW_AUDIT_INFORMATION |\ + LSA_POLICY_GET_PRIVATE_INFORMATION |\ + LSA_POLICY_TRUST_ADMIN |\ + LSA_POLICY_CREATE_ACCOUNT |\ + LSA_POLICY_CREATE_SECRET |\ + LSA_POLICY_CREATE_PRIVILEGE |\ + LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS |\ + LSA_POLICY_SET_AUDIT_REQUIREMENTS |\ + LSA_POLICY_AUDIT_LOG_ADMIN |\ + LSA_POLICY_SERVER_ADMIN |\ + LSA_POLICY_LOOKUP_NAMES ) + + +#define LSA_POLICY_READ ( STANDARD_RIGHTS_READ_ACCESS |\ + LSA_POLICY_VIEW_AUDIT_INFORMATION |\ + LSA_POLICY_GET_PRIVATE_INFORMATION) + +#define LSA_POLICY_WRITE ( STD_RIGHT_READ_CONTROL_ACCESS |\ + LSA_POLICY_TRUST_ADMIN |\ + LSA_POLICY_CREATE_ACCOUNT |\ + LSA_POLICY_CREATE_SECRET |\ + LSA_POLICY_CREATE_PRIVILEGE |\ + LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS |\ + LSA_POLICY_SET_AUDIT_REQUIREMENTS |\ + LSA_POLICY_AUDIT_LOG_ADMIN |\ + LSA_POLICY_SERVER_ADMIN) + +#define LSA_POLICY_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS |\ + LSA_POLICY_VIEW_LOCAL_INFORMATION |\ + LSA_POLICY_LOOKUP_NAMES ) #endif /* _RPC_LSA_H */ diff --git a/source3/include/rpc_netlogon.h b/source3/include/rpc_netlogon.h index a82b977a5b..cd88ffef59 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -23,64 +23,6 @@ #ifndef _RPC_NETLOGON_H /* _RPC_NETLOGON_H */ #define _RPC_NETLOGON_H - -/* NETLOGON pipe */ -#define NET_SAMLOGON 0x02 -#define NET_SAMLOGOFF 0x03 -#define NET_REQCHAL 0x04 -#define NET_AUTH 0x05 -#define NET_SRVPWSET 0x06 -#define NET_SAM_DELTAS 0x07 -#define NET_GETDCNAME 0x0b -#define NET_LOGON_CTRL 0x0c -#define NET_GETANYDCNAME 0x0d -#define NET_AUTH2 0x0f -#define NET_LOGON_CTRL2 0x0e -#define NET_SAM_SYNC 0x10 -#define NET_TRUST_DOM_LIST 0x13 -#define NET_DSR_GETDCNAME 0x14 -#define NET_AUTH3 0x1a -#define NET_DSR_GETDCNAMEEX 0x1b -#define NET_DSR_GETSITENAME 0x1c -#define NET_DSR_GETDCNAMEEX2 0x22 -#define NET_SAMLOGON_EX 0x27 - -/* Secure Channel types. used in NetrServerAuthenticate negotiation */ -#define SEC_CHAN_WKSTA 2 -#define SEC_CHAN_DOMAIN 4 -#define SEC_CHAN_BDC 6 - -/* Returned delta types */ -#define SAM_DELTA_DOMAIN_INFO 0x01 -#define SAM_DELTA_GROUP_INFO 0x02 -#define SAM_DELTA_RENAME_GROUP 0x04 -#define SAM_DELTA_ACCOUNT_INFO 0x05 -#define SAM_DELTA_RENAME_USER 0x07 -#define SAM_DELTA_GROUP_MEM 0x08 -#define SAM_DELTA_ALIAS_INFO 0x09 -#define SAM_DELTA_RENAME_ALIAS 0x0b -#define SAM_DELTA_ALIAS_MEM 0x0c -#define SAM_DELTA_POLICY_INFO 0x0d -#define SAM_DELTA_TRUST_DOMS 0x0e -#define SAM_DELTA_PRIVS_INFO 0x10 /* DT_DELTA_ACCOUNTS */ -#define SAM_DELTA_SECRET_INFO 0x12 -#define SAM_DELTA_DELETE_GROUP 0x14 -#define SAM_DELTA_DELETE_USER 0x15 -#define SAM_DELTA_MODIFIED_COUNT 0x16 - -/* SAM database types */ -#define SAM_DATABASE_DOMAIN 0x00 /* Domain users and groups */ -#define SAM_DATABASE_BUILTIN 0x01 /* BUILTIN users and groups */ -#define SAM_DATABASE_PRIVS 0x02 /* Privileges */ - -/* flags use when sending a NETLOGON_CONTROL request */ - -#define NETLOGON_CONTROL_SYNC 0x2 -#define NETLOGON_CONTROL_REDISCOVER 0x5 -#define NETLOGON_CONTROL_TC_QUERY 0x6 -#define NETLOGON_CONTROL_TRANSPORT_NOTIFY 0x7 -#define NETLOGON_CONTROL_SET_DBFLAG 0xfffe - /* Some flag values reverse engineered from NLTEST.EXE */ /* used in the NETLOGON_CONTROL[2] reply */ @@ -89,30 +31,12 @@ #define NL_CTRL_REPL_IN_PROGRESS 0x0002 #define NL_CTRL_FULL_SYNC 0x0004 -#define LOGON_GUEST 0x00000001 -#define LOGON_NOENCRYPTION 0x00000002 -#define LOGON_CACHED_ACCOUNT 0x00000004 -#define LOGON_USED_LM_PASSWORD 0x00000008 -#define LOGON_EXTRA_SIDS 0x00000020 -#define LOGON_SUBAUTH_SESSION_KEY 0x00000040 -#define LOGON_SERVER_TRUST_ACCOUNT 0x00000080 -#define LOGON_NTLMV2_ENABLED 0x00000100 -#define LOGON_RESOURCE_GROUPS 0x00000200 -#define LOGON_PROFILE_PATH_RETURNED 0x00000400 -#define LOGON_GRACE_LOGON 0x01000000 #define LOGON_KRB5_FAIL_CLOCK_SKEW 0x02000000 -#define SE_GROUP_MANDATORY 0x00000001 -#define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002 -#define SE_GROUP_ENABLED 0x00000004 -#define SE_GROUP_OWNER 0x00000008 -#define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010 -#define SE_GROUP_LOGON_ID 0xC0000000 -#define SE_GROUP_RESOURCE 0x20000000 /* Domain Local Group */ - /* Flags for controlling the behaviour of a particular logon */ -/* sets LOGON_SERVER_TRUST_ACCOUNT user_flag */ +/* sets NETLOGON_SERVER_TRUST_ACCOUNT user_flag */ +#if 0 #define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x00000020 #define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x00000800 @@ -125,566 +49,11 @@ /* returns the profilepath in the driveletter and * sets LOGON_PROFILE_PATH_RETURNED user_flag */ #define MSV1_0_RETURN_PROFILE_PATH 0x00000200 - -#if 0 -/* I think this is correct - it's what gets parsed on the wire. JRA. */ -/* NET_USER_INFO_2 */ -typedef struct net_user_info_2 { - uint32 ptr_user_info; - - NTTIME logon_time; /* logon time */ - NTTIME logoff_time; /* logoff time */ - NTTIME kickoff_time; /* kickoff time */ - NTTIME pass_last_set_time; /* password last set time */ - NTTIME pass_can_change_time; /* password can change time */ - NTTIME pass_must_change_time; /* password must change time */ - - UNIHDR hdr_user_name; /* username unicode string header */ - UNIHDR hdr_full_name; /* user's full name unicode string header */ - UNIHDR hdr_logon_script; /* logon script unicode string header */ - UNIHDR hdr_profile_path; /* profile path unicode string header */ - UNIHDR hdr_home_dir; /* home directory unicode string header */ - UNIHDR hdr_dir_drive; /* home directory drive unicode string header */ - - uint16 logon_count; /* logon count */ - uint16 bad_pw_count; /* bad password count */ - - uint32 user_id; /* User ID */ - uint32 group_id; /* Group ID */ - uint32 num_groups; /* num groups */ - uint32 buffer_groups; /* undocumented buffer pointer to groups. */ - uint32 user_flgs; /* user flags */ - - uint8 user_sess_key[16]; /* unused user session key */ - - UNIHDR hdr_logon_srv; /* logon server unicode string header */ - UNIHDR hdr_logon_dom; /* logon domain unicode string header */ - - uint32 buffer_dom_id; /* undocumented logon domain id pointer */ - uint8 padding[40]; /* unused padding bytes. expansion room */ - - UNISTR2 uni_user_name; /* username unicode string */ - UNISTR2 uni_full_name; /* user's full name unicode string */ - UNISTR2 uni_logon_script; /* logon script unicode string */ - UNISTR2 uni_profile_path; /* profile path unicode string */ - UNISTR2 uni_home_dir; /* home directory unicode string */ - UNISTR2 uni_dir_drive; /* home directory drive unicode string */ - - uint32 num_groups2; /* num groups */ - DOM_GID *gids; /* group info */ - - UNISTR2 uni_logon_srv; /* logon server unicode string */ - UNISTR2 uni_logon_dom; /* logon domain unicode string */ - - DOM_SID2 dom_sid; /* domain SID */ - - uint32 num_other_groups; /* other groups */ - DOM_GID *other_gids; /* group info */ - DOM_SID2 *other_sids; /* undocumented - domain SIDs */ - -} NET_USER_INFO_2; #endif -/* NET_USER_INFO_2 */ -typedef struct net_user_info_2 { - uint32 ptr_user_info; - - NTTIME logon_time; /* logon time */ - NTTIME logoff_time; /* logoff time */ - NTTIME kickoff_time; /* kickoff time */ - NTTIME pass_last_set_time; /* password last set time */ - NTTIME pass_can_change_time; /* password can change time */ - NTTIME pass_must_change_time; /* password must change time */ - - UNIHDR hdr_user_name; /* username unicode string header */ - UNIHDR hdr_full_name; /* user's full name unicode string header */ - UNIHDR hdr_logon_script; /* logon script unicode string header */ - UNIHDR hdr_profile_path; /* profile path unicode string header */ - UNIHDR hdr_home_dir; /* home directory unicode string header */ - UNIHDR hdr_dir_drive; /* home directory drive unicode string header */ - - uint16 logon_count; /* logon count */ - uint16 bad_pw_count; /* bad password count */ - - uint32 user_rid; /* User RID */ - uint32 group_rid; /* Group RID */ - - uint32 num_groups; /* num groups */ - uint32 buffer_groups; /* undocumented buffer pointer to groups. */ - uint32 user_flgs; /* user flags */ - - uint8 user_sess_key[16]; /* user session key */ - - UNIHDR hdr_logon_srv; /* logon server unicode string header */ - UNIHDR hdr_logon_dom; /* logon domain unicode string header */ - - uint32 buffer_dom_id; /* undocumented logon domain id pointer */ - uint8 lm_sess_key[8]; /* lm session key */ - uint32 acct_flags; /* account flags */ - uint32 unknown[7]; /* unknown */ - - UNISTR2 uni_user_name; /* username unicode string */ - UNISTR2 uni_full_name; /* user's full name unicode string */ - UNISTR2 uni_logon_script; /* logon script unicode string */ - UNISTR2 uni_profile_path; /* profile path unicode string */ - UNISTR2 uni_home_dir; /* home directory unicode string */ - UNISTR2 uni_dir_drive; /* home directory drive unicode string */ - - UNISTR2 uni_logon_srv; /* logon server unicode string */ - UNISTR2 uni_logon_dom; /* logon domain unicode string */ - - DOM_SID2 dom_sid; /* domain SID */ -} NET_USER_INFO_2; - -/* NET_USER_INFO_3 */ -typedef struct net_user_info_3 { - uint32 ptr_user_info; - - NTTIME logon_time; /* logon time */ - NTTIME logoff_time; /* logoff time */ - NTTIME kickoff_time; /* kickoff time */ - NTTIME pass_last_set_time; /* password last set time */ - NTTIME pass_can_change_time; /* password can change time */ - NTTIME pass_must_change_time; /* password must change time */ - - UNIHDR hdr_user_name; /* username unicode string header */ - UNIHDR hdr_full_name; /* user's full name unicode string header */ - UNIHDR hdr_logon_script; /* logon script unicode string header */ - UNIHDR hdr_profile_path; /* profile path unicode string header */ - UNIHDR hdr_home_dir; /* home directory unicode string header */ - UNIHDR hdr_dir_drive; /* home directory drive unicode string header */ - - uint16 logon_count; /* logon count */ - uint16 bad_pw_count; /* bad password count */ - - uint32 user_rid; /* User RID */ - uint32 group_rid; /* Group RID */ - - uint32 num_groups; /* num groups */ - uint32 buffer_groups; /* undocumented buffer pointer to groups. */ - uint32 user_flgs; /* user flags */ - - uint8 user_sess_key[16]; /* user session key */ - - UNIHDR hdr_logon_srv; /* logon server unicode string header */ - UNIHDR hdr_logon_dom; /* logon domain unicode string header */ - - uint32 buffer_dom_id; /* undocumented logon domain id pointer */ - uint8 lm_sess_key[8]; /* lm session key */ - uint32 acct_flags; /* account flags */ - uint32 unknown[7]; /* unknown */ - - uint32 num_other_sids; /* number of foreign/trusted domain sids */ - uint32 buffer_other_sids; - - /* The next three uint32 are not really part of user_info_3 but here - * for parsing convenience. They are only valid in Kerberos PAC - * parsing - Guenther */ - uint32 ptr_res_group_dom_sid; - uint32 res_group_count; - uint32 ptr_res_groups; - - UNISTR2 uni_user_name; /* username unicode string */ - UNISTR2 uni_full_name; /* user's full name unicode string */ - UNISTR2 uni_logon_script; /* logon script unicode string */ - UNISTR2 uni_profile_path; /* profile path unicode string */ - UNISTR2 uni_home_dir; /* home directory unicode string */ - UNISTR2 uni_dir_drive; /* home directory drive unicode string */ - - uint32 num_groups2; /* num groups */ - DOM_GID *gids; /* group info */ - - UNISTR2 uni_logon_srv; /* logon server unicode string */ - UNISTR2 uni_logon_dom; /* logon domain unicode string */ - - DOM_SID2 dom_sid; /* domain SID */ - - DOM_SID2 *other_sids; /* foreign/trusted domain SIDs */ - uint32 *other_sids_attrib; -} NET_USER_INFO_3; - - -/* NETLOGON_INFO_1 - pdc status info, i presume */ -typedef struct netlogon_1_info { - uint32 flags; /* 0x0 - undocumented */ - uint32 pdc_status; /* 0x0 - undocumented */ -} NETLOGON_INFO_1; - -/* NETLOGON_INFO_2 - pdc status info, plus trusted domain info */ -typedef struct netlogon_2_info { - uint32 flags; /* 0x0 - undocumented */ - uint32 pdc_status; /* 0x0 - undocumented */ - uint32 ptr_trusted_dc_name; /* pointer to trusted domain controller name */ - uint32 tc_status; - UNISTR2 uni_trusted_dc_name; /* unicode string - trusted dc name */ -} NETLOGON_INFO_2; - -/* NETLOGON_INFO_3 - logon status info, i presume */ -typedef struct netlogon_3_info { - uint32 flags; /* 0x0 - undocumented */ - uint32 logon_attempts; /* number of logon attempts */ - uint32 reserved_1; /* 0x0 - undocumented */ - uint32 reserved_2; /* 0x0 - undocumented */ - uint32 reserved_3; /* 0x0 - undocumented */ - uint32 reserved_4; /* 0x0 - undocumented */ - uint32 reserved_5; /* 0x0 - undocumented */ -} NETLOGON_INFO_3; - -/******************************************************** - Logon Control Query - - This is generated by a nltest /bdc_query:DOMAIN - - query_level 0x1, function_code 0x1 - - ********************************************************/ - -/* NET_Q_LOGON_CTRL - LSA Netr Logon Control */ - -typedef struct net_q_logon_ctrl_info { - uint32 ptr; - UNISTR2 uni_server_name; - uint32 function_code; - uint32 query_level; -} NET_Q_LOGON_CTRL; - -/* NET_R_LOGON_CTRL - LSA Netr Logon Control */ - -typedef struct net_r_logon_ctrl_info { - uint32 switch_value; - uint32 ptr; - - union { - NETLOGON_INFO_1 info1; - } logon; - - NTSTATUS status; -} NET_R_LOGON_CTRL; - - -typedef struct ctrl_data_info_5 { - uint32 function_code; - - uint32 ptr_domain; - UNISTR2 domain; -} CTRL_DATA_INFO_5; - -typedef struct ctrl_data_info_6 { - uint32 function_code; - - uint32 ptr_domain; - UNISTR2 domain; -} CTRL_DATA_INFO_6; - - -/******************************************************** - Logon Control2 Query - - query_level 0x1 - pdc status - query_level 0x3 - number of logon attempts. - - ********************************************************/ - -/* NET_Q_LOGON_CTRL2 - LSA Netr Logon Control 2 */ -typedef struct net_q_logon_ctrl2_info { - uint32 ptr; /* undocumented buffer pointer */ - UNISTR2 uni_server_name; /* server name, starting with two '\'s */ - - uint32 function_code; - uint32 query_level; - union { - CTRL_DATA_INFO_5 info5; - CTRL_DATA_INFO_6 info6; - } info; -} NET_Q_LOGON_CTRL2; - -/******************************************************* - Logon Control Response - - switch_value is same as query_level in request - *******************************************************/ - -/* NET_R_LOGON_CTRL2 - response to LSA Logon Control2 */ -typedef struct net_r_logon_ctrl2_info { - uint32 switch_value; /* 0x1, 0x3 */ - uint32 ptr; - - union - { - NETLOGON_INFO_1 info1; - NETLOGON_INFO_2 info2; - NETLOGON_INFO_3 info3; - - } logon; - - NTSTATUS status; /* return code */ -} NET_R_LOGON_CTRL2; - -/* NET_Q_GETANYDCNAME - Ask a DC for a trusted DC name */ - -typedef struct net_q_getanydcname { - uint32 ptr_logon_server; - UNISTR2 uni_logon_server; - uint32 ptr_domainname; - UNISTR2 uni_domainname; -} NET_Q_GETANYDCNAME; - -/* NET_R_GETANYDCNAME - Ask a DC for a trusted DC name */ - -typedef struct net_r_getanydcname { - uint32 ptr_dcname; - UNISTR2 uni_dcname; - WERROR status; -} NET_R_GETANYDCNAME; - - -/* NET_Q_GETDCNAME - Ask a DC for a trusted DC name */ - -typedef struct net_q_getdcname { - UNISTR2 uni_logon_server; - uint32 ptr_domainname; - UNISTR2 uni_domainname; -} NET_Q_GETDCNAME; - -/* NET_R_GETDCNAME - Ask a DC for a trusted DC name */ - -typedef struct net_r_getdcname { - uint32 ptr_dcname; - UNISTR2 uni_dcname; - WERROR status; -} NET_R_GETDCNAME; - -/* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */ -typedef struct net_q_trust_dom_info { - uint32 ptr; /* undocumented buffer pointer */ - UNISTR2 uni_server_name; /* server name, starting with two '\'s */ -} NET_Q_TRUST_DOM_LIST; - -#define MAX_TRUST_DOMS 1 - -/* NET_R_TRUST_DOM_LIST - response to LSA Trusted Domains */ -typedef struct net_r_trust_dom_info { - UNISTR2 uni_trust_dom_name[MAX_TRUST_DOMS]; - - NTSTATUS status; /* return code */ -} NET_R_TRUST_DOM_LIST; - - -/* NEG_FLAGS */ -typedef struct neg_flags_info { - uint32 neg_flags; /* negotiated flags */ -} NEG_FLAGS; - - -/* NET_Q_REQ_CHAL */ -typedef struct net_q_req_chal_info { - uint32 undoc_buffer; /* undocumented buffer pointer */ - UNISTR2 uni_logon_srv; /* logon server unicode string */ - UNISTR2 uni_logon_clnt; /* logon client unicode string */ - DOM_CHAL clnt_chal; /* client challenge */ -} NET_Q_REQ_CHAL; - - -/* NET_R_REQ_CHAL */ -typedef struct net_r_req_chal_info { - DOM_CHAL srv_chal; /* server challenge */ - NTSTATUS status; /* return code */ -} NET_R_REQ_CHAL; - -/* NET_Q_AUTH */ -typedef struct net_q_auth_info { - DOM_LOG_INFO clnt_id; /* client identification info */ - DOM_CHAL clnt_chal; /* client-calculated credentials */ -} NET_Q_AUTH; - -/* NET_R_AUTH */ -typedef struct net_r_auth_info { - DOM_CHAL srv_chal; /* server-calculated credentials */ - NTSTATUS status; /* return code */ -} NET_R_AUTH; - -/* NET_Q_AUTH_2 */ -typedef struct net_q_auth2_info { - DOM_LOG_INFO clnt_id; /* client identification info */ - DOM_CHAL clnt_chal; /* client-calculated credentials */ - - NEG_FLAGS clnt_flgs; /* usually 0x0000 01ff */ -} NET_Q_AUTH_2; - - -/* NET_R_AUTH_2 */ -typedef struct net_r_auth2_info { - DOM_CHAL srv_chal; /* server-calculated credentials */ - NEG_FLAGS srv_flgs; /* usually 0x0000 01ff */ - NTSTATUS status; /* return code */ -} NET_R_AUTH_2; - -/* NET_Q_AUTH_3 */ -typedef struct net_q_auth3_info { - DOM_LOG_INFO clnt_id; /* client identification info */ - DOM_CHAL clnt_chal; /* client-calculated credentials */ - NEG_FLAGS clnt_flgs; /* usually 0x6007 ffff */ -} NET_Q_AUTH_3; - -/* NET_R_AUTH_3 */ -typedef struct net_r_auth3_info { - DOM_CHAL srv_chal; /* server-calculated credentials */ - NEG_FLAGS srv_flgs; /* usually 0x6007 ffff */ - uint32 unknown; /* 0x0000045b */ - NTSTATUS status; /* return code */ -} NET_R_AUTH_3; - - -/* NET_Q_SRV_PWSET */ -typedef struct net_q_srv_pwset_info { - DOM_CLNT_INFO clnt_id; /* client identification/authentication info */ - uint8 pwd[16]; /* new password - undocumented. */ -} NET_Q_SRV_PWSET; - -/* NET_R_SRV_PWSET */ -typedef struct net_r_srv_pwset_info { - DOM_CRED srv_cred; /* server-calculated credentials */ - - NTSTATUS status; /* return code */ -} NET_R_SRV_PWSET; - -/* NET_ID_INFO_2 */ -typedef struct net_network_info_2 { - uint32 ptr_id_info2; /* pointer to id_info_2 */ - UNIHDR hdr_domain_name; /* domain name unicode header */ - uint32 param_ctrl; /* param control (0x2) */ - DOM_LOGON_ID logon_id; /* logon ID */ - UNIHDR hdr_user_name; /* user name unicode header */ - UNIHDR hdr_wksta_name; /* workstation name unicode header */ - uint8 lm_chal[8]; /* lan manager 8 byte challenge */ - STRHDR hdr_nt_chal_resp; /* nt challenge response */ - STRHDR hdr_lm_chal_resp; /* lm challenge response */ - - UNISTR2 uni_domain_name; /* domain name unicode string */ - UNISTR2 uni_user_name; /* user name unicode string */ - UNISTR2 uni_wksta_name; /* workgroup name unicode string */ - STRING2 nt_chal_resp; /* nt challenge response */ - STRING2 lm_chal_resp; /* lm challenge response */ -} NET_ID_INFO_2; - -/* NET_ID_INFO_1 */ -typedef struct id_info_1 { - uint32 ptr_id_info1; /* pointer to id_info_1 */ - UNIHDR hdr_domain_name; /* domain name unicode header */ - uint32 param_ctrl; /* param control */ - DOM_LOGON_ID logon_id; /* logon ID */ - UNIHDR hdr_user_name; /* user name unicode header */ - UNIHDR hdr_wksta_name; /* workstation name unicode header */ - OWF_INFO lm_owf; /* LM OWF Password */ - OWF_INFO nt_owf; /* NT OWF Password */ - UNISTR2 uni_domain_name; /* domain name unicode string */ - UNISTR2 uni_user_name; /* user name unicode string */ - UNISTR2 uni_wksta_name; /* workgroup name unicode string */ -} NET_ID_INFO_1; - #define INTERACTIVE_LOGON_TYPE 1 #define NET_LOGON_TYPE 2 -/* NET_ID_INFO_CTR */ -typedef struct net_id_info_ctr_info { - uint16 switch_value; - - union { - NET_ID_INFO_1 id1; /* auth-level 1 - interactive user login */ - NET_ID_INFO_2 id2; /* auth-level 2 - workstation referred login */ - } auth; -} NET_ID_INFO_CTR; - -/* SAM_INFO - sam logon/off id structure */ -typedef struct sam_info { - DOM_CLNT_INFO2 client; - uint32 ptr_rtn_cred; /* pointer to return credentials */ - DOM_CRED rtn_cred; /* return credentials */ - uint16 logon_level; - NET_ID_INFO_CTR *ctr; -} DOM_SAM_INFO; - -/* SAM_INFO - sam logon/off id structure - no creds */ -typedef struct sam_info_ex { - DOM_CLNT_SRV client; - uint16 logon_level; - NET_ID_INFO_CTR *ctr; -} DOM_SAM_INFO_EX; - -/* NET_Q_SAM_LOGON */ -typedef struct net_q_sam_logon_info { - DOM_SAM_INFO sam_id; - uint16 validation_level; -} NET_Q_SAM_LOGON; - -/* NET_Q_SAM_LOGON_EX */ -typedef struct net_q_sam_logon_info_ex { - DOM_SAM_INFO_EX sam_id; - uint16 validation_level; - uint32 flags; -} NET_Q_SAM_LOGON_EX; - -/* NET_R_SAM_LOGON */ -typedef struct net_r_sam_logon_info { - uint32 buffer_creds; /* undocumented buffer pointer */ - DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */ - - uint16 switch_value; /* 3 - indicates type of USER INFO */ - NET_USER_INFO_3 *user; - - uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */ - - NTSTATUS status; /* return code */ -} NET_R_SAM_LOGON; - -/* NET_R_SAM_LOGON_EX */ -typedef struct net_r_sam_logon_info_ex { - uint16 switch_value; /* 3 - indicates type of USER INFO */ - NET_USER_INFO_3 *user; - - uint32 auth_resp; /* 1 - Authoritative response; 0 - Non-Auth? */ - uint32 flags; - - NTSTATUS status; /* return code */ -} NET_R_SAM_LOGON_EX; - - -/* NET_Q_SAM_LOGOFF */ -typedef struct net_q_sam_logoff_info { - DOM_SAM_INFO sam_id; -} NET_Q_SAM_LOGOFF; - -/* NET_R_SAM_LOGOFF */ -typedef struct net_r_sam_logoff_info { - uint32 buffer_creds; /* undocumented buffer pointer */ - DOM_CRED srv_creds; /* server credentials. server time stamp appears to be ignored. */ - NTSTATUS status; /* return code */ -} NET_R_SAM_LOGOFF; - -/* NET_Q_SAM_SYNC */ -typedef struct net_q_sam_sync_info { - UNISTR2 uni_srv_name; /* \\PDC */ - UNISTR2 uni_cli_name; /* BDC */ - DOM_CRED cli_creds; - DOM_CRED ret_creds; - - uint32 database_id; - uint32 restart_state; - uint32 sync_context; - - uint32 max_size; /* preferred maximum length */ -} NET_Q_SAM_SYNC; - -/* SAM_DELTA_HDR */ -typedef struct sam_delta_hdr_info { - uint16 type; /* type of structure attached */ - uint16 type2; - uint32 target_rid; - - uint32 type3; - uint32 ptr_delta; -} SAM_DELTA_HDR; - /* LOCKOUT_STRING */ typedef struct account_lockout_string { uint32 array_size; @@ -704,381 +73,6 @@ typedef struct hdr_account_lockout_string { uint32 buffer; } HDR_LOCKOUT_STRING; -/* SAM_DOMAIN_INFO (0x1) */ -typedef struct sam_domain_info_info { - UNIHDR hdr_dom_name; - UNIHDR hdr_oem_info; - - uint64 force_logoff; - uint16 min_pwd_len; - uint16 pwd_history_len; - uint64 max_pwd_age; - uint64 min_pwd_age; - uint64 dom_mod_count; - NTTIME creation_time; - uint32 security_information; - - BUFHDR4 hdr_sec_desc; /* security descriptor */ - - HDR_LOCKOUT_STRING hdr_account_lockout; - - UNIHDR hdr_unknown2; - UNIHDR hdr_unknown3; - UNIHDR hdr_unknown4; - - UNISTR2 uni_dom_name; - UNISTR2 buf_oem_info; - - RPC_DATA_BLOB buf_sec_desc; - - LOCKOUT_STRING account_lockout; - - UNISTR2 buf_unknown2; - UNISTR2 buf_unknown3; - UNISTR2 buf_unknown4; - - uint32 logon_chgpass; - uint32 unknown6; - uint32 unknown7; - uint32 unknown8; -} SAM_DOMAIN_INFO; - -/* SAM_GROUP_INFO (0x2) */ -typedef struct sam_group_info_info { - UNIHDR hdr_grp_name; - DOM_GID gid; - UNIHDR hdr_grp_desc; - BUFHDR2 hdr_sec_desc; /* security descriptor */ - uint8 reserved[48]; - - UNISTR2 uni_grp_name; - UNISTR2 uni_grp_desc; - RPC_DATA_BLOB buf_sec_desc; -} SAM_GROUP_INFO; - -/* SAM_PWD */ -typedef struct sam_passwd_info { - /* this structure probably contains password history */ - /* this is probably a count of lm/nt pairs */ - uint32 unk_0; /* 0x0000 0002 */ - - UNIHDR hdr_lm_pwd; - uint8 buf_lm_pwd[16]; - - UNIHDR hdr_nt_pwd; - uint8 buf_nt_pwd[16]; - - UNIHDR hdr_empty_lm; - UNIHDR hdr_empty_nt; -} SAM_PWD; - -/* SAM_ACCOUNT_INFO (0x5) */ -typedef struct sam_account_info_info { - UNIHDR hdr_acct_name; - UNIHDR hdr_full_name; - - uint32 user_rid; - uint32 group_rid; - - UNIHDR hdr_home_dir; - UNIHDR hdr_dir_drive; - UNIHDR hdr_logon_script; - UNIHDR hdr_acct_desc; - UNIHDR hdr_workstations; - - NTTIME logon_time; - NTTIME logoff_time; - - uint32 logon_divs; /* 0xA8 */ - uint32 ptr_logon_hrs; - - uint16 bad_pwd_count; - uint16 logon_count; - NTTIME pwd_last_set_time; - NTTIME acct_expiry_time; - - uint32 acb_info; - uint8 nt_pwd[16]; - uint8 lm_pwd[16]; - uint8 nt_pwd_present; - uint8 lm_pwd_present; - uint8 pwd_expired; - - UNIHDR hdr_comment; - UNIHDR hdr_parameters; - uint16 country; - uint16 codepage; - - BUFHDR2 hdr_sec_desc; /* security descriptor */ - - UNIHDR hdr_profile; - UNIHDR hdr_reserved[3]; /* space for more strings */ - uint32 dw_reserved[4]; /* space for more data - first two seem to - be an NTTIME */ - - UNISTR2 uni_acct_name; - UNISTR2 uni_full_name; - UNISTR2 uni_home_dir; - UNISTR2 uni_dir_drive; - UNISTR2 uni_logon_script; - UNISTR2 uni_acct_desc; - UNISTR2 uni_workstations; - - uint32 unknown1; /* 0x4EC */ - uint32 unknown2; /* 0 */ - - RPC_DATA_BLOB buf_logon_hrs; - UNISTR2 uni_comment; - UNISTR2 uni_parameters; - SAM_PWD pass; - RPC_DATA_BLOB buf_sec_desc; - UNISTR2 uni_profile; -} SAM_ACCOUNT_INFO; - -/* SAM_GROUP_MEM_INFO (0x8) */ -typedef struct sam_group_mem_info_info { - uint32 ptr_rids; - uint32 ptr_attribs; - uint32 num_members; - uint8 unknown[16]; - - uint32 num_members2; - uint32 *rids; - - uint32 num_members3; - uint32 *attribs; - -} SAM_GROUP_MEM_INFO; - -/* SAM_ALIAS_INFO (0x9) */ -typedef struct sam_alias_info_info { - UNIHDR hdr_als_name; - uint32 als_rid; - BUFHDR2 hdr_sec_desc; /* security descriptor */ - UNIHDR hdr_als_desc; - uint8 reserved[40]; - - UNISTR2 uni_als_name; - RPC_DATA_BLOB buf_sec_desc; - UNISTR2 uni_als_desc; -} SAM_ALIAS_INFO; - -/* SAM_ALIAS_MEM_INFO (0xC) */ -typedef struct sam_alias_mem_info_info { - uint32 num_members; - uint32 ptr_members; - uint8 unknown[16]; - - uint32 num_sids; - uint32 *ptr_sids; - DOM_SID2 *sids; -} SAM_ALIAS_MEM_INFO; - - -/* SAM_DELTA_POLICY (0x0D) */ -typedef struct { - uint32 max_log_size; /* 0x5000 */ - uint64 audit_retention_period; /* 0 */ - uint32 auditing_mode; /* 0 */ - uint32 num_events; - uint32 ptr_events; - UNIHDR hdr_dom_name; - uint32 sid_ptr; - - uint32 paged_pool_limit; /* 0x02000000 */ - uint32 non_paged_pool_limit; /* 0x00100000 */ - uint32 min_workset_size; /* 0x00010000 */ - uint32 max_workset_size; /* 0x0f000000 */ - uint32 page_file_limit; /* 0 */ - uint64 time_limit; /* 0 */ - NTTIME modify_time; /* 0x3c*/ - NTTIME create_time; /* a7080110 */ - BUFHDR2 hdr_sec_desc; - - uint32 num_event_audit_options; - uint32 event_audit_option; - - UNISTR2 domain_name; - DOM_SID2 domain_sid; - - RPC_DATA_BLOB buf_sec_desc; -} SAM_DELTA_POLICY; - -/* SAM_DELTA_TRUST_DOMS */ -typedef struct { - uint32 buf_size; - SEC_DESC *sec_desc; - DOM_SID2 sid; - UNIHDR hdr_domain; - - uint32 unknown0; - uint32 unknown1; - uint32 unknown2; - - uint32 buf_size2; - uint32 ptr; - - uint32 unknown3; - UNISTR2 domain; -} SAM_DELTA_TRUSTDOMS; - -/* SAM_DELTA_PRIVS (0x10) */ -typedef struct { - DOM_SID2 sid; - - uint32 priv_count; - uint32 priv_control; - - uint32 priv_attr_ptr; - uint32 priv_name_ptr; - - uint32 paged_pool_limit; /* 0x02000000 */ - uint32 non_paged_pool_limit; /* 0x00100000 */ - uint32 min_workset_size; /* 0x00010000 */ - uint32 max_workset_size; /* 0x0f000000 */ - uint32 page_file_limit; /* 0 */ - uint64 time_limit; /* 0 */ - uint32 system_flags; /* 1 */ - BUFHDR2 hdr_sec_desc; - - uint32 buf_size2; - - uint32 attribute_count; - uint32 *attributes; - - uint32 privlist_count; - UNIHDR *hdr_privslist; - UNISTR2 *uni_privslist; - - RPC_DATA_BLOB buf_sec_desc; -} SAM_DELTA_PRIVS; - -/* SAM_DELTA_SECRET */ -typedef struct { - uint32 buf_size; - SEC_DESC *sec_desc; - UNISTR2 secret; - - uint32 count1; - uint32 count2; - uint32 ptr; - NTTIME time1; - uint32 count3; - uint32 count4; - uint32 ptr2; - NTTIME time2; - uint32 unknow1; - - uint32 buf_size2; - uint32 ptr3; - uint32 unknow2; /* 0x0 12 times */ - - uint32 chal_len; - uint32 reserved1; /* 0 */ - uint32 chal_len2; - uint8 chal[16]; - - uint32 key_len; - uint32 reserved2; /* 0 */ - uint32 key_len2; - uint8 key[8]; - - uint32 buf_size3; - SEC_DESC *sec_desc2; -} SAM_DELTA_SECRET; - -/* SAM_DELTA_MOD_COUNT (0x16) */ -typedef struct { - uint32 seqnum; - uint32 dom_mod_count_ptr; - uint64 dom_mod_count; /* domain mod count at last sync */ -} SAM_DELTA_MOD_COUNT; - -typedef union sam_delta_ctr_info { - SAM_DOMAIN_INFO domain_info ; - SAM_GROUP_INFO group_info ; - SAM_ACCOUNT_INFO account_info; - SAM_GROUP_MEM_INFO grp_mem_info; - SAM_ALIAS_INFO alias_info ; - SAM_ALIAS_MEM_INFO als_mem_info; - SAM_DELTA_POLICY policy_info; - SAM_DELTA_PRIVS privs_info; - SAM_DELTA_MOD_COUNT mod_count; - SAM_DELTA_TRUSTDOMS trustdoms_info; - SAM_DELTA_SECRET secret_info; -} SAM_DELTA_CTR; - -/* NET_R_SAM_SYNC */ -typedef struct net_r_sam_sync_info { - DOM_CRED srv_creds; - - uint32 sync_context; - - uint32 ptr_deltas; - uint32 num_deltas; - uint32 ptr_deltas2; - uint32 num_deltas2; - - SAM_DELTA_HDR *hdr_deltas; - SAM_DELTA_CTR *deltas; - - NTSTATUS status; -} NET_R_SAM_SYNC; - -/* NET_Q_SAM_DELTAS */ -typedef struct net_q_sam_deltas_info { - UNISTR2 uni_srv_name; - UNISTR2 uni_cli_name; - DOM_CRED cli_creds; - DOM_CRED ret_creds; - - uint32 database_id; - uint64 dom_mod_count; /* domain mod count at last sync */ - - uint32 max_size; /* preferred maximum length */ -} NET_Q_SAM_DELTAS; - -/* NET_R_SAM_DELTAS */ -typedef struct net_r_sam_deltas_info { - DOM_CRED srv_creds; - - uint64 dom_mod_count; /* new domain mod count */ - - uint32 ptr_deltas; - uint32 num_deltas; - uint32 num_deltas2; - - SAM_DELTA_HDR *hdr_deltas; - SAM_DELTA_CTR *deltas; - - NTSTATUS status; -} NET_R_SAM_DELTAS; - -#define DS_FORCE_REDISCOVERY 0x00000001 -#define DS_DIRECTORY_SERVICE_REQUIRED 0x00000010 -#define DS_DIRECTORY_SERVICE_PREFERRED 0x00000020 -#define DS_GC_SERVER_REQUIRED 0x00000040 -#define DS_PDC_REQUIRED 0x00000080 -#define DS_BACKGROUND_ONLY 0x00000100 -#define DS_IP_REQUIRED 0x00000200 -#define DS_KDC_REQUIRED 0x00000400 -#define DS_TIMESERV_REQUIRED 0x00000800 -#define DS_WRITABLE_REQUIRED 0x00001000 -#define DS_GOOD_TIMESERV_PREFERRED 0x00002000 -#define DS_AVOID_SELF 0x00004000 -#define DS_ONLY_LDAP_NEEDED 0x00008000 - -#define DS_IS_FLAT_NAME 0x00010000 -#define DS_IS_DNS_NAME 0x00020000 - -#define DS_RETURN_DNS_NAME 0x40000000 -#define DS_RETURN_FLAT_NAME 0x80000000 - -#if 0 /* unknown yet */ -#define DS_IP_VERSION_AGNOSTIC -#define DS_TRY_NEXTCLOSEST_SITE -#endif - #define DSGETDC_VALID_FLAGS ( \ DS_FORCE_REDISCOVERY | \ DS_DIRECTORY_SERVICE_REQUIRED | \ @@ -1110,86 +104,4 @@ struct DS_DOMAIN_CONTROLLER_INFO { const char *client_site_name; }; -/* NET_Q_DSR_GETDCNAME */ -typedef struct net_q_dsr_getdcname { - uint32 ptr_server_unc; - UNISTR2 uni_server_unc; - uint32 ptr_domain_name; - UNISTR2 uni_domain_name; - uint32 ptr_domain_guid; - struct GUID *domain_guid; - uint32 ptr_site_guid; - struct GUID *site_guid; - uint32 flags; -} NET_Q_DSR_GETDCNAME; - -/* NET_R_DSR_GETDCNAME */ -typedef struct net_r_dsr_getdcname { - uint32 ptr_dc_unc; - UNISTR2 uni_dc_unc; - uint32 ptr_dc_address; - UNISTR2 uni_dc_address; - int32 dc_address_type; - struct GUID domain_guid; - uint32 ptr_domain_name; - UNISTR2 uni_domain_name; - uint32 ptr_forest_name; - UNISTR2 uni_forest_name; - uint32 dc_flags; - uint32 ptr_dc_site_name; - UNISTR2 uni_dc_site_name; - uint32 ptr_client_site_name; - UNISTR2 uni_client_site_name; - WERROR result; -} NET_R_DSR_GETDCNAME; - -/* NET_Q_DSR_GETDCNAMEEX */ -typedef struct net_q_dsr_getdcnameex { - uint32 ptr_server_unc; - UNISTR2 uni_server_unc; - uint32 ptr_domain_name; - UNISTR2 uni_domain_name; - uint32 ptr_domain_guid; - struct GUID *domain_guid; - uint32 ptr_site_name; - UNISTR2 uni_site_name; - uint32 flags; -} NET_Q_DSR_GETDCNAMEEX; - -/* NET_R_DSR_GETDCNAMEEX */ -typedef struct net_r_dsr_getdcnameex NET_R_DSR_GETDCNAMEEX; - -/* NET_Q_DSR_GETDCNAMEEX2 */ -typedef struct net_q_dsr_getdcnameex2 { - uint32 ptr_server_unc; - UNISTR2 uni_server_unc; - uint32 ptr_client_account; - UNISTR2 uni_client_account; - uint32 mask; - uint32 ptr_domain_name; - UNISTR2 uni_domain_name; - uint32 ptr_domain_guid; - struct GUID *domain_guid; - uint32 ptr_site_name; - UNISTR2 uni_site_name; - uint32 flags; -} NET_Q_DSR_GETDCNAMEEX2; - -/* NET_R_DSR_GETDCNAMEEX2 */ -typedef struct net_r_dsr_getdcnameex2 NET_R_DSR_GETDCNAMEEX2; - -/* NET_Q_DSR_GESITENAME */ -typedef struct net_q_dsr_getsitename { - uint32 ptr_computer_name; - UNISTR2 uni_computer_name; -} NET_Q_DSR_GETSITENAME; - -/* NET_R_DSR_GETSITENAME */ -typedef struct net_r_dsr_getsitename { - uint32 ptr_site_name; - UNISTR2 uni_site_name; - WERROR result; -} NET_R_DSR_GETSITENAME; - - #endif /* _RPC_NETLOGON_H */ diff --git a/source3/include/rpc_ntsvcs.h b/source3/include/rpc_ntsvcs.h index 045d9b4e92..71274cc380 100644 --- a/source3/include/rpc_ntsvcs.h +++ b/source3/include/rpc_ntsvcs.h @@ -36,32 +36,6 @@ /**************************/ typedef struct { - /* nothing in the request */ - uint32 dummy; -} NTSVCS_Q_GET_VERSION; - -typedef struct { - uint32 version; - WERROR status; -} NTSVCS_R_GET_VERSION; - - -/**************************/ - -typedef struct { - UNISTR2 *devicename; - uint32 flags; -} NTSVCS_Q_GET_DEVICE_LIST_SIZE; - -typedef struct { - uint32 size; - WERROR status; -} NTSVCS_R_GET_DEVICE_LIST_SIZE; - - -/**************************/ - -typedef struct { UNISTR2 *devicename; uint32 buffer_size; uint32 flags; @@ -75,17 +49,6 @@ typedef struct { /**************************/ -typedef struct { - UNISTR2 devicepath; - uint32 flags; -} NTSVCS_Q_VALIDATE_DEVICE_INSTANCE; - -typedef struct { - WERROR status; -} NTSVCS_R_VALIDATE_DEVICE_INSTANCE; - -/**************************/ - #define DEV_REGPROP_DESC 1 typedef struct { @@ -105,42 +68,4 @@ typedef struct { WERROR status; } NTSVCS_R_GET_DEVICE_REG_PROPERTY; - -/**************************/ - -typedef struct { - uint32 index; - uint8 *buffer; - uint32 buffer_size; - uint32 unknown1; -} NTSVCS_Q_GET_HW_PROFILE_INFO; - -typedef struct { - uint32 buffer_size; /* the size (not included in the reply) - if just matched from the request */ - uint8 *buffer; - WERROR status; -} NTSVCS_R_GET_HW_PROFILE_INFO; - - -/**************************/ - -typedef struct { - uint32 unknown1; - UNISTR2 devicepath; - uint32 unknown2; - uint32 unknown3; - uint32 unknown4; - uint32 unknown5; - uint32 unknown6; - uint32 unknown7; -} NTSVCS_Q_HW_PROFILE_FLAGS; - -typedef struct { - uint32 unknown1; - uint32 unknown2; - uint32 unknown3; - WERROR status; -} NTSVCS_R_HW_PROFILE_FLAGS; - #endif /* _RPC_NTSVCS_H */ diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h deleted file mode 100644 index 2273fba2e6..0000000000 --- a/source3/include/rpc_samr.h +++ /dev/null @@ -1,2012 +0,0 @@ -/* - Unix SMB/CIFS implementation. - SMB parameters and setup - Copyright (C) Andrew Tridgell 1992-2000 - Copyright (C) Luke Kenneth Casson Leighton 1996-2000 - Copyright (C) Paul Ashton 1997-2000 - Copyright (C) Jean François Micouleau 1998-2001 - Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002 - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef _RPC_SAMR_H /* _RPC_SAMR_H */ -#define _RPC_SAMR_H - -/******************************************************************* - the following information comes from a QuickView on samsrv.dll, - and gives an idea of exactly what is needed: - -x SamrAddMemberToAlias -x SamrAddMemberToGroup -SamrAddMultipleMembersToAlias -x SamrChangePasswordUser -x SamrCloseHandle -x SamrConnect -x SamrCreateAliasInDomain -x SamrCreateGroupInDomain -x SamrCreateUserInDomain -? SamrDeleteAlias -SamrDeleteGroup -x SamrDeleteUser -x SamrEnumerateAliasesInDomain -SamrEnumerateDomainsInSamServer -x SamrEnumerateGroupsInDomain -x SamrEnumerateUsersInDomain -SamrGetUserDomainPasswordInformation -SamrLookupDomainInSamServer -? SamrLookupIdsInDomain -x SamrLookupNamesInDomain -x SamrOpenAlias -x SamrOpenDomain -x SamrOpenGroup -x SamrOpenUser -x SamrQueryDisplayInformation -x SamrQueryInformationAlias -SamrQueryInformationDomain -? SamrQueryInformationUser -x SamrQuerySecurityObject -SamrRemoveMemberFromAlias -SamrRemoveMemberFromForiegnDomain -SamrRemoveMemberFromGroup -SamrRemoveMultipleMembersFromAlias -x SamrSetInformationAlias -SamrSetInformationDomain -x SamrSetInformationGroup -x SamrSetInformationUser -SamrSetMemberAttributesOfGroup -SamrSetSecurityObject -SamrShutdownSamServer -SamrTestPrivateFunctionsDomain -SamrTestPrivateFunctionsUser - -********************************************************************/ - -#define SAMR_CONNECT_ANON 0x00 -#define SAMR_CLOSE_HND 0x01 -#define SAMR_SET_SEC_OBJECT 0x02 -#define SAMR_QUERY_SEC_OBJECT 0x03 - -#define SAMR_UNKNOWN_4 0x04 /* profile info? */ -#define SAMR_LOOKUP_DOMAIN 0x05 -#define SAMR_ENUM_DOMAINS 0x06 -#define SAMR_OPEN_DOMAIN 0x07 -#define SAMR_QUERY_DOMAIN_INFO 0x08 -#define SAMR_SET_DOMAIN_INFO 0x09 - -#define SAMR_CREATE_DOM_GROUP 0x0a -#define SAMR_ENUM_DOM_GROUPS 0x0b -#define SAMR_ENUM_DOM_USERS 0x0d -#define SAMR_CREATE_DOM_ALIAS 0x0e -#define SAMR_ENUM_DOM_ALIASES 0x0f -#define SAMR_QUERY_USERALIASES 0x10 - -#define SAMR_LOOKUP_NAMES 0x11 -#define SAMR_LOOKUP_RIDS 0x12 - -#define SAMR_OPEN_GROUP 0x13 -#define SAMR_QUERY_GROUPINFO 0x14 -#define SAMR_SET_GROUPINFO 0x15 -#define SAMR_ADD_GROUPMEM 0x16 -#define SAMR_DELETE_DOM_GROUP 0x17 -#define SAMR_DEL_GROUPMEM 0x18 -#define SAMR_QUERY_GROUPMEM 0x19 -#define SAMR_UNKNOWN_1A 0x1a - -#define SAMR_OPEN_ALIAS 0x1b -#define SAMR_QUERY_ALIASINFO 0x1c -#define SAMR_SET_ALIASINFO 0x1d -#define SAMR_DELETE_DOM_ALIAS 0x1e -#define SAMR_ADD_ALIASMEM 0x1f -#define SAMR_DEL_ALIASMEM 0x20 -#define SAMR_QUERY_ALIASMEM 0x21 - -#define SAMR_OPEN_USER 0x22 -#define SAMR_DELETE_DOM_USER 0x23 -#define SAMR_QUERY_USERINFO 0x24 -#define SAMR_SET_USERINFO2 0x25 -#define SAMR_QUERY_USERGROUPS 0x27 - -#define SAMR_QUERY_DISPINFO 0x28 -#define SAMR_GET_DISPENUM_INDEX 0x29 -#define SAMR_UNKNOWN_2a 0x2a -#define SAMR_UNKNOWN_2b 0x2b -#define SAMR_GET_USRDOM_PWINFO 0x2c -#define SAMR_REMOVE_SID_FOREIGN_DOMAIN 0x2d -#define SAMR_QUERY_DOMAIN_INFO2 0x2e /* looks like an alias for SAMR_QUERY_DOMAIN_INFO */ -#define SAMR_UNKNOWN_2f 0x2f -#define SAMR_QUERY_DISPINFO3 0x30 /* Alias for SAMR_QUERY_DISPINFO - with info level 3 */ -#define SAMR_UNKNOWN_31 0x31 -#define SAMR_CREATE_USER 0x32 -#define SAMR_QUERY_DISPINFO4 0x33 /* Alias for SAMR_QUERY_DISPINFO - with info level 4 */ -#define SAMR_ADDMULTI_ALIASMEM 0x34 - -#define SAMR_UNKNOWN_35 0x35 -#define SAMR_UNKNOWN_36 0x36 -#define SAMR_CHGPASSWD_USER 0x37 -#define SAMR_GET_DOM_PWINFO 0x38 -#define SAMR_CONNECT 0x39 -#define SAMR_SET_USERINFO 0x3A -#define SAMR_CONNECT4 0x3E -#define SAMR_CHGPASSWD_USER3 0x3F -#define SAMR_CONNECT5 0x40 - -typedef struct logon_hours_info -{ - uint32 max_len; /* normally 1260 bytes */ - uint32 offset; - uint32 len; /* normally 21 bytes */ - uint8 hours[32]; - -} LOGON_HRS; - -/* SAM_USER_INFO_23 */ -typedef struct sam_user_info_23 -{ - /* TIMES MAY NOT IN RIGHT ORDER!!!! */ - NTTIME logon_time; /* logon time */ - NTTIME logoff_time; /* logoff time */ - NTTIME kickoff_time; /* kickoff time */ - NTTIME pass_last_set_time; /* password last set time */ - NTTIME pass_can_change_time; /* password can change time */ - NTTIME pass_must_change_time; /* password must change time */ - - UNIHDR hdr_user_name; /* NULL - user name unicode string header */ - UNIHDR hdr_full_name; /* user's full name unicode string header */ - UNIHDR hdr_home_dir; /* home directory unicode string header */ - UNIHDR hdr_dir_drive; /* home drive unicode string header */ - UNIHDR hdr_logon_script; /* logon script unicode string header */ - UNIHDR hdr_profile_path; /* profile path unicode string header */ - UNIHDR hdr_acct_desc ; /* user description */ - UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */ - UNIHDR hdr_comment; - UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */ - - uint8 lm_pwd[16]; /* lm user passwords */ - uint8 nt_pwd[16]; /* nt user passwords */ - - uint32 user_rid; /* Primary User ID */ - uint32 group_rid; /* Primary Group ID */ - - uint32 acb_info; /* account info (ACB_xxxx bit-mask) */ - - uint32 fields_present; /* 0x09f8 27fa */ - - uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */ - /* uint8 pad[2] */ - uint32 ptr_logon_hrs; /* pointer to logon hours */ - - /* Was unknown_5. */ - uint16 bad_password_count; - uint16 logon_count; - - uint8 padding1[6]; - - uint8 passmustchange; /* 0x00 must change = 0x01 */ - - uint8 padding2; - - uint8 pass[516]; - - UNISTR2 uni_user_name; /* NULL - username unicode string */ - UNISTR2 uni_full_name; /* user's full name unicode string */ - UNISTR2 uni_home_dir; /* home directory unicode string */ - UNISTR2 uni_dir_drive; /* home directory drive unicode string */ - UNISTR2 uni_logon_script; /* logon script unicode string */ - UNISTR2 uni_profile_path; /* profile path unicode string */ - UNISTR2 uni_acct_desc ; /* user description unicode string */ - UNISTR2 uni_workstations; /* login from workstations unicode string */ - UNISTR2 uni_comment; - UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */ - - LOGON_HRS logon_hrs; - -} SAM_USER_INFO_23; - -/* SAM_USER_INFO_24 */ -typedef struct sam_user_info_24 -{ - uint8 pass[516]; - uint8 pw_len; -} SAM_USER_INFO_24; - -/* - * NB. This structure is *definately* incorrect. It's my best guess - * currently for W2K SP2. The password field is encrypted in a different - * way than normal... And there are definately other problems. JRA. - */ - -/* SAM_USER_INFO_25 */ -typedef struct sam_user_info_25 -{ - /* TIMES MAY NOT IN RIGHT ORDER!!!! */ - NTTIME logon_time; /* logon time */ - NTTIME logoff_time; /* logoff time */ - NTTIME kickoff_time; /* kickoff time */ - NTTIME pass_last_set_time; /* password last set time */ - NTTIME pass_can_change_time; /* password can change time */ - NTTIME pass_must_change_time; /* password must change time */ - - UNIHDR hdr_user_name; /* NULL - user name unicode string header */ - UNIHDR hdr_full_name; /* user's full name unicode string header */ - UNIHDR hdr_home_dir; /* home directory unicode string header */ - UNIHDR hdr_dir_drive; /* home drive unicode string header */ - UNIHDR hdr_logon_script; /* logon script unicode string header */ - UNIHDR hdr_profile_path; /* profile path unicode string header */ - UNIHDR hdr_acct_desc ; /* user description */ - UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */ - UNIHDR hdr_comment; - UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */ - - uint8 lm_pwd[16]; /* lm user passwords */ - uint8 nt_pwd[16]; /* nt user passwords */ - - uint32 user_rid; /* Primary User ID */ - uint32 group_rid; /* Primary Group ID */ - - uint32 acb_info; /* account info (ACB_xxxx bit-mask) */ - uint32 fields_present; - - uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */ - /* uint8 pad[2] */ - uint32 ptr_logon_hrs; /* pointer to logon hours */ - - /* Was unknown_5. */ - uint16 bad_password_count; - uint16 logon_count; - - uint8 padding1[6]; - - uint8 passmustchange; /* 0x00 must change = 0x01 */ - - uint8 padding2; - - uint8 pass[532]; - - UNISTR2 uni_user_name; /* NULL - username unicode string */ - UNISTR2 uni_full_name; /* user's full name unicode string */ - UNISTR2 uni_home_dir; /* home directory unicode string */ - UNISTR2 uni_dir_drive; /* home directory drive unicode string */ - UNISTR2 uni_logon_script; /* logon script unicode string */ - UNISTR2 uni_profile_path; /* profile path unicode string */ - UNISTR2 uni_acct_desc ; /* user description unicode string */ - UNISTR2 uni_workstations; /* login from workstations unicode string */ - UNISTR2 uni_comment; - UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */ - LOGON_HRS logon_hrs; -} SAM_USER_INFO_25; - -/* SAM_USER_INFO_26 */ -typedef struct sam_user_info_26 -{ - uint8 pass[532]; - uint8 pw_len; -} SAM_USER_INFO_26; - - -/* SAM_USER_INFO_21 */ -typedef struct sam_user_info_21 -{ - NTTIME logon_time; /* logon time */ - NTTIME logoff_time; /* logoff time */ - NTTIME kickoff_time; /* kickoff time */ - NTTIME pass_last_set_time; /* password last set time */ - NTTIME pass_can_change_time; /* password can change time */ - NTTIME pass_must_change_time; /* password must change time */ - - UNIHDR hdr_user_name; /* username unicode string header */ - UNIHDR hdr_full_name; /* user's full name unicode string header */ - UNIHDR hdr_home_dir; /* home directory unicode string header */ - UNIHDR hdr_dir_drive; /* home drive unicode string header */ - UNIHDR hdr_logon_script; /* logon script unicode string header */ - UNIHDR hdr_profile_path; /* profile path unicode string header */ - UNIHDR hdr_acct_desc ; /* user description */ - UNIHDR hdr_workstations; /* comma-separated workstations user can log in from */ - UNIHDR hdr_comment; - UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */ - - uint8 lm_pwd[16]; /* lm user passwords */ - uint8 nt_pwd[16]; /* nt user passwords */ - - uint32 user_rid; /* Primary User ID */ - uint32 group_rid; /* Primary Group ID */ - - uint32 acb_info; /* account info (ACB_xxxx bit-mask) */ - - /* Was unknown_3 */ - uint32 fields_present; /* 0x00ff ffff */ - - uint16 logon_divs; /* 0x0000 00a8 which is 168 which is num hrs in a week */ - /* uint8 pad[2] */ - uint32 ptr_logon_hrs; /* unknown pointer */ - - /* Was unknown_5. */ - uint16 bad_password_count; - uint16 logon_count; - - uint8 padding1[6]; - - uint8 passmustchange; /* 0x00 must change = 0x01 */ - - uint8 padding2; - - UNISTR2 uni_user_name; /* username unicode string */ - UNISTR2 uni_full_name; /* user's full name unicode string */ - UNISTR2 uni_home_dir; /* home directory unicode string */ - UNISTR2 uni_dir_drive; /* home directory drive unicode string */ - UNISTR2 uni_logon_script; /* logon script unicode string */ - UNISTR2 uni_profile_path; /* profile path unicode string */ - UNISTR2 uni_acct_desc ; /* user description unicode string */ - UNISTR2 uni_workstations; /* login from workstations unicode string */ - UNISTR2 uni_comment; - UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */ - - LOGON_HRS logon_hrs; - -} SAM_USER_INFO_21; - -#define PASS_MUST_CHANGE_AT_NEXT_LOGON 0x01 -#define PASS_DONT_CHANGE_AT_NEXT_LOGON 0x00 - -/* SAM_USER_INFO_20 */ -typedef struct sam_user_info_20 -{ - UNIHDR hdr_munged_dial ; /* munged path name and dial-back tel number */ - - UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel number */ - -} SAM_USER_INFO_20; - -/* SAM_USER_INFO_18 */ -typedef struct sam_user_info_18 -{ - uint8 lm_pwd[16]; /* lm user passwords */ - uint8 nt_pwd[16]; /* nt user passwords */ - - uint8 lm_pwd_active; - uint8 nt_pwd_active; - -} SAM_USER_INFO_18; - -/* SAM_USER_INFO_17 */ -typedef struct sam_user_info_17 -{ - uint8 padding_0[16]; /* 0 - padding 16 bytes */ - NTTIME expiry; /* expiry time or something? */ - uint8 padding_1[24]; /* 0 - padding 24 bytes */ - - UNIHDR hdr_mach_acct; /* unicode header for machine account */ - uint32 padding_2; /* 0 - padding 4 bytes */ - - uint32 ptr_1; /* pointer */ - uint8 padding_3[32]; /* 0 - padding 32 bytes */ - uint32 padding_4; /* 0 - padding 4 bytes */ - - uint32 ptr_2; /* pointer */ - uint32 padding_5; /* 0 - padding 4 bytes */ - - uint32 ptr_3; /* pointer */ - uint8 padding_6[32]; /* 0 - padding 32 bytes */ - - uint32 rid_user; /* user RID */ - uint32 rid_group; /* group RID */ - - uint16 acct_ctrl; /* 0080 - ACB_XXXX */ - uint16 unknown_3; /* 16 bit padding */ - - uint16 unknown_4; /* 0x003f - 16 bit unknown */ - uint16 unknown_5; /* 0x003c - 16 bit unknown */ - - uint8 padding_7[16]; /* 0 - padding 16 bytes */ - uint32 padding_8; /* 0 - padding 4 bytes */ - - UNISTR2 uni_mach_acct; /* unicode string for machine account */ - - uint8 padding_9[48]; /* 0 - padding 48 bytes */ - -} SAM_USER_INFO_17; - - -/* SAM_USER_INFO_16 */ -typedef struct sam_user_info_16 -{ - uint32 acb_info; - -} SAM_USER_INFO_16; - - -/* SAM_USER_INFO_7 */ -typedef struct sam_user_info_7 -{ - UNIHDR hdr_name; /* unicode header for name */ - UNISTR2 uni_name; /* unicode string for name */ - -} SAM_USER_INFO_7; - - -/* SAM_USER_INFO_9 */ -typedef struct sam_user_info_9 -{ - uint32 rid_group; /* Primary Group RID */ -} SAM_USER_INFO_9; - - -/* SAMR_Q_CLOSE_HND - probably a policy handle close */ -typedef struct q_samr_close_hnd_info -{ - POLICY_HND pol; /* policy handle */ - -} SAMR_Q_CLOSE_HND; - - -/* SAMR_R_CLOSE_HND - probably a policy handle close */ -typedef struct r_samr_close_hnd_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_CLOSE_HND; - - -/**************************************************************************** -SAMR_Q_GET_USRDOM_PWINFO - a "set user info" occurs just after this -*****************************************************************************/ - -/* SAMR_Q_GET_USRDOM_PWINFO */ -typedef struct q_samr_usrdom_pwinfo_info -{ - POLICY_HND user_pol; /* policy handle */ - -} SAMR_Q_GET_USRDOM_PWINFO; - - -/**************************************************************************** -SAMR_R_GET_USRDOM_PWINFO - a "set user info" occurs just after this -*****************************************************************************/ - -/* SAMR_R_GET_USRDOM_PWINFO */ -typedef struct r_samr_usrdom_pwinfo_info -{ - uint16 min_pwd_length; - uint16 unknown_1; /* 0x0016 or 0x0015 */ - uint32 password_properties; - NTSTATUS status; - -} SAMR_R_GET_USRDOM_PWINFO; - -/**************************************************************************** -SAMR_Q_SET_SEC_OBJ - info level 4. -*****************************************************************************/ - -/* SAMR_Q_SET_SEC_OBJ - */ -typedef struct q_samr_set_sec_obj_info -{ - POLICY_HND pol; /* policy handle */ - uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */ - SEC_DESC_BUF *buf; - -} SAMR_Q_SET_SEC_OBJ; - -/* SAMR_R_SET_SEC_OBJ - */ -typedef struct r_samr_set_sec_obj_info -{ - NTSTATUS status; /* return status */ - -} SAMR_R_SET_SEC_OBJ; - - -/**************************************************************************** -SAMR_Q_QUERY_SEC_OBJ - info level 4. returns SIDs. -*****************************************************************************/ - -/* SAMR_Q_QUERY_SEC_OBJ - probably get domain info... */ -typedef struct q_samr_query_sec_obj_info -{ - POLICY_HND user_pol; /* policy handle */ - uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */ - -} SAMR_Q_QUERY_SEC_OBJ; - -/* SAMR_R_QUERY_SEC_OBJ - probably an open */ -typedef struct r_samr_query_sec_obj_info -{ - uint32 ptr; - SEC_DESC_BUF *buf; - - NTSTATUS status; /* return status */ - -} SAMR_R_QUERY_SEC_OBJ; - - -/**************************************************************************** -SAMR_Q_QUERY_DOMAIN_INFO - probably a query on domain group info. -*****************************************************************************/ - -/* SAMR_Q_QUERY_DOMAIN_INFO - */ -typedef struct q_samr_query_domain_info -{ - POLICY_HND domain_pol; /* policy handle */ - uint16 switch_value; /* 0x0002, 0x0001 */ - -} SAMR_Q_QUERY_DOMAIN_INFO; - -typedef struct sam_unknown_info_1_inf -{ - uint16 min_length_password; - uint16 password_history; - uint32 password_properties; - NTTIME expire; - NTTIME min_passwordage; - -} SAM_UNK_INFO_1; - -typedef struct sam_unknown_info_2_inf -{ - NTTIME logout; /* whether users are forcibly disconnected when logon hours expire */ - UNIHDR hdr_comment; /* comment according to samba4 idl */ - UNIHDR hdr_domain; /* domain name unicode header */ - UNIHDR hdr_server; /* server name unicode header */ - - /* put all the data in here, at the moment, including what the above - pointer is referring to - */ - - uint64 seq_num; - - uint32 unknown_4; /* 0x0000 0001 */ - uint32 server_role; - uint32 unknown_6; /* 0x0000 0001 */ - uint32 num_domain_usrs; /* number of users in domain */ - uint32 num_domain_grps; /* number of domain groups in domain */ - uint32 num_local_grps; /* number of local groups in domain */ - - UNISTR2 uni_comment; /* comment unicode string */ - UNISTR2 uni_domain; /* domain name unicode string */ - UNISTR2 uni_server; /* server name unicode string */ - -} SAM_UNK_INFO_2; - -typedef struct sam_unknown_info_3_info -{ - NTTIME logout; - /* 0x8000 0000 */ /* DON'T forcibly disconnect remote users from server when logon hours expire*/ - /* 0x0000 0000 */ /* forcibly disconnect remote users from server when logon hours expire*/ - -} SAM_UNK_INFO_3; - -typedef struct sam_unknown_info_4_inf -{ - UNIHDR hdr_comment; /* comment according to samba4 idl */ - UNISTR2 uni_comment; /* comment unicode string */ - -} SAM_UNK_INFO_4; - -typedef struct sam_unknown_info_5_inf -{ - UNIHDR hdr_domain; /* domain name unicode header */ - UNISTR2 uni_domain; /* domain name unicode string */ - -} SAM_UNK_INFO_5; - -typedef struct sam_unknown_info_6_info -{ - UNIHDR hdr_server; /* server name unicode header */ - UNISTR2 uni_server; /* server name unicode string */ - -} SAM_UNK_INFO_6; - -typedef struct sam_unknown_info_7_info -{ - uint16 server_role; - -} SAM_UNK_INFO_7; - -typedef struct sam_unknown_info_8_info -{ - uint64 seq_num; - NTTIME domain_create_time; - -} SAM_UNK_INFO_8; - -typedef struct sam_unknown_info_9_info -{ - uint32 unknown; - -} SAM_UNK_INFO_9; - -typedef struct sam_unknown_info_12_inf -{ - NTTIME duration; - NTTIME reset_count; - uint16 bad_attempt_lockout; - -} SAM_UNK_INFO_12; - -typedef struct sam_unknown_info_13_info -{ - uint64 seq_num; - NTTIME domain_create_time; - uint32 unknown1; - uint32 unknown2; - -} SAM_UNK_INFO_13; - -typedef struct sam_unknown_ctr_info -{ - union - { - SAM_UNK_INFO_1 inf1; - SAM_UNK_INFO_2 inf2; - SAM_UNK_INFO_3 inf3; - SAM_UNK_INFO_4 inf4; - SAM_UNK_INFO_5 inf5; - SAM_UNK_INFO_6 inf6; - SAM_UNK_INFO_7 inf7; - SAM_UNK_INFO_8 inf8; - SAM_UNK_INFO_9 inf9; - SAM_UNK_INFO_12 inf12; - SAM_UNK_INFO_13 inf13; - - } info; - -} SAM_UNK_CTR; - - -/* SAMR_R_QUERY_DOMAIN_INFO - */ -typedef struct r_samr_query_domain_info -{ - uint32 ptr_0; - uint16 switch_value; /* same as in query */ - - SAM_UNK_CTR *ctr; - - NTSTATUS status; /* return status */ - -} SAMR_R_QUERY_DOMAIN_INFO; - - -/* SAMR_Q_LOOKUP_DOMAIN - obtain SID for a local domain */ -typedef struct q_samr_lookup_domain_info -{ - POLICY_HND connect_pol; - - UNIHDR hdr_domain; - UNISTR2 uni_domain; - -} SAMR_Q_LOOKUP_DOMAIN; - - -/* SAMR_R_LOOKUP_DOMAIN */ -typedef struct r_samr_lookup_domain_info -{ - uint32 ptr_sid; - DOM_SID2 dom_sid; - - NTSTATUS status; - -} SAMR_R_LOOKUP_DOMAIN; - - -/**************************************************************************** -SAMR_Q_OPEN_DOMAIN - unknown_0 values seen associated with SIDs: - -0x0000 03f1 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0 -0x0000 0200 and a specific domain sid - S-1-5-21-44c01ca6-797e5c3d-33f83fd0 -*****************************************************************************/ - -/* SAMR_Q_OPEN_DOMAIN */ -typedef struct q_samr_open_domain_info -{ - POLICY_HND pol; /* policy handle */ - uint32 flags; /* 0x2000 0000; 0x0000 0211; 0x0000 0280; 0x0000 0200 - flags? */ - DOM_SID2 dom_sid; /* domain SID */ - -} SAMR_Q_OPEN_DOMAIN; - - -/* SAMR_R_OPEN_DOMAIN - probably an open */ -typedef struct r_samr_open_domain_info -{ - POLICY_HND domain_pol; /* policy handle associated with the SID */ - NTSTATUS status; /* return status */ - -} SAMR_R_OPEN_DOMAIN; - -#define MAX_SAM_ENTRIES_W2K 0x400 -#define MAX_SAM_ENTRIES_W95 50 -/* The following should be the greater of the preceeding two. */ -#define MAX_SAM_ENTRIES MAX_SAM_ENTRIES_W2K - -typedef struct samr_entry_info -{ - uint32 rid; - UNIHDR hdr_name; - -} SAM_ENTRY; - - -/* SAMR_Q_ENUM_DOMAINS - SAM rids and names */ -typedef struct q_samr_enum_domains_info -{ - POLICY_HND pol; /* policy handle */ - - uint32 start_idx; /* enumeration handle */ - uint32 max_size; /* 0x0000 ffff */ - -} SAMR_Q_ENUM_DOMAINS; - -/* SAMR_R_ENUM_DOMAINS - SAM rids and Domain names */ -typedef struct r_samr_enum_domains_info -{ - uint32 next_idx; /* next starting index required for enum */ - uint32 ptr_entries1; - - uint32 num_entries2; - uint32 ptr_entries2; - - uint32 num_entries3; - - SAM_ENTRY *sam; - UNISTR2 *uni_dom_name; - - uint32 num_entries4; - - NTSTATUS status; - -} SAMR_R_ENUM_DOMAINS; - -/* SAMR_Q_ENUM_DOM_USERS - SAM rids and names */ -typedef struct q_samr_enum_dom_users_info -{ - POLICY_HND pol; /* policy handle */ - - uint32 start_idx; /* number of values (0 indicates unlimited?) */ - uint32 acb_mask; /* 0x0000 indicates all */ - - uint32 max_size; /* 0x0000 ffff */ - -} SAMR_Q_ENUM_DOM_USERS; - - -/* SAMR_R_ENUM_DOM_USERS - SAM rids and names */ -typedef struct r_samr_enum_dom_users_info -{ - uint32 next_idx; /* next starting index required for enum */ - uint32 ptr_entries1; - - uint32 num_entries2; - uint32 ptr_entries2; - - uint32 num_entries3; - - SAM_ENTRY *sam; - UNISTR2 *uni_acct_name; - - uint32 num_entries4; - - NTSTATUS status; - -} SAMR_R_ENUM_DOM_USERS; - - -/* SAMR_Q_ENUM_DOM_GROUPS - SAM rids and names */ -typedef struct q_samr_enum_dom_groups_info -{ - POLICY_HND pol; /* policy handle */ - - /* this is possibly an enumeration context handle... */ - uint32 start_idx; /* 0x0000 0000 */ - - uint32 max_size; /* 0x0000 ffff */ - -} SAMR_Q_ENUM_DOM_GROUPS; - - -/* SAMR_R_ENUM_DOM_GROUPS - SAM rids and names */ -typedef struct r_samr_enum_dom_groups_info -{ - uint32 next_idx; - uint32 ptr_entries1; - - uint32 num_entries2; - uint32 ptr_entries2; - - uint32 num_entries3; - - SAM_ENTRY *sam; - UNISTR2 *uni_grp_name; - - uint32 num_entries4; - - NTSTATUS status; - -} SAMR_R_ENUM_DOM_GROUPS; - - -/* SAMR_Q_ENUM_DOM_ALIASES - SAM rids and names */ -typedef struct q_samr_enum_dom_aliases_info -{ - POLICY_HND pol; /* policy handle */ - - /* this is possibly an enumeration context handle... */ - uint32 start_idx; /* 0x0000 0000 */ - - uint32 max_size; /* 0x0000 ffff */ - -} SAMR_Q_ENUM_DOM_ALIASES; - - -/* SAMR_R_ENUM_DOM_ALIASES - SAM rids and names */ -typedef struct r_samr_enum_dom_aliases_info -{ - uint32 next_idx; - uint32 ptr_entries1; - - uint32 num_entries2; - uint32 ptr_entries2; - - uint32 num_entries3; - - SAM_ENTRY *sam; - UNISTR2 *uni_grp_name; - - uint32 num_entries4; - - NTSTATUS status; - -} SAMR_R_ENUM_DOM_ALIASES; - - -/* -- Level 1 Display Info - User Information -- */ - -typedef struct samr_entry_info1 -{ - uint32 user_idx; - - uint32 rid_user; - uint32 acb_info; - - UNIHDR hdr_acct_name; - UNIHDR hdr_user_name; - UNIHDR hdr_user_desc; - -} SAM_ENTRY1; - -typedef struct samr_str_entry_info1 -{ - UNISTR2 uni_acct_name; - UNISTR2 uni_full_name; - UNISTR2 uni_acct_desc; - -} SAM_STR1; - -typedef struct sam_entry_info_1 -{ - SAM_ENTRY1 *sam; - SAM_STR1 *str; - -} SAM_DISPINFO_1; - - -/* -- Level 2 Display Info - Trust Account Information -- */ - -typedef struct samr_entry_info2 -{ - uint32 user_idx; - - uint32 rid_user; - uint32 acb_info; - - UNIHDR hdr_srv_name; - UNIHDR hdr_srv_desc; - -} SAM_ENTRY2; - -typedef struct samr_str_entry_info2 -{ - UNISTR2 uni_srv_name; - UNISTR2 uni_srv_desc; - -} SAM_STR2; - -typedef struct sam_entry_info_2 -{ - SAM_ENTRY2 *sam; - SAM_STR2 *str; - -} SAM_DISPINFO_2; - - -/* -- Level 3 Display Info - Domain Group Information -- */ - -typedef struct samr_entry_info3 -{ - uint32 grp_idx; - - uint32 rid_grp; - uint32 attr; /* SE_GROUP_xxx, usually 7 */ - - UNIHDR hdr_grp_name; - UNIHDR hdr_grp_desc; - -} SAM_ENTRY3; - -typedef struct samr_str_entry_info3 -{ - UNISTR2 uni_grp_name; - UNISTR2 uni_grp_desc; - -} SAM_STR3; - -typedef struct sam_entry_info_3 -{ - SAM_ENTRY3 *sam; - SAM_STR3 *str; - -} SAM_DISPINFO_3; - - -/* -- Level 4 Display Info - User List (ASCII) -- */ - -typedef struct samr_entry_info4 -{ - uint32 user_idx; - STRHDR hdr_acct_name; - -} SAM_ENTRY4; - -typedef struct samr_str_entry_info4 -{ - STRING2 acct_name; - -} SAM_STR4; - -typedef struct sam_entry_info_4 -{ - SAM_ENTRY4 *sam; - SAM_STR4 *str; - -} SAM_DISPINFO_4; - - -/* -- Level 5 Display Info - Group List (ASCII) -- */ - -typedef struct samr_entry_info5 -{ - uint32 grp_idx; - STRHDR hdr_grp_name; - -} SAM_ENTRY5; - -typedef struct samr_str_entry_info5 -{ - STRING2 grp_name; - -} SAM_STR5; - -typedef struct sam_entry_info_5 -{ - SAM_ENTRY5 *sam; - SAM_STR5 *str; - -} SAM_DISPINFO_5; - - -typedef struct sam_dispinfo_ctr_info -{ - union - { - SAM_DISPINFO_1 *info1; /* users/names/descriptions */ - SAM_DISPINFO_2 *info2; /* trust accounts */ - SAM_DISPINFO_3 *info3; /* domain groups/descriptions */ - SAM_DISPINFO_4 *info4; /* user list (ASCII) - used by Win95 */ - SAM_DISPINFO_5 *info5; /* group list (ASCII) */ - void *info; /* allows assignment without typecasting, */ - - } sam; - -} SAM_DISPINFO_CTR; - - -/* SAMR_Q_QUERY_DISPINFO - SAM rids, names and descriptions */ -typedef struct q_samr_query_disp_info -{ - POLICY_HND domain_pol; - - uint16 switch_level; /* see SAM_DISPINFO_CTR above */ - /* align */ - - uint32 start_idx; /* start enumeration index */ - uint32 max_entries; /* maximum number of entries to return */ - uint32 max_size; /* recommended data size; if exceeded server - should return STATUS_MORE_ENTRIES */ - -} SAMR_Q_QUERY_DISPINFO; - - -/* SAMR_R_QUERY_DISPINFO */ -typedef struct r_samr_query_dispinfo_info -{ - uint32 total_size; /* total data size for all matching entries - (0 = uncalculated) */ - uint32 data_size; /* actual data size returned = size of SAM_ENTRY - structures + total length of strings */ - - uint16 switch_level; /* see SAM_DISPINFO_CTR above */ - /* align */ - - uint32 num_entries; /* number of entries returned */ - uint32 ptr_entries; - uint32 num_entries2; - - SAM_DISPINFO_CTR *ctr; - - NTSTATUS status; - -} SAMR_R_QUERY_DISPINFO; - -/* SAMR_Q_GET_DISPENUM_INDEX */ -typedef struct q_samr_get_dispenum_index -{ - POLICY_HND domain_pol; - uint16 switch_level; - LSA_STRING name; - -} SAMR_Q_GET_DISPENUM_INDEX; - -/* SAMR_R_GET_DISPENUM_INDEX */ -typedef struct r_samr_get_dispenum_index -{ - uint32 idx; - NTSTATUS status; - -} SAMR_R_GET_DISPENUM_INDEX; - -/* SAMR_Q_DELETE_DOM_GROUP - delete domain group */ -typedef struct q_samr_delete_dom_group_info -{ - POLICY_HND group_pol; /* policy handle */ - -} SAMR_Q_DELETE_DOM_GROUP; - - -/* SAMR_R_DELETE_DOM_GROUP - delete domain group */ -typedef struct r_samr_delete_dom_group_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_DELETE_DOM_GROUP; - - -/* SAMR_Q_CREATE_DOM_GROUP - SAM create group */ -typedef struct q_samr_create_dom_group_info -{ - POLICY_HND pol; /* policy handle */ - - UNIHDR hdr_acct_desc; - UNISTR2 uni_acct_desc; - - uint32 access_mask; - -} SAMR_Q_CREATE_DOM_GROUP; - -/* SAMR_R_CREATE_DOM_GROUP - SAM create group */ -typedef struct r_samr_create_dom_group_info -{ - POLICY_HND pol; /* policy handle */ - - uint32 rid; - NTSTATUS status; - -} SAMR_R_CREATE_DOM_GROUP; - -/* SAMR_Q_QUERY_GROUPINFO - SAM Group Info */ -typedef struct q_samr_query_group_info -{ - POLICY_HND pol; /* policy handle */ - - uint16 switch_level; /* 0x0001 seen */ - -} SAMR_Q_QUERY_GROUPINFO; - -typedef struct samr_group_info1 -{ - UNIHDR hdr_acct_name; - - uint32 group_attr; /* 0x0000 0003 - group attribute */ - uint32 num_members; /* 0x0000 0001 - number of group members? */ - - UNIHDR hdr_acct_desc; - - UNISTR2 uni_acct_name; - UNISTR2 uni_acct_desc; - -} GROUP_INFO1; - -typedef struct samr_group_info2 -{ - uint16 level; - UNIHDR hdr_acct_name; - UNISTR2 uni_acct_name; - -} GROUP_INFO2; - -typedef struct samr_group_info3 -{ - uint32 group_attr; /* 0x0000 0003 - group attribute */ - -} GROUP_INFO3; - -typedef struct samr_group_info4 -{ - uint16 level; - UNIHDR hdr_acct_desc; - UNISTR2 uni_acct_desc; - -} GROUP_INFO4; - -typedef struct samr_group_info5 -{ - UNIHDR hdr_acct_name; - - uint32 group_attr; /* 0x0000 0003 - group attribute */ - uint32 num_members; /* 0x0000 0001 - number of group members? */ - - UNIHDR hdr_acct_desc; - - UNISTR2 uni_acct_name; - UNISTR2 uni_acct_desc; - -} GROUP_INFO5; - - -/* GROUP_INFO_CTR */ -typedef struct group_info_ctr -{ - uint16 switch_value1; - - union - { - GROUP_INFO1 info1; - GROUP_INFO2 info2; - GROUP_INFO3 info3; - GROUP_INFO4 info4; - GROUP_INFO5 info5; - } group; - -} GROUP_INFO_CTR; - -/* SAMR_R_QUERY_GROUPINFO - SAM Group Info */ -typedef struct r_samr_query_groupinfo_info -{ - uint32 ptr; - GROUP_INFO_CTR *ctr; - - NTSTATUS status; - -} SAMR_R_QUERY_GROUPINFO; - - -/* SAMR_Q_SET_GROUPINFO - SAM Group Info */ -typedef struct q_samr_set_group_info -{ - POLICY_HND pol; /* policy handle */ - GROUP_INFO_CTR *ctr; - -} SAMR_Q_SET_GROUPINFO; - -/* SAMR_R_SET_GROUPINFO - SAM Group Info */ -typedef struct r_samr_set_group_info -{ - NTSTATUS status; - -} SAMR_R_SET_GROUPINFO; - - -/* SAMR_Q_DELETE_DOM_ALIAS - delete domain alias */ -typedef struct q_samr_delete_dom_alias_info -{ - POLICY_HND alias_pol; /* policy handle */ - -} SAMR_Q_DELETE_DOM_ALIAS; - - -/* SAMR_R_DELETE_DOM_ALIAS - delete domain alias */ -typedef struct r_samr_delete_dom_alias_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_DELETE_DOM_ALIAS; - - -/* SAMR_Q_CREATE_DOM_ALIAS - SAM create alias */ -typedef struct q_samr_create_dom_alias_info -{ - POLICY_HND dom_pol; /* policy handle */ - - UNIHDR hdr_acct_desc; - UNISTR2 uni_acct_desc; - - uint32 access_mask; /* 0x001f000f */ - -} SAMR_Q_CREATE_DOM_ALIAS; - -/* SAMR_R_CREATE_DOM_ALIAS - SAM create alias */ -typedef struct r_samr_create_dom_alias_info -{ - POLICY_HND alias_pol; /* policy handle */ - - uint32 rid; - NTSTATUS status; - -} SAMR_R_CREATE_DOM_ALIAS; - - -/********************************************************/ - -typedef struct { - UNISTR4 name; - UNISTR4 description; - uint32 num_member; -} ALIAS_INFO1; - -typedef struct { - UNISTR4 name; -} ALIAS_INFO2; - -typedef struct { - UNISTR4 description; -} ALIAS_INFO3; - -typedef struct { - POLICY_HND pol; /* policy handle */ - uint16 level; /* 0x0003 seen */ -} SAMR_Q_QUERY_ALIASINFO; - -typedef struct { - uint16 level; - union { - ALIAS_INFO1 info1; - ALIAS_INFO2 info2; - ALIAS_INFO3 info3; - } alias; -} ALIAS_INFO_CTR; - -typedef struct { - ALIAS_INFO_CTR *ctr; - NTSTATUS status; -} SAMR_R_QUERY_ALIASINFO; - - -/********************************************************/ - -typedef struct { - POLICY_HND alias_pol; /* policy handle */ - ALIAS_INFO_CTR ctr; -} SAMR_Q_SET_ALIASINFO; - -typedef struct { - NTSTATUS status; -} SAMR_R_SET_ALIASINFO; - - -/********************************************************/ - -/* SAMR_Q_QUERY_USERGROUPS - */ -typedef struct q_samr_query_usergroup_info -{ - POLICY_HND pol; /* policy handle associated with unknown id */ - -} SAMR_Q_QUERY_USERGROUPS; - -/* SAMR_R_QUERY_USERGROUPS - probably a get sam info */ -typedef struct r_samr_query_usergroup_info -{ - uint32 ptr_0; /* pointer */ - uint32 num_entries; /* number of RID groups */ - uint32 ptr_1; /* pointer */ - uint32 num_entries2; /* number of RID groups */ - - DOM_GID *gid; /* group info */ - - NTSTATUS status; /* return status */ - -} SAMR_R_QUERY_USERGROUPS; - -/* SAM_USERINFO_CTR - sam user info */ -typedef struct sam_userinfo_ctr_info -{ - uint16 switch_value; - - union - { - SAM_USER_INFO_7 *id7; - SAM_USER_INFO_9 *id9; - SAM_USER_INFO_16 *id16; - SAM_USER_INFO_17 *id17; - SAM_USER_INFO_18 *id18; - SAM_USER_INFO_20 *id20; - SAM_USER_INFO_21 *id21; - SAM_USER_INFO_23 *id23; - SAM_USER_INFO_24 *id24; - SAM_USER_INFO_25 *id25; - SAM_USER_INFO_26 *id26; - void* id; /* to make typecasting easy */ - - } info; - -} SAM_USERINFO_CTR; - - -/* SAMR_Q_SET_USERINFO2 - set sam info */ -typedef struct q_samr_set_user_info2 -{ - POLICY_HND pol; /* policy handle associated with user */ - uint16 switch_value; /* 0x0010 */ - - SAM_USERINFO_CTR *ctr; - -} SAMR_Q_SET_USERINFO2; - -/* SAMR_R_SET_USERINFO2 - set sam info */ -typedef struct r_samr_set_user_info2 -{ - NTSTATUS status; /* return status */ - -} SAMR_R_SET_USERINFO2; - -/* SAMR_Q_SET_USERINFO - set sam info */ -typedef struct q_samr_set_user_info -{ - POLICY_HND pol; /* policy handle associated with user */ - uint16 switch_value; - SAM_USERINFO_CTR *ctr; - -} SAMR_Q_SET_USERINFO; - -/* SAMR_R_SET_USERINFO - set sam info */ -typedef struct r_samr_set_user_info -{ - NTSTATUS status; /* return status */ - -} SAMR_R_SET_USERINFO; - - -/* SAMR_Q_QUERY_USERINFO - probably a get sam info */ -typedef struct q_samr_query_user_info -{ - POLICY_HND pol; /* policy handle associated with unknown id */ - uint16 switch_value; /* 0x0015, 0x0011 or 0x0010 - 16 bit unknown */ - -} SAMR_Q_QUERY_USERINFO; - -/* SAMR_R_QUERY_USERINFO - probably a get sam info */ -typedef struct r_samr_query_user_info -{ - uint32 ptr; /* pointer */ - SAM_USERINFO_CTR *ctr; - - NTSTATUS status; /* return status */ - -} SAMR_R_QUERY_USERINFO; - - -/**************************************************************************** -SAMR_Q_QUERY_USERALIASES - do a conversion from name to RID. - -the policy handle allocated by an "samr open secret" call is associated -with a SID. this policy handle is what is queried here, *not* the SID -itself. the response to the lookup rids is relative to this SID. -*****************************************************************************/ -/* SAMR_Q_QUERY_USERALIASES */ -typedef struct q_samr_query_useraliases_info -{ - POLICY_HND pol; /* policy handle */ - - uint32 num_sids1; /* number of rids being looked up */ - uint32 ptr; /* buffer pointer */ - uint32 num_sids2; /* number of rids being looked up */ - - uint32 *ptr_sid; /* pointers to sids to be looked up */ - DOM_SID2 *sid ; /* sids to be looked up. */ - -} SAMR_Q_QUERY_USERALIASES; - - -/* SAMR_R_QUERY_USERALIASES */ -typedef struct r_samr_query_useraliases_info -{ - uint32 num_entries; - uint32 ptr; /* undocumented buffer pointer */ - - uint32 num_entries2; - uint32 *rid; /* domain RIDs being looked up */ - - NTSTATUS status; /* return code */ - -} SAMR_R_QUERY_USERALIASES; - - -/**************************************************************************** -SAMR_Q_LOOKUP_NAMES - do a conversion from Names to RIDs+types. -*****************************************************************************/ -/* SAMR_Q_LOOKUP_NAMES */ -typedef struct q_samr_lookup_names_info -{ - POLICY_HND pol; /* policy handle */ - - uint32 num_names1; /* number of names being looked up */ - uint32 flags; /* 0x0000 03e8 - unknown */ - uint32 ptr; /* 0x0000 0000 - 32 bit unknown */ - uint32 num_names2; /* number of names being looked up */ - - UNIHDR *hdr_name; /* unicode account name header */ - UNISTR2 *uni_name; /* unicode account name string */ - -} SAMR_Q_LOOKUP_NAMES; - - -/* SAMR_R_LOOKUP_NAMES */ -typedef struct r_samr_lookup_names_info -{ - uint32 num_rids1; /* number of aliases being looked up */ - uint32 ptr_rids; /* pointer to aliases */ - uint32 num_rids2; /* number of aliases being looked up */ - - uint32 *rids; /* rids */ - - uint32 num_types1; /* number of users in aliases being looked up */ - uint32 ptr_types; /* pointer to users in aliases */ - uint32 num_types2; /* number of users in aliases being looked up */ - - uint32 *types; /* SID_ENUM type */ - - NTSTATUS status; /* return code */ - -} SAMR_R_LOOKUP_NAMES; - - -/**************************************************************************** -SAMR_Q_LOOKUP_RIDS - do a conversion from RID groups to something. - -called to resolve domain RID groups. -*****************************************************************************/ -/* SAMR_Q_LOOKUP_RIDS */ -typedef struct q_samr_lookup_rids_info -{ - POLICY_HND pol; /* policy handle */ - - uint32 num_rids1; /* number of rids being looked up */ - uint32 flags; /* 0x0000 03e8 - unknown */ - uint32 ptr; /* 0x0000 0000 - 32 bit unknown */ - uint32 num_rids2; /* number of rids being looked up */ - - uint32 *rid; /* domain RIDs being looked up */ - -} SAMR_Q_LOOKUP_RIDS; - - -/**************************************************************************** -SAMR_R_LOOKUP_RIDS - do a conversion from group RID to names - -*****************************************************************************/ -/* SAMR_R_LOOKUP_RIDS */ -typedef struct r_samr_lookup_rids_info -{ - uint32 num_names1; /* number of aliases being looked up */ - uint32 ptr_names; /* pointer to aliases */ - uint32 num_names2; /* number of aliases being looked up */ - - UNIHDR *hdr_name; /* unicode account name header */ - UNISTR2 *uni_name; /* unicode account name string */ - - uint32 num_types1; /* number of users in aliases being looked up */ - uint32 ptr_types; /* pointer to users in aliases */ - uint32 num_types2; /* number of users in aliases being looked up */ - - uint32 *type; /* SID_ENUM type */ - - NTSTATUS status; - -} SAMR_R_LOOKUP_RIDS; - - -/* SAMR_Q_OPEN_USER - probably an open */ -typedef struct q_samr_open_user_info -{ - POLICY_HND domain_pol; /* policy handle */ - uint32 access_mask; /* 32 bit unknown - 0x02011b */ - uint32 user_rid; /* user RID */ - -} SAMR_Q_OPEN_USER; - - -/* SAMR_R_OPEN_USER - probably an open */ -typedef struct r_samr_open_user_info -{ - POLICY_HND user_pol; /* policy handle associated with unknown id */ - NTSTATUS status; /* return status */ - -} SAMR_R_OPEN_USER; - - -/* SAMR_Q_CREATE_USER - probably a create */ -typedef struct q_samr_create_user_info -{ - POLICY_HND domain_pol; /* policy handle */ - - UNIHDR hdr_name; /* unicode account name header */ - UNISTR2 uni_name; /* unicode account name */ - - uint32 acb_info; /* account control info */ - uint32 access_mask; /* 0xe005 00b0 */ - -} SAMR_Q_CREATE_USER; - - -/* SAMR_R_CREATE_USER - probably a create */ -typedef struct r_samr_create_user_info -{ - POLICY_HND user_pol; /* policy handle associated with user */ - - uint32 access_granted; - uint32 user_rid; /* user RID */ - NTSTATUS status; /* return status */ - -} SAMR_R_CREATE_USER; - - -/* SAMR_Q_DELETE_DOM_USER - delete domain user */ -typedef struct q_samr_delete_dom_user_info -{ - POLICY_HND user_pol; /* policy handle */ - -} SAMR_Q_DELETE_DOM_USER; - - -/* SAMR_R_DELETE_DOM_USER - delete domain user */ -typedef struct r_samr_delete_dom_user_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_DELETE_DOM_USER; - - -/* SAMR_Q_QUERY_GROUPMEM - query group members */ -typedef struct q_samr_query_groupmem_info -{ - POLICY_HND group_pol; /* policy handle */ - -} SAMR_Q_QUERY_GROUPMEM; - - -/* SAMR_R_QUERY_GROUPMEM - query group members */ -typedef struct r_samr_query_groupmem_info -{ - uint32 ptr; - uint32 num_entries; - - uint32 ptr_rids; - uint32 ptr_attrs; - - uint32 num_rids; - uint32 *rid; - - uint32 num_attrs; - uint32 *attr; - - NTSTATUS status; - -} SAMR_R_QUERY_GROUPMEM; - - -/* SAMR_Q_DEL_GROUPMEM - probably an del group member */ -typedef struct q_samr_del_group_mem_info -{ - POLICY_HND pol; /* policy handle */ - uint32 rid; /* rid */ - -} SAMR_Q_DEL_GROUPMEM; - - -/* SAMR_R_DEL_GROUPMEM - probably an del group member */ -typedef struct r_samr_del_group_mem_info -{ - NTSTATUS status; /* return status */ - -} SAMR_R_DEL_GROUPMEM; - - -/* SAMR_Q_ADD_GROUPMEM - probably an add group member */ -typedef struct q_samr_add_group_mem_info -{ - POLICY_HND pol; /* policy handle */ - - uint32 rid; /* rid */ - uint32 unknown; /* 0x0000 0005 */ - -} SAMR_Q_ADD_GROUPMEM; - - -/* SAMR_R_ADD_GROUPMEM - probably an add group member */ -typedef struct r_samr_add_group_mem_info -{ - NTSTATUS status; /* return status */ - -} SAMR_R_ADD_GROUPMEM; - - -/* SAMR_Q_OPEN_GROUP - probably an open */ -typedef struct q_samr_open_group_info -{ - POLICY_HND domain_pol; /* policy handle */ - uint32 access_mask; /* 0x0000 0001, 0x0000 0003, 0x0000 001f */ - uint32 rid_group; /* rid */ - -} SAMR_Q_OPEN_GROUP; - - -/* SAMR_R_OPEN_GROUP - probably an open */ -typedef struct r_samr_open_group_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_OPEN_GROUP; - - -/* SAMR_Q_QUERY_ALIASMEM - query alias members */ -typedef struct q_samr_query_aliasmem_info -{ - POLICY_HND alias_pol; /* policy handle */ - -} SAMR_Q_QUERY_ALIASMEM; - - -/* SAMR_R_QUERY_ALIASMEM - query alias members */ -typedef struct r_samr_query_aliasmem_info -{ - uint32 num_sids; - uint32 ptr; - uint32 num_sids1; - - DOM_SID2 *sid; - - NTSTATUS status; - -} SAMR_R_QUERY_ALIASMEM; - - -/* SAMR_Q_ADD_ALIASMEM - add alias member */ -typedef struct q_samr_add_alias_mem_info -{ - POLICY_HND alias_pol; /* policy handle */ - - DOM_SID2 sid; /* member sid to be added to the alias */ - -} SAMR_Q_ADD_ALIASMEM; - - -/* SAMR_R_ADD_ALIASMEM - add alias member */ -typedef struct r_samr_add_alias_mem_info -{ - NTSTATUS status; /* return status */ - -} SAMR_R_ADD_ALIASMEM; - - -/* SAMR_Q_DEL_ALIASMEM - add an add alias member */ -typedef struct q_samr_del_alias_mem_info -{ - POLICY_HND alias_pol; /* policy handle */ - - DOM_SID2 sid; /* member sid to be added to alias */ - -} SAMR_Q_DEL_ALIASMEM; - - -/* SAMR_R_DEL_ALIASMEM - delete alias member */ -typedef struct r_samr_del_alias_mem_info -{ - NTSTATUS status; /* return status */ - -} SAMR_R_DEL_ALIASMEM; - - - -/* SAMR_Q_OPEN_ALIAS - probably an open */ -typedef struct q_samr_open_alias_info -{ - POLICY_HND dom_pol; - - uint32 access_mask; - uint32 rid_alias; - -} SAMR_Q_OPEN_ALIAS; - - -/* SAMR_R_OPEN_ALIAS - probably an open */ -typedef struct r_samr_open_alias_info -{ - POLICY_HND pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_OPEN_ALIAS; - - -/* SAMR_Q_CONNECT_ANON - probably an open */ -typedef struct q_samr_connect_anon_info { - uint32 ptr; /* ptr? */ - uint16 unknown_0; /* Only pushed if ptr is non-zero. */ - uint32 access_mask; -} SAMR_Q_CONNECT_ANON; - -/* SAMR_R_CONNECT_ANON - probably an open */ -typedef struct r_samr_connect_anon_info -{ - POLICY_HND connect_pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_CONNECT_ANON; - -/* SAMR_Q_CONNECT - probably an open */ -typedef struct q_samr_connect_info -{ - uint32 ptr_srv_name; /* pointer (to server name?) */ - UNISTR2 uni_srv_name; /* unicode server name starting with '\\' */ - - uint32 access_mask; - -} SAMR_Q_CONNECT; - - -/* SAMR_R_CONNECT - probably an open */ -typedef struct r_samr_connect_info -{ - POLICY_HND connect_pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_CONNECT; - -/* SAMR_Q_CONNECT4 */ -typedef struct q_samr_connect4_info -{ - uint32 ptr_srv_name; /* pointer to server name */ - UNISTR2 uni_srv_name; - - uint32 unk_0; /* possible server name type, 1 for IP num, 2 for name */ - uint32 access_mask; -} SAMR_Q_CONNECT4; - -/* SAMR_R_CONNECT4 - same format as connect */ -typedef struct r_samr_connect_info SAMR_R_CONNECT4; - -/* SAMR_Q_CONNECT5 */ -typedef struct q_samr_connect5_info -{ - uint32 ptr_srv_name; /* pointer to server name */ - UNISTR2 uni_srv_name; - uint32 access_mask; - uint32 level; - /* These following are acutally a level dependent - value. Fudge it for now. JRA */ - uint32 info1_unk1; - uint32 info1_unk2; -} SAMR_Q_CONNECT5; - -/* SAMR_R_CONNECT5 */ -typedef struct r_samr_connect_info5 -{ - uint32 level; - uint32 info1_unk1; - uint32 info1_unk2; - POLICY_HND connect_pol; /* policy handle */ - NTSTATUS status; /* return status */ - -} SAMR_R_CONNECT5; - - -/* SAMR_Q_GET_DOM_PWINFO */ -typedef struct q_samr_get_dom_pwinfo -{ - uint32 ptr; - UNIHDR hdr_srv_name; - UNISTR2 uni_srv_name; - -} SAMR_Q_GET_DOM_PWINFO; - -#define DOMAIN_PASSWORD_COMPLEX 0x00000001 -#define DOMAIN_PASSWORD_NO_ANON_CHANGE 0x00000002 -#define DOMAIN_PASSWORD_NO_CLEAR_CHANGE 0x00000004 -#define DOMAIN_LOCKOUT_ADMINS 0x00000008 -#define DOMAIN_PASSWORD_STORE_CLEARTEXT 0x00000010 -#define DOMAIN_REFUSE_PASSWORD_CHANGE 0x00000020 - -/* SAMR_R_GET_DOM_PWINFO */ -typedef struct r_samr_get_dom_pwinfo -{ - uint16 min_pwd_length; - uint32 password_properties; - NTSTATUS status; - -} SAMR_R_GET_DOM_PWINFO; - -/* SAMR_ENC_PASSWD */ -typedef struct enc_passwd_info -{ - uint32 ptr; - uint8 pass[516]; - -} SAMR_ENC_PASSWD; - -/* SAMR_ENC_HASH */ -typedef struct enc_hash_info -{ - uint32 ptr; - uint8 hash[16]; - -} SAMR_ENC_HASH; - -/* SAMR_Q_CHGPASSWD_USER */ -typedef struct q_samr_chgpasswd_user_info -{ - uint32 ptr_0; - - UNIHDR hdr_dest_host; /* server name unicode header */ - UNISTR2 uni_dest_host; /* server name unicode string */ - - UNIHDR hdr_user_name; /* username unicode string header */ - UNISTR2 uni_user_name; /* username unicode string */ - - SAMR_ENC_PASSWD nt_newpass; - SAMR_ENC_HASH nt_oldhash; - - uint32 unknown; /* 0x0000 0001 */ - - SAMR_ENC_PASSWD lm_newpass; - SAMR_ENC_HASH lm_oldhash; - -} SAMR_Q_CHGPASSWD_USER; - -/* SAMR_R_CHGPASSWD_USER */ -typedef struct r_samr_chgpasswd_user_info -{ - NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */ - -} SAMR_R_CHGPASSWD_USER; - -/* SAMR_Q_CHGPASSWD3 */ -typedef struct q_samr_chgpasswd_user3 -{ - uint32 ptr_0; - - UNIHDR hdr_dest_host; /* server name unicode header */ - UNISTR2 uni_dest_host; /* server name unicode string */ - - UNIHDR hdr_user_name; /* username unicode string header */ - UNISTR2 uni_user_name; /* username unicode string */ - - SAMR_ENC_PASSWD nt_newpass; - SAMR_ENC_HASH nt_oldhash; - - uint32 lm_change; /* 0x0000 0001 */ - - SAMR_ENC_PASSWD lm_newpass; - SAMR_ENC_HASH lm_oldhash; - - SAMR_ENC_PASSWD password3; - -} SAMR_Q_CHGPASSWD_USER3; - -#define REJECT_REASON_OTHER 0x00000000 -#define REJECT_REASON_TOO_SHORT 0x00000001 -#define REJECT_REASON_IN_HISTORY 0x00000002 -#define REJECT_REASON_NOT_COMPLEX 0x00000005 - -/* SAMR_CHANGE_REJECT */ -typedef struct samr_change_reject -{ - uint32 reject_reason; - uint32 unknown1; - uint32 unknown2; - -} SAMR_CHANGE_REJECT; - -/* SAMR_R_CHGPASSWD3 */ -typedef struct r_samr_chgpasswd_user3 -{ - uint32 ptr_info; - uint32 ptr_reject; - SAM_UNK_INFO_1 *info; - SAMR_CHANGE_REJECT *reject; - NTSTATUS status; /* 0 == OK, C000006A (NT_STATUS_WRONG_PASSWORD) */ - -} SAMR_R_CHGPASSWD_USER3; - - - -/* SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN */ -typedef struct q_samr_remove_sid_foreign_domain_info -{ - POLICY_HND dom_pol; /* policy handle */ - DOM_SID2 sid; /* SID */ - -} SAMR_Q_REMOVE_SID_FOREIGN_DOMAIN; - - -/* SAMR_R_REMOVE_SID_FOREIGN_DOMAIN */ -typedef struct r_samr_remove_sid_foreign_domain_info -{ - NTSTATUS status; /* return status */ - -} SAMR_R_REMOVE_SID_FOREIGN_DOMAIN; - - - -/* these are from the old rpc_samr.h - they are needed while the merge - is still going on */ -#define MAX_SAM_SIDS 15 - -/* DOM_SID3 - security id */ -typedef struct sid_info_3 -{ - uint16 len; /* length, bytes, including length of len :-) */ - /* uint8 pad[2]; */ - - DOM_SID sid; - -} DOM_SID3; - -/* SAMR_Q_QUERY_DOMAIN_INFO2 */ -typedef struct q_samr_query_domain_info2 -{ - POLICY_HND domain_pol; /* policy handle */ - uint16 switch_value; - -} SAMR_Q_QUERY_DOMAIN_INFO2; - -/* SAMR_R_QUERY_DOMAIN_INFO2 */ -typedef struct r_samr_query_domain_info2 -{ - uint32 ptr_0; - uint16 switch_value; - SAM_UNK_CTR *ctr; - NTSTATUS status; /* return status */ - -} SAMR_R_QUERY_DOMAIN_INFO2; - -/* SAMR_Q_SET_DOMAIN_INFO */ -typedef struct q_samr_set_domain_info -{ - POLICY_HND domain_pol; /* policy handle */ - uint16 switch_value0; - uint16 switch_value; - SAM_UNK_CTR *ctr; - -} SAMR_Q_SET_DOMAIN_INFO; - -/* SAMR_R_SET_DOMAIN_INFO */ -typedef struct r_samr_set_domain_info -{ - NTSTATUS status; /* return status */ - -} SAMR_R_SET_DOMAIN_INFO; - -#endif /* _RPC_SAMR_H */ diff --git a/source3/include/rpc_svcctl.h b/source3/include/rpc_svcctl.h index 1e42aef20c..5a87e350ba 100644 --- a/source3/include/rpc_svcctl.h +++ b/source3/include/rpc_svcctl.h @@ -197,81 +197,6 @@ typedef struct _ServiceInfo { /**************************/ typedef struct { - UNISTR2 *servername; - UNISTR2 *database; - uint32 access; -} SVCCTL_Q_OPEN_SCMANAGER; - -typedef struct { - POLICY_HND handle; - WERROR status; -} SVCCTL_R_OPEN_SCMANAGER; - -/**************************/ - -typedef struct { - POLICY_HND handle; - UNISTR2 servicename; - uint32 display_name_len; -} SVCCTL_Q_GET_DISPLAY_NAME; - -typedef struct { - UNISTR2 displayname; - uint32 display_name_len; - WERROR status; -} SVCCTL_R_GET_DISPLAY_NAME; - -/**************************/ - -typedef struct { - POLICY_HND handle; - UNISTR2 servicename; - uint32 access; -} SVCCTL_Q_OPEN_SERVICE; - -typedef struct { - POLICY_HND handle; - WERROR status; -} SVCCTL_R_OPEN_SERVICE; - -/**************************/ - -typedef struct { - POLICY_HND handle; - uint32 parmcount; - UNISTR4_ARRAY *parameters; -} SVCCTL_Q_START_SERVICE; - -typedef struct { - WERROR status; -} SVCCTL_R_START_SERVICE; - -/**************************/ - -typedef struct { - POLICY_HND handle; - uint32 control; -} SVCCTL_Q_CONTROL_SERVICE; - -typedef struct { - SERVICE_STATUS svc_status; - WERROR status; -} SVCCTL_R_CONTROL_SERVICE; - -/**************************/ - -typedef struct { - POLICY_HND handle; -} SVCCTL_Q_QUERY_STATUS; - -typedef struct { - SERVICE_STATUS svc_status; - WERROR status; -} SVCCTL_R_QUERY_STATUS; - -/**************************/ - -typedef struct { POLICY_HND handle; uint32 type; uint32 state; @@ -346,57 +271,5 @@ typedef struct { WERROR status; } SVCCTL_R_QUERY_SERVICE_STATUSEX; - -/**************************/ - -typedef struct { - POLICY_HND handle; -} SVCCTL_Q_LOCK_SERVICE_DB; - -typedef struct { - POLICY_HND h_lock; - WERROR status; -} SVCCTL_R_LOCK_SERVICE_DB; - - -/**************************/ - -typedef struct { - POLICY_HND h_lock; -} SVCCTL_Q_UNLOCK_SERVICE_DB; - -typedef struct { - WERROR status; -} SVCCTL_R_UNLOCK_SERVICE_DB; - - -/**************************/ - -typedef struct { - POLICY_HND handle; - uint32 security_flags; - uint32 buffer_size; -} SVCCTL_Q_QUERY_SERVICE_SEC; - -typedef struct { - RPC_BUFFER buffer; - uint32 needed; - WERROR status; -} SVCCTL_R_QUERY_SERVICE_SEC; - -/**************************/ - -typedef struct { - POLICY_HND handle; - uint32 security_flags; - RPC_BUFFER buffer; - uint32 buffer_size; -} SVCCTL_Q_SET_SERVICE_SEC; - -typedef struct { - WERROR status; -} SVCCTL_R_SET_SERVICE_SEC; - - #endif /* _RPC_SVCCTL_H */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 744acd719f..c582a97e5c 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -193,7 +193,7 @@ typedef uint32 codepoint_t; #define PIPE_NETLOGON_PLAIN "\\NETLOGON" #define PI_LSARPC 0 -#define PI_LSARPC_DS 1 +#define PI_DSSETUP 1 #define PI_SAMR 2 #define PI_NETLOGON 3 #define PI_SRVSVC 4 @@ -211,30 +211,6 @@ typedef uint32 codepoint_t; /* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */ typedef uint64_t NTTIME; - -/* Allowable account control bits */ -#define ACB_DISABLED 0x00000001 /* 1 = User account disabled */ -#define ACB_HOMDIRREQ 0x00000002 /* 1 = Home directory required */ -#define ACB_PWNOTREQ 0x00000004 /* 1 = User password not required */ -#define ACB_TEMPDUP 0x00000008 /* 1 = Temporary duplicate account */ -#define ACB_NORMAL 0x00000010 /* 1 = Normal user account */ -#define ACB_MNS 0x00000020 /* 1 = MNS logon user account */ -#define ACB_DOMTRUST 0x00000040 /* 1 = Interdomain trust account */ -#define ACB_WSTRUST 0x00000080 /* 1 = Workstation trust account */ -#define ACB_SVRTRUST 0x00000100 /* 1 = Server trust account (BDC) */ -#define ACB_PWNOEXP 0x00000200 /* 1 = User password does not expire */ -#define ACB_AUTOLOCK 0x00000400 /* 1 = Account auto locked */ - -/* only valid for > Windows 2000 */ -#define ACB_ENC_TXT_PWD_ALLOWED 0x00000800 /* 1 = Text password encryped */ -#define ACB_SMARTCARD_REQUIRED 0x00001000 /* 1 = Smart Card required */ -#define ACB_TRUSTED_FOR_DELEGATION 0x00002000 /* 1 = Trusted for Delegation */ -#define ACB_NOT_DELEGATED 0x00004000 /* 1 = Not delegated */ -#define ACB_USE_DES_KEY_ONLY 0x00008000 /* 1 = Use DES key only */ -#define ACB_DONT_REQUIRE_PREAUTH 0x00010000 /* 1 = Preauth not required */ -#define ACB_PWEXPIRED 0x00020000 /* 1 = Password is expired */ -#define ACB_NO_AUTH_DATA_REQD 0x00080000 /* 1 = No authorization data required */ - #define MAX_HOURS_LEN 32 #ifndef MAXSUBAUTHS @@ -283,9 +259,6 @@ typedef struct dom_sid { uint32 sub_auths[MAXSUBAUTHS]; } DOM_SID; -#define dom_sid2 dom_sid -#define dom_sid28 dom_sid - enum id_mapping { ID_UNKNOWN = 0, ID_MAPPED, @@ -310,8 +283,17 @@ struct id_map { enum id_mapping status; }; -#include "librpc/ndr/misc.h" -#include "librpc/ndr/security.h" +/* used to hold an arbitrary blob of data */ +typedef struct data_blob { + uint8 *data; + size_t length; + void (*free)(struct data_blob *data_blob); +} DATA_BLOB; + +extern const DATA_BLOB data_blob_null; + +#include "librpc/gen_ndr/misc.h" +#include "librpc/gen_ndr/security.h" #include "librpc/ndr/libndr.h" #include "librpc/gen_ndr/lsa.h" #include "librpc/gen_ndr/dfs.h" @@ -322,8 +304,12 @@ struct id_map { #include "librpc/gen_ndr/wkssvc.h" #include "librpc/gen_ndr/echo.h" #include "librpc/gen_ndr/svcctl.h" +#include "librpc/gen_ndr/netlogon.h" +#include "librpc/gen_ndr/samr.h" +#include "librpc/gen_ndr/dssetup.h" #include "librpc/gen_ndr/libnet_join.h" - +#include "librpc/gen_ndr/krb5pac.h" +#include "librpc/gen_ndr/ntsvcs.h" struct lsa_dom_info { bool valid; @@ -527,20 +513,13 @@ typedef struct files_struct { FAKE_FILE_HANDLE *fake_file_handle; struct notify_change_buf *notify; + + struct files_struct *base_fsp; /* placeholder for delete on close */ } files_struct; #include "ntquotas.h" #include "sysquotas.h" -/* used to hold an arbitrary blob of data */ -typedef struct data_blob { - uint8 *data; - size_t length; - void (*free)(struct data_blob *data_blob); -} DATA_BLOB; - -extern const DATA_BLOB data_blob_null; - /* * Structure used to keep directory state information around. * Used in NT change-notify code. @@ -597,6 +576,16 @@ struct trans_state { char *data; }; +/* + * Info about an alternate data stream + */ + +struct stream_struct { + SMB_OFF_T size; + SMB_OFF_T alloc_size; + char *name; +}; + /* Include VFS stuff */ #include "smb_acls.h" @@ -1382,6 +1371,9 @@ struct bitmap { #define NTCREATEX_OPTIONS_PRIVATE_DENY_DOS 0x01000000 #define NTCREATEX_OPTIONS_PRIVATE_DENY_FCB 0x02000000 +/* Private options for streams support */ +#define NTCREATEX_OPTIONS_PRIVATE_STREAM_DELETE 0x04000000 + /* Responses when opening a file. */ #define FILE_WAS_SUPERSEDED 0 #define FILE_WAS_OPENED 1 @@ -1912,6 +1904,8 @@ struct ea_list { #define SAMBA_POSIX_INHERITANCE_EA_NAME "user.SAMBA_PAI" /* EA to use for DOS attributes */ #define SAMBA_XATTR_DOS_ATTRIB "user.DOSATTRIB" +/* Prefix for DosStreams in the vfs_streams_xattr module */ +#define SAMBA_XATTR_DOSSTREAM_PREFIX "user.DosStream." #define UUID_SIZE 16 @@ -1942,4 +1936,15 @@ enum usershare_err { /* Different reasons for closing a file. */ enum file_close_type {NORMAL_CLOSE=0,SHUTDOWN_CLOSE,ERROR_CLOSE}; +/* Used in SMB_FS_OBJECTID_INFORMATION requests. Must be exactly 48 bytes. */ +#define SAMBA_EXTENDED_INFO_MAGIC 0x536d4261 /* "SmBa" */ +#define SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH 28 +struct smb_extended_info { + uint32 samba_magic; /* Always SAMBA_EXTRA_INFO_MAGIC */ + uint32 samba_version; /* Major/Minor/Release/Revision */ + uint32 samba_subversion; /* Prerelease/RC/Vendor patch */ + NTTIME samba_gitcommitdate; + char samba_version_string[SAMBA_EXTENDED_INFO_VERSION_STRING_LENGTH]; +}; + #endif /* _SMB_H */ diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 463a2bdb0b..c98c4244de 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -305,10 +305,9 @@ NULL returns on zero request. JRA. #define talloc_destroy(ctx) talloc_free(ctx) #define TALLOC_FREE(ctx) do { if ((ctx) != NULL) {talloc_free(ctx); ctx=NULL;} } while(0) -/* only define PARANOID_MALLOC_CHECKER with --enable-developer and not compiling - the smbmount utils */ +/* only define PARANOID_MALLOC_CHECKER with --enable-developer */ -#if defined(DEVELOPER) && !defined(SMBMOUNT_MALLOC) +#if defined(DEVELOPER) # define PARANOID_MALLOC_CHECKER 1 #endif diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 0be3886227..ca176aabb2 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -103,8 +103,8 @@ /* Leave at 22 - not yet released. Remove parameter fd from write. - obnox */ /* Leave at 22 - not yet released. Remove parameter fromfd from sendfile. - obnox */ /* Leave at 22 - not yet released. Remove parameter fromfd from recvfile. - obnox */ - - +/* Leave at 22 - not yet released. Additional change: add operations for offline files -- ab */ +/* Leave at 22 - not yet released. Add the streaminfo call. -- jpeach, vl */ #define SMB_VFS_INTERFACE_VERSION 22 @@ -149,6 +149,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_SET_QUOTA, SMB_VFS_OP_GET_SHADOW_COPY_DATA, SMB_VFS_OP_STATVFS, + SMB_VFS_OP_FS_CAPABILITIES, /* Directory operations */ @@ -199,6 +200,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_NOTIFY_WATCH, SMB_VFS_OP_CHFLAGS, SMB_VFS_OP_FILE_ID_CREATE, + SMB_VFS_OP_STREAMINFO, /* NT ACL operations. */ @@ -257,9 +259,14 @@ typedef enum _vfs_op_type { SMB_VFS_OP_AIO_ERROR, SMB_VFS_OP_AIO_FSYNC, SMB_VFS_OP_AIO_SUSPEND, + SMB_VFS_OP_AIO_FORCE, + + /* offline operations */ + SMB_VFS_OP_IS_OFFLINE, + SMB_VFS_OP_SET_OFFLINE, /* This should always be last enum value */ - + SMB_VFS_OP_LAST } vfs_op_type; @@ -269,7 +276,7 @@ typedef enum _vfs_op_type { struct vfs_ops { struct vfs_fn_pointers { /* Disk operations */ - + int (*connect_fn)(struct vfs_handle_struct *handle, const char *service, const char *user); void (*disconnect)(struct vfs_handle_struct *handle); SMB_BIG_UINT (*disk_free)(struct vfs_handle_struct *handle, const char *path, bool small_query, SMB_BIG_UINT *bsize, @@ -278,9 +285,10 @@ struct vfs_ops { int (*set_quota)(struct vfs_handle_struct *handle, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt); int (*get_shadow_copy_data)(struct vfs_handle_struct *handle, struct files_struct *fsp, SHADOW_COPY_DATA *shadow_copy_data, bool labels); int (*statvfs)(struct vfs_handle_struct *handle, const char *path, struct vfs_statvfs_struct *statbuf); - + uint32_t (*fs_capabilities)(struct vfs_handle_struct *handle); + /* Directory operations */ - + SMB_STRUCT_DIR *(*opendir)(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attributes); SMB_STRUCT_DIRENT *(*readdir)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp); void (*seekdir)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset); @@ -289,9 +297,9 @@ struct vfs_ops { int (*mkdir)(struct vfs_handle_struct *handle, const char *path, mode_t mode); int (*rmdir)(struct vfs_handle_struct *handle, const char *path); int (*closedir)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dir); - + /* File operations */ - + int (*open)(struct vfs_handle_struct *handle, const char *fname, files_struct *fsp, int flags, mode_t mode); int (*close_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd); ssize_t (*read)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n); @@ -335,8 +343,15 @@ struct vfs_ops { int (*chflags)(struct vfs_handle_struct *handle, const char *path, unsigned int flags); struct file_id (*file_id_create)(struct vfs_handle_struct *handle, SMB_DEV_T dev, SMB_INO_T inode); + NTSTATUS (*streaminfo)(struct vfs_handle_struct *handle, + struct files_struct *fsp, + const char *fname, + TALLOC_CTX *mem_ctx, + unsigned int *num_streams, + struct stream_struct **streams); + /* NT ACL operations. */ - + NTSTATUS (*fget_nt_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 security_info, @@ -354,12 +369,12 @@ struct vfs_ops { const char *name, uint32 security_info_sent, struct security_descriptor *psd); - + /* POSIX ACL operations. */ - + int (*chmod_acl)(struct vfs_handle_struct *handle, const char *name, mode_t mode); int (*fchmod_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); - + int (*sys_acl_get_entry)(struct vfs_handle_struct *handle, SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p); int (*sys_acl_get_tag_type)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_TAG_T *tag_type_p); int (*sys_acl_get_permset)(struct vfs_handle_struct *handle, SMB_ACL_ENTRY_T entry_d, SMB_ACL_PERMSET_T *permset_p); @@ -405,7 +420,11 @@ struct vfs_ops { int (*aio_error_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb); int (*aio_fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb); int (*aio_suspend)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *timeout); + bool (*aio_force)(struct vfs_handle_struct *handle, struct files_struct *fsp); + /* offline operations */ + bool (*is_offline)(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf); + int (*set_offline)(struct vfs_handle_struct *handle, const char *path); } ops; struct vfs_handles_pointers { @@ -418,6 +437,7 @@ struct vfs_ops { struct vfs_handle_struct *set_quota; struct vfs_handle_struct *get_shadow_copy_data; struct vfs_handle_struct *statvfs; + struct vfs_handle_struct *fs_capabilities; /* Directory operations */ @@ -468,6 +488,7 @@ struct vfs_ops { struct vfs_handle_struct *notify_watch; struct vfs_handle_struct *chflags; struct vfs_handle_struct *file_id_create; + struct vfs_handle_struct *streaminfo; /* NT ACL operations. */ @@ -526,27 +547,32 @@ struct vfs_ops { struct vfs_handle_struct *aio_error; struct vfs_handle_struct *aio_fsync; struct vfs_handle_struct *aio_suspend; + struct vfs_handle_struct *aio_force; + + /* offline operations */ + struct vfs_handle_struct *is_offline; + struct vfs_handle_struct *set_offline; } handles; }; /* Possible VFS operation layers (per-operation) - + These values are used by VFS subsystem when building vfs_ops for connection from multiple VFS modules. Internally, Samba differentiates only opaque and transparent layers at this process. Other types are used for providing better diagnosing facilities. - + Most modules will provide transparent layers. Opaque layer is for modules which implement actual file system calls (like DB-based VFS). For example, default POSIX VFS which is built in into Samba is an opaque VFS module. - + Other layer types (audit, splitter, scanner) were designed to provide different degree of transparency and for diagnosing VFS module behaviour. - + Each module can implement several layers at the same time provided that only one layer is used per each operation. - + */ typedef enum _vfs_op_layer { @@ -565,7 +591,7 @@ typedef enum _vfs_op_layer { /* VFS operation description. Each VFS module registers an array of vfs_op_tuple to VFS subsystem, - which describes all operations this module is willing to intercept. + which describes all operations this module is willing to intercept. VFS subsystem initializes then the conn->vfs_ops and conn->vfs_opaque_ops structs using this information. */ @@ -590,12 +616,12 @@ typedef struct vfs_handle_struct { typedef struct vfs_statvfs_struct { /* For undefined recommended transfer size return -1 in that field */ uint32 OptimalTransferSize; /* bsize on some os, iosize on other os */ - uint32 BlockSize; + uint32 BlockSize; /* The next three fields are in terms of the block size. (above). If block size is unknown, 4096 would be a - reasonable block size for a server to report. + reasonable block size for a server to report. Note that returning the blocks/blocksavail removes need to make a second call (to QFSInfo level 0x103 to get this info. UserBlockAvail is typically less than or equal to BlocksAvail, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 9232e94a42..1e64bd5ac3 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -1,18 +1,18 @@ -/* +/* Unix SMB/CIFS implementation. VFS wrapper macros Copyright (C) Stefan (metze) Metzmacher 2003 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ @@ -26,7 +26,7 @@ (Fixes should go also into the vfs_opaque_* and vfs_next_* macros!) ********************************************************************/ -/* Disk operations */ +/* Disk operations */ #define SMB_VFS_CONNECT(conn, service, user) ((conn)->vfs.ops.connect_fn((conn)->vfs.handles.connect_hnd, (service), (user))) #define SMB_VFS_DISCONNECT(conn) ((conn)->vfs.ops.disconnect((conn)->vfs.handles.disconnect)) #define SMB_VFS_DISK_FREE(conn, path, small_query, bsize, dfree ,dsize) ((conn)->vfs.ops.disk_free((conn)->vfs.handles.disk_free, (path), (small_query), (bsize), (dfree), (dsize))) @@ -34,6 +34,7 @@ #define SMB_VFS_SET_QUOTA(conn, qtype, id, qt) ((conn)->vfs.ops.set_quota((conn)->vfs.handles.set_quota, (qtype), (id), (qt))) #define SMB_VFS_GET_SHADOW_COPY_DATA(fsp,shadow_copy_data,labels) ((fsp)->conn->vfs.ops.get_shadow_copy_data((fsp)->conn->vfs.handles.get_shadow_copy_data,(fsp),(shadow_copy_data),(labels))) #define SMB_VFS_STATVFS(conn, path, statbuf) ((conn)->vfs.ops.statvfs((conn)->vfs.handles.statvfs, (path), (statbuf))) +#define SMB_VFS_FS_CAPABILITIES(conn) ((conn)->vfs.ops.fs_capabilities((conn)->vfs.handles.fs_capabilities)) /* Directory operations */ #define SMB_VFS_OPENDIR(conn, fname, mask, attr) ((conn)->vfs.ops.opendir((conn)->vfs.handles.opendir, (fname), (mask), (attr))) @@ -44,7 +45,7 @@ #define SMB_VFS_MKDIR(conn, path, mode) ((conn)->vfs.ops.mkdir((conn)->vfs.handles.mkdir,(path), (mode))) #define SMB_VFS_RMDIR(conn, path) ((conn)->vfs.ops.rmdir((conn)->vfs.handles.rmdir, (path))) #define SMB_VFS_CLOSEDIR(conn, dir) ((conn)->vfs.ops.closedir((conn)->vfs.handles.closedir, dir)) - + /* File operations */ #define SMB_VFS_OPEN(conn, fname, fsp, flags, mode) (((conn)->vfs.ops.open)((conn)->vfs.handles.open, (fname), (fsp), (flags), (mode))) #define SMB_VFS_CLOSE(fsp, fd) ((fsp)->conn->vfs.ops.close_fn((fsp)->conn->vfs.handles.close_hnd, (fsp), (fd))) @@ -82,6 +83,7 @@ #define SMB_VFS_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) ((conn)->vfs.ops.notify_watch((conn)->vfs.handles.notify_watch, (ctx), (e), (callback), (private_data), (handle_p))) #define SMB_VFS_CHFLAGS(conn, path, flags) ((conn)->vfs.ops.chflags((conn)->vfs.handles.chflags, (path), (flags))) #define SMB_VFS_FILE_ID_CREATE(conn, dev, inode) ((conn)->vfs.ops.file_id_create((conn)->vfs.handles.file_id_create, (dev), (inode))) +#define SMB_VFS_STREAMINFO(conn, fsp, fname, mem_ctx, num_streams, streams) ((conn)->vfs.ops.streaminfo((conn)->vfs.handles.streaminfo, (fsp), (fname), (mem_ctx), (num_streams), (streams))) /* NT ACL operations. */ #define SMB_VFS_FGET_NT_ACL(fsp, security_info, ppdesc) ((fsp)->conn->vfs.ops.fget_nt_acl((fsp)->conn->vfs.handles.fget_nt_acl, (fsp), (security_info), (ppdesc))) @@ -138,6 +140,11 @@ #define SMB_VFS_AIO_ERROR(fsp,aiocb) ((fsp)->conn->vfs.ops.aio_error_fn((fsp)->conn->vfs.handles.aio_error,(fsp),(aiocb))) #define SMB_VFS_AIO_FSYNC(fsp,op,aiocb) ((fsp)->conn->vfs.ops.aio_fsync((fsp)->conn->vfs.handles.aio_fsync,(fsp),(op),(aiocb))) #define SMB_VFS_AIO_SUSPEND(fsp,aiocb,n,ts) ((fsp)->conn->vfs.ops.aio_suspend((fsp)->conn->vfs.handles.aio_suspend,(fsp),(aiocb),(n),(ts))) +#define SMB_VFS_AIO_FORCE(fsp) ((fsp)->conn->vfs.ops.aio_force((fsp)->conn->vfs.handles.aio_force,(fsp))) + +/* Offline operations */ +#define SMB_VFS_IS_OFFLINE(conn,path,sbuf) ((conn)->vfs.ops.is_offline((conn)->vfs.handles.is_offline,(path),(sbuf))) +#define SMB_VFS_SET_OFFLINE(conn,path) ((conn)->vfs.ops.set_offline((conn)->vfs.handles.set_offline,(path))) /******************************************************************* Don't access conn->vfs_opaque.ops directly!!! @@ -145,7 +152,7 @@ (Fixes should also go into the vfs_* and vfs_next_* macros!) ********************************************************************/ -/* Disk operations */ +/* Disk operations */ #define SMB_VFS_OPAQUE_CONNECT(conn, service, user) ((conn)->vfs_opaque.ops.connect_fn((conn)->vfs_opaque.handles.connect_hnd, (service), (user))) #define SMB_VFS_OPAQUE_DISCONNECT(conn) ((conn)->vfs_opaque.ops.disconnect((conn)->vfs_opaque.handles.disconnect)) #define SMB_VFS_OPAQUE_DISK_FREE(conn, path, small_query, bsize, dfree ,dsize) ((conn)->vfs_opaque.ops.disk_free((conn)->vfs_opaque.handles.disk_free, (path), (small_query), (bsize), (dfree), (dsize))) @@ -153,6 +160,7 @@ #define SMB_VFS_OPAQUE_SET_QUOTA(conn, qtype, id, qt) ((conn)->vfs_opaque.ops.set_quota((conn)->vfs_opaque.handles.set_quota, (qtype), (id), (qt))) #define SMB_VFS_OPAQUE_GET_SHADOW_COPY_DATA(fsp,shadow_copy_data,labels) ((fsp)->conn->vfs_opaque.ops.get_shadow_copy_data((fsp)->conn->vfs_opaque.handles.get_shadow_copy_data,(fsp),(shadow_copy_data),(labels))) #define SMB_VFS_OPAQUE_STATVFS(conn, path, statbuf) ((conn)->vfs_opaque.ops.statvfs((conn)->vfs_opaque.handles.statvfs, (path), (statbuf))) +#define SMB_VFS_OPAQUE_FS_CAPABILITIES(conn) ((conn)->vfs_opaque.ops.fs_capabilities((conn)->vfs_opaque.handles.fs_capabilities)) /* Directory operations */ #define SMB_VFS_OPAQUE_OPENDIR(conn, fname, mask, attr) ((conn)->vfs_opaque.ops.opendir((conn)->vfs_opaque.handles.opendir, (fname), (mask), (attr))) @@ -163,7 +171,7 @@ #define SMB_VFS_OPAQUE_MKDIR(conn, path, mode) ((conn)->vfs_opaque.ops.mkdir((conn)->vfs_opaque.handles.mkdir,(path), (mode))) #define SMB_VFS_OPAQUE_RMDIR(conn, path) ((conn)->vfs_opaque.ops.rmdir((conn)->vfs_opaque.handles.rmdir, (path))) #define SMB_VFS_OPAQUE_CLOSEDIR(conn, dir) ((conn)->vfs_opaque.ops.closedir((conn)->vfs_opaque.handles.closedir, dir)) - + /* File operations */ #define SMB_VFS_OPAQUE_OPEN(conn, fname, fsp, flags, mode) (((conn)->vfs_opaque.ops.open)((conn)->vfs_opaque.handles.open, (fname), (fsp), (flags), (mode))) #define SMB_VFS_OPAQUE_CLOSE(fsp, fd) ((fsp)->conn->vfs_opaque.ops.close_fn((fsp)->conn->vfs_opaque.handles.close_hnd, (fsp), (fd))) @@ -201,6 +209,7 @@ #define SMB_VFS_OPAQUE_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) ((conn)->vfs_opaque.ops.notify_watch((conn)->vfs_opaque.handles.notify_watch, (ctx), (e), (callback), (private_data), (handle_p))) #define SMB_VFS_OPAQUE_CHFLAGS(conn, path, flags) ((conn)->vfs_opaque.ops.chflags((conn)->vfs_opaque.handles.chflags, (path), (flags))) #define SMB_VFS_OPAQUE_FILE_ID_CREATE(conn, dev, inode) ((conn)->vfs.ops_opaque.file_id_create((conn)->vfs_opaque.handles.file_id_create, (dev), (inode))) +#define SMB_VFS_OPAQUE_STREAMINFO(conn, fsp, fname, mem_ctx, num_streams, streams) ((conn)->vfs_opaque.ops.streaminfo((conn)->vfs_opaque.handles.streaminfo, (fsp), (fname), (mem_ctx), (num_streams), (streams))) /* NT ACL operations. */ #define SMB_VFS_OPAQUE_FGET_NT_ACL(fsp, security_info, ppdesc) ((fsp)->conn->vfs_opaque.ops.fget_nt_acl((fsp)->conn->vfs_opaque.handles.fget_nt_acl, (fsp), (security_info), (ppdesc))) @@ -257,6 +266,11 @@ #define SMB_VFS_OPAQUE_AIO_ERROR(fsp,aiocb) ((fsp)->conn->vfs_opaque.ops.aio_error_fn((fsp)->conn->vfs_opaque.handles.aio_error,(fsp),(aiocb))) #define SMB_VFS_OPAQUE_AIO_FSYNC(fsp,op,aiocb) ((fsp)->conn->vfs_opaque.ops.aio_fsync((fsp)->conn->vfs_opaque.handles.aio_fsync,(fsp),(op),(aiocb))) #define SMB_VFS_OPAQUE_AIO_SUSPEND(fsp,aiocb,n,ts) ((fsp)->conn->vfs_opaque.ops.aio_suspend((fsp)->conn->vfs_opaque.handles.aio_suspend,(fsp),(aiocb),(n),(ts))) +#define SMB_VFS_OPAQUE_AIO_FORCE(fsp) ((fsp)->conn->vfs_opaque.ops.aio_force((fsp)->conn->vfs_opaque.handles.aio_force,(fsp))) + +/* Offline operations */ +#define SMB_VFS_OPAQUE_IS_OFFLINE(conn,path,sbuf) ((conn)->vfs_opaque.ops.is_offline((conn)->vfs_opaque.handles.is_offline,(path),(sbuf))) +#define SMB_VFS_OPAQUE_SET_OFFLINE(conn,path) ((conn)->vfs_opaque.ops.set_offline((conn)->vfs_opaque.handles.set_offline,(path))) /******************************************************************* Don't access handle->vfs_next.ops.* directly!!! @@ -264,7 +278,7 @@ (Fixes should go also into the vfs_* and vfs_opaque_* macros!) ********************************************************************/ -/* Disk operations */ +/* Disk operations */ #define SMB_VFS_NEXT_CONNECT(handle, service, user) ((handle)->vfs_next.ops.connect_fn((handle)->vfs_next.handles.connect_hnd, (service), (user))) #define SMB_VFS_NEXT_DISCONNECT(handle) ((handle)->vfs_next.ops.disconnect((handle)->vfs_next.handles.disconnect)) #define SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize, dfree ,dsize) ((handle)->vfs_next.ops.disk_free((handle)->vfs_next.handles.disk_free, (path), (small_query), (bsize), (dfree), (dsize))) @@ -272,6 +286,7 @@ #define SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, qt) ((handle)->vfs_next.ops.set_quota((handle)->vfs_next.handles.set_quota, (qtype), (id), (qt))) #define SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data ,labels) ((handle)->vfs_next.ops.get_shadow_copy_data((handle)->vfs_next.handles.get_shadow_copy_data,(fsp),(shadow_copy_data),(labels))) #define SMB_VFS_NEXT_STATVFS(handle, path, statbuf) ((handle)->vfs_next.ops.statvfs((handle)->vfs_next.handles.statvfs, (path), (statbuf))) +#define SMB_VFS_NEXT_FS_CAPABILITIES(handle) ((handle)->vfs_next.ops.fs_capabilities((handle)->vfs_next.handles.fs_capabilities)) /* Directory operations */ #define SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr) ((handle)->vfs_next.ops.opendir((handle)->vfs_next.handles.opendir, (fname), (mask), (attr))) @@ -283,7 +298,7 @@ #define SMB_VFS_NEXT_MKDIR(handle, path, mode) ((handle)->vfs_next.ops.mkdir((handle)->vfs_next.handles.mkdir,(path), (mode))) #define SMB_VFS_NEXT_RMDIR(handle, path) ((handle)->vfs_next.ops.rmdir((handle)->vfs_next.handles.rmdir, (path))) #define SMB_VFS_NEXT_CLOSEDIR(handle, dir) ((handle)->vfs_next.ops.closedir((handle)->vfs_next.handles.closedir, dir)) - + /* File operations */ #define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) (((handle)->vfs_next.ops.open)((handle)->vfs_next.handles.open, (fname), (fsp), (flags), (mode))) #define SMB_VFS_NEXT_CLOSE(handle, fsp, fd) ((handle)->vfs_next.ops.close_fn((handle)->vfs_next.handles.close_hnd, (fsp), (fd))) @@ -321,6 +336,7 @@ #define SMB_VFS_NEXT_NOTIFY_WATCH(conn, ctx, e, callback, private_data, handle_p) ((conn)->vfs_next.ops.notify_watch((conn)->vfs_next.handles.notify_watch, (ctx), (e), (callback), (private_data), (handle_p))) #define SMB_VFS_NEXT_CHFLAGS(handle, path, flags) ((handle)->vfs_next.ops.chflags((handle)->vfs_next.handles.chflags, (path), (flags))) #define SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode) ((handle)->vfs_next.ops.file_id_create((handle)->vfs_next.handles.file_id_create, (dev), (inode))) +#define SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx, num_streams, streams) ((handle)->vfs.ops.streaminfo((handle)->vfs.handles.streaminfo, (fsp), (fname), (mem_ctx), (num_streams), (streams))) /* NT ACL operations. */ #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc) ((handle)->vfs_next.ops.fget_nt_acl((handle)->vfs_next.handles.fget_nt_acl, (fsp), (security_info), (ppdesc))) @@ -377,5 +393,10 @@ #define SMB_VFS_NEXT_AIO_ERROR(handle,fsp,aiocb) ((handle)->vfs_next.ops.aio_error_fn((handle)->vfs_next.handles.aio_error,(fsp),(aiocb))) #define SMB_VFS_NEXT_AIO_FSYNC(handle,fsp,op,aiocb) ((handle)->vfs_next.ops.aio_fsync((handle)->vfs_next.handles.aio_fsync,(fsp),(op),(aiocb))) #define SMB_VFS_NEXT_AIO_SUSPEND(handle,fsp,aiocb,n,ts) ((handle)->vfs_next.ops.aio_suspend((handle)->vfs_next.handles.aio_suspend,(fsp),(aiocb),(n),(ts))) +#define SMB_VFS_NEXT_AIO_FORCE(handle,fsp) ((handle)->vfs_next.ops.aio_force((handle)->vfs_next.handles.aio_force,(fsp))) + +/* Offline operations */ +#define SMB_VFS_NEXT_IS_OFFLINE(handle,path,sbuf) ((handle)->vfs_next.ops.is_offline((handle)->vfs_next.handles.is_offline,(path),(sbuf))) +#define SMB_VFS_NEXT_SET_OFFLINE(handle,path) ((handle)->vfs_next.ops.set_offline((handle)->vfs_next.handles.set_offline,(path))) #endif /* _VFS_MACROS_H */ |