diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-03-05 19:42:15 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-03-05 19:42:15 +0100 |
commit | 63036a6f3380652c0cb54627bdeabcd212fa2f8c (patch) | |
tree | 90194f23cb1e6ca483e7773233c326a9b705f85f /source3/include | |
parent | d41d580c600e3228ff8fee5c16c47580f661a240 (diff) | |
parent | 932c287a406048759fa1ac4bf86e29d96991ded1 (diff) | |
download | samba-63036a6f3380652c0cb54627bdeabcd212fa2f8c.tar.gz samba-63036a6f3380652c0cb54627bdeabcd212fa2f8c.tar.bz2 samba-63036a6f3380652c0cb54627bdeabcd212fa2f8c.zip |
Merge branch 'v3-2-test' of ssh://git.samba.org/data/git/samba into v3-2-test
(This used to be commit 3482cd9b0e81bbc801f1cec33fca82fc45a3ddef)
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/ads.h | 5 | ||||
-rw-r--r-- | source3/include/authdata.h | 134 | ||||
-rw-r--r-- | source3/include/byteorder.h | 6 | ||||
-rw-r--r-- | source3/include/client.h | 7 | ||||
-rw-r--r-- | source3/include/gpo.h | 64 | ||||
-rw-r--r-- | source3/include/includes.h | 15 | ||||
-rw-r--r-- | source3/include/libsmb_internal.h | 446 | ||||
-rw-r--r-- | source3/include/libsmbclient.h | 1028 | ||||
-rw-r--r-- | source3/include/ntdomain.h | 6 | ||||
-rw-r--r-- | source3/include/reg_objects.h | 7 | ||||
-rw-r--r-- | source3/include/rpc_brs.h | 79 | ||||
-rw-r--r-- | source3/include/rpc_client.h | 1 | ||||
-rw-r--r-- | source3/include/rpc_lsa.h | 574 | ||||
-rw-r--r-- | source3/include/rpc_netlogon.h | 909 | ||||
-rw-r--r-- | source3/include/rpc_ntsvcs.h | 75 | ||||
-rw-r--r-- | source3/include/rpc_samr.h | 160 | ||||
-rw-r--r-- | source3/include/rpc_srvsvc.h | 139 | ||||
-rw-r--r-- | source3/include/rpc_svcctl.h | 127 | ||||
-rw-r--r-- | source3/include/smb.h | 2 | ||||
-rw-r--r-- | source3/include/smb_macros.h | 5 |
20 files changed, 1383 insertions, 2406 deletions
diff --git a/source3/include/ads.h b/source3/include/ads.h index d1047bbdc2..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 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..d29a2e7341 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 { diff --git a/source3/include/gpo.h b/source3/include/gpo.h index 9b1a672640..bf5ff6a598 100644 --- a/source3/include/gpo.h +++ b/source3/include/gpo.h @@ -1,7 +1,7 @@ /* * Unix SMB/CIFS implementation. * Group Policy Object Support - * Copyright (C) Guenther Deschner 2005-2007 + * Copyright (C) Guenther Deschner 2005-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 @@ -22,7 +22,8 @@ enum GPO_LINK_TYPE { GP_LINK_MACHINE = 1, GP_LINK_SITE = 2, GP_LINK_DOMAIN = 3, - GP_LINK_OU = 4 + GP_LINK_OU = 4, + GP_LINK_LOCAL = 5 /* for convenience */ }; /* GPO_OPTIONS */ @@ -33,6 +34,17 @@ enum GPO_LINK_TYPE { #define GPO_LIST_FLAG_MACHINE 0x00000001 #define GPO_LIST_FLAG_SITEONLY 0x00000002 +/* following flags from http://support.microsoft.com/kb/312164/EN-US/ */ +#define GPO_INFO_FLAG_MACHINE 0x00000001 +#define GPO_INFO_FLAG_BACKGROUND 0x00000010 +#define GPO_INFO_FLAG_SLOWLINK 0x00000020 +#define GPO_INFO_FLAG_VERBOSE 0x00000040 +#define GPO_INFO_FLAG_NOCHANGES 0x00000080 +#define GPO_INFO_FLAG_LINKTRANSITION 0x00000100 +#define GPO_INFO_FLAG_LOGRSOP_TRANSITION 0x00000200 +#define GPO_INFO_FLAG_FORCED_REFRESH 0x00000400 +#define GPO_INFO_FLAG_SAFEMODE_BOOT 0x00000800 + #define GPO_VERSION_USER(x) (x >> 16) #define GPO_VERSION_MACHINE(x) (x & 0xffff) @@ -88,11 +100,59 @@ struct GP_EXT { char **extensions_guid; char **snapins; char **snapins_guid; + struct GP_EXT *next, *prev; }; #define GPO_CACHE_DIR "gpo_cache" #define GPT_INI "GPT.INI" +#define GPO_REFRESH_INTERVAL 60*90 + +#define GPO_REG_STATE_MACHINE "State\\Machine" + +enum gp_reg_action { + GP_REG_ACTION_NONE = 0, + GP_REG_ACTION_ADD_VALUE = 1, + GP_REG_ACTION_ADD_KEY = 2, + GP_REG_ACTION_DEL_VALUES = 3, + GP_REG_ACTION_DEL_VALUE = 4, + GP_REG_ACTION_DEL_ALL_VALUES = 5, + GP_REG_ACTION_DEL_KEYS = 6, + GP_REG_ACTION_SEC_KEY_SET = 7, + GP_REG_ACTION_SEC_KEY_RESET = 8 +}; + +struct gp_registry_entry { + enum gp_reg_action action; + const char *key; + const char *value; + struct registry_value *data; +}; + +struct gp_registry_value { + const char *value; + struct registry_value *data; +}; + +struct gp_registry_entry2 { + enum gp_reg_action action; + const char *key; + size_t num_values; + struct gp_registry_value **values; +}; + +struct gp_registry_entries { + size_t num_entries; + struct gp_registry_entry **entries; +}; + +struct gp_registry_context { + const struct nt_user_token *token; + const char *path; + struct registry_key *curr_key; +}; #define GP_EXT_GUID_SECURITY "827D319E-6EAC-11D2-A4EA-00C04F79F83A" #define GP_EXT_GUID_REGISTRY "35378EAC-683F-11D2-A89A-00C04FBBCFA2" #define GP_EXT_GUID_SCRIPTS "42B5FAAE-6536-11D2-AE5A-0000F87571E3" + +#include "libgpo/gpext/gpext.h" diff --git a/source3/include/includes.h b/source3/include/includes.h index 041c431a58..c54afd8933 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -698,7 +698,6 @@ 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" @@ -1170,15 +1169,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, @@ -1206,7 +1205,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); @@ -1289,4 +1287,9 @@ void exit_server_fault(void) NORETURN_ATTRIBUTE ; #include "libnscd.h" #endif +#if defined(HAVE_IPV6) +void in6_addr_to_sockaddr_storage(struct sockaddr_storage *ss, + struct in6_addr ip); +#endif + #endif /* _INCLUDES_H */ diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h index 6c7dc80da8..6930812b29 100644 --- a/source3/include/libsmb_internal.h +++ b/source3/include/libsmb_internal.h @@ -1,12 +1,71 @@ +/* + Unix SMB/Netbios implementation. + SMB client library implementation + Copyright (C) Andrew Tridgell 1998 + Copyright (C) Richard Sharpe 2000, 2002 + Copyright (C) John Terpstra 2000 + Copyright (C) Tom Jansen (Ninja ISD) 2002 + Copyright (C) Derrell Lipman 2003-2008 + Copyright (C) Jeremy Allison 2007, 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" + + #ifndef _LIBSMB_INTERNAL_H_ #define _LIBSMB_INTERNAL_H_ +#include "../include/libsmbclient.h" + #define SMBC_MAX_NAME 1023 #define SMBC_FILE_MODE (S_IFREG | 0444) #define SMBC_DIR_MODE (S_IFDIR | 0555) +/* + * DOS Attribute values (used internally) + */ +typedef struct DOS_ATTR_DESC { + int mode; + SMB_OFF_T size; + time_t create_time; + time_t access_time; + time_t write_time; + time_t change_time; + SMB_INO_T inode; +} DOS_ATTR_DESC; + + +/* + * Internal flags for extended attributes + */ -#include "include/libsmbclient.h" +/* internal mode values */ +#define SMBC_XATTR_MODE_ADD 1 +#define SMBC_XATTR_MODE_REMOVE 2 +#define SMBC_XATTR_MODE_REMOVE_ALL 3 +#define SMBC_XATTR_MODE_SET 4 +#define SMBC_XATTR_MODE_CHOWN 5 +#define SMBC_XATTR_MODE_CHGRP 6 + +#define CREATE_ACCESS_READ READ_CONTROL_ACCESS + +/*We should test for this in configure ... */ +#ifndef ENOTSUP +#define ENOTSUP EOPNOTSUPP +#endif struct _SMBCSRV { @@ -46,12 +105,13 @@ struct _SMBCFILE { }; -struct smbc_internal_data { +/* + * Context structure + */ +struct SMBC_internal_data { - /* - * Is this handle initialized ? - */ - bool _initialized; + /* True when this handle is initialized */ + bool initialized; /* dirent pointer location * @@ -64,22 +124,22 @@ struct smbc_internal_data { * According to <linux/limits.h>, NAME_MAX is 255. Is it longer * anyplace else? */ - char _dirent[1024]; + char dirent[1024]; /* * server connection list */ - SMBCSRV * _servers; + SMBCSRV * servers; /* * open file/dir list */ - SMBCFILE * _files; + SMBCFILE * files; /* * Log to standard error instead of the more typical standard output */ - bool _debug_stderr; + bool debug_stderr; /* * Support "Create Time" in get/set with the *xattr() functions, if @@ -88,33 +148,389 @@ struct smbc_internal_data { * CREATE_TIME. Default is FALSE, i.e. to use the old-style shorter * names and to not support CREATE time, for backward compatibility. */ - bool _full_time_names; + bool full_time_names; /* * The share mode of a file being opened. To match POSIX semantics * (and maintain backward compatibility), DENY_NONE is the default. */ - smbc_share_mode _share_mode; + smbc_share_mode share_mode; /* * Authentication function which includes the context. This will be * used if set; otherwise context->callbacks.auth_fn() will be used. */ - smbc_get_auth_data_with_context_fn _auth_fn_with_context; + smbc_get_auth_data_with_context_fn auth_fn_with_context; /* * An opaque (to this library) user data handle which can be set * and retrieved with smbc_option_set() and smbc_option_get(). */ - void * _user_data; + void * user_data; /* * Should we attempt UNIX smb encryption ? * Set to 0 if we should never attempt, set to 1 if * encryption requested, set to 2 if encryption required. */ - int _smb_encryption_level; + smbc_smb_encrypt_level smb_encryption_level; + + struct smbc_server_cache * server_cache; + + /* POSIX emulation functions */ + struct + { +#if 0 /* Left in libsmbclient.h for backward compatibility */ + smbc_open_fn open_fn; + smbc_creat_fn creat_fn; + smbc_read_fn read_fn; + smbc_write_fn write_fn; + smbc_unlink_fn unlink_fn; + smbc_rename_fn rename_fn; + smbc_lseek_fn lseek_fn; + smbc_stat_fn stat_fn; + smbc_fstat_fn fstat_fn; +#endif + smbc_ftruncate_fn ftruncate_fn; +#if 0 /* Left in libsmbclient.h for backward compatibility */ + smbc_close_fn close_fn; + smbc_opendir_fn opendir_fn; + smbc_closedir_fn closedir_fn; + smbc_readdir_fn readdir_fn; + smbc_getdents_fn getdents_fn; + smbc_mkdir_fn mkdir_fn; + smbc_rmdir_fn rmdir_fn; + smbc_telldir_fn telldir_fn; + smbc_lseekdir_fn lseekdir_fn; + smbc_fstatdir_fn fstatdir_fn; + smbc_chmod_fn chmod_fn; + smbc_utimes_fn utimes_fn; + smbc_setxattr_fn setxattr_fn; + smbc_getxattr_fn getxattr_fn; + smbc_removexattr_fn removexattr_fn; + smbc_listxattr_fn listxattr_fn; +#endif + } posix_emu; + +#if 0 /* Left in libsmbclient.h for backward compatibility */ + /* Printing-related functions */ + struct + { + smbc_print_file_fn print_file_fn; + smbc_open_print_job_fn open_print_job_fn; + smbc_list_print_jobs_fn list_print_jobs_fn; + smbc_unlink_print_job_fn unlink_print_job_fn; + } printing; +#endif + +#if 0 /* None available yet */ + /* SMB high-level functions */ + struct + { + } smb; + +#endif }; +/* Functions in libsmb_cache.c */ +int +SMBC_add_cached_server(SMBCCTX * context, + SMBCSRV * newsrv, + const char * server, + const char * share, + const char * workgroup, + const char * username); + +SMBCSRV * +SMBC_get_cached_server(SMBCCTX * context, + const char * server, + const char * share, + const char * workgroup, + const char * user); + +int +SMBC_remove_cached_server(SMBCCTX * context, + SMBCSRV * server); + +int +SMBC_purge_cached_servers(SMBCCTX * context); + + +/* Functions in libsmb_dir.c */ +int +SMBC_check_options(char *server, + char *share, + char *path, + char *options); + +SMBCFILE * +SMBC_opendir_ctx(SMBCCTX *context, + const char *fname); + +int +SMBC_closedir_ctx(SMBCCTX *context, + SMBCFILE *dir); + +struct smbc_dirent * +SMBC_readdir_ctx(SMBCCTX *context, + SMBCFILE *dir); + +int +SMBC_getdents_ctx(SMBCCTX *context, + SMBCFILE *dir, + struct smbc_dirent *dirp, + int count); + +int +SMBC_mkdir_ctx(SMBCCTX *context, + const char *fname, + mode_t mode); + +int +SMBC_rmdir_ctx(SMBCCTX *context, + const char *fname); + +off_t +SMBC_telldir_ctx(SMBCCTX *context, + SMBCFILE *dir); + +int +SMBC_lseekdir_ctx(SMBCCTX *context, + SMBCFILE *dir, + off_t offset); + +int +SMBC_fstatdir_ctx(SMBCCTX *context, + SMBCFILE *dir, + struct stat *st); + +int +SMBC_chmod_ctx(SMBCCTX *context, + const char *fname, + mode_t newmode); + +int +SMBC_utimes_ctx(SMBCCTX *context, + const char *fname, + struct timeval *tbuf); + +int +SMBC_unlink_ctx(SMBCCTX *context, + const char *fname); + +int +SMBC_rename_ctx(SMBCCTX *ocontext, + const char *oname, + SMBCCTX *ncontext, + const char *nname); + + +/* Functions in libsmb_file.c */ +SMBCFILE * +SMBC_open_ctx(SMBCCTX *context, + const char *fname, + int flags, + mode_t mode); + +SMBCFILE * +SMBC_creat_ctx(SMBCCTX *context, + const char *path, + mode_t mode); + +ssize_t +SMBC_read_ctx(SMBCCTX *context, + SMBCFILE *file, + void *buf, + size_t count); + +ssize_t +SMBC_write_ctx(SMBCCTX *context, + SMBCFILE *file, + void *buf, + size_t count); + +int +SMBC_close_ctx(SMBCCTX *context, + SMBCFILE *file); + +bool +SMBC_getatr(SMBCCTX * context, + SMBCSRV *srv, + char *path, + uint16 *mode, + SMB_OFF_T *size, + struct timespec *create_time_ts, + struct timespec *access_time_ts, + struct timespec *write_time_ts, + struct timespec *change_time_ts, + SMB_INO_T *ino); + +bool +SMBC_setatr(SMBCCTX * context, SMBCSRV *srv, char *path, + time_t create_time, + time_t access_time, + time_t write_time, + time_t change_time, + uint16 mode); + +off_t +SMBC_lseek_ctx(SMBCCTX *context, + SMBCFILE *file, + off_t offset, + int whence); + +int +SMBC_ftruncate_ctx(SMBCCTX *context, + SMBCFILE *file, + off_t length); + + +/* Functions in libsmb_misc.c */ +int +SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p); + +int +SMBC_errno(SMBCCTX *context, + struct cli_state *c); + + +/* Functions in libsmb_path.c */ +int +SMBC_urldecode(char *dest, + char *src, + size_t max_dest_len); + +int +SMBC_urlencode(char *dest, + char *src, + int max_dest_len); + +int +SMBC_parse_path(TALLOC_CTX *ctx, + SMBCCTX *context, + const char *fname, + char **pp_workgroup, + char **pp_server, + char **pp_share, + char **pp_path, + char **pp_user, + char **pp_password, + char **pp_options); + + +/* Functions in libsmb_printjob.c */ +SMBCFILE * +SMBC_open_print_job_ctx(SMBCCTX *context, + const char *fname); + +int +SMBC_print_file_ctx(SMBCCTX *c_file, + const char *fname, + SMBCCTX *c_print, + const char *printq); + +int +SMBC_list_print_jobs_ctx(SMBCCTX *context, + const char *fname, + smbc_list_print_job_fn fn); + +int +SMBC_unlink_print_job_ctx(SMBCCTX *context, + const char *fname, + int id); + + +/* Functions in libsmb_server.c */ +int +SMBC_check_server(SMBCCTX * context, + SMBCSRV * server); + +int +SMBC_remove_unused_server(SMBCCTX * context, + SMBCSRV * srv); + +void +SMBC_call_auth_fn(TALLOC_CTX *ctx, + SMBCCTX *context, + const char *server, + const char *share, + char **pp_workgroup, + char **pp_username, + char **pp_password); + +void +SMBC_get_auth_data(const char *server, const char *share, + char *workgroup_buf, int workgroup_buf_len, + char *username_buf, int username_buf_len, + char *password_buf, int password_buf_len); + +SMBCSRV * +SMBC_find_server(TALLOC_CTX *ctx, + SMBCCTX *context, + const char *server, + const char *share, + char **pp_workgroup, + char **pp_username, + char **pp_password); + +SMBCSRV * +SMBC_server(TALLOC_CTX *ctx, + SMBCCTX *context, + bool connect_if_not_found, + const char *server, + const char *share, + char **pp_workgroup, + char **pp_username, + char **pp_password); + +SMBCSRV * +SMBC_attr_server(TALLOC_CTX *ctx, + SMBCCTX *context, + const char *server, + const char *share, + char **pp_workgroup, + char **pp_username, + char **pp_password); + + +/* Functions in libsmb_stat.c */ +int +SMBC_stat_ctx(SMBCCTX *context, + const char *fname, + struct stat *st); + +int +SMBC_fstat_ctx(SMBCCTX *context, + SMBCFILE *file, + struct stat *st); + + +/* Functions in libsmb_xattr.c */ +int +SMBC_setxattr_ctx(SMBCCTX *context, + const char *fname, + const char *name, + const void *value, + size_t size, + int flags); + +int +SMBC_getxattr_ctx(SMBCCTX *context, + const char *fname, + const char *name, + const void *value, + size_t size); + +int +SMBC_removexattr_ctx(SMBCCTX *context, + const char *fname, + const char *name); + +int +SMBC_listxattr_ctx(SMBCCTX *context, + const char *fname, + char *list, + size_t size); + #endif diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h index 07242f7956..2e38944d65 100644 --- a/source3/include/libsmbclient.h +++ b/source3/include/libsmbclient.h @@ -5,7 +5,7 @@ Copyright (C) Richard Sharpe 2000 Copyright (C) John Terpsra 2000 Copyright (C) Tom Jansen (Ninja ISD) 2002 - Copyright (C) Derrell Lipman 2003 + Copyright (C) Derrell Lipman 2003-2008 This program is free software; you can redistribute it and/or modify @@ -25,6 +25,13 @@ #ifndef SMBCLIENT_H_INCLUDED #define SMBCLIENT_H_INCLUDED +#undef DEPRECATED_SMBC_INTERFACE +#if ! defined(__LIBSMBCLIENT_INTERNAL__) && defined(__GNUC__) +# define DEPRECATED_SMBC_INTERFACE __attribute__ ((deprecated)) +#else +# define DEPRECATED_SMBC_INTERFACE +#endif + #ifdef __cplusplus extern "C" { #endif @@ -142,7 +149,7 @@ struct smbc_dirent /* * Valid values for the option "open_share_mode", when calling - * smbc_option_set() + * smbc_setOptionOpenShareMode() */ typedef enum smbc_share_mode { @@ -155,6 +162,21 @@ typedef enum smbc_share_mode } smbc_share_mode; +/** + * Values for option SMB Encryption Level, as set and retrieved with + * smbc_setOptionSmbEncryptionLevel() and smbc_getOptionSmbEncryptionLevel() + */ +typedef enum smbc_smb_encrypt_level +{ + SMBC_ENCRYPTLEVEL_NONE = 0, + SMBC_ENCRYPTLEVEL_REQUEST = 1, + SMBC_ENCRYPTLEVEL_REQUIRE = 2 +} smbc_smb_encrypt_level; + + +typedef int smbc_bool; + + #ifndef ENOATTR # define ENOATTR ENOENT /* No such attribute */ #endif @@ -213,6 +235,21 @@ typedef struct _SMBCFILE SMBCFILE; typedef struct _SMBCCTX SMBCCTX; +/* + * Flags for SMBCCTX->flags + * + * NEW CODE SHOULD NOT DIRECTLY MANIPULATE THE CONTEXT STRUCTURE. + * Instead, use: + * smbc_setOptionUseKerberos() + * smbc_getOptionUseKerberos() + * smbc_setOptionFallbackAfterKerberos() + * smbc_getOptionFallbackAFterKerberos() + * smbc_setOptionNoAutoAnonymousLogin() + * smbc_getOptionNoAutoAnonymousLogin() + */ +# define SMB_CTX_FLAG_USE_KERBEROS (1 << 0) +# define SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS (1 << 1) +# define SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON (1 << 2) @@ -389,207 +426,556 @@ typedef int (*smbc_remove_cached_srv_fn)(SMBCCTX * c, SMBCSRV *srv); typedef int (*smbc_purge_cached_fn) (SMBCCTX * c); -/**@ingroup structure - * Structure that contains a client context information - * This structure is know as SMBCCTX + +/***************************************** + * Getters and setters for CONFIGURATION * + *****************************************/ + +/** Get the debug level */ +int +smbc_getDebug(SMBCCTX *c); + +/** Set the debug level */ +void +smbc_setDebug(SMBCCTX *c, int debug); + +/** Get the netbios name used for making connections */ +char * +smbc_getNetbiosName(SMBCCTX *c); + +/** Set the netbios name used for making connections */ +void +smbc_setNetbiosName(SMBCCTX *c, char * netbios_name); + +/** Get the workgroup used for making connections */ +char * +smbc_getWorkgroup(SMBCCTX *c); + +/** Set the workgroup used for making connections */ +void smbc_setWorkgroup(SMBCCTX *c, char * workgroup); + +/** Get the username used for making connections */ +char * +smbc_getUser(SMBCCTX *c); + +/** Set the username used for making connections */ +void +smbc_setUser(SMBCCTX *c, char * user); + +/** + * Get the timeout used for waiting on connections and response data + * (in milliseconds) */ -struct _SMBCCTX { - /** debug level - */ - int debug; - - /** netbios name used for making connections - */ - char * netbios_name; +int +smbc_getTimeout(SMBCCTX *c); - /** workgroup name used for making connections - */ - char * workgroup; +/** + * Set the timeout used for waiting on connections and response data + * (in milliseconds) + */ +void +smbc_setTimeout(SMBCCTX *c, int timeout); - /** username used for making connections - */ - char * user; - /** timeout used for waiting on connections / response data (in milliseconds) - */ - int timeout; - /** callable functions for files: - * For usage and return values see the smbc_* functions - */ - SMBCFILE * (*open) (SMBCCTX *c, const char *fname, int flags, mode_t mode); - SMBCFILE * (*creat) (SMBCCTX *c, const char *path, mode_t mode); - ssize_t (*read) (SMBCCTX *c, SMBCFILE *file, void *buf, size_t count); - ssize_t (*write) (SMBCCTX *c, SMBCFILE *file, void *buf, size_t count); - int (*unlink) (SMBCCTX *c, const char *fname); - int (*rename) (SMBCCTX *ocontext, const char *oname, - SMBCCTX *ncontext, const char *nname); - 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); - int (*close_fn) (SMBCCTX *c, SMBCFILE *file); - - /** callable functions for dirs - */ - SMBCFILE * (*opendir) (SMBCCTX *c, const char *fname); - int (*closedir)(SMBCCTX *c, SMBCFILE *dir); - struct smbc_dirent * (*readdir)(SMBCCTX *c, SMBCFILE *dir); - int (*getdents)(SMBCCTX *c, SMBCFILE *dir, - struct smbc_dirent *dirp, int count); - int (*mkdir) (SMBCCTX *c, const char *fname, mode_t mode); - int (*rmdir) (SMBCCTX *c, const char *fname); - off_t (*telldir) (SMBCCTX *c, SMBCFILE *dir); - int (*lseekdir)(SMBCCTX *c, SMBCFILE *dir, off_t offset); - int (*fstatdir)(SMBCCTX *c, SMBCFILE *dir, struct stat *st); - int (*chmod)(SMBCCTX *c, const char *fname, mode_t mode); - int (*utimes)(SMBCCTX *c, - const char *fname, struct timeval *tbuf); - int (*setxattr)(SMBCCTX *context, - const char *fname, - const char *name, - const void *value, - size_t size, - int flags); - int (*getxattr)(SMBCCTX *context, - const char *fname, - const char *name, - const void *value, - size_t size); - int (*removexattr)(SMBCCTX *context, - const char *fname, - const char *name); - int (*listxattr)(SMBCCTX *context, - const char *fname, - char *list, - size_t size); +/*********************************** + * Getters and setters for OPTIONS * + ***********************************/ - /** callable functions for printing - */ - int (*print_file)(SMBCCTX *c_file, const char *fname, - SMBCCTX *c_print, const char *printq); - SMBCFILE * (*open_print_job)(SMBCCTX *c, const char *fname); - int (*list_print_jobs)(SMBCCTX *c, const char *fname, smbc_list_print_job_fn fn); - int (*unlink_print_job)(SMBCCTX *c, const char *fname, int id); +/** Get whether to log to standard error instead of standard output */ +smbc_bool +smbc_getOptionDebugToStderr(SMBCCTX *c); +/** Set whether to log to standard error instead of standard output */ +void +smbc_setOptionDebugToStderr(SMBCCTX *c, smbc_bool b); - /* - ** Callbacks - * These callbacks _always_ have to be initialized because they will - * not be checked at dereference for increased speed. - */ - struct _smbc_callbacks { - /** authentication function callback: called upon auth requests - */ - smbc_get_auth_data_fn auth_fn; - - /** check if a server is still good - */ - smbc_check_server_fn check_server_fn; +/** + * Get whether to use new-style time attribute names, e.g. WRITE_TIME rather + * than the old-style names such as M_TIME. This allows also setting/getting + * CREATE_TIME which was previously unimplemented. (Note that the old C_TIME + * was supposed to be CHANGE_TIME but was confused and sometimes referred to + * CREATE_TIME.) + */ +smbc_bool +smbc_getOptionFullTimeNames(SMBCCTX *c); - /** remove a server if unused - */ - smbc_remove_unused_server_fn remove_unused_server_fn; +/** + * Set whether to use new-style time attribute names, e.g. WRITE_TIME rather + * than the old-style names such as M_TIME. This allows also setting/getting + * CREATE_TIME which was previously unimplemented. (Note that the old C_TIME + * was supposed to be CHANGE_TIME but was confused and sometimes referred to + * CREATE_TIME.) + */ +void +smbc_setOptionFullTimeNames(SMBCCTX *c, smbc_bool b); - /** Cache subsystem - * For an example cache system see samba/source/libsmb/libsmb_cache.c - * Cache subsystem functions follow. - */ +/** + * Get the share mode to use for files opened with SMBC_open_ctx(). The + * default is SMBC_SHAREMODE_DENY_NONE. + */ +smbc_share_mode +smbc_getOptionOpenShareMode(SMBCCTX *c); - /** server cache addition - */ - smbc_add_cached_srv_fn add_cached_srv_fn; +/** + * Set the share mode to use for files opened with SMBC_open_ctx(). The + * default is SMBC_SHAREMODE_DENY_NONE. + */ +void +smbc_setOptionOpenShareMode(SMBCCTX *c, smbc_share_mode share_mode); - /** server cache lookup - */ - smbc_get_cached_srv_fn get_cached_srv_fn; +/** Retrieve a previously saved user data handle */ +void * +smbc_getOptionUserData(SMBCCTX *c); - /** server cache removal - */ - smbc_remove_cached_srv_fn remove_cached_srv_fn; - - /** server cache purging, try to remove all cached servers (disconnect) - */ - smbc_purge_cached_fn purge_cached_fn; - } callbacks; +/** Save a user data handle */ +void +smbc_setOptionUserData(SMBCCTX *c, void *user_data); +/** Get the encoded value for encryption level. */ +smbc_smb_encrypt_level +smbc_getOptionSmbEncryptionLevel(SMBCCTX *c); - /** Space to store private data of the server cache. - */ - struct smbc_server_cache * server_cache; +/** Set the encoded value for encryption level. */ +void +smbc_setOptionSmbEncryptionLevel(SMBCCTX *c, smbc_smb_encrypt_level level); - int flags; - - /** user options selections that apply to this session - */ - struct _smbc_options { +/** + * Get from how many local master browsers should the list of workgroups be + * retrieved. It can take up to 12 minutes or longer after a server becomes a + * local master browser, for it to have the entire browse list (the list of + * workgroups/domains) from an entire network. Since a client never knows + * which local master browser will be found first, the one which is found + * first and used to retrieve a browse list may have an incomplete or empty + * browse list. By requesting the browse list from multiple local master + * browsers, a more complete list can be generated. For small networks (few + * workgroups), it is recommended that this value be set to 0, causing the + * browse lists from all found local master browsers to be retrieved and + * merged. For networks with many workgroups, a suitable value for this + * variable is probably somewhere around 3. (Default: 3). + */ +int +smbc_getOptionBrowseMaxLmbCount(SMBCCTX *c); - /* - * From how many local master browsers should the list of - * workgroups be retrieved? It can take up to 12 minutes or - * longer after a server becomes a local master browser, for - * it to have the entire browse list (the list of - * workgroups/domains) from an entire network. Since a client - * never knows which local master browser will be found first, - * the one which is found first and used to retrieve a browse - * list may have an incomplete or empty browse list. By - * requesting the browse list from multiple local master - * browsers, a more complete list can be generated. For small - * networks (few workgroups), it is recommended that this - * value be set to 0, causing the browse lists from all found - * local master browsers to be retrieved and merged. For - * networks with many workgroups, a suitable value for this - * variable is probably somewhere around 3. (Default: 3). - */ - int browse_max_lmb_count; - - /* - * There is a difference in the desired return strings from - * smbc_readdir() depending upon whether the filenames are to - * be displayed to the user, or whether they are to be - * appended to the path name passed to smbc_opendir() to call - * a further smbc_ function (e.g. open the file with - * smbc_open()). In the former case, the filename should be - * in "human readable" form. In the latter case, the smbc_ - * functions expect a URL which must be url-encoded. Those - * functions decode the URL. If, for example, smbc_readdir() - * returned a file name of "abc%20def.txt", passing a path - * with this file name attached to smbc_open() would cause - * smbc_open to attempt to open the file "abc def.txt" since - * the %20 is decoded into a space. - * - * Set this option to True if the names returned by - * smbc_readdir() should be url-encoded such that they can be - * passed back to another smbc_ call. Set it to False if the - * names returned by smbc_readdir() are to be presented to the - * user. - * - * For backwards compatibility, this option defaults to False. - */ - int urlencode_readdir_entries; - - /* - * Some Windows versions appear to have a limit to the number - * of concurrent SESSIONs and/or TREE CONNECTions. In - * one-shot programs (i.e. the program runs and then quickly - * ends, thereby shutting down all connections), it is - * probably reasonable to establish a new connection for each - * share. In long-running applications, the limitation can be - * avoided by using only a single connection to each server, - * and issuing a new TREE CONNECT when the share is accessed. - */ - int one_share_per_server; - } options; - - /** INTERNAL DATA - * do _NOT_ touch this from your program ! - */ - struct smbc_internal_data * internal; -}; +/** + * Set from how many local master browsers should the list of workgroups be + * retrieved. It can take up to 12 minutes or longer after a server becomes a + * local master browser, for it to have the entire browse list (the list of + * workgroups/domains) from an entire network. Since a client never knows + * which local master browser will be found first, the one which is found + * first and used to retrieve a browse list may have an incomplete or empty + * browse list. By requesting the browse list from multiple local master + * browsers, a more complete list can be generated. For small networks (few + * workgroups), it is recommended that this value be set to 0, causing the + * browse lists from all found local master browsers to be retrieved and + * merged. For networks with many workgroups, a suitable value for this + * variable is probably somewhere around 3. (Default: 3). + */ +void +smbc_setOptionBrowseMaxLmbCount(SMBCCTX *c, int count); + +/** + * Get whether to url-encode readdir entries. + * + * There is a difference in the desired return strings from + * smbc_readdir() depending upon whether the filenames are to + * be displayed to the user, or whether they are to be + * appended to the path name passed to smbc_opendir() to call + * a further smbc_ function (e.g. open the file with + * smbc_open()). In the former case, the filename should be + * in "human readable" form. In the latter case, the smbc_ + * functions expect a URL which must be url-encoded. Those + * functions decode the URL. If, for example, smbc_readdir() + * returned a file name of "abc%20def.txt", passing a path + * with this file name attached to smbc_open() would cause + * smbc_open to attempt to open the file "abc def.txt" since + * the %20 is decoded into a space. + * + * Set this option to True if the names returned by + * smbc_readdir() should be url-encoded such that they can be + * passed back to another smbc_ call. Set it to False if the + * names returned by smbc_readdir() are to be presented to the + * user. + * + * For backwards compatibility, this option defaults to False. + */ +smbc_bool +smbc_getOptionUrlEncodeReaddirEntries(SMBCCTX *c); + +/** + * Set whether to url-encode readdir entries. + * + * There is a difference in the desired return strings from + * smbc_readdir() depending upon whether the filenames are to + * be displayed to the user, or whether they are to be + * appended to the path name passed to smbc_opendir() to call + * a further smbc_ function (e.g. open the file with + * smbc_open()). In the former case, the filename should be + * in "human readable" form. In the latter case, the smbc_ + * functions expect a URL which must be url-encoded. Those + * functions decode the URL. If, for example, smbc_readdir() + * returned a file name of "abc%20def.txt", passing a path + * with this file name attached to smbc_open() would cause + * smbc_open to attempt to open the file "abc def.txt" since + * the %20 is decoded into a space. + * + * Set this option to True if the names returned by + * smbc_readdir() should be url-encoded such that they can be + * passed back to another smbc_ call. Set it to False if the + * names returned by smbc_readdir() are to be presented to the + * user. + * + * For backwards compatibility, this option defaults to False. + */ +void +smbc_setOptionUrlEncodeReaddirEntries(SMBCCTX *c, smbc_bool b); + +/** + * Get whether to use the same connection for all shares on a server. + * + * Some Windows versions appear to have a limit to the number + * of concurrent SESSIONs and/or TREE CONNECTions. In + * one-shot programs (i.e. the program runs and then quickly + * ends, thereby shutting down all connections), it is + * probably reasonable to establish a new connection for each + * share. In long-running applications, the limitation can be + * avoided by using only a single connection to each server, + * and issuing a new TREE CONNECT when the share is accessed. + */ +smbc_bool +smbc_getOptionOneSharePerServer(SMBCCTX *c); + +/** + * Set whether to use the same connection for all shares on a server. + * + * Some Windows versions appear to have a limit to the number + * of concurrent SESSIONs and/or TREE CONNECTions. In + * one-shot programs (i.e. the program runs and then quickly + * ends, thereby shutting down all connections), it is + * probably reasonable to establish a new connection for each + * share. In long-running applications, the limitation can be + * avoided by using only a single connection to each server, + * and issuing a new TREE CONNECT when the share is accessed. + */ +void +smbc_setOptionOneSharePerServer(SMBCCTX *c, smbc_bool b); + +/** Get whether to enable use of kerberos */ +smbc_bool +smbc_getOptionUseKerberos(SMBCCTX *c); + +/** Set whether to enable use of kerberos */ +void +smbc_setOptionUseKerberos(SMBCCTX *c, smbc_bool b); + +/** Get whether to fallback after kerberos */ +smbc_bool +smbc_getOptionFallbackAfterKerberos(SMBCCTX *c); + +/** Set whether to fallback after kerberos */ +void +smbc_setOptionFallbackAfterKerberos(SMBCCTX *c, smbc_bool b); + +/** Get whether to automatically select anonymous login */ +smbc_bool +smbc_getOptionNoAutoAnonymousLogin(SMBCCTX *c); + +/** Set whether to automatically select anonymous login */ +void +smbc_setOptionNoAutoAnonymousLogin(SMBCCTX *c, smbc_bool b); + + + +/************************************* + * Getters and setters for FUNCTIONS * + *************************************/ + +/** Get the function for obtaining authentication data */ +smbc_get_auth_data_fn smbc_getFunctionAuthData(SMBCCTX *c); + +/** Set the function for obtaining authentication data */ +void smbc_setFunctionAuthData(SMBCCTX *c, smbc_get_auth_data_fn fn); + +/** Get the new-style authentication function which includes the context. */ +smbc_get_auth_data_with_context_fn +smbc_getFunctionAuthDataWithContext(SMBCCTX *c); + +/** Set the new-style authentication function which includes the context. */ +void +smbc_setFunctionAuthDataWithContext(SMBCCTX *c, + smbc_get_auth_data_with_context_fn fn); + +/** Get the function for checking if a server is still good */ +smbc_check_server_fn smbc_getFunctionCheckServer(SMBCCTX *c); + +/** Set the function for checking if a server is still good */ +void smbc_setFunctionCheckServer(SMBCCTX *c, smbc_check_server_fn fn); + +/** Get the function for removing a server if unused */ +smbc_remove_unused_server_fn smbc_getFunctionRemoveUnusedServer(SMBCCTX *c); + +/** Set the function for removing a server if unused */ +void smbc_setFunctionRemoveUnusedServer(SMBCCTX *c, + smbc_remove_unused_server_fn fn); + +/** Get the function for adding a cached server */ +smbc_add_cached_srv_fn smbc_getFunctionAddCachedServer(SMBCCTX *c); + +/** Set the function for adding a cached server */ +void smbc_setFunctionAddCachedServer(SMBCCTX *c, smbc_add_cached_srv_fn fn); + +/** Get the function for server cache lookup */ +smbc_get_cached_srv_fn smbc_getFunctionGetCachedServer(SMBCCTX *c); + +/** Set the function for server cache lookup */ +void smbc_setFunctionGetCachedServer(SMBCCTX *c, smbc_get_cached_srv_fn fn); + +/** Get the function for server cache removal */ +smbc_remove_cached_srv_fn smbc_getFunctionRemoveCachedServer(SMBCCTX *c); + +/** Set the function for server cache removal */ +void smbc_setFunctionRemoveCachedServer(SMBCCTX *c, + smbc_remove_cached_srv_fn fn); + +/** + * Get the function for server cache purging. This function tries to + * remove all cached servers (e.g. on disconnect) + */ +smbc_purge_cached_fn smbc_getFunctionPurgeCachedServers(SMBCCTX *c); + +/** + * Set the function for server cache purging. This function tries to + * remove all cached servers (e.g. on disconnect) + */ +void smbc_setFunctionPurgeCachedServers(SMBCCTX *c, + smbc_purge_cached_fn fn); + +/** Get the function to store private data of the server cache */ +struct smbc_server_cache * smbc_getServerCacheData(SMBCCTX *c); + +/** Set the function to store private data of the server cache */ +void smbc_setServerCacheData(SMBCCTX *c, struct smbc_server_cache * cache); + + + +/***************************************************************** + * Callable functions for files. * + * Each callable has a function signature typedef, a declaration * + * for the getter, and a declaration for the setter. * + *****************************************************************/ + +typedef SMBCFILE * (*smbc_open_fn)(SMBCCTX *c, + const char *fname, + int flags, + mode_t mode); +smbc_open_fn smbc_getFunctionOpen(SMBCCTX *c); +void smbc_setFunctionOpen(SMBCCTX *c, smbc_open_fn fn); + +typedef SMBCFILE * (*smbc_creat_fn)(SMBCCTX *c, + const char *path, + mode_t mode); +smbc_creat_fn smbc_getFunctionCreat(SMBCCTX *c); +void smbc_setFunctionCreat(SMBCCTX *c, smbc_creat_fn); + +typedef ssize_t (*smbc_read_fn)(SMBCCTX *c, + SMBCFILE *file, + void *buf, + size_t count); +smbc_read_fn smbc_getFunctionRead(SMBCCTX *c); +void smbc_setFunctionRead(SMBCCTX *c, smbc_read_fn fn); + +typedef ssize_t (*smbc_write_fn)(SMBCCTX *c, + SMBCFILE *file, + void *buf, + size_t count); +smbc_write_fn smbc_getFunctionWrite(SMBCCTX *c); +void smbc_setFunctionWrite(SMBCCTX *c, smbc_write_fn fn); + +typedef int (*smbc_unlink_fn)(SMBCCTX *c, + const char *fname); +smbc_unlink_fn smbc_getFunctionUnlink(SMBCCTX *c); +void smbc_setFunctionUnlink(SMBCCTX *c, smbc_unlink_fn fn); + +typedef int (*smbc_rename_fn)(SMBCCTX *ocontext, + const char *oname, + SMBCCTX *ncontext, + const char *nname); +smbc_rename_fn smbc_getFunctionRename(SMBCCTX *c); +void smbc_setFunctionRename(SMBCCTX *c, smbc_rename_fn fn); + +typedef off_t (*smbc_lseek_fn)(SMBCCTX *c, + SMBCFILE * file, + off_t offset, + int whence); +smbc_lseek_fn smbc_getFunctionLseek(SMBCCTX *c); +void smbc_setFunctionLseek(SMBCCTX *c, smbc_lseek_fn fn); + +typedef int (*smbc_stat_fn)(SMBCCTX *c, + const char *fname, + struct stat *st); +smbc_stat_fn smbc_getFunctionStat(SMBCCTX *c); +void smbc_setFunctionStat(SMBCCTX *c, smbc_stat_fn fn); + +typedef int (*smbc_fstat_fn)(SMBCCTX *c, + SMBCFILE *file, + struct stat *st); +smbc_fstat_fn smbc_getFunctionFstat(SMBCCTX *c); +void smbc_setFunctionFstat(SMBCCTX *c, smbc_fstat_fn fn); + +typedef int (*smbc_ftruncate_fn)(SMBCCTX *c, + SMBCFILE *f, + off_t size); +smbc_ftruncate_fn smbc_getFunctionFtruncate(SMBCCTX *c); +void smbc_setFunctionFtruncate(SMBCCTX *c, smbc_ftruncate_fn fn); + +typedef int (*smbc_close_fn)(SMBCCTX *c, + SMBCFILE *file); +smbc_close_fn smbc_getFunctionClose(SMBCCTX *c); +void smbc_setFunctionClose(SMBCCTX *c, smbc_close_fn fn); + + + +/***************************************************************** + * Callable functions for directories. * + * Each callable has a function signature typedef, a declaration * + * for the getter, and a declaration for the setter. * + *****************************************************************/ + +typedef SMBCFILE * (*smbc_opendir_fn)(SMBCCTX *c, + const char *fname); +smbc_opendir_fn smbc_getFunctionOpendir(SMBCCTX *c); +void smbc_setFunctionOpendir(SMBCCTX *c, smbc_opendir_fn fn); + +typedef int (*smbc_closedir_fn)(SMBCCTX *c, + SMBCFILE *dir); +smbc_closedir_fn smbc_getFunctionClosedir(SMBCCTX *c); +void smbc_setFunctionClosedir(SMBCCTX *c, smbc_closedir_fn fn); + +typedef struct smbc_dirent * (*smbc_readdir_fn)(SMBCCTX *c, + SMBCFILE *dir); +smbc_readdir_fn smbc_getFunctionReaddir(SMBCCTX *c); +void smbc_setFunctionReaddir(SMBCCTX *c, smbc_readdir_fn fn); + +typedef int (*smbc_getdents_fn)(SMBCCTX *c, + SMBCFILE *dir, + struct smbc_dirent *dirp, + int count); +smbc_getdents_fn smbc_getFunctionGetdents(SMBCCTX *c); +void smbc_setFunctionGetdents(SMBCCTX *c, smbc_getdents_fn fn); + +typedef int (*smbc_mkdir_fn)(SMBCCTX *c, + const char *fname, + mode_t mode); +smbc_mkdir_fn smbc_getFunctionMkdir(SMBCCTX *c); +void smbc_setFunctionMkdir(SMBCCTX *c, smbc_mkdir_fn fn); + +typedef int (*smbc_rmdir_fn)(SMBCCTX *c, + const char *fname); +smbc_rmdir_fn smbc_getFunctionRmdir(SMBCCTX *c); +void smbc_setFunctionRmdir(SMBCCTX *c, smbc_rmdir_fn fn); + +typedef off_t (*smbc_telldir_fn)(SMBCCTX *c, + SMBCFILE *dir); +smbc_telldir_fn smbc_getFunctionTelldir(SMBCCTX *c); +void smbc_setFunctionTelldir(SMBCCTX *c, smbc_telldir_fn fn); + +typedef int (*smbc_lseekdir_fn)(SMBCCTX *c, + SMBCFILE *dir, + off_t offset); +smbc_lseekdir_fn smbc_getFunctionLseekdir(SMBCCTX *c); +void smbc_setFunctionLseekdir(SMBCCTX *c, smbc_lseekdir_fn fn); + +typedef int (*smbc_fstatdir_fn)(SMBCCTX *c, + SMBCFILE *dir, + struct stat *st); +smbc_fstatdir_fn smbc_getFunctionFstatdir(SMBCCTX *c); +void smbc_setFunctionFstatdir(SMBCCTX *c, smbc_fstatdir_fn fn); + + + +/***************************************************************** + * Callable functions applicable to both files and directories. * + * Each callable has a function signature typedef, a declaration * + * for the getter, and a declaration for the setter. * + *****************************************************************/ + +typedef int (*smbc_chmod_fn)(SMBCCTX *c, + const char *fname, + mode_t mode); +smbc_chmod_fn smbc_getFunctionChmod(SMBCCTX *c); +void smbc_setFunctionChmod(SMBCCTX *c, smbc_chmod_fn fn); + +typedef int (*smbc_utimes_fn)(SMBCCTX *c, + const char *fname, + struct timeval *tbuf); +smbc_utimes_fn smbc_getFunctionUtimes(SMBCCTX *c); +void smbc_setFunctionUtimes(SMBCCTX *c, smbc_utimes_fn fn); + +typedef int (*smbc_setxattr_fn)(SMBCCTX *context, + const char *fname, + const char *name, + const void *value, + size_t size, + int flags); +smbc_setxattr_fn smbc_getFunctionSetxattr(SMBCCTX *c); +void smbc_setFunctionSetxattr(SMBCCTX *c, smbc_setxattr_fn fn); + +typedef int (*smbc_getxattr_fn)(SMBCCTX *context, + const char *fname, + const char *name, + const void *value, + size_t size); +smbc_getxattr_fn smbc_getFunctionGetxattr(SMBCCTX *c); +void smbc_setFunctionGetxattr(SMBCCTX *c, smbc_getxattr_fn fn); + +typedef int (*smbc_removexattr_fn)(SMBCCTX *context, + const char *fname, + const char *name); +smbc_removexattr_fn smbc_getFunctionRemovexattr(SMBCCTX *c); +void smbc_setFunctionRemovexattr(SMBCCTX *c, smbc_removexattr_fn fn); + +typedef int (*smbc_listxattr_fn)(SMBCCTX *context, + const char *fname, + char *list, + size_t size); +smbc_listxattr_fn smbc_getFunctionListxattr(SMBCCTX *c); +void smbc_setFunctionListxattr(SMBCCTX *c, smbc_listxattr_fn fn); + + + +/***************************************************************** + * Callable functions for printing. * + * Each callable has a function signature typedef, a declaration * + * for the getter, and a declaration for the setter. * + *****************************************************************/ + +typedef int (*smbc_print_file_fn)(SMBCCTX *c_file, + const char *fname, + SMBCCTX *c_print, + const char *printq); +smbc_print_file_fn smbc_getFunctionPrintFile(SMBCCTX *c); +void smbc_setFunctionPrintFile(SMBCCTX *c, smbc_print_file_fn fn); + +typedef SMBCFILE * (*smbc_open_print_job_fn)(SMBCCTX *c, + const char *fname); +smbc_open_print_job_fn smbc_getFunctionOpenPrintJob(SMBCCTX *c); +void smbc_setFunctionOpenPrintJob(SMBCCTX *c, + smbc_open_print_job_fn fn); + +typedef int (*smbc_list_print_jobs_fn)(SMBCCTX *c, + const char *fname, + smbc_list_print_job_fn fn); +smbc_list_print_jobs_fn smbc_getFunctionListPrintJobs(SMBCCTX *c); +void smbc_setFunctionListPrintJobs(SMBCCTX *c, + smbc_list_print_jobs_fn fn); + +typedef int (*smbc_unlink_print_job_fn)(SMBCCTX *c, + const char *fname, + int id); +smbc_unlink_print_job_fn smbc_getFunctionUnlinkPrintJob(SMBCCTX *c); +void smbc_setFunctionUnlinkPrintJob(SMBCCTX *c, + smbc_unlink_print_job_fn fn); -/* Flags for SMBCCTX->flags */ -#define SMB_CTX_FLAG_USE_KERBEROS (1 << 0) -#define SMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS (1 << 1) -#define SMBCCTX_FLAG_NO_AUTO_ANONYMOUS_LOGON (1 << 2) /* don't try to do automatic anon login */ /**@ingroup misc * Create a new SBMCCTX (a context). @@ -630,35 +1016,16 @@ int smbc_free_context(SMBCCTX * context, int shutdown_ctx); /**@ingroup misc - * Each time the context structure is changed, we have binary backward - * compatibility issues. Instead of modifying the public portions of the - * context structure to add new options, instead, we put them in the internal - * portion of the context structure and provide a set function for these new - * options. - * - * @param context A pointer to a SMBCCTX obtained from smbc_new_context() - * - * @param option_name - * The name of the option for which the value is to be set - * - * @param option_value - * The new value of the option being set * + * @deprecated. Use smbc_setOption*() functions instead. */ void smbc_option_set(SMBCCTX *context, char *option_name, ... /* option_value */); + /* - * Retrieve the current value of an option - * - * @param context A pointer to a SMBCCTX obtained from smbc_new_context() - * - * @param option_name - * The name of the option for which the value is to be - * retrieved - * - * @return The value of the specified option. + * @deprecated. Use smbc_getOption*() functions instead. */ void * smbc_option_get(SMBCCTX *context, @@ -1193,6 +1560,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. * @@ -2190,5 +2577,232 @@ smbc_version(void); } #endif +/** + * @ingroup structure + * Structure that contains a client context information + * This structure is known as SMBCCTX + * + * DO NOT DIRECTLY MANIPULATE THE CONTEXT STRUCTURE! The data in the context + * structure should all be considered private to the library. It remains here + * only for backward compatibility. + * + * See the comments herein for use of the setter and getter functions which + * should now be used for manipulating these values. New features, functions, + * etc., are not added here but rather in _internal where they are not + * directly visible to applications. This makes it much easier to maintain + * ABI compatibility. + */ +struct _SMBCCTX +{ + /** + * debug level + * + * DEPRECATED: + * Use smbc_getDebug() and smbc_setDebug() + */ + int debug DEPRECATED_SMBC_INTERFACE; + + /** + * netbios name used for making connections + * + * DEPRECATED: + * Use smbc_getNetbiosName() and smbc_setNetbiosName() + */ + char * netbios_name DEPRECATED_SMBC_INTERFACE; + + /** + * workgroup name used for making connections + * + * DEPRECATED: + * Use smbc_getWorkgroup() and smbc_setWorkgroup() + */ + char * workgroup DEPRECATED_SMBC_INTERFACE; + + /** + * username used for making connections + * + * DEPRECATED: + * Use smbc_getUser() and smbc_setUser() + */ + char * user DEPRECATED_SMBC_INTERFACE; + + /** + * timeout used for waiting on connections / response data (in + * milliseconds) + * + * DEPRECATED: + * Use smbc_getTimeout() and smbc_setTimeout() + */ + int timeout DEPRECATED_SMBC_INTERFACE; + + /** + * callable functions for files: + * For usage and return values see the SMBC_* functions + * + * DEPRECATED: + * + * Use smbc_getFunction*() and smbc_setFunction*(), e.g. + * smbc_getFunctionOpen(), smbc_setFunctionUnlink(), etc. + */ + smbc_open_fn open DEPRECATED_SMBC_INTERFACE; + smbc_creat_fn creat DEPRECATED_SMBC_INTERFACE; + smbc_read_fn read DEPRECATED_SMBC_INTERFACE; + smbc_write_fn write DEPRECATED_SMBC_INTERFACE; + smbc_unlink_fn unlink DEPRECATED_SMBC_INTERFACE; + smbc_rename_fn rename DEPRECATED_SMBC_INTERFACE; + smbc_lseek_fn lseek DEPRECATED_SMBC_INTERFACE; + smbc_stat_fn stat DEPRECATED_SMBC_INTERFACE; + smbc_fstat_fn fstat DEPRECATED_SMBC_INTERFACE; +#if 0 /* internal */ + smbc_ftruncate_fn ftruncate_fn; +#endif + smbc_close_fn close_fn DEPRECATED_SMBC_INTERFACE; + smbc_opendir_fn opendir DEPRECATED_SMBC_INTERFACE; + smbc_closedir_fn closedir DEPRECATED_SMBC_INTERFACE; + smbc_readdir_fn readdir DEPRECATED_SMBC_INTERFACE; + smbc_getdents_fn getdents DEPRECATED_SMBC_INTERFACE; + smbc_mkdir_fn mkdir DEPRECATED_SMBC_INTERFACE; + smbc_rmdir_fn rmdir DEPRECATED_SMBC_INTERFACE; + smbc_telldir_fn telldir DEPRECATED_SMBC_INTERFACE; + smbc_lseekdir_fn lseekdir DEPRECATED_SMBC_INTERFACE; + smbc_fstatdir_fn fstatdir DEPRECATED_SMBC_INTERFACE; + smbc_chmod_fn chmod DEPRECATED_SMBC_INTERFACE; + smbc_utimes_fn utimes DEPRECATED_SMBC_INTERFACE; + smbc_setxattr_fn setxattr DEPRECATED_SMBC_INTERFACE; + smbc_getxattr_fn getxattr DEPRECATED_SMBC_INTERFACE; + smbc_removexattr_fn removexattr DEPRECATED_SMBC_INTERFACE; + smbc_listxattr_fn listxattr DEPRECATED_SMBC_INTERFACE; + + /* Printing-related functions */ + smbc_print_file_fn print_file DEPRECATED_SMBC_INTERFACE; + smbc_open_print_job_fn open_print_job DEPRECATED_SMBC_INTERFACE; + smbc_list_print_jobs_fn list_print_jobs DEPRECATED_SMBC_INTERFACE; + smbc_unlink_print_job_fn unlink_print_job DEPRECATED_SMBC_INTERFACE; + + /* + ** Callbacks + * + * DEPRECATED: + * + * See the comment above each field, for the getter and setter + * functions that should now be used. + */ + struct _smbc_callbacks + { + /** + * authentication function callback: called upon auth requests + * + * DEPRECATED: + * Use smbc_getFunctionAuthData(), smbc_setFunctionAuthData() + */ + smbc_get_auth_data_fn auth_fn DEPRECATED_SMBC_INTERFACE; + + /** + * check if a server is still good + * + * DEPRECATED: + * Use smbc_getFunctionCheckServer(), + * smbc_setFunctionCheckServer() + */ + smbc_check_server_fn check_server_fn DEPRECATED_SMBC_INTERFACE; + + /** + * remove a server if unused + * + * DEPRECATED: + * Use smbc_getFunctionRemoveUnusedServer(), + * smbc_setFunctionCheckServer() + */ + smbc_remove_unused_server_fn remove_unused_server_fn DEPRECATED_SMBC_INTERFACE; + + /** Cache subsystem + * + * For an example cache system see + * samba/source/libsmb/libsmb_cache.c + * + * Cache subsystem * functions follow. + */ + + /** + * server cache addition + * + * DEPRECATED: + * Use smbc_getFunctionAddCachedServer(), + * smbc_setFunctionAddCachedServer() + */ + smbc_add_cached_srv_fn add_cached_srv_fn DEPRECATED_SMBC_INTERFACE; + + /** + * server cache lookup + * + * DEPRECATED: + * Use smbc_getFunctionGetCachedServer(), + * smbc_setFunctionGetCachedServer() + */ + smbc_get_cached_srv_fn get_cached_srv_fn DEPRECATED_SMBC_INTERFACE; + + /** + * server cache removal + * + * DEPRECATED: + * Use smbc_getFunctionRemoveCachedServer(), + * smbc_setFunctionRemoveCachedServer() + */ + smbc_remove_cached_srv_fn remove_cached_srv_fn DEPRECATED_SMBC_INTERFACE; + + /** + * server cache purging, try to remove all cached servers + * (disconnect) + * + * DEPRECATED: + * Use smbc_getFunctionPurgeCachedServers(), + * smbc_setFunctionPurgeCachedServers() + */ + smbc_purge_cached_fn purge_cached_fn DEPRECATED_SMBC_INTERFACE; + } callbacks; + + /** + * Space where the private data of the server cache used to be + * + * DEPRECATED: + * Use smbc_getServerCacheData(), smbc_setServerCacheData() + */ + void * reserved DEPRECATED_SMBC_INTERFACE; + + /* + * Very old configuration options. + * + * DEPRECATED: + * Use one of the following functions instead: + * smbc_setOptionUseKerberos() + * smbc_getOptionUseKerberos() + * smbc_setOptionFallbackAfterKerberos() + * smbc_getOptionFallbackAfterKerberos() + * smbc_setOptionNoAutoAnonymousLogin() + * smbc_getOptionNoAutoAnonymousLogin() + */ + int flags DEPRECATED_SMBC_INTERFACE; + + /** + * user options selections that apply to this session + * + * NEW OPTIONS ARE NOT ADDED HERE! + * + * DEPRECATED: + * To set and retrieve options, use the smbc_setOption*() and + * smbc_getOption*() functions. + */ + struct _smbc_options { + int browse_max_lmb_count DEPRECATED_SMBC_INTERFACE; + int urlencode_readdir_entries DEPRECATED_SMBC_INTERFACE; + int one_share_per_server DEPRECATED_SMBC_INTERFACE; + } options DEPRECATED_SMBC_INTERFACE; + + /** INTERNAL DATA + * do _NOT_ touch this from your program ! + */ + struct SMBC_internal_data * internal; +}; + #endif /* SMBCLIENT_H_INCLUDED */ 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/reg_objects.h b/source3/include/reg_objects.h index 3df701f61c..1d0d0d4996 100644 --- a/source3/include/reg_objects.h +++ b/source3/include/reg_objects.h @@ -105,9 +105,16 @@ typedef struct { #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_GROUP_POLICY "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Group Policy" +#define KEY_WINLOGON "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon" #define KEY_SMBCONF "HKLM\\SOFTWARE\\Samba\\smbconf" +#define KEY_SAMBA_GROUP_POLICY "HKLM\\SOFTWARE\\Samba\\Group Policy" #define KEY_TREE_ROOT "" +#define KEY_GP_MACHINE_POLICY "HKLM\\Software\\Policies" +#define KEY_GP_MACHINE_WIN_POLICY "HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies" +#define KEY_GP_USER_POLICY "HKCU\\Software\\Policies" +#define KEY_GP_USER_WIN_POLICY "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies" /* * Registry key types * Most keys are going to be GENERIC -- may need a better name? 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 c560fd0909..e1ebb2509d 100644 --- a/source3/include/rpc_client.h +++ b/source3/include/rpc_client.h @@ -34,6 +34,7 @@ #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_lsa.h b/source3/include/rpc_lsa.h index 724a980b45..b4021afd0a 100644 --- a/source3/include/rpc_lsa.h +++ b/source3/include/rpc_lsa.h @@ -23,547 +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 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 ) - -/*******************************************************/ - -/*******************************************************/ - -#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; - -/* 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_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; - -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 { - 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; +#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 f2802b8e72..cd88ffef59 100644 --- a/source3/include/rpc_netlogon.h +++ b/source3/include/rpc_netlogon.h @@ -23,59 +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 - -/* 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 */ @@ -104,515 +51,9 @@ #define MSV1_0_RETURN_PROFILE_PATH 0x00000200 #endif -#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; - -/* 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; @@ -632,356 +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 DSGETDC_VALID_FLAGS ( \ DS_FORCE_REDISCOVERY | \ DS_DIRECTORY_SERVICE_REQUIRED | \ 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 62c6b167db..0000000000 --- a/source3/include/rpc_samr.h +++ /dev/null @@ -1,160 +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 /* this is SAMR_SET_USERINFO! */ -#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 /* this is SAMR_SET_USERINFO2! */ -#define SAMR_CONNECT4 0x3E -#define SAMR_CHGPASSWD_USER3 0x3F -#define SAMR_CONNECT5 0x40 - -#define PASS_MUST_CHANGE_AT_NEXT_LOGON 0x01 -#define PASS_DONT_CHANGE_AT_NEXT_LOGON 0x00 - -#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 - -/* these are from the old rpc_samr.h - they are needed while the merge - is still going on */ -#define MAX_SAM_SIDS 15 - -#endif /* _RPC_SAMR_H */ diff --git a/source3/include/rpc_srvsvc.h b/source3/include/rpc_srvsvc.h index 097c0d4348..d0b25e4fad 100644 --- a/source3/include/rpc_srvsvc.h +++ b/source3/include/rpc_srvsvc.h @@ -683,145 +683,6 @@ typedef struct { WERROR status; } SRV_R_NET_FILE_ENUM; -/* SRV_INFO_100 */ -typedef struct srv_info_100_info -{ - uint32 platform_id; /* 0x500 */ - uint32 ptr_name; /* pointer to server name */ - - UNISTR2 uni_name; /* server name "server" */ - -} SRV_INFO_100; - -/* SRV_INFO_101 */ -typedef struct srv_info_101_info -{ - uint32 platform_id; /* 0x500 */ - uint32 ptr_name; /* pointer to server name */ - uint32 ver_major; /* 0x4 */ - uint32 ver_minor; /* 0x2 */ - uint32 srv_type; /* browse etc type */ - uint32 ptr_comment; /* pointer to server comment */ - - UNISTR2 uni_name; /* server name "server" */ - UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */ - -} SRV_INFO_101; - -/* SRV_INFO_102 */ -typedef struct srv_info_102_info -{ - uint32 platform_id; /* 0x500 */ - uint32 ptr_name; /* pointer to server name */ - uint32 ver_major; /* 0x4 */ - uint32 ver_minor; /* 0x2 */ - uint32 srv_type; /* browse etc type */ - uint32 ptr_comment; /* pointer to server comment */ - uint32 users; /* 0xffff ffff*/ - uint32 disc; /* 0xf */ - uint32 hidden; /* 0x0 */ - uint32 announce; /* 240 */ - uint32 ann_delta; /* 3000 */ - uint32 licenses; /* 0 */ - uint32 ptr_usr_path; /* pointer to user path */ - - UNISTR2 uni_name; /* server name "server" */ - UNISTR2 uni_comment; /* server comment "samba x.x.x blah" */ - UNISTR2 uni_usr_path; /* "c:\" (eh?) */ - -} SRV_INFO_102; - - -/* SRV_INFO_CTR */ -typedef struct srv_info_ctr_info -{ - uint32 switch_value; /* switch value */ - uint32 ptr_srv_ctr; /* pointer to server info */ - union - { - SRV_INFO_102 sv102; /* server info level 102 */ - SRV_INFO_101 sv101; /* server info level 101 */ - SRV_INFO_100 sv100; /* server info level 100 */ - - } srv; - -} SRV_INFO_CTR; - -/* SRV_Q_NET_SRV_GET_INFO */ -typedef struct q_net_srv_get_info -{ - uint32 ptr_srv_name; - UNISTR2 uni_srv_name; /* "\\server" */ - uint32 switch_value; - -} SRV_Q_NET_SRV_GET_INFO; - -/* SRV_R_NET_SRV_GET_INFO */ -typedef struct r_net_srv_get_info -{ - SRV_INFO_CTR *ctr; - - WERROR status; /* return status */ - -} SRV_R_NET_SRV_GET_INFO; - -/* SRV_Q_NET_SRV_SET_INFO */ -typedef struct q_net_srv_set_info -{ - uint32 ptr_srv_name; - UNISTR2 uni_srv_name; /* "\\server" */ - uint32 switch_value; - - SRV_INFO_CTR *ctr; - -} SRV_Q_NET_SRV_SET_INFO; - - -/* SRV_R_NET_SRV_SET_INFO */ -typedef struct r_net_srv_set_info -{ - uint32 switch_value; /* switch value */ - - WERROR status; /* return status */ - -} SRV_R_NET_SRV_SET_INFO; - -/* SRV_Q_NET_REMOTE_TOD */ -typedef struct q_net_remote_tod -{ - uint32 ptr_srv_name; - UNISTR2 uni_srv_name; /* "\\server" */ - -} SRV_Q_NET_REMOTE_TOD; - -/* TIME_OF_DAY_INFO */ -typedef struct time_of_day_info -{ - uint32 elapsedt; - uint32 msecs; - uint32 hours; - uint32 mins; - uint32 secs; - uint32 hunds; - uint32 zone; - uint32 tintervals; - uint32 day; - uint32 month; - uint32 year; - uint32 weekday; - -} TIME_OF_DAY_INFO; - -/* SRV_R_NET_REMOTE_TOD */ -typedef struct r_net_remote_tod -{ - uint32 ptr_srv_tod; /* pointer to TOD */ - TIME_OF_DAY_INFO *tod; - - WERROR status; /* return status */ - -} SRV_R_NET_REMOTE_TOD; - /* SRV_Q_NET_FILE_QUERY_SECDESC */ typedef struct q_net_file_query_secdesc { 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 3e0c997997..c582a97e5c 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -308,6 +308,8 @@ extern const DATA_BLOB data_blob_null; #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; 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 |