diff options
Diffstat (limited to 'source/include')
50 files changed, 2230 insertions, 946 deletions
diff --git a/source/include/ads.h b/source/include/ads.h index cbab016d46e..fcaeb2069d2 100644 --- a/source/include/ads.h +++ b/source/include/ads.h @@ -10,9 +10,8 @@ enum wb_posix_mapping { WB_POSIX_MAP_UNKNOWN = -1, WB_POSIX_MAP_TEMPLATE = 0, WB_POSIX_MAP_SFU = 1, - WB_POSIX_MAP_SFU20 = 2, - WB_POSIX_MAP_RFC2307 = 3, - WB_POSIX_MAP_UNIXINFO = 4 + WB_POSIX_MAP_RFC2307 = 2, + WB_POSIX_MAP_UNIXINFO = 3 }; typedef struct { @@ -122,22 +121,14 @@ typedef void **ADS_MODLIST; #define ADS_PERMIT_MODIFY_OID "1.2.840.113556.1.4.1413" #define ADS_ASQ_OID "1.2.840.113556.1.4.1504" #define ADS_EXTENDED_DN_OID "1.2.840.113556.1.4.529" -#define ADS_SD_FLAGS_OID "1.2.840.113556.1.4.801" -/* ldap attribute oids (Services for Unix 3.0, 3.5) */ +/* ldap attribute oids (Services for Unix) */ #define ADS_ATTR_SFU_UIDNUMBER_OID "1.2.840.113556.1.6.18.1.310" #define ADS_ATTR_SFU_GIDNUMBER_OID "1.2.840.113556.1.6.18.1.311" #define ADS_ATTR_SFU_HOMEDIR_OID "1.2.840.113556.1.6.18.1.344" #define ADS_ATTR_SFU_SHELL_OID "1.2.840.113556.1.6.18.1.312" #define ADS_ATTR_SFU_GECOS_OID "1.2.840.113556.1.6.18.1.337" -/* ldap attribute oids (Services for Unix 2.0) */ -#define ADS_ATTR_SFU20_UIDNUMBER_OID "1.2.840.113556.1.4.7000.187.70" -#define ADS_ATTR_SFU20_GIDNUMBER_OID "1.2.840.113556.1.4.7000.187.71" -#define ADS_ATTR_SFU20_HOMEDIR_OID "1.2.840.113556.1.4.7000.187.106" -#define ADS_ATTR_SFU20_SHELL_OID "1.2.840.113556.1.4.7000.187.72" -#define ADS_ATTR_SFU20_GECOS_OID "1.2.840.113556.1.4.7000.187.97" - /* ldap attribute oids (RFC2307) */ #define ADS_ATTR_RFC2307_UIDNUMBER_OID "1.3.6.1.1.1.1.0" #define ADS_ATTR_RFC2307_GIDNUMBER_OID "1.3.6.1.1.1.1.1" @@ -258,11 +249,6 @@ typedef void **ADS_MODLIST; GROUP_TYPE_ACCOUNT_GROUP| \ GROUP_TYPE_SECURITY_ENABLED \ ) -#define GTYPE_SECURITY_UNIVERSAL_GROUP ( /* 0x80000008 -2147483656 */ \ - GROUP_TYPE_UNIVERSAL_GROUP| \ - GROUP_TYPE_SECURITY_ENABLED \ - ) - #define GTYPE_DISTRIBUTION_GLOBAL_GROUP 0x00000002 /* 2 */ #define GTYPE_DISTRIBUTION_DOMAIN_LOCAL_GROUP 0x00000004 /* 4 */ #define GTYPE_DISTRIBUTION_UNIVERSAL_GROUP 0x00000008 /* 8 */ @@ -312,12 +298,6 @@ typedef void **ADS_MODLIST; #ifdef HAVE_KRB5 typedef struct { - NTSTATUS ntstatus; - uint32 unknown1; - uint32 unknown2; /* 0x00000001 */ -} KRB5_EDATA_NTSTATUS; - -typedef struct { #if defined(HAVE_MAGIC_IN_KRB5_ADDRESS) && defined(HAVE_ADDRTYPE_IN_KRB5_ADDRESS) /* MIT */ krb5_address **addrs; #elif defined(HAVE_KRB5_ADDRESSES) /* Heimdal */ diff --git a/source/include/ads_protos.h b/source/include/ads_protos.h index 0cd7c2cac07..b5f323774d3 100644 --- a/source/include/ads_protos.h +++ b/source/include/ads_protos.h @@ -76,15 +76,6 @@ ADS_STATUS ads_search_retry_extended_dn(ADS_STRUCT *ads, LDAPMessage **res, const char *dn, const char **attrs, enum ads_extended_dn_flags flags); -ADS_STATUS ads_search_retry_extended_dn_ranged(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, - const char *dn, - const char **attrs, - enum ads_extended_dn_flags flags, - char ***strings, - size_t *num_strings); -BOOL ads_get_dn_from_extended_dn(TALLOC_CTX *mem_ctx, - const char *extended_dn, - char **dn); ADS_STATUS ads_search_retry_sid(ADS_STRUCT *ads, LDAPMessage **res, const DOM_SID *sid, const char **attrs); @@ -102,18 +93,3 @@ ADS_STATUS ads_parse_gpo(ADS_STRUCT *ads, LDAPMessage *res, const char *gpo_dn, struct GROUP_POLICY_OBJECT *gpo); -ADS_STATUS ads_search_retry_dn_sd_flags(ADS_STRUCT *ads, LDAPMessage **res, - uint32 sd_flags, - const char *dn, - const char **attrs); -ADS_STATUS ads_do_search_all_sd_flags(ADS_STRUCT *ads, const char *bind_path, - int scope, const char *expr, - const char **attrs, uint32 sd_flags, - LDAPMessage **res); -ADS_STATUS ads_get_tokensids(ADS_STRUCT *ads, - TALLOC_CTX *mem_ctx, - const char *dn, - DOM_SID *user_sid, - DOM_SID *primary_group_sid, - DOM_SID **sids, - size_t *num_sids); diff --git a/source/include/auth.h b/source/include/auth.h index 4e7eb469bac..de75ff68f6f 100644 --- a/source/include/auth.h +++ b/source/include/auth.h @@ -115,6 +115,12 @@ typedef struct auth_methods /* Used to keep tabs on things like the cli for SMB server authentication */ void *private_data; + + /* Function to clean up the above arbitary structure */ + void (*free_private_data)(void **private_data); + + /* Function to send a keepalive message on the above structure */ + void (*send_keepalive)(void **private_data); } auth_methods; diff --git a/source/include/client.h b/source/include/client.h index 741ce6470d9..aa8a6479470 100644 --- a/source/include/client.h +++ b/source/include/client.h @@ -29,13 +29,13 @@ #define CLI_BUFFER_SIZE (0xFFFF) #define CLI_SAMBA_MAX_LARGE_READX_SIZE (127*1024) /* Works for Samba servers */ #define CLI_WINDOWS_MAX_LARGE_READX_SIZE ((64*1024)-2) /* Windows servers are broken.... */ -#define CLI_SAMBA_MAX_POSIX_LARGE_READX_SIZE (0xFFFF00) /* 24-bit len. */ /* * These definitions depend on smb.h */ -struct print_job_info { +struct print_job_info +{ uint16 id; uint16 priority; size_t size; @@ -79,28 +79,6 @@ struct rpc_pipe_client { struct dcinfo *dc; }; -/* Transport encryption state. */ -enum smb_trans_enc_type { SMB_TRANS_ENC_NTLM, SMB_TRANS_ENC_GSS }; - -#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) -struct smb_tran_enc_state_gss { - gss_ctx_id_t gss_ctx; - gss_cred_id_t creds; -}; -#endif - -struct smb_trans_enc_state { - enum smb_trans_enc_type smb_enc_type; - uint16 enc_ctx_num; - BOOL enc_on; - union { - NTLMSSP_STATE *ntlmssp_state; -#if defined(HAVE_GSSAPI) && defined(HAVE_KRB5) - struct smb_tran_enc_state_gss *gss_state; -#endif - } s; -}; - struct cli_state { int port; int fd; @@ -153,15 +131,12 @@ struct cli_state { int win95; BOOL is_samba; uint32 capabilities; - uint32 posix_capabilities; BOOL dfsroot; TALLOC_CTX *mem_ctx; smb_sign_info sign_info; - struct smb_trans_enc_state *trans_enc_state; /* Setup if we're encrypting SMB's. */ - /* the session key for this CLI, outside any per-pipe authenticaion */ DATA_BLOB user_session_key; diff --git a/source/include/core/nterr.h b/source/include/core/nterr.h new file mode 100644 index 00000000000..c56735e7723 --- /dev/null +++ b/source/include/core/nterr.h @@ -0,0 +1 @@ +#include "includes.h" diff --git a/source/include/ctdbd_conn.h b/source/include/ctdbd_conn.h deleted file mode 100644 index 79d8abe59d1..00000000000 --- a/source/include/ctdbd_conn.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Samba3 ctdb connection handling - Copyright (C) Volker Lendecke 2007 - - 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 2 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -struct ctdbd_connection; - -NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx, - struct ctdbd_connection **pconn); -NTSTATUS ctdbd_messaging_connection(TALLOC_CTX *mem_ctx, - struct ctdbd_connection **pconn); - -uint32 ctdbd_vnn(const struct ctdbd_connection *conn); - -NTSTATUS ctdbd_register_msg_ctx(struct ctdbd_connection *conn, - struct messaging_context *msg_ctx); - -NTSTATUS ctdbd_messaging_send(struct ctdbd_connection *conn, - uint32 dst_vnn, uint64 dst_srvid, - struct messaging_rec *msg); - -BOOL ctdbd_process_exists(struct ctdbd_connection *conn, uint32 vnn, - pid_t pid); - -char *ctdbd_dbpath(struct ctdbd_connection *conn, - TALLOC_CTX *mem_ctx, uint32_t db_id); - -NTSTATUS ctdbd_db_attach(struct ctdbd_connection *conn, const char *name, - uint32_t *db_id, int tdb_flags); - -NTSTATUS ctdbd_migrate(struct ctdbd_connection *conn, uint32 db_id, - TDB_DATA key); - -NTSTATUS ctdbd_fetch(struct ctdbd_connection *conn, uint32 db_id, - TDB_DATA key, TALLOC_CTX *mem_ctx, TDB_DATA *data); - -NTSTATUS ctdbd_traverse(uint32 db_id, - void (*fn)(TDB_DATA key, TDB_DATA data, - void *private_data), - void *private_data); - -NTSTATUS ctdbd_register_ips(struct ctdbd_connection *conn, - const struct sockaddr_in *server, - const struct sockaddr_in *client, - void (*release_ip_handler)(const char *ip_addr, - void *private_data), - void *private_data); - -NTSTATUS ctdbd_register_reconfigure(struct ctdbd_connection *conn); - diff --git a/source/include/dbwrap.h b/source/include/dbwrap.h deleted file mode 100644 index eae53e8ed48..00000000000 --- a/source/include/dbwrap.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Database interface wrapper around tdb - Copyright (C) Volker Lendecke 2005-2007 - - 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 2 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#ifndef __FILEDB_H__ -#define __FILEDB_H__ - -struct db_record { - TDB_DATA key, value; - NTSTATUS (*store)(struct db_record *rec, TDB_DATA data, int flag); - NTSTATUS (*delete_rec)(struct db_record *rec); - void *private_data; -}; - -struct db_context { - struct db_record *(*fetch_locked)(struct db_context *db, - TALLOC_CTX *mem_ctx, - TDB_DATA key); - int (*fetch)(struct db_context *db, TALLOC_CTX *mem_ctx, - TDB_DATA key, TDB_DATA *data); - int (*traverse)(struct db_context *db, - int (*f)(struct db_record *db, - void *private_data), - void *private_data); - int (*traverse_read)(struct db_context *db, - int (*f)(struct db_record *db, - void *private_data), - void *private_data); - int (*get_seqnum)(struct db_context *db); - void *private_data; -}; - -struct db_context *db_open(TALLOC_CTX *mem_ctx, - const char *name, - int hash_size, int tdb_flags, - int open_flags, mode_t mode); - - -#endif /* __FILEDB_H__ */ diff --git a/source/include/doserr.h b/source/include/doserr.h index e9dab2adefa..5073cd005c1 100644 --- a/source/include/doserr.h +++ b/source/include/doserr.h @@ -217,7 +217,6 @@ #define WERR_DEST_NOT_FOUND W_ERROR(2152) #define WERR_NOT_LOCAL_DOMAIN W_ERROR(2320) #define WERR_DOMAIN_CONTROLLER_NOT_FOUND W_ERROR(2453) -#define WERR_DEVICE_NOT_AVAILABLE W_ERROR(4319) #define WERR_STATUS_MORE_ENTRIES W_ERROR(0x0105) #define WERR_PRINTER_DRIVER_ALREADY_INSTALLED W_ERROR(ERRdriveralreadyinstalled) diff --git a/source/include/gpo.h b/source/include/gpo.h index 431702e3001..c3ae20dd20b 100644 --- a/source/include/gpo.h +++ b/source/include/gpo.h @@ -49,7 +49,6 @@ struct GROUP_POLICY_OBJECT { uint32 link_type; /* GPO_LINK_TYPE */ const char *user_extensions; const char *machine_extensions; - SEC_DESC *security_descriptor; struct GROUP_POLICY_OBJECT *next, *prev; }; @@ -94,10 +93,3 @@ struct GP_EXT { #define GPO_CACHE_DIR "gpo_cache" #define GPT_INI "GPT.INI" - -struct GPO_SID_TOKEN { - DOM_SID object_sid; - DOM_SID primary_group_sid; - size_t num_token_sids; - DOM_SID *token_sids; -}; diff --git a/source/include/includes.h b/source/include/includes.h index ebcb071b1c2..3ddfc7d96d6 100644 --- a/source/include/includes.h +++ b/source/include/includes.h @@ -173,7 +173,7 @@ #if HAVE_LBER_H #include <lber.h> -#if defined(HPUX) && !defined(_LBER_TYPES_H) +#ifdef HPUX /* Define ber_tag_t and ber_int_t for using * HP LDAP-UX Integration products' LDAP libraries. */ @@ -181,7 +181,7 @@ typedef unsigned long ber_tag_t; typedef int ber_int_t; #endif -#endif /* defined(HPUX) && !defined(_LBER_TYPES_H) */ +#endif /* HPUX */ #ifndef LBER_USE_DER #define LBER_USE_DER 0x01 #endif @@ -225,6 +225,10 @@ typedef int ber_int_t; #include <sys/attributes.h> #endif +#ifndef ENOATTR +#define ENOATTR ENODATA +#endif + /* mutually exclusive (SuSE 8.2) */ #if HAVE_ATTR_XATTR_H #include <attr/xattr.h> @@ -635,6 +639,7 @@ typedef int BOOL; #include "dlinklist.h" #include "tdb.h" #include "util_tdb.h" +#include "tdbback.h" #include "lib/talloc/talloc.h" /* And a little extension. Abort on type mismatch */ @@ -643,18 +648,19 @@ typedef int BOOL; #include "nt_status.h" #include "ads.h" +#include "gpo.h" #include "ads_dns.h" #include "interfaces.h" #include "trans2.h" #include "nterr.h" #include "ntioctl.h" +#include "messages.h" #include "charset.h" #include "dynconfig.h" #include "util_getent.h" #include "debugparse.h" #include "version.h" #include "privileges.h" -#include "messages.h" #include "locking.h" #include "smb.h" #include "ads_cldap.h" @@ -667,7 +673,6 @@ typedef int BOOL; #include "mapping.h" #include "passdb.h" #include "rpc_secdes.h" -#include "gpo.h" #include "authdata.h" #include "msdfs.h" #include "rap.h" @@ -681,11 +686,15 @@ typedef int BOOL; #include "rpc_lsa.h" #include "rpc_netlogon.h" #include "reg_objects.h" -#include "reg_db.h" +#include "rpc_reg.h" #include "rpc_samr.h" +#include "rpc_srvsvc.h" #include "rpc_spoolss.h" #include "rpc_eventlog.h" +#include "rpc_dfs.h" #include "rpc_ds.h" +#include "rpc_echo.h" +#include "rpc_shutdown.h" #include "rpc_perfcount.h" #include "rpc_perfcount_defs.h" #include "librpc/gen_ndr/notify.h" @@ -702,9 +711,6 @@ typedef int BOOL; #include "spnego.h" #include "rpc_client.h" #include "event.h" -#include "dbwrap.h" -#include "packet.h" -#include "ctdbd_conn.h" /* * Type for wide character dirent structure. @@ -779,12 +785,6 @@ enum flush_reason_enum { #include "nss_info.h" -/* generated rpc server implementation functions */ -#include "librpc/gen_ndr/srv_echo.h" -#include "librpc/gen_ndr/srv_svcctl.h" -#include "librpc/gen_ndr/srv_lsa.h" -#include "librpc/gen_ndr/srv_eventlog.h" - /***** automatically generated prototypes *****/ #ifndef NO_PROTO_H #include "proto.h" @@ -1108,7 +1108,9 @@ krb5_error_code smb_krb5_unparse_name(krb5_context context, krb5_error_code krb5_set_real_time(krb5_context context, int32_t seconds, int32_t microseconds); #endif +#ifndef HAVE_KRB5_SET_DEFAULT_TGS_KTYPES krb5_error_code krb5_set_default_tgs_ktypes(krb5_context ctx, const krb5_enctype *enc); +#endif #if defined(HAVE_KRB5_AUTH_CON_SETKEY) && !defined(HAVE_KRB5_AUTH_CON_SETUSERUSERKEY) krb5_error_code krb5_auth_con_setuseruserkey(krb5_context context, krb5_auth_context auth_context, krb5_keyblock *keyblock); @@ -1200,15 +1202,6 @@ krb5_error_code smb_krb5_mk_error(krb5_context context, krb5_error_code error_code, const krb5_principal server, krb5_data *reply); -krb5_enctype smb_get_enctype_from_kt_entry(const krb5_keytab_entry *kt_entry); -krb5_error_code smb_krb5_enctype_to_string(krb5_context context, - krb5_enctype enctype, - char **etype_s); -krb5_error_code smb_krb5_open_keytab(krb5_context context, - const char *keytab_name, - BOOL write_access, - krb5_keytab *keytab); - #endif /* HAVE_KRB5 */ @@ -1219,9 +1212,6 @@ LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to); #endif /* HAVE_LDAP */ -#if defined(HAVE_LINUX_READAHEAD) && ! defined(HAVE_READAHEAD_DECL) -ssize_t readahead(int fd, off64_t offset, size_t count); -#endif /* TRUE and FALSE are part of the C99 standard and gcc, but unfortunately many vendor compilers don't support them. Use True diff --git a/source/include/intl.h b/source/include/intl.h index 58f21e359b6..01fa3bad976 100644 --- a/source/include/intl.h +++ b/source/include/intl.h @@ -21,4 +21,5 @@ /* ideally we would have a static mapping, but that precludes dynamic loading. This is a reasonable compromise */ +#define _(x) lang_msg_rotate(x) #define N_(x) (x) diff --git a/source/include/libsmbclient.h b/source/include/libsmbclient.h index 5d674264d8c..45f2a41b088 100644 --- a/source/include/libsmbclient.h +++ b/source/include/libsmbclient.h @@ -1242,16 +1242,14 @@ int smbc_chown(const char *url, uid_t owner, gid_t group); */ int smbc_chmod(const char *url, mode_t mode); -/** - * @ingroup attribute +/**@ingroup attribute * Change the last modification time on a file * * @param url The smb url of the file or directory to change * the modification time of - * - * @param tbuf An array of two timeval structures which contains, - * respectively, the desired access and modification times. - * NOTE: Only the tv_sec field off each timeval structure is + * + * @param tbuf A timeval structure which contains the desired + * modification time. NOTE: Only the tv_sec field is * used. The tv_usec (microseconds) portion is ignored. * * @return 0 on success, < 0 on error with errno set: @@ -1262,15 +1260,15 @@ int smbc_chmod(const char *url, mode_t mode); int smbc_utimes(const char *url, struct timeval *tbuf); #ifdef HAVE_UTIME_H -/** - * @ingroup attribute +/**@ingroup attribute * Change the last modification time on a file * * @param url The smb url of the file or directory to change * the modification time of - * - * @param utbuf A pointer to a utimebuf structure which contains the - * desired access and modification times. + * + * @param utbuf A utimebuf structure which contains the desired + * modification time. NOTE: Although the structure contains + * an access time as well, the access time value is ignored. * * @return 0 on success, < 0 on error with errno set: * - EINVAL The client library is not properly initialized diff --git a/source/include/locking.h b/source/include/locking.h index d61b5fe1e43..4b3b10d7367 100644 --- a/source/include/locking.h +++ b/source/include/locking.h @@ -39,29 +39,39 @@ enum brl_flavour {WINDOWS_LOCK = 0, POSIX_LOCK = 1}; struct lock_context { uint32 smbpid; uint16 tid; - struct server_id pid; + struct process_id pid; }; -struct files_struct; +/* The key used in the brlock database. */ -struct file_id { - /* we don't use SMB_DEV_T and SMB_INO_T as we want a fixed size here, - and we may be using file system specific code to fill in something - other than a dev_t for the device */ - uint64_t devid; - uint64_t inode; +struct lock_key { + SMB_DEV_T device; + SMB_INO_T inode; }; +struct files_struct; + struct byte_range_lock { struct files_struct *fsp; unsigned int num_locks; BOOL modified; BOOL read_only; - struct file_id key; - struct lock_struct *lock_data; - struct db_record *record; + struct lock_key key; + void *lock_data; }; +#define BRLOCK_FN_CAST() \ + void (*)(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, \ + enum brl_type lock_type, \ + enum brl_flavour lock_flav, \ + br_off start, br_off size) + +#define BRLOCK_FN(fn) \ + void (*fn)(SMB_DEV_T dev, SMB_INO_T ino, struct process_id pid, \ + enum brl_type lock_type, \ + enum brl_flavour lock_flav, \ + br_off start, br_off size) + /* Internal structure in brlock.tdb. The data in brlock records is an unsorted linear array of these records. It is unnecessary to store the count as tdb provides the diff --git a/source/include/messages.h b/source/include/messages.h index 8c829712eb1..7cd0e023487 100644 --- a/source/include/messages.h +++ b/source/include/messages.h @@ -22,203 +22,90 @@ #ifndef _MESSAGES_H_ #define _MESSAGES_H_ -/* change the message version with any incompatible changes in the protocol */ -#define MESSAGE_VERSION 2 - - -#define MSG_TYPE_MASK 0xFFFF - /* general messages */ -#define MSG_DEBUG 0x0001 -#define MSG_PING 0x0002 -#define MSG_PONG 0x0003 -#define MSG_PROFILE 0x0004 -#define MSG_REQ_DEBUGLEVEL 0x0005 -#define MSG_DEBUGLEVEL 0x0006 -#define MSG_REQ_PROFILELEVEL 0x0007 -#define MSG_PROFILELEVEL 0x0008 -#define MSG_REQ_POOL_USAGE 0x0009 -#define MSG_POOL_USAGE 0x000A +#define MSG_DEBUG 1 +#define MSG_PING 2 +#define MSG_PONG 3 +#define MSG_PROFILE 4 +#define MSG_REQ_DEBUGLEVEL 5 +#define MSG_DEBUGLEVEL 6 +#define MSG_REQ_PROFILELEVEL 7 +#define MSG_PROFILELEVEL 8 +#define MSG_REQ_POOL_USAGE 9 +#define MSG_POOL_USAGE 10 /* If dmalloc is included, set a steady-state mark */ -#define MSG_REQ_DMALLOC_MARK 0x000B +#define MSG_REQ_DMALLOC_MARK 11 /* If dmalloc is included, dump to the dmalloc log a description of * what has changed since the last MARK */ -#define MSG_REQ_DMALLOC_LOG_CHANGED 0x000C +#define MSG_REQ_DMALLOC_LOG_CHANGED 12 -#define MSG_SHUTDOWN 0x000D +#define MSG_SHUTDOWN 13 /* nmbd messages */ -#define MSG_FORCE_ELECTION 0x0101 -#define MSG_WINS_NEW_ENTRY 0x0102 -#define MSG_SEND_PACKET 0x0103 +#define MSG_FORCE_ELECTION 1001 +#define MSG_WINS_NEW_ENTRY 1002 +#define MSG_SEND_PACKET 1003 /* printing messages */ /* #define MSG_PRINTER_NOTIFY 2001*/ /* Obsolete */ -#define MSG_PRINTER_NOTIFY2 0x0202 +#define MSG_PRINTER_NOTIFY2 2002 -#define MSG_PRINTER_DRVUPGRADE 0x0203 -#define MSG_PRINTERDATA_INIT_RESET 0x0204 -#define MSG_PRINTER_UPDATE 0x0205 -#define MSG_PRINTER_MOD 0x0206 +#define MSG_PRINTER_DRVUPGRADE 2101 +#define MSG_PRINTERDATA_INIT_RESET 2102 +#define MSG_PRINTER_UPDATE 2103 +#define MSG_PRINTER_MOD 2104 /* smbd messages */ -#define MSG_SMB_CONF_UPDATED 0x0301 -#define MSG_SMB_FORCE_TDIS 0x0302 -#define MSG_SMB_SAM_SYNC 0x0303 -#define MSG_SMB_SAM_REPL 0x0304 -#define MSG_SMB_UNLOCK 0x0305 -#define MSG_SMB_BREAK_REQUEST 0x0306 -#define MSG_SMB_BREAK_RESPONSE 0x0307 -#define MSG_SMB_ASYNC_LEVEL2_BREAK 0x0308 -#define MSG_SMB_OPEN_RETRY 0x0309 -#define MSG_SMB_KERNEL_BREAK 0x030A -#define MSG_SMB_FILE_RENAME 0x030B -#define MSG_SMB_INJECT_FAULT 0x030C -#define MSG_SMB_BLOCKING_LOCK_CANCEL 0x030D -#define MSG_SMB_NOTIFY 0x030E -#define MSG_SMB_STAT_CACHE_DELETE 0x030F +#define MSG_SMB_CONF_UPDATED 3001 +#define MSG_SMB_FORCE_TDIS 3002 +#define MSG_SMB_SAM_SYNC 3003 +#define MSG_SMB_SAM_REPL 3004 +#define MSG_SMB_UNLOCK 3005 +#define MSG_SMB_BREAK_REQUEST 3006 +#define MSG_SMB_BREAK_RESPONSE 3007 +#define MSG_SMB_ASYNC_LEVEL2_BREAK 3008 +#define MSG_SMB_OPEN_RETRY 3009 +#define MSG_SMB_KERNEL_BREAK 3010 +#define MSG_SMB_FILE_RENAME 3011 +#define MSG_SMB_INJECT_FAULT 3012 +#define MSG_SMB_BLOCKING_LOCK_CANCEL 3013 +#define MSG_SMB_NOTIFY 3014 +#define MSG_SMB_STAT_CACHE_DELETE 3015 /* * Samba4 compatibility */ -#define MSG_PVFS_NOTIFY 0x0310 -/* - * cluster reconfigure events - */ -#define MSG_SMB_BRL_VALIDATE 0x0311 -#define MSG_SMB_RELEASE_IP 0x0312 +#define MSG_PVFS_NOTIFY 3016 /* winbind messages */ -#define MSG_WINBIND_FINISHED 0x0401 -#define MSG_WINBIND_FORGET_STATE 0x0402 -#define MSG_WINBIND_ONLINE 0x0403 -#define MSG_WINBIND_OFFLINE 0x0404 -#define MSG_WINBIND_ONLINESTATUS 0x0405 -#define MSG_WINBIND_TRY_TO_GO_ONLINE 0x0406 -#define MSG_WINBIND_FAILED_TO_GO_ONLINE 0x0407 - -/* event messages */ -#define MSG_DUMP_EVENT_LIST 0x0500 - -/* - * Special flags passed to message_send. Allocated from the top, lets see when - * it collides with the message types in the lower 16 bits :-) - */ - -/* - * Under high load, this message can be dropped. Use for notify-style - * messages that are not critical for correct operation. - */ -#define MSG_FLAG_LOWPRIORITY 0x80000000 - +#define MSG_WINBIND_FINISHED 4001 +#define MSG_WINBIND_FORGET_STATE 4002 +#define MSG_WINBIND_ONLINE 4003 +#define MSG_WINBIND_OFFLINE 4004 +#define MSG_WINBIND_ONLINESTATUS 4005 +#define MSG_WINBIND_TRY_TO_GO_ONLINE 4006 +#define MSG_WINBIND_FAILED_TO_GO_ONLINE 4007 /* Flags to classify messages - used in message_send_all() */ /* Sender will filter by flag. */ -#define FLAG_MSG_GENERAL 0x0001 -#define FLAG_MSG_SMBD 0x0002 -#define FLAG_MSG_NMBD 0x0004 -#define FLAG_MSG_PRINT_NOTIFY 0x0008 -#define FLAG_MSG_PRINT_GENERAL 0x0010 - - -/* - * Virtual Node Numbers are identifying a node within a cluster. Ctdbd sets - * this, we retrieve our vnn from it. - */ - -#define NONCLUSTER_VNN (0xFFFFFFFF) +#define FLAG_MSG_GENERAL 0x0001 +#define FLAG_MSG_SMBD 0x0002 +#define FLAG_MSG_NMBD 0x0004 +#define FLAG_MSG_PRINT_NOTIFY 0x0008 +#define FLAG_MSG_PRINT_GENERAL 0x0010 -/* - * ctdb gives us 64-bit server ids for messaging_send. This is done to avoid - * pid clashes and to be able to register for special messages like "all - * smbds". - * - * Normal individual server id's have the upper 32 bits to 0, I picked "1" for - * Samba, other subsystems might use something else. - */ - -#define MSG_SRVID_SAMBA 0x0000000100000000LL - - -struct server_id { +struct process_id { pid_t pid; -#ifdef CLUSTER_SUPPORT - uint32 vnn; -#endif }; - - -struct messaging_context; -struct messaging_rec; -struct data_blob; - /* - * struct messaging_context belongs to messages.c, but because we still have - * messaging_dispatch, we need it here. Once we get rid of signals for - * notifying processes, this will go. + * Samba4 API compatibility layer */ -struct messaging_context { - struct server_id id; - struct event_context *event_ctx; - struct messaging_callback *callbacks; - - struct messaging_backend *local; - struct messaging_backend *remote; -}; - -struct messaging_backend { - NTSTATUS (*send_fn)(struct messaging_context *msg_ctx, - struct server_id pid, int msg_type, - const struct data_blob *data, - struct messaging_backend *backend); - void *private_data; +struct server_id { + struct process_id id; }; -NTSTATUS messaging_tdb_init(struct messaging_context *msg_ctx, - TALLOC_CTX *mem_ctx, - struct messaging_backend **presult); -void message_dispatch(struct messaging_context *msg_ctx); - -NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx, - TALLOC_CTX *mem_ctx, - struct messaging_backend **presult); -struct ctdbd_connection *messaging_ctdbd_connection(void); - -BOOL message_send_all(struct messaging_context *msg_ctx, - int msg_type, - const void *buf, size_t len, - int *n_sent); -struct event_context *messaging_event_context(struct messaging_context *msg_ctx); -struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, - struct server_id server_id, - struct event_context *ev); - -/* - * re-init after a fork - */ -NTSTATUS messaging_reinit(struct messaging_context *msg_ctx); - -NTSTATUS messaging_register(struct messaging_context *msg_ctx, - void *private_data, - uint32_t msg_type, - void (*fn)(struct messaging_context *msg, - void *private_data, - uint32_t msg_type, - struct server_id server_id, - struct data_blob *data)); -void messaging_deregister(struct messaging_context *ctx, uint32_t msg_type, - void *private_data); -NTSTATUS messaging_send(struct messaging_context *msg_ctx, - struct server_id server, - uint32_t msg_type, const struct data_blob *data); -NTSTATUS messaging_send_buf(struct messaging_context *msg_ctx, - struct server_id server, uint32_t msg_type, - const uint8 *buf, size_t len); -void messaging_dispatch_rec(struct messaging_context *msg_ctx, - struct messaging_rec *rec); - #endif diff --git a/source/include/nt_status.h b/source/include/nt_status.h index 4d083106d3e..471ac47927a 100644 --- a/source/include/nt_status.h +++ b/source/include/nt_status.h @@ -72,12 +72,6 @@ typedef uint32 WERROR; }\ } while (0) -#define W_ERROR_NOT_OK_RETURN(x) do { \ - if (!W_ERROR_IS_OK(x)) {\ - return x;\ - }\ -} while (0) - /* The top byte in an NTSTATUS code is used as a type field. * Windows only uses value 0xC0 as an indicator for an NT error * and 0x00 for success. diff --git a/source/include/ntdomain.h b/source/include/ntdomain.h index 2108520b157..6d8c4e62c65 100644 --- a/source/include/ntdomain.h +++ b/source/include/ntdomain.h @@ -234,9 +234,17 @@ typedef struct pipes_struct { struct dcinfo *dc; /* Keeps the creds data from netlogon. */ /* - * Credentials used for the pipe operations + * Windows user info. + */ + fstring user_name; + fstring domain; + fstring wks; + + /* + * Unix user name and credentials used when a pipe is authenticated. */ + fstring pipe_user_name; struct current_user pipe_user; DATA_BLOB session_key; @@ -257,7 +265,7 @@ typedef struct pipes_struct { */ BOOL bad_handle_fault_state; - + /* * Set to true when the backend does not support a call. */ diff --git a/source/include/nterr.h b/source/include/nterr.h index e14f341de13..8a667707c8c 100644 --- a/source/include/nterr.h +++ b/source/include/nterr.h @@ -31,7 +31,7 @@ #define NT_STATUS_NO_MORE_ENTRIES NT_STATUS(0x8000001a) /* Vista Status codes. */ -#define NT_STATUS_INACCESSIBLE_SYSTEM_SHORTCUT NT_STATUS(0x8000002d) +#define STATUS_INACCESSIBLE_SYSTEM_SHORTCUT NT_STATUS(0x8000002d) #define STATUS_MORE_ENTRIES NT_STATUS(0x0105) #define STATUS_SOME_UNMAPPED NT_STATUS(0x0107) diff --git a/source/include/ntioctl.h b/source/include/ntioctl.h index b4b8169a517..9b748d38ed1 100644 --- a/source/include/ntioctl.h +++ b/source/include/ntioctl.h @@ -47,7 +47,7 @@ #define FSCTL_SET_REPARSE_POINT 0x000900A4 #define FSCTL_GET_REPARSE_POINT 0x000900A8 #define FSCTL_DELETE_REPARSE_POINT 0x000900AC -#define FSCTL_CREATE_OR_GET_OBJECT_ID 0x000900C0 +#define FSCTL_0x000900C0 0x000900C0 #define FSCTL_SET_SPARSE 0x000900C4 #define FSCTL_SET_ZERO_DATA 0x000900C8 #define FSCTL_SET_ENCRYPTION 0x000900D7 @@ -65,7 +65,7 @@ #define FSCTL_DISMOUNT_VOLUME #define FSCTL_GET_NTFS_FILE_RECORD #define FSCTL_ALLOW_EXTENDED_DASD_IO -#define FSCTL_RECALL_FILE 0x00090117 +#define FSCTL_RECALL_FILE #endif diff --git a/source/include/packet.h b/source/include/packet.h deleted file mode 100644 index 9f364827051..00000000000 --- a/source/include/packet.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Packet handling - Copyright (C) Volker Lendecke 2007 - - 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 2 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* - * A packet context is a wrapper around a bidirectional file descriptor, - * hiding the handling of individual requests. - */ - -struct packet_context; - -/* - * Initialize a packet context. The fd is given to the packet context, meaning - * that it is automatically closed when the packet context is freed. - */ -struct packet_context *packet_init(TALLOC_CTX *mem_ctx, int fd); - -/* - * Pull data from the fd - */ -NTSTATUS packet_fd_read(struct packet_context *ctx); - -/* - * Sync read, wait for the next chunk - */ -NTSTATUS packet_fd_read_sync(struct packet_context *ctx); - -/* - * Handle an incoming packet: - * Return False if none is available - * Otherwise return True and store the callback result in *status - */ -BOOL packet_handler(struct packet_context *ctx, - BOOL (*full_req)(const struct data_blob *data, - size_t *length, - void *private_data), - NTSTATUS (*callback)(const struct data_blob *data, - void *private_data), - void *private_data, - NTSTATUS *status); - -/* - * How many bytes of outgoing data do we have pending? - */ -size_t packet_outgoing_bytes(struct packet_context *ctx); - -/* - * Push data to the fd - */ -NTSTATUS packet_fd_write(struct packet_context *ctx); - -/* - * Sync flush all outgoing bytes - */ -NTSTATUS packet_flush(struct packet_context *ctx); - -/* - * Send a list of DATA_BLOBs - * - * Example: packet_send(ctx, 2, data_blob_const(&size, sizeof(size)), - * data_blob_const(buf, size)); - */ -NTSTATUS packet_send(struct packet_context *ctx, int num_blobs, ...); - -/* - * Get the packet context's file descriptor - */ -int packet_get_fd(struct packet_context *ctx); diff --git a/source/include/passdb.h b/source/include/passdb.h index c3af0f4f11e..10f77e1ed51 100644 --- a/source/include/passdb.h +++ b/source/include/passdb.h @@ -242,10 +242,9 @@ struct pdb_search { * the pdb module. Remove the latter, this might happen more often. VL. * changed to version 14 to move lookup_rids and lookup_names to return * enum lsa_SidType rather than uint32. - * Changed to 16 for access to the trusted domain passwords (obnox). */ -#define PASSDB_INTERFACE_VERSION 16 +#define PASSDB_INTERFACE_VERSION 15 struct pdb_methods { @@ -329,6 +328,9 @@ struct pdb_methods TALLOC_CTX *mem_ctx, uint32 group_rid, uint32 member_rid); + NTSTATUS (*find_alias)(struct pdb_methods *methods, + const char *name, DOM_SID *sid); + NTSTATUS (*create_alias)(struct pdb_methods *methods, const char *name, uint32 *rid); @@ -401,19 +403,6 @@ struct pdb_methods BOOL (*rid_algorithm)(struct pdb_methods *methods); BOOL (*new_rid)(struct pdb_methods *methods, uint32 *rid); - - BOOL (*get_trusteddom_pw)(struct pdb_methods *methods, - const char *domain, char** pwd, - DOM_SID *sid, time_t *pass_last_set_time); - BOOL (*set_trusteddom_pw)(struct pdb_methods *methods, - const char* domain, const char* pwd, - const DOM_SID *sid); - BOOL (*del_trusteddom_pw)(struct pdb_methods *methods, - const char *domain); - NTSTATUS (*enum_trusteddoms)(struct pdb_methods *methods, - TALLOC_CTX *mem_ctx, uint32 *num_domains, - struct trustdom_info ***domains); - void *private_data; /* Private data of some kind */ void (*free_private_data)(void **); diff --git a/source/include/popt_common.h b/source/include/popt_common.h index 9db5ecc3d13..4c3facb48f9 100644 --- a/source/include/popt_common.h +++ b/source/include/popt_common.h @@ -50,17 +50,6 @@ struct user_auth_info { int signing_state; }; -enum smb_server_mode { - /* Daemonize and manage our own sockets */ - SERVER_MODE_DAEMON, - /* Don't daemonize or manage sockets */ - SERVER_MODE_INETD, - /* Don't daemonize, but do manage sockets */ - SERVER_MODE_FOREGROUND, - /* Run in the foreground, log to stdout, don't fork children */ - SERVER_MODE_INTERACTIVE -}; - extern struct user_auth_info cmdline_auth_info; #endif /* _POPT_COMMON_H */ diff --git a/source/include/privileges.h b/source/include/privileges.h index 72b2c913245..eac42e0ba93 100644 --- a/source/include/privileges.h +++ b/source/include/privileges.h @@ -61,9 +61,7 @@ typedef struct { #define SE_RESTORE { { 0x00000400, 0x00000000, 0x00000000, 0x00000000 } } #define SE_TAKE_OWNERSHIP { { 0x00000800, 0x00000000, 0x00000000, 0x00000000 } } -/* defined in lib/privilegs_basic.c */ - -extern const SE_PRIV se_priv_all; +/* defined in lib/privilegs.c */ extern const SE_PRIV se_priv_none; extern const SE_PRIV se_machine_account; diff --git a/source/include/reg_db.h b/source/include/reg_db.h deleted file mode 100644 index 9a35f91e5dc..00000000000 --- a/source/include/reg_db.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Parameters for Samba's Internal Registry Database - - Copyright (C) Michael Adam 2007 - - 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 2 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#ifndef _REG_DB_H -#define _REG_DB_H - -#define REG_TDB_FLAGS TDB_SEQNUM - -#define REGVER_V1 1 /* first db version with write support */ - -#define REG_VALUE_PREFIX "SAMBA_REGVAL" -#define REG_SECDESC_PREFIX "SAMBA_SECDESC" - -#endif /* _REG_DB_H */ diff --git a/source/include/reg_objects.h b/source/include/reg_objects.h index b108d6d0824..1f819df999b 100644 --- a/source/include/reg_objects.h +++ b/source/include/reg_objects.h @@ -32,31 +32,6 @@ typedef struct { uint8 *data_p; } REGISTRY_VALUE; -/* - * A REG_SZ string is not necessarily NULL terminated. When retrieving it from - * the net, we guarantee this however. A server might want to push it without - * the terminator though. - */ - -struct registry_string { - size_t len; - char *str; -}; - -struct registry_value { - enum winreg_Type type; - union { - uint32 dword; - uint64 qword; - struct registry_string sz; - struct { - uint32 num_strings; - char **strings; - } multi_sz; - DATA_BLOB binary; - } v; -}; - /* container for registry values */ typedef struct { @@ -71,86 +46,5 @@ typedef struct { char **subkeys; } REGSUBKEY_CTR; -/* - * - * Macros that used to reside in rpc_reg.h - * - */ - -#define HKEY_CLASSES_ROOT 0x80000000 -#define HKEY_CURRENT_USER 0x80000001 -#define HKEY_LOCAL_MACHINE 0x80000002 -#define HKEY_USERS 0x80000003 -#define HKEY_PERFORMANCE_DATA 0x80000004 - -#define KEY_HKLM "HKLM" -#define KEY_HKU "HKU" -#define KEY_HKCC "HKCC" -#define KEY_HKCR "HKCR" -#define KEY_HKPD "HKPD" -#define KEY_HKPT "HKPT" -#define KEY_HKPN "HKPN" -#define KEY_HKCU "HKCU" -#define KEY_HKDD "HKDD" -#define KEY_SERVICES "HKLM\\SYSTEM\\CurrentControlSet\\Services" -#define KEY_PRINTING "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Print" -#define KEY_PRINTING_2K "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\Printers" -#define KEY_PRINTING_PORTS "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Ports" -#define KEY_EVENTLOG "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog" -#define KEY_SHARES "HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Shares" -#define KEY_SMBCONF "HKLM\\SOFTWARE\\Samba\\smbconf" -#define KEY_TREE_ROOT "" - -/* - * Registry key types - * Most keys are going to be GENERIC -- may need a better name? - * HKPD and HKPT are used by reg_perfcount.c - * they are special keys that contain performance data - */ -#define REG_KEY_GENERIC 0 -#define REG_KEY_HKPD 1 -#define REG_KEY_HKPT 2 - -/* - * container for function pointers to enumeration routines - * for virtual registry view - */ - -typedef struct { - /* functions for enumerating subkeys and values */ - int (*fetch_subkeys)( const char *key, REGSUBKEY_CTR *subkeys); - int (*fetch_values) ( const char *key, REGVAL_CTR *val ); - BOOL (*store_subkeys)( const char *key, REGSUBKEY_CTR *subkeys ); - BOOL (*store_values)( const char *key, REGVAL_CTR *val ); - BOOL (*reg_access_check)( const char *keyname, uint32 requested, - uint32 *granted, - const NT_USER_TOKEN *token ); - WERROR (*get_secdesc)(TALLOC_CTX *mem_ctx, const char *key, - struct security_descriptor **psecdesc); - WERROR (*set_secdesc)(const char *key, - struct security_descriptor *sec_desc); -} REGISTRY_OPS; - -typedef struct { - const char *keyname; /* full path to name of key */ - REGISTRY_OPS *ops; /* registry function hooks */ -} REGISTRY_HOOK; - - -/* structure to store the registry handles */ - -typedef struct _RegistryKey { - uint32 type; - char *name; /* full name of registry key */ - uint32 access_granted; - REGISTRY_HOOK *hook; -} REGISTRY_KEY; - -struct registry_key { - REGISTRY_KEY *key; - REGSUBKEY_CTR *subkeys; - REGVAL_CTR *values; - struct nt_user_token *token; -}; - #endif /* _REG_OBJECTS_H */ + diff --git a/source/include/rpc_client.h b/source/include/rpc_client.h index 94803dbaea2..b05924e657d 100644 --- a/source/include/rpc_client.h +++ b/source/include/rpc_client.h @@ -23,15 +23,6 @@ /* autogenerated client stubs */ -#include "librpc/gen_ndr/cli_echo.h" -#include "librpc/gen_ndr/cli_unixinfo.h" -#include "librpc/gen_ndr/cli_epmapper.h" -#include "librpc/gen_ndr/cli_dfs.h" -#include "librpc/gen_ndr/cli_lsa.h" -#include "librpc/gen_ndr/cli_srvsvc.h" -#include "librpc/gen_ndr/cli_svcctl.h" -#include "librpc/gen_ndr/cli_winreg.h" -#include "librpc/gen_ndr/cli_initshutdown.h" #include "librpc/gen_ndr/cli_wkssvc.h" /* macro to expand cookie-cutter code in cli_xxx() using rpc_api_pipe_req() */ diff --git a/source/include/rpc_dfs.h b/source/include/rpc_dfs.h new file mode 100644 index 00000000000..601d3d3b017 --- /dev/null +++ b/source/include/rpc_dfs.h @@ -0,0 +1,394 @@ +/* + * Unix SMB/CIFS implementation. + * header auto-generated by pidl. DO NOT MODIFY! + */ + + +#ifndef _RPC_NETDFS_H +#define _RPC_NETDFS_H + +#define DFS_GETMANAGERVERSION 0 +#define DFS_ADD 1 +#define DFS_REMOVE 2 +#define DFS_SETINFO 3 +#define DFS_GETINFO 4 +#define DFS_ENUM 5 +#define DFS_RENAME 6 +#define DFS_MOVE 7 +#define DFS_MANAGERGETCONFIGINFO 8 +#define DFS_MANAGERSENDSITEINFO 9 +#define DFS_ADDFTROOT 10 +#define DFS_REMOVEFTROOT 11 +#define DFS_ADDSTDROOT 12 +#define DFS_REMOVESTDROOT 13 +#define DFS_MANAGERINITIALIZE 14 +#define DFS_ADDSTDROOTFORCED 15 +#define DFS_GETDCADDRESS 16 +#define DFS_SETDCADDRESS 17 +#define DFS_FLUSHFTTABLE 18 +#define DFS_ADD2 19 +#define DFS_REMOVE2 20 +#define DFS_ENUMEX 21 +#define DFS_SETINFO2 22 + +typedef struct netdfs_dfs_Info0 { + uint32 dummy; +} NETDFS_DFS_INFO0; + +typedef struct netdfs_dfs_Info1 { + uint32 ptr0_path; + UNISTR2 path; +} NETDFS_DFS_INFO1; + +typedef struct netdfs_dfs_Info2 { + uint32 ptr0_path; + UNISTR2 path; + uint32 ptr0_comment; + UNISTR2 comment; + uint32 state; + uint32 num_stores; +} NETDFS_DFS_INFO2; + +typedef struct netdfs_dfs_StorageInfo { + uint32 state; + uint32 ptr0_server; + UNISTR2 server; + uint32 ptr0_share; + UNISTR2 share; +} NETDFS_DFS_STORAGEINFO; + +typedef struct netdfs_dfs_Info3 { + uint32 ptr0_path; + UNISTR2 path; + uint32 ptr0_comment; + UNISTR2 comment; + uint32 state; + uint32 num_stores; + uint32 ptr0_stores; + uint32 size_stores; + NETDFS_DFS_STORAGEINFO *stores; +} NETDFS_DFS_INFO3; + +typedef struct netdfs_dfs_Info4 { + uint32 ptr0_path; + UNISTR2 path; + uint32 ptr0_comment; + UNISTR2 comment; + uint32 state; + uint32 timeout; + struct GUID guid; + uint32 num_stores; + uint32 ptr0_stores; + uint32 size_stores; + NETDFS_DFS_STORAGEINFO *stores; +} NETDFS_DFS_INFO4; + +typedef struct netdfs_dfs_Info100 { + uint32 ptr0_comment; + UNISTR2 comment; +} NETDFS_DFS_INFO100; + +typedef struct netdfs_dfs_Info101 { + uint32 state; +} NETDFS_DFS_INFO101; + +typedef struct netdfs_dfs_Info102 { + uint32 timeout; +} NETDFS_DFS_INFO102; + +typedef struct netdfs_dfs_Info200 { + uint32 ptr0_dom_root; + UNISTR2 dom_root; +} NETDFS_DFS_INFO200; + +typedef struct netdfs_dfs_Info300 { + uint32 flags; + uint32 ptr0_dom_root; + UNISTR2 dom_root; +} NETDFS_DFS_INFO300; + +typedef struct netdfs_dfs_Info_ctr { + uint32 switch_value; + uint32 ptr0; + union netdfs_dfs_Info { + NETDFS_DFS_INFO0 info0; + NETDFS_DFS_INFO1 info1; + NETDFS_DFS_INFO2 info2; + NETDFS_DFS_INFO3 info3; + NETDFS_DFS_INFO4 info4; + NETDFS_DFS_INFO100 info100; + NETDFS_DFS_INFO101 info101; + NETDFS_DFS_INFO102 info102; + } u; +} NETDFS_DFS_INFO_CTR; + +typedef struct netdfs_dfs_EnumArray1 { + uint32 count; + uint32 ptr0_s; + uint32 size_s; + NETDFS_DFS_INFO1 *s; +} NETDFS_DFS_ENUMARRAY1; + +typedef struct netdfs_dfs_EnumArray2 { + uint32 count; + uint32 ptr0_s; + uint32 size_s; + NETDFS_DFS_INFO2 *s; +} NETDFS_DFS_ENUMARRAY2; + +typedef struct netdfs_dfs_EnumArray3 { + uint32 count; + uint32 ptr0_s; + uint32 size_s; + NETDFS_DFS_INFO3 *s; +} NETDFS_DFS_ENUMARRAY3; + +typedef struct netdfs_dfs_EnumArray4 { + uint32 count; + uint32 ptr0_s; + uint32 size_s; + NETDFS_DFS_INFO4 *s; +} NETDFS_DFS_ENUMARRAY4; + +typedef struct netdfs_dfs_EnumArray200 { + uint32 count; + uint32 ptr0_s; + uint32 size_s; + NETDFS_DFS_INFO200 *s; +} NETDFS_DFS_ENUMARRAY200; + +typedef struct netdfs_dfs_EnumArray300 { + uint32 count; + uint32 ptr0_s; + uint32 size_s; + NETDFS_DFS_INFO300 *s; +} NETDFS_DFS_ENUMARRAY300; + +typedef struct netdfs_dfs_EnumInfo_ctr { + uint32 switch_value; + uint32 ptr0; + union netdfs_dfs_EnumInfo { + NETDFS_DFS_ENUMARRAY1 info1; + NETDFS_DFS_ENUMARRAY2 info2; + NETDFS_DFS_ENUMARRAY3 info3; + NETDFS_DFS_ENUMARRAY4 info4; + NETDFS_DFS_ENUMARRAY200 info200; + NETDFS_DFS_ENUMARRAY300 info300; + } u; +} NETDFS_DFS_ENUMINFO_CTR; + +typedef struct netdfs_dfs_EnumStruct { + uint32 level; + NETDFS_DFS_ENUMINFO_CTR e; +} NETDFS_DFS_ENUMSTRUCT; + +typedef struct netdfs_q_dfs_GetManagerVersion { + uint32 dummy; +} NETDFS_Q_DFS_GETMANAGERVERSION; + +typedef struct netdfs_r_dfs_GetManagerVersion { + uint32 exist_flag; +} NETDFS_R_DFS_GETMANAGERVERSION; + +typedef struct netdfs_q_dfs_Add { + UNISTR2 path; + UNISTR2 server; + uint32 ptr0_share; + UNISTR2 share; + uint32 ptr0_comment; + UNISTR2 comment; + uint32 flags; +} NETDFS_Q_DFS_ADD; + +typedef struct netdfs_r_dfs_Add { + WERROR status; +} NETDFS_R_DFS_ADD; + +typedef struct netdfs_q_dfs_Remove { + UNISTR2 path; + uint32 ptr0_server; + UNISTR2 server; + uint32 ptr0_share; + UNISTR2 share; +} NETDFS_Q_DFS_REMOVE; + +typedef struct netdfs_r_dfs_Remove { + WERROR status; +} NETDFS_R_DFS_REMOVE; + +typedef struct netdfs_q_dfs_SetInfo { + uint32 dummy; +} NETDFS_Q_DFS_SETINFO; + +typedef struct netdfs_r_dfs_SetInfo { + WERROR status; +} NETDFS_R_DFS_SETINFO; + +typedef struct netdfs_q_dfs_GetInfo { + UNISTR2 path; + uint32 ptr0_server; + UNISTR2 server; + uint32 ptr0_share; + UNISTR2 share; + uint32 level; +} NETDFS_Q_DFS_GETINFO; + +typedef struct netdfs_r_dfs_GetInfo { + NETDFS_DFS_INFO_CTR info; + WERROR status; +} NETDFS_R_DFS_GETINFO; + +typedef struct netdfs_q_dfs_Enum { + uint32 level; + uint32 bufsize; + uint32 ptr0_info; + NETDFS_DFS_ENUMSTRUCT info; + uint32 ptr0_total; + uint32 total; +} NETDFS_Q_DFS_ENUM; + +typedef struct netdfs_r_dfs_Enum { + uint32 ptr0_info; + NETDFS_DFS_ENUMSTRUCT info; + uint32 ptr0_total; + uint32 total; + WERROR status; +} NETDFS_R_DFS_ENUM; + +typedef struct netdfs_q_dfs_Rename { + uint32 dummy; +} NETDFS_Q_DFS_RENAME; + +typedef struct netdfs_r_dfs_Rename { + WERROR status; +} NETDFS_R_DFS_RENAME; + +typedef struct netdfs_q_dfs_Move { + uint32 dummy; +} NETDFS_Q_DFS_MOVE; + +typedef struct netdfs_r_dfs_Move { + WERROR status; +} NETDFS_R_DFS_MOVE; + +typedef struct netdfs_q_dfs_ManagerGetConfigInfo { + uint32 dummy; +} NETDFS_Q_DFS_MANAGERGETCONFIGINFO; + +typedef struct netdfs_r_dfs_ManagerGetConfigInfo { + WERROR status; +} NETDFS_R_DFS_MANAGERGETCONFIGINFO; + +typedef struct netdfs_q_dfs_ManagerSendSiteInfo { + uint32 dummy; +} NETDFS_Q_DFS_MANAGERSENDSITEINFO; + +typedef struct netdfs_r_dfs_ManagerSendSiteInfo { + WERROR status; +} NETDFS_R_DFS_MANAGERSENDSITEINFO; + +typedef struct netdfs_q_dfs_AddFtRoot { + uint32 dummy; +} NETDFS_Q_DFS_ADDFTROOT; + +typedef struct netdfs_r_dfs_AddFtRoot { + WERROR status; +} NETDFS_R_DFS_ADDFTROOT; + +typedef struct netdfs_q_dfs_RemoveFtRoot { + uint32 dummy; +} NETDFS_Q_DFS_REMOVEFTROOT; + +typedef struct netdfs_r_dfs_RemoveFtRoot { + WERROR status; +} NETDFS_R_DFS_REMOVEFTROOT; + +typedef struct netdfs_q_dfs_AddStdRoot { + uint32 dummy; +} NETDFS_Q_DFS_ADDSTDROOT; + +typedef struct netdfs_r_dfs_AddStdRoot { + WERROR status; +} NETDFS_R_DFS_ADDSTDROOT; + +typedef struct netdfs_q_dfs_RemoveStdRoot { + uint32 dummy; +} NETDFS_Q_DFS_REMOVESTDROOT; + +typedef struct netdfs_r_dfs_RemoveStdRoot { + WERROR status; +} NETDFS_R_DFS_REMOVESTDROOT; + +typedef struct netdfs_q_dfs_ManagerInitialize { + uint32 dummy; +} NETDFS_Q_DFS_MANAGERINITIALIZE; + +typedef struct netdfs_r_dfs_ManagerInitialize { + WERROR status; +} NETDFS_R_DFS_MANAGERINITIALIZE; + +typedef struct netdfs_q_dfs_AddStdRootForced { + uint32 dummy; +} NETDFS_Q_DFS_ADDSTDROOTFORCED; + +typedef struct netdfs_r_dfs_AddStdRootForced { + WERROR status; +} NETDFS_R_DFS_ADDSTDROOTFORCED; + +typedef struct netdfs_q_dfs_GetDcAddress { + uint32 dummy; +} NETDFS_Q_DFS_GETDCADDRESS; + +typedef struct netdfs_r_dfs_GetDcAddress { + WERROR status; +} NETDFS_R_DFS_GETDCADDRESS; + +typedef struct netdfs_q_dfs_SetDcAddress { + uint32 dummy; +} NETDFS_Q_DFS_SETDCADDRESS; + +typedef struct netdfs_r_dfs_SetDcAddress { + WERROR status; +} NETDFS_R_DFS_SETDCADDRESS; + +typedef struct netdfs_q_dfs_FlushFtTable { + uint32 dummy; +} NETDFS_Q_DFS_FLUSHFTTABLE; + +typedef struct netdfs_r_dfs_FlushFtTable { + WERROR status; +} NETDFS_R_DFS_FLUSHFTTABLE; + +typedef struct netdfs_q_dfs_Add2 { + uint32 dummy; +} NETDFS_Q_DFS_ADD2; + +typedef struct netdfs_r_dfs_Add2 { + WERROR status; +} NETDFS_R_DFS_ADD2; + +typedef struct netdfs_q_dfs_Remove2 { + uint32 dummy; +} NETDFS_Q_DFS_REMOVE2; + +typedef struct netdfs_r_dfs_Remove2 { + WERROR status; +} NETDFS_R_DFS_REMOVE2; + +typedef struct netdfs_q_dfs_EnumEx { + uint32 dummy; +} NETDFS_Q_DFS_ENUMEX; + +typedef struct netdfs_r_dfs_EnumEx { + WERROR status; +} NETDFS_R_DFS_ENUMEX; + +typedef struct netdfs_q_dfs_SetInfo2 { + uint32 dummy; +} NETDFS_Q_DFS_SETINFO2; + +typedef struct netdfs_r_dfs_SetInfo2 { + WERROR status; +} NETDFS_R_DFS_SETINFO2; + +#endif /* _RPC_NETDFS_H */ diff --git a/source/include/rpc_ds.h b/source/include/rpc_ds.h index 05258fb306c..4ca49871f6d 100644 --- a/source/include/rpc_ds.h +++ b/source/include/rpc_ds.h @@ -30,6 +30,7 @@ #define DS_ENUM_DOM_TRUSTS 0x28 + /* macros for RPC's */ /* DSROLE_PRIMARY_DOMAIN_INFO_BASIC */ @@ -55,6 +56,8 @@ #define DS_DOMAIN_FUCNTION_2003_MIXED 1 #define DS_DOMAIN_FUNCTION_2003 2 + + typedef struct { uint16 machine_role; @@ -78,6 +81,7 @@ typedef struct #define DsRolePrimaryDomainInfoBasic 1 + /* DS_Q_GETPRIMDOMINFO - DsGetPrimaryDomainInformation() request */ typedef struct { @@ -135,33 +139,15 @@ typedef struct { } DS_DOMAIN_TRUSTS_CTR; -/* Trust flags */ - #define DS_DOMAIN_IN_FOREST 0x0001 /* domains in the forest to which we belong; even different domain trees */ #define DS_DOMAIN_DIRECT_OUTBOUND 0x0002 /* trusted domains */ -#define DS_DOMAIN_TREE_ROOT 0x0004 /* root of a forest */ +#define DS_DOMAIN_TREE_ROOT 0x0004 /* root of our forest; also available in + DsRoleGetPrimaryDomainInfo() */ #define DS_DOMAIN_PRIMARY 0x0008 /* our domain */ #define DS_DOMAIN_NATIVE_MODE 0x0010 /* native mode AD servers */ #define DS_DOMAIN_DIRECT_INBOUND 0x0020 /* trusting domains */ -/* Trust types */ - -#define DS_DOMAIN_TRUST_TYPE_DOWNLEVEL 0x00000001 -#define DS_DOMAIN_TRUST_TYPE_UPLEVEL 0x00000002 - -/* Trust attributes */ - -#define DS_DOMAIN_TRUST_ATTRIB_NON_TRANSITIVE 0x00000001 -#define DS_DOMAIN_TRUST_ATTRIB_UPLEVEL_ONLY 0x00000002 -#define DS_DOMAIN_TRUST_ATTRIB_QUARANTINED_DOMAIN 0x00000004 -#define DS_DOMAIN_TRUST_ATTRIB_FOREST_TRANSITIVE 0x00000008 -#define DS_DOMAIN_TRUST_ATTRIB_CROSS_ORG 0x00000010 -#define DS_DOMAIN_TRUST_ATTRIB_IN_FOREST 0x00000020 -#define DS_DOMAIN_TRUST_ATTRIB_EXTERNAL 0x00000040 - - - /* DS_Q_ENUM_DOM_TRUSTS - DsEnumerateDomainTrusts() request */ typedef struct { diff --git a/source/include/rpc_echo.h b/source/include/rpc_echo.h new file mode 100644 index 00000000000..6b4ea6abfba --- /dev/null +++ b/source/include/rpc_echo.h @@ -0,0 +1,75 @@ +/* + Unix SMB/CIFS implementation. + + Samba rpcecho definitions. + + Copyright (C) Tim Potter 2003 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_ECHO_H +#define _RPC_ECHO_H + +#define ECHO_ADD_ONE 0x00 +#define ECHO_DATA 0x01 +#define ECHO_SINK_DATA 0x02 +#define ECHO_SOURCE_DATA 0x03 + +typedef struct echo_q_add_one +{ + uint32 request; +} ECHO_Q_ADD_ONE; + +typedef struct echo_r_add_one +{ + uint32 response; +} ECHO_R_ADD_ONE; + +typedef struct echo_q_echo_data +{ + uint32 size; + char *data; +} ECHO_Q_ECHO_DATA; + +typedef struct echo_r_echo_data +{ + uint32 size; + char *data; +} ECHO_R_ECHO_DATA; + +typedef struct echo_q_source_data +{ + uint32 size; +} ECHO_Q_SOURCE_DATA; + +typedef struct echo_r_source_data +{ + uint32 size; + char *data; +} ECHO_R_SOURCE_DATA; + +typedef struct echo_q_sink_data +{ + uint32 size; + char *data; +} ECHO_Q_SINK_DATA; + +typedef struct echo_r_sink_data +{ + int dummy; /* unused */ +} ECHO_R_SINK_DATA; + +#endif diff --git a/source/include/rpc_eventlog.h b/source/include/rpc_eventlog.h index 547568e93bd..5bede97d1c9 100644 --- a/source/include/rpc_eventlog.h +++ b/source/include/rpc_eventlog.h @@ -31,10 +31,20 @@ #define EVENTLOG_READEVENTLOG 0x0a /* Eventlog read flags */ -/* defined in librpc/gen_ndr/eventlog.h */ + +#define EVENTLOG_SEQUENTIAL_READ 0x0001 +#define EVENTLOG_SEEK_READ 0x0002 +#define EVENTLOG_FORWARDS_READ 0x0004 +#define EVENTLOG_BACKWARDS_READ 0x0008 /* Event types */ -/* defined in librpc/gen_ndr/eventlog.h */ + +#define EVENTLOG_SUCCESS 0x0000 +#define EVENTLOG_ERROR_TYPE 0x0001 +#define EVENTLOG_WARNING_TYPE 0x0002 +#define EVENTLOG_INFORMATION_TYPE 0x0004 +#define EVENTLOG_AUDIT_SUCCESS 0x0008 +#define EVENTLOG_AUDIT_FAILURE 0x0010 /* Defines for TDB keys */ #define EVT_OLDEST_ENTRY "INFO/oldest_entry" @@ -84,6 +94,18 @@ typedef struct { typedef struct { POLICY_HND handle; +} EVENTLOG_Q_CLOSE_EVENTLOG; + +typedef struct { + POLICY_HND handle; + NTSTATUS status; +} EVENTLOG_R_CLOSE_EVENTLOG; + + +/***********************************/ + +typedef struct { + POLICY_HND handle; } EVENTLOG_Q_GET_NUM_RECORDS; typedef struct { diff --git a/source/include/rpc_misc.h b/source/include/rpc_misc.h index 62bef2cb380..7404f5669d2 100644 --- a/source/include/rpc_misc.h +++ b/source/include/rpc_misc.h @@ -93,6 +93,10 @@ enum unistr2_term_codes { UNI_FLAGS_NONE = 0, UNI_STR_TERMINATE = 1, UNI_MAXLEN_ **********************************************************************/ typedef struct policy_handle POLICY_HND; +typedef struct { + uint32 ptr_hnd; /* pointer to enumeration handle */ + uint32 handle; /* enumeration handle */ +} ENUM_HND; #define OUR_HANDLE(hnd) (((hnd)==NULL) ? "NULL" :\ ( IVAL((hnd)->uuid.node,2) == (uint32)sys_getpid() ? "OURS" : \ diff --git a/source/include/rpc_netlogon.h b/source/include/rpc_netlogon.h index 940709346f1..324755a2659 100644 --- a/source/include/rpc_netlogon.h +++ b/source/include/rpc_netlogon.h @@ -32,7 +32,6 @@ #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 @@ -46,6 +45,11 @@ #define NET_DSR_GETDCNAMEEX2 0x22 #define NET_SAMLOGON_EX 0x27 +/* Secure Channel types. used in NetrServerAuthenticate negotiation */ +#define SEC_CHAN_WKSTA 2 +#define SEC_CHAN_DOMAIN 4 +#define SEC_CHAN_BDC 6 + /* Returned delta types */ #define SAM_DELTA_DOMAIN_INFO 0x01 #define SAM_DELTA_GROUP_INFO 0x02 @@ -64,6 +68,11 @@ #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 @@ -91,7 +100,6 @@ #define LOGON_RESOURCE_GROUPS 0x00000200 #define LOGON_PROFILE_PATH_RETURNED 0x00000400 #define LOGON_GRACE_LOGON 0x01000000 -#define LOGON_KRB5_FAIL_CLOCK_SKEW 0x02000000 #define SE_GROUP_MANDATORY 0x00000001 #define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002 @@ -428,23 +436,6 @@ typedef struct net_r_getanydcname { WERROR status; } NET_R_GETANYDCNAME; - -/* NET_Q_GETDCNAME - Ask a DC for a trusted DC name */ - -typedef struct net_q_getdcname { - UNISTR2 uni_logon_server; - uint32 ptr_domainname; - UNISTR2 uni_domainname; -} NET_Q_GETDCNAME; - -/* NET_R_GETDCNAME - Ask a DC for a trusted DC name */ - -typedef struct net_r_getdcname { - uint32 ptr_dcname; - UNISTR2 uni_dcname; - WERROR status; -} NET_R_GETDCNAME; - /* NET_Q_TRUST_DOM_LIST - LSA Query Trusted Domains */ typedef struct net_q_trust_dom_info { uint32 ptr; /* undocumented buffer pointer */ diff --git a/source/include/rpc_reg.h b/source/include/rpc_reg.h new file mode 100644 index 00000000000..c454a1d6f94 --- /dev/null +++ b/source/include/rpc_reg.h @@ -0,0 +1,470 @@ +/* + Unix SMB/CIFS implementation. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997. + Copyright (C) Luke Kenneth Casson Leighton 1996-1997. + Copyright (C) Paul Ashton 1997. + Copyright (C) Jeremy Cooper 2004. + Copyright (C) Gerald Carter 2002-2005. + + 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 2 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_REG_H /* _RPC_REG_H */ +#define _RPC_REG_H + +/* RPC opnum */ + +#define REG_OPEN_HKCR 0x00 +#define REG_OPEN_HKLM 0x02 +#define REG_OPEN_HKPD 0x03 +#define REG_OPEN_HKU 0x04 +#define REG_CLOSE 0x05 +#define REG_CREATE_KEY_EX 0x06 +#define REG_DELETE_KEY 0x07 +#define REG_DELETE_VALUE 0x08 +#define REG_ENUM_KEY 0x09 +#define REG_ENUM_VALUE 0x0a +#define REG_FLUSH_KEY 0x0b +#define REG_GET_KEY_SEC 0x0c +#define REG_OPEN_ENTRY 0x0f +#define REG_QUERY_KEY 0x10 +#define REG_QUERY_VALUE 0x11 +#define REG_RESTORE_KEY 0x13 +#define REG_SAVE_KEY 0x14 +#define REG_SET_KEY_SEC 0x15 +#define REG_SET_VALUE 0x16 +#define REG_SHUTDOWN 0x18 +#define REG_ABORT_SHUTDOWN 0x19 +#define REG_OPEN_HKPT 0x20 +#define REG_GETVERSION 0x1a +#define REG_SHUTDOWN_EX 0x1e + + +#define HKEY_CLASSES_ROOT 0x80000000 +#define HKEY_CURRENT_USER 0x80000001 +#define HKEY_LOCAL_MACHINE 0x80000002 +#define HKEY_USERS 0x80000003 +#define HKEY_PERFORMANCE_DATA 0x80000004 + +#define KEY_HKLM "HKLM" +#define KEY_HKU "HKU" +#define KEY_HKCR "HKCR" +#define KEY_HKPD "HKPD" +#define KEY_HKPT "HKPT" +#define KEY_SERVICES "HKLM\\SYSTEM\\CurrentControlSet\\Services" +#define KEY_PRINTING "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Print" +#define KEY_PRINTING_2K "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print\\Printers" +#define KEY_PRINTING_PORTS "HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Ports" +#define KEY_EVENTLOG "HKLM\\SYSTEM\\CurrentControlSet\\Services\\Eventlog" +#define KEY_SHARES "HKLM\\SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Shares" +#define KEY_TREE_ROOT "" + +/* Registry data types */ + +#define REG_NONE 0 +#define REG_SZ 1 +#define REG_EXPAND_SZ 2 +#define REG_BINARY 3 +#define REG_DWORD 4 +#define REG_DWORD_LE 4 /* DWORD, little endian */ +#define REG_DWORD_BE 5 /* DWORD, big endian */ +#define REG_LINK 6 +#define REG_MULTI_SZ 7 +#define REG_RESOURCE_LIST 8 +#define REG_FULL_RESOURCE_DESCRIPTOR 9 +#define REG_RESOURCE_REQUIREMENTS_LIST 10 + +/* + * Registry key types + * Most keys are going to be GENERIC -- may need a better name? + * HKPD and HKPT are used by reg_perfcount.c + * they are special keys that contain performance data + */ +#define REG_KEY_GENERIC 0 +#define REG_KEY_HKPD 1 +#define REG_KEY_HKPT 2 + +/* + * container for function pointers to enumeration routines + * for virtual registry view + */ + +typedef struct { + /* functions for enumerating subkeys and values */ + int (*fetch_subkeys)( const char *key, REGSUBKEY_CTR *subkeys); + int (*fetch_values) ( const char *key, REGVAL_CTR *val ); + BOOL (*store_subkeys)( const char *key, REGSUBKEY_CTR *subkeys ); + BOOL (*store_values)( const char *key, REGVAL_CTR *val ); + BOOL (*reg_access_check)( const char *keyname, uint32 requested, uint32 *granted, NT_USER_TOKEN *token ); +} REGISTRY_OPS; + +typedef struct { + const char *keyname; /* full path to name of key */ + REGISTRY_OPS *ops; /* registry function hooks */ +} REGISTRY_HOOK; + + +/* structure to store the registry handles */ + +typedef struct _RegistryKey { + uint32 type; + char *name; /* full name of registry key */ + uint32 access_granted; + REGISTRY_HOOK *hook; +} REGISTRY_KEY; + +/* + * RPC REGISTRY STRUCTURES + */ + +/***********************************************/ + +typedef struct { + uint16 *server; + uint32 access; +} REG_Q_OPEN_HIVE; + +typedef struct { + POLICY_HND pol; + WERROR status; +} REG_R_OPEN_HIVE; + + +/***********************************************/ + +typedef struct { + POLICY_HND pol; +} REG_Q_FLUSH_KEY; + +typedef struct { + WERROR status; +} REG_R_FLUSH_KEY; + + +/***********************************************/ + +typedef struct { + POLICY_HND handle; + uint32 sec_info; + uint32 ptr; + BUFHDR hdr_sec; + SEC_DESC_BUF *data; +} REG_Q_SET_KEY_SEC; + +typedef struct { + WERROR status; +} REG_R_SET_KEY_SEC; + + +/***********************************************/ + +typedef struct { + POLICY_HND handle; + uint32 sec_info; + uint32 ptr; + BUFHDR hdr_sec; + SEC_DESC_BUF *data; +} REG_Q_GET_KEY_SEC; + +typedef struct { + uint32 sec_info; + uint32 ptr; + BUFHDR hdr_sec; + SEC_DESC_BUF *data; + WERROR status; +} REG_R_GET_KEY_SEC; + +/***********************************************/ + +typedef struct { + POLICY_HND handle; + UNISTR4 name; + uint32 type; + RPC_DATA_BLOB value; + uint32 size; +} REG_Q_SET_VALUE; + +typedef struct { + WERROR status; +} REG_R_SET_VALUE; + +/***********************************************/ + +typedef struct { + POLICY_HND pol; + uint32 val_index; + UNISTR4 name; + uint32 *type; + REGVAL_BUFFER *value; /* value, in byte buffer */ + uint32 *buffer_len; + uint32 *name_len; +} REG_Q_ENUM_VALUE; + +typedef struct { + UNISTR4 name; + uint32 *type; + REGVAL_BUFFER *value; + uint32 *buffer_len1; + uint32 *buffer_len2; + WERROR status; +} REG_R_ENUM_VALUE; + +/***********************************************/ + +typedef struct { + POLICY_HND handle; + UNISTR4 name; + UNISTR4 key_class; + uint32 options; + uint32 access; + + /* FIXME! collapse all this into one structure */ + uint32 *sec_info; + uint32 ptr2; + BUFHDR hdr_sec; + uint32 ptr3; + SEC_DESC_BUF *data; + + uint32 *disposition; +} REG_Q_CREATE_KEY_EX; + +typedef struct { + POLICY_HND handle; + uint32 disposition; + WERROR status; +} REG_R_CREATE_KEY_EX; + +/***********************************************/ + +typedef struct { + POLICY_HND handle; + UNISTR4 name; +} REG_Q_DELETE_KEY; + +typedef struct { + WERROR status; +} REG_R_DELETE_KEY; + +/***********************************************/ + +typedef struct { + POLICY_HND handle; + UNISTR4 name; +} REG_Q_DELETE_VALUE; + +typedef struct { + WERROR status; +} REG_R_DELETE_VALUE; + +/***********************************************/ + +typedef struct { + POLICY_HND pol; + UNISTR4 key_class; +} REG_Q_QUERY_KEY; + +typedef struct { + UNISTR4 key_class; + uint32 num_subkeys; + uint32 max_subkeylen; + uint32 reserved; /* 0x0000 0000 - according to MSDN (max_subkeysize?) */ + uint32 num_values; + uint32 max_valnamelen; + uint32 max_valbufsize; + uint32 sec_desc; /* 0x0000 0078 */ + NTTIME mod_time; /* modified time */ + WERROR status; +} REG_R_QUERY_KEY; + + +/***********************************************/ + +typedef struct { + POLICY_HND pol; +} REG_Q_GETVERSION; + +typedef struct { + uint32 win_version; + WERROR status; +} REG_R_GETVERSION; + + +/***********************************************/ + +typedef struct { + POLICY_HND pol; + UNISTR4 filename; + uint32 flags; +} REG_Q_RESTORE_KEY; + +typedef struct { + WERROR status; /* return status */ +} REG_R_RESTORE_KEY; + + +/***********************************************/ + + +/* I have no idea if this is correct since I + have not seen the full structure on the wire + as of yet */ + +typedef struct { + uint32 max_len; + uint32 len; + SEC_DESC *secdesc; +} REG_SEC_DESC_BUF; + +typedef struct { + uint32 size; /* size in bytes of security descriptor */ + REG_SEC_DESC_BUF secdesc; + uint8 inherit; /* see MSDN for a description */ +} SECURITY_ATTRIBUTE; + +typedef struct { + POLICY_HND pol; + UNISTR4 filename; + SECURITY_ATTRIBUTE *sec_attr; +} REG_Q_SAVE_KEY; + +typedef struct { + WERROR status; /* return status */ +} REG_R_SAVE_KEY; + + +/***********************************************/ + +typedef struct { + POLICY_HND pol; /* policy handle */ +} REG_Q_CLOSE; + +typedef struct { + POLICY_HND pol; + WERROR status; +} REG_R_CLOSE; + + +/***********************************************/ + +typedef struct { + POLICY_HND pol; + uint32 key_index; + uint16 key_name_len; + uint16 unknown_1; /* 0x0414 */ + uint32 ptr1; + uint32 unknown_2; /* 0x0000 020A */ + uint8 pad1[8]; + uint32 ptr2; + uint8 pad2[8]; + uint32 ptr3; + NTTIME time; +} REG_Q_ENUM_KEY; + +typedef struct { + UNISTR4 keyname; + UNISTR4 *classname; + NTTIME *time; + WERROR status; /* return status */ +} REG_R_ENUM_KEY; + + +/***********************************************/ + +typedef struct { + POLICY_HND pol; /* policy handle */ + UNISTR4 name; + + uint32 ptr_reserved; /* pointer */ + + uint32 ptr_buf; /* the next three fields follow if ptr_buf != 0 */ + uint32 ptr_bufsize; + uint32 bufsize; + uint32 buf_unk; + + uint32 unk1; + uint32 ptr_buflen; + uint32 buflen; + + uint32 ptr_buflen2; + uint32 buflen2; + +} REG_Q_QUERY_VALUE; + +typedef struct { + uint32 *type; + REGVAL_BUFFER *value; /* key value */ + uint32 *buf_max_len; + uint32 *buf_len; + WERROR status; /* return status */ +} REG_R_QUERY_VALUE; + + +/***********************************************/ + +typedef struct { + POLICY_HND pol; + UNISTR4 name; + uint32 unknown_0; /* 32 bit unknown - 0x0000 0000 */ + uint32 access; +} REG_Q_OPEN_ENTRY; + +typedef struct { + POLICY_HND handle; + WERROR status; +} REG_R_OPEN_ENTRY; + +/***********************************************/ + +typedef struct { + uint16 *server; + UNISTR4 *message; + uint32 timeout; /* in seconds */ + uint8 force; /* boolean: force shutdown */ + uint8 reboot; /* boolean: reboot on shutdown */ +} REG_Q_SHUTDOWN; + +typedef struct { + WERROR status; /* return status */ +} REG_R_SHUTDOWN; + +/***********************************************/ + +typedef struct { + uint16 *server; + UNISTR4 *message; + uint32 timeout; /* in seconds */ + uint8 force; /* boolean: force shutdown */ + uint8 reboot; /* boolean: reboot on shutdown */ + uint32 reason; /* reason - must be defined code */ +} REG_Q_SHUTDOWN_EX; + +typedef struct { + WERROR status; +} REG_R_SHUTDOWN_EX; + +/***********************************************/ + +typedef struct { + uint16 *server; +} REG_Q_ABORT_SHUTDOWN; + +typedef struct { + WERROR status; +} REG_R_ABORT_SHUTDOWN; + + +#endif /* _RPC_REG_H */ + diff --git a/source/include/rpc_samr.h b/source/include/rpc_samr.h index d34ecdb5fbb..575cd78ef2f 100644 --- a/source/include/rpc_samr.h +++ b/source/include/rpc_samr.h @@ -4,7 +4,7 @@ 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) Jean François Micouleau 1998-2001 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2002 @@ -128,11 +128,11 @@ SamrTestPrivateFunctionsUser #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_DISPINFO2 0x30 /* Alias for SAMR_QUERY_DISPINFO +#define SAMR_QUERY_DISPINFO3 0x30 /* Alias for SAMR_QUERY_DISPINFO with info level 3 */ -#define SAMR_GET_DISPENUM_INDEX2 0x31 +#define SAMR_UNKNOWN_31 0x31 #define SAMR_CREATE_USER 0x32 -#define SAMR_QUERY_DISPINFO3 0x33 /* Alias for SAMR_QUERY_DISPINFO +#define SAMR_QUERY_DISPINFO4 0x33 /* Alias for SAMR_QUERY_DISPINFO with info level 4 */ #define SAMR_ADDMULTI_ALIASMEM 0x34 @@ -289,6 +289,7 @@ typedef struct sam_user_info_25 UNISTR2 uni_comment; UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */ LOGON_HRS logon_hrs; + } SAM_USER_INFO_25; /* SAM_USER_INFO_26 */ diff --git a/source/include/rpc_secdes.h b/source/include/rpc_secdes.h index 8396040a9b1..6bfddcef01f 100644 --- a/source/include/rpc_secdes.h +++ b/source/include/rpc_secdes.h @@ -38,7 +38,6 @@ #define SEC_RIGHTS_EXTENDED 0x100 /* change/reset password, receive/send as*/ #define SEC_RIGHTS_CHANGE_PASSWD SEC_RIGHTS_EXTENDED #define SEC_RIGHTS_RESET_PASSWD SEC_RIGHTS_EXTENDED -#define SEC_RIGHTS_APPLY_GROUP_POLICY SEC_RIGHTS_EXTENDED #define SEC_RIGHTS_FULL_CTRL 0xf01ff #define SEC_ACE_OBJECT_PRESENT 0x00000001 /* thanks for Jim McDonough <jmcd@us.ibm.com> */ @@ -76,7 +75,22 @@ typedef uint32 SEC_ACCESS; /* SEC_ACE */ -typedef struct security_ace SEC_ACE; +typedef struct security_ace_info { + uint8 type; /* xxxx_xxxx_ACE_TYPE - e.g allowed / denied etc */ + uint8 flags; /* xxxx_INHERIT_xxxx - e.g OBJECT_INHERIT_ACE */ + uint16 size; + + SEC_ACCESS access_mask; + + /* this stuff may be present when type is XXXX_TYPE_XXXX_OBJECT */ + uint32 obj_flags; /* xxxx_ACE_OBJECT_xxxx e.g present/inherited present etc */ + struct GUID obj_guid; /* object GUID */ + struct GUID inh_guid; /* inherited object GUID */ + /* eof object stuff */ + + DOM_SID trustee; + +} SEC_ACE; #define SEC_ACE_HEADER_SIZE (2 * sizeof(uint8) + sizeof(uint16) + sizeof(uint32)) #ifndef ACL_REVISION @@ -85,7 +99,14 @@ typedef struct security_ace SEC_ACE; #ifndef _SEC_ACL /* SEC_ACL */ -typedef struct security_acl SEC_ACL; +typedef struct security_acl_info { + uint16 revision; /* 0x0003 */ + uint16 size; /* size in bytes of the entire ACL structure */ + uint32 num_aces; /* number of Access Control Entries */ + + SEC_ACE *aces; + +} SEC_ACL; #define SEC_ACL_HEADER_SIZE (2 * sizeof(uint16) + sizeof(uint32)) #define _SEC_ACL #endif @@ -96,14 +117,35 @@ typedef struct security_acl SEC_ACL; #ifndef _SEC_DESC /* SEC_DESC */ -typedef struct security_descriptor SEC_DESC; +typedef struct security_descriptor_info { + uint16 revision; /* 0x0001 */ + uint16 type; /* SEC_DESC_xxxx flags */ + + uint32 off_owner_sid; /* offset to owner sid */ + uint32 off_grp_sid ; /* offset to group sid */ + uint32 off_sacl ; /* offset to system list of permissions */ + uint32 off_dacl ; /* offset to list of permissions */ + + SEC_ACL *dacl; /* user ACL */ + SEC_ACL *sacl; /* system ACL */ + DOM_SID *owner_sid; + DOM_SID *group_sid; + +} SEC_DESC; #define SEC_DESC_HEADER_SIZE (2 * sizeof(uint16) + 4 * sizeof(uint32)) #define _SEC_DESC #endif #ifndef _SEC_DESC_BUF /* SEC_DESC_BUF */ -typedef struct sec_desc_buf SEC_DESC_BUF; +typedef struct sec_desc_buf_info { + uint32 max_len; + uint32 ptr; + uint32 len; + + SEC_DESC *sec; + +} SEC_DESC_BUF; #define _SEC_DESC_BUF #endif diff --git a/source/include/rpc_shutdown.h b/source/include/rpc_shutdown.h new file mode 100644 index 00000000000..a9d86aec26c --- /dev/null +++ b/source/include/rpc_shutdown.h @@ -0,0 +1,75 @@ +/* + Unix SMB/CIFS implementation. + + Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2003. + Copyright (C) Gerald (Jerry) Carter 2005. + + 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 2 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_SHUTDOWN_H /* _RPC_SHUTDOWN_H */ +#define _RPC_SHUTDOWN_H + + +/* opnums */ + +#define SHUTDOWN_INIT 0x00 +#define SHUTDOWN_ABORT 0x01 +#define SHUTDOWN_INIT_EX 0x02 + + +/***********************************************/ + +typedef struct { + uint16 *server; + UNISTR4 *message; + uint32 timeout; /* in seconds */ + uint8 force; /* boolean: force shutdown */ + uint8 reboot; /* boolean: reboot on shutdown */ +} SHUTDOWN_Q_INIT; + +typedef struct { + WERROR status; /* return status */ +} SHUTDOWN_R_INIT; + +/***********************************************/ + +typedef struct { + uint16 *server; + UNISTR4 *message; + uint32 timeout; /* in seconds */ + uint8 force; /* boolean: force shutdown */ + uint8 reboot; /* boolean: reboot on shutdown */ + uint32 reason; /* reason - must be defined code */ +} SHUTDOWN_Q_INIT_EX; + +typedef struct { + WERROR status; +} SHUTDOWN_R_INIT_EX; + +/***********************************************/ + +typedef struct { + uint16 *server; +} SHUTDOWN_Q_ABORT; + +typedef struct { + WERROR status; +} SHUTDOWN_R_ABORT; + + + +#endif /* _RPC_SHUTDOWN_H */ + diff --git a/source/include/rpc_srvsvc.h b/source/include/rpc_srvsvc.h new file mode 100644 index 00000000000..62acce58050 --- /dev/null +++ b/source/include/rpc_srvsvc.h @@ -0,0 +1,884 @@ +/* + Unix SMB/CIFS implementation. + SMB parameters and setup + Copyright (C) Andrew Tridgell 1992-1997 + Copyright (C) Luke Kenneth Casson Leighton 1996-1997 + Copyright (C) Paul Ashton 1997 + Copyright (C) Nigel Williams 2001 + Copyright (C) Gerald (Jerry) Carter 2006. + + + 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 2 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _RPC_SRVSVC_H /* _RPC_SRVSVC_H */ +#define _RPC_SRVSVC_H + +/* srvsvc pipe */ +#define SRV_NET_CONN_ENUM 0x08 +#define SRV_NET_FILE_ENUM 0x09 +#define SRV_NET_FILE_CLOSE 0x0b +#define SRV_NET_SESS_ENUM 0x0c +#define SRV_NET_SESS_DEL 0x0d +#define SRV_NET_SHARE_ADD 0x0e +#define SRV_NET_SHARE_ENUM_ALL 0x0f +#define SRV_NET_SHARE_GET_INFO 0x10 +#define SRV_NET_SHARE_SET_INFO 0x11 +#define SRV_NET_SHARE_DEL 0x12 +#define SRV_NET_SHARE_DEL_STICKY 0x13 +#define SRV_NET_SRV_GET_INFO 0x15 +#define SRV_NET_SRV_SET_INFO 0x16 +#define SRV_NET_DISK_ENUM 0x17 +#define SRV_NET_REMOTE_TOD 0x1c +#define SRV_NET_NAME_VALIDATE 0x21 +#define SRV_NET_SHARE_ENUM 0x24 +#define SRV_NET_FILE_QUERY_SECDESC 0x27 +#define SRV_NET_FILE_SET_SECDESC 0x28 + +#define MAX_SERVER_DISK_ENTRIES 15 + +typedef struct disk_info { + uint32 unknown; + UNISTR3 disk_name; +} DISK_INFO; + +typedef struct disk_enum_container { + uint32 level; + uint32 entries_read; + uint32 unknown; + uint32 disk_info_ptr; + DISK_INFO *disk_info; +} DISK_ENUM_CONTAINER; + +typedef struct net_srv_disk_enum { + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* server name */ + + DISK_ENUM_CONTAINER disk_enum_ctr; + + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + uint32 total_entries; /* total number of entries */ + ENUM_HND enum_hnd; + WERROR status; /* return status */ +} SRV_Q_NET_DISK_ENUM, SRV_R_NET_DISK_ENUM; + +/***************************/ + +typedef struct { + UNISTR2 *servername; + UNISTR2 sharename; + uint32 type; + uint32 flags; + WERROR status; +} SRV_Q_NET_NAME_VALIDATE; + +typedef struct { + WERROR status; +} SRV_R_NET_NAME_VALIDATE; + +/***************************/ + +/* oops - this is going to take up a *massive* amount of stack. */ +/* the UNISTR2s already have 1024 uint16 chars in them... */ + +#define MAX_SESS_ENTRIES 32 + +typedef struct { + UNISTR2 *sharename; +} SESS_INFO_0; + +typedef struct { + uint32 num_entries_read; + uint32 ptr_sess_info; + uint32 num_entries_read2; + SESS_INFO_0 info_0[MAX_SESS_ENTRIES]; +} SRV_SESS_INFO_0; + +typedef struct { + UNISTR2 *sharename; + UNISTR2 *username; + uint32 num_opens; + uint32 open_time; + uint32 idle_time; + uint32 user_flags; +} SESS_INFO_1; + +typedef struct { + uint32 num_entries_read; + uint32 ptr_sess_info; + uint32 num_entries_read2; + SESS_INFO_1 info_1[MAX_SESS_ENTRIES]; +} SRV_SESS_INFO_1; + +typedef struct { + uint32 switch_value; + uint32 ptr_sess_ctr; + union { + SRV_SESS_INFO_0 info0; + SRV_SESS_INFO_1 info1; + } sess; + +} SRV_SESS_INFO_CTR; + +typedef struct { + UNISTR2 *servername; + UNISTR2 *qualifier; + UNISTR2 *username; + uint32 sess_level; + SRV_SESS_INFO_CTR *ctr; + uint32 preferred_len; + ENUM_HND enum_hnd; +} SRV_Q_NET_SESS_ENUM; + +typedef struct { + uint32 sess_level; + SRV_SESS_INFO_CTR *ctr; + uint32 total_entries; + ENUM_HND enum_hnd; + WERROR status; +} SRV_R_NET_SESS_ENUM; + +/***************************/ + +/* SRV_Q_NET_SESS_DEL */ +typedef struct q_net_sess_del +{ + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* server name */ + + uint32 ptr_cli_name; /* pointer (to qualifier name) */ + UNISTR2 uni_cli_name; /* qualifier name "\\qualifier" */ + + uint32 ptr_user_name; /* pointer (to user name */ + UNISTR2 uni_user_name; /* user name */ + +} SRV_Q_NET_SESS_DEL; + +/* SRV_R_NET_SESS_DEL */ +typedef struct r_net_sess_del +{ + WERROR status; /* return status */ + +} SRV_R_NET_SESS_DEL; + +/* CONN_INFO_0 (pointers to level 0 connection info strings) */ +typedef struct ptr_conn_info0 +{ + uint32 id; /* connection id. */ + +} CONN_INFO_0; + +/* oops - this is going to take up a *massive* amount of stack. */ +/* the UNISTR2s already have 1024 uint16 chars in them... */ +#define MAX_CONN_ENTRIES 32 + +/* SRV_CONN_INFO_0 */ +typedef struct srv_conn_info_0_info +{ + uint32 num_entries_read; /* EntriesRead */ + uint32 ptr_conn_info; /* Buffer */ + uint32 num_entries_read2; /* EntriesRead */ + + CONN_INFO_0 info_0 [MAX_CONN_ENTRIES]; /* connection entry pointers */ + +} SRV_CONN_INFO_0; + +/* CONN_INFO_1 (pointers to level 1 connection info strings) */ +typedef struct ptr_conn_info1 +{ + uint32 id; /* connection id */ + uint32 type; /* 0x3 */ + uint32 num_opens; + uint32 num_users; + uint32 open_time; + + uint32 ptr_usr_name; /* pointer to user name. */ + uint32 ptr_net_name; /* pointer to network name (e.g IPC$). */ + +} CONN_INFO_1; + +/* CONN_INFO_1_STR (level 1 connection info strings) */ +typedef struct str_conn_info1 +{ + UNISTR2 uni_usr_name; /* unicode string of user */ + UNISTR2 uni_net_name; /* unicode string of name */ + +} CONN_INFO_1_STR; + +/* SRV_CONN_INFO_1 */ +typedef struct srv_conn_info_1_info +{ + uint32 num_entries_read; /* EntriesRead */ + uint32 ptr_conn_info; /* Buffer */ + uint32 num_entries_read2; /* EntriesRead */ + + CONN_INFO_1 info_1 [MAX_CONN_ENTRIES]; /* connection entry pointers */ + CONN_INFO_1_STR info_1_str[MAX_CONN_ENTRIES]; /* connection entry strings */ + +} SRV_CONN_INFO_1; + +/* SRV_CONN_INFO_CTR */ +typedef struct srv_conn_info_ctr_info +{ + uint32 switch_value; /* switch value */ + uint32 ptr_conn_ctr; /* pointer to conn info union */ + union + { + SRV_CONN_INFO_0 info0; /* connection info level 0 */ + SRV_CONN_INFO_1 info1; /* connection info level 1 */ + + } conn; + +} SRV_CONN_INFO_CTR; + + +/* SRV_Q_NET_CONN_ENUM */ +typedef struct q_net_conn_enum_info +{ + uint32 ptr_srv_name; /* pointer (to server name) */ + UNISTR2 uni_srv_name; /* server name "\\server" */ + + uint32 ptr_qual_name; /* pointer (to qualifier name) */ + UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */ + + uint32 conn_level; /* connection level */ + + SRV_CONN_INFO_CTR *ctr; + + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + ENUM_HND enum_hnd; + +} SRV_Q_NET_CONN_ENUM; + +/* SRV_R_NET_CONN_ENUM */ +typedef struct r_net_conn_enum_info +{ + uint32 conn_level; /* share level */ + + SRV_CONN_INFO_CTR *ctr; + + uint32 total_entries; /* total number of entries */ + ENUM_HND enum_hnd; + + WERROR status; /* return status */ + +} SRV_R_NET_CONN_ENUM; + +/* SH_INFO_0 */ +typedef struct ptr_share_info0 +{ + uint32 ptr_netname; /* pointer to net name. */ +} SH_INFO_0; + +/* SH_INFO_0_STR (level 0 share info strings) */ +typedef struct str_share_info0 +{ + SH_INFO_0 *ptrs; + + UNISTR2 uni_netname; /* unicode string of net name */ + +} SH_INFO_0_STR; + +/* SRV_SHARE_INFO_0 */ +typedef struct share_info_0_info +{ + SH_INFO_0 info_0; + SH_INFO_0_STR info_0_str; + +} SRV_SHARE_INFO_0; + +/* SH_INFO_1 (pointers to level 1 share info strings) */ +typedef struct ptr_share_info1 +{ + uint32 ptr_netname; /* pointer to net name. */ + uint32 type; /* ipc, print, disk ... */ + uint32 ptr_remark; /* pointer to comment. */ + +} SH_INFO_1; + +/* SH_INFO_1_STR (level 1 share info strings) */ +typedef struct str_share_info1 +{ + SH_INFO_1 *ptrs; + + UNISTR2 uni_netname; /* unicode string of net name */ + UNISTR2 uni_remark; /* unicode string of comment */ + +} SH_INFO_1_STR; + +/* SRV_SHARE_INFO_1 */ +typedef struct share_info_1_info +{ + SH_INFO_1 info_1; + SH_INFO_1_STR info_1_str; + +} SRV_SHARE_INFO_1; + +/* SH_INFO_2 (pointers to level 2 share info strings) */ +typedef struct ptr_share_info2 +{ + uint32 ptr_netname; /* pointer to net name. */ + uint32 type; /* ipc, print, disk ... */ + uint32 ptr_remark; /* pointer to comment. */ + uint32 perms; /* permissions */ + uint32 max_uses; /* maximum uses */ + uint32 num_uses; /* current uses */ + uint32 ptr_path; /* pointer to path name */ + uint32 ptr_passwd; /* pointer to password */ + +} SH_INFO_2; + +/* SH_INFO_2_STR (level 2 share info strings) */ +typedef struct str_share_info2 +{ + SH_INFO_2 *ptrs; + + UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */ + UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */ + UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */ + UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */ + +} SH_INFO_2_STR; + +/* SRV_SHARE_INFO_2 */ +typedef struct share_info_2_info +{ + SH_INFO_2 info_2; + SH_INFO_2_STR info_2_str; + +} SRV_SHARE_INFO_2; + +typedef struct ptr_share_info501 +{ + uint32 ptr_netname; /* pointer to net name */ + uint32 type; /* ipc, print, disk */ + uint32 ptr_remark; /* pointer to comment */ + uint32 csc_policy; /* client-side offline caching policy << 4 */ +} SH_INFO_501; + +typedef struct str_share_info501 +{ + UNISTR2 uni_netname; /* unicode string of net name */ + UNISTR2 uni_remark; /* unicode string of comment */ +} SH_INFO_501_STR; + +/* SRV_SHARE_INFO_501 */ +typedef struct share_info_501_info +{ + SH_INFO_501 info_501; + SH_INFO_501_STR info_501_str; +} SRV_SHARE_INFO_501; + +/* SH_INFO_502 (pointers to level 502 share info strings) */ +typedef struct ptr_share_info502 +{ + uint32 ptr_netname; /* pointer to net name. */ + uint32 type; /* ipc, print, disk ... */ + uint32 ptr_remark; /* pointer to comment. */ + uint32 perms; /* permissions */ + uint32 max_uses; /* maximum uses */ + uint32 num_uses; /* current uses */ + uint32 ptr_path; /* pointer to path name */ + uint32 ptr_passwd; /* pointer to password */ + uint32 reserved; /* this holds the space taken by the sd in the rpc packet */ + uint32 reserved_offset; /* required for _post operation when marshalling */ + uint32 sd_size; /* size of security descriptor */ + uint32 ptr_sd; /* pointer to security descriptor */ + +} SH_INFO_502; + +/* SH_INFO_502_STR (level 502 share info strings) */ +typedef struct str_share_info502 +{ + SH_INFO_502 *ptrs; + + UNISTR2 uni_netname; /* unicode string of net name (e.g NETLOGON) */ + UNISTR2 uni_remark; /* unicode string of comment (e.g "Logon server share") */ + UNISTR2 uni_path; /* unicode string of local path (e.g c:\winnt\system32\repl\import\scripts) */ + UNISTR2 uni_passwd; /* unicode string of password - presumably for share level security (e.g NULL) */ + + uint32 reserved; + uint32 sd_size; + SEC_DESC *sd; + +} SH_INFO_502_STR; + +/* SRV_SHARE_INFO_502 */ +typedef struct share_info_502_info +{ + SH_INFO_502 info_502; + SH_INFO_502_STR info_502_str; + +} SRV_SHARE_INFO_502; + +typedef struct ptr_share_info1004 +{ + uint32 ptr_remark; + +} SH_INFO_1004; + +typedef struct str_share_info1004 +{ + SH_INFO_1004 *ptrs; + + UNISTR2 uni_remark; + +} SH_INFO_1004_STR; + +typedef struct ptr_info_1004_info +{ + SH_INFO_1004 info_1004; + SH_INFO_1004_STR info_1004_str; +} SRV_SHARE_INFO_1004; + +typedef struct share_info_1005_info +{ + uint32 share_info_flags; +} SRV_SHARE_INFO_1005; + +typedef struct share_info_1006_info +{ + uint32 max_uses; +} SRV_SHARE_INFO_1006; + +typedef struct ptr_share_info1007 +{ + uint32 flags; + uint32 ptr_AlternateDirectoryName; + +} SH_INFO_1007; + +typedef struct str_share_info1007 +{ + SH_INFO_1007 *ptrs; + + UNISTR2 uni_AlternateDirectoryName; + +} SH_INFO_1007_STR; + +typedef struct ptr_info_1007_info +{ + SH_INFO_1007 info_1007; + SH_INFO_1007_STR info_1007_str; +} SRV_SHARE_INFO_1007; + +/* SRV_SHARE_INFO_1501 */ +typedef struct share_info_1501_info +{ + SEC_DESC_BUF *sdb; +} SRV_SHARE_INFO_1501; + +/* SRV_SHARE_INFO_CTR */ +typedef struct srv_share_info_ctr_info +{ + uint32 info_level; + uint32 switch_value; + uint32 ptr_share_info; + + uint32 num_entries; + uint32 ptr_entries; + uint32 num_entries2; + + union { + SRV_SHARE_INFO_0 *info0; + SRV_SHARE_INFO_1 *info1; /* share info level 1 */ + SRV_SHARE_INFO_2 *info2; /* share info level 2 */ + SRV_SHARE_INFO_501 *info501; /* share info level 501 */ + SRV_SHARE_INFO_502 *info502; /* share info level 502 */ + SRV_SHARE_INFO_1004 *info1004; + SRV_SHARE_INFO_1005 *info1005; + SRV_SHARE_INFO_1006 *info1006; + SRV_SHARE_INFO_1007 *info1007; + SRV_SHARE_INFO_1501 *info1501; + void *info; + + } share; + +} SRV_SHARE_INFO_CTR; + +/* SRV_Q_NET_SHARE_ENUM */ +typedef struct q_net_share_enum_info +{ + uint32 ptr_srv_name; /* pointer (to server name?) */ + UNISTR2 uni_srv_name; /* server name */ + + SRV_SHARE_INFO_CTR ctr; /* share info container */ + + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + + ENUM_HND enum_hnd; + +} SRV_Q_NET_SHARE_ENUM; + + +/* SRV_R_NET_SHARE_ENUM */ +typedef struct r_net_share_enum_info +{ + SRV_SHARE_INFO_CTR ctr; /* share info container */ + + uint32 total_entries; /* total number of entries */ + ENUM_HND enum_hnd; + + WERROR status; /* return status */ + +} SRV_R_NET_SHARE_ENUM; + + +/* SRV_Q_NET_SHARE_GET_INFO */ +typedef struct q_net_share_get_info_info +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; + + UNISTR2 uni_share_name; + uint32 info_level; + +} SRV_Q_NET_SHARE_GET_INFO; + +/* SRV_SHARE_INFO */ +typedef struct srv_share_info { + uint32 switch_value; + uint32 ptr_share_ctr; + + union { + SRV_SHARE_INFO_0 info0; + SRV_SHARE_INFO_1 info1; + SRV_SHARE_INFO_2 info2; + SRV_SHARE_INFO_501 info501; + SRV_SHARE_INFO_502 info502; + SRV_SHARE_INFO_1004 info1004; + SRV_SHARE_INFO_1005 info1005; + SRV_SHARE_INFO_1006 info1006; + SRV_SHARE_INFO_1007 info1007; + SRV_SHARE_INFO_1501 info1501; + } share; +} SRV_SHARE_INFO; + +/* SRV_R_NET_SHARE_GET_INFO */ +typedef struct r_net_share_get_info_info +{ + SRV_SHARE_INFO info; + WERROR status; + +} SRV_R_NET_SHARE_GET_INFO; + +/* SRV_Q_NET_SHARE_SET_INFO */ +typedef struct q_net_share_set_info_info +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; + + UNISTR2 uni_share_name; + uint32 info_level; + + SRV_SHARE_INFO info; + + uint32 ptr_parm_error; + uint32 parm_error; + +} SRV_Q_NET_SHARE_SET_INFO; + +/* SRV_R_NET_SHARE_SET_INFO */ +typedef struct r_net_share_set_info +{ + uint32 ptr_parm_error; + uint32 parm_error; + + WERROR status; /* return status */ + +} SRV_R_NET_SHARE_SET_INFO; + +/* SRV_Q_NET_SHARE_ADD */ +typedef struct q_net_share_add +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; + + uint32 info_level; + + SRV_SHARE_INFO info; + + uint32 ptr_err_index; /* pointer to error index */ + uint32 err_index; /* index in info to field in error */ + +} SRV_Q_NET_SHARE_ADD; + +/* SRV_R_NET_SHARE_ADD */ +typedef struct r_net_share_add +{ + + uint32 ptr_parm_error; + uint32 parm_error; + + WERROR status; /* return status */ + +} SRV_R_NET_SHARE_ADD; + +/* SRV_Q_NET_SHARE_DEL */ +typedef struct q_net_share_del +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; + UNISTR2 uni_share_name; + uint32 reserved; + +} SRV_Q_NET_SHARE_DEL; + +/* SRV_R_NET_SHARE_DEL */ +typedef struct r_net_share_del +{ + WERROR status; /* return status */ + +} SRV_R_NET_SHARE_DEL; + +/***************************/ + +typedef struct { + uint32 id; /* file index */ + uint32 perms; /* file permissions. don't know what format */ + uint32 num_locks; /* file locks */ + UNISTR2 *path; /* file name */ + UNISTR2 *user; /* file owner */ +} FILE_INFO_3; + +typedef struct { + uint32 level; /* switch value */ + uint32 ptr_file_info; /* pointer to file info union */ + + uint32 num_entries; + uint32 ptr_entries; + uint32 num_entries2; + union { + FILE_INFO_3 *info3; + } file; + +} SRV_FILE_INFO_CTR; + +typedef struct { + UNISTR2 *servername; + UNISTR2 *qualifier; + UNISTR2 *username; + uint32 level; + SRV_FILE_INFO_CTR ctr; + uint32 preferred_len; /* preferred maximum length (0xffff ffff) */ + ENUM_HND enum_hnd; +} SRV_Q_NET_FILE_ENUM; + +typedef struct { + uint32 level; + SRV_FILE_INFO_CTR ctr; + uint32 total_entries; + ENUM_HND enum_hnd; + 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 +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; + uint32 ptr_qual_name; + UNISTR2 uni_qual_name; + UNISTR2 uni_file_name; + uint32 unknown1; + uint32 unknown2; + uint32 unknown3; +} SRV_Q_NET_FILE_QUERY_SECDESC; + +/* SRV_R_NET_FILE_QUERY_SECDESC */ +typedef struct r_net_file_query_secdesc +{ + uint32 ptr_response; + uint32 size_response; + uint32 ptr_secdesc; + uint32 size_secdesc; + SEC_DESC *sec_desc; + WERROR status; +} SRV_R_NET_FILE_QUERY_SECDESC; + +/* SRV_Q_NET_FILE_SET_SECDESC */ +typedef struct q_net_file_set_secdesc +{ + uint32 ptr_srv_name; + UNISTR2 uni_srv_name; + uint32 ptr_qual_name; + UNISTR2 uni_qual_name; + UNISTR2 uni_file_name; + uint32 sec_info; + uint32 size_set; + uint32 ptr_secdesc; + uint32 size_secdesc; + SEC_DESC *sec_desc; +} SRV_Q_NET_FILE_SET_SECDESC; + +/* SRV_R_NET_FILE_SET_SECDESC */ +typedef struct r_net_file_set_secdesc +{ + WERROR status; +} SRV_R_NET_FILE_SET_SECDESC; + +/***************************/ + +typedef struct { + UNISTR2 *servername; + uint32 file_id; +} SRV_Q_NET_FILE_CLOSE; + +typedef struct { + WERROR status; +} SRV_R_NET_FILE_CLOSE; + +/***************************/ + +#endif /* _RPC_SRVSVC_H */ diff --git a/source/include/rpc_svcctl.h b/source/include/rpc_svcctl.h index f4bf509f7c2..8ca5e1772b8 100644 --- a/source/include/rpc_svcctl.h +++ b/source/include/rpc_svcctl.h @@ -202,6 +202,17 @@ typedef struct _ServiceInfo { /**************************/ typedef struct { + POLICY_HND handle; +} SVCCTL_Q_CLOSE_SERVICE; + +typedef struct { + POLICY_HND handle; + WERROR status; +} SVCCTL_R_CLOSE_SERVICE; + +/**************************/ + +typedef struct { UNISTR2 *servername; UNISTR2 *database; uint32 access; diff --git a/source/include/safe_string.h b/source/include/safe_string.h index 3a732e11e1f..d278e29aca5 100644 --- a/source/include/safe_string.h +++ b/source/include/safe_string.h @@ -164,7 +164,7 @@ size_t __unsafe_string_function_usage_here_char__(void); #define safe_strcpy(dest,src,maxlength) safe_strcpy_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE,dest,src,maxlength) #define safe_strcat(dest,src,maxlength) safe_strcat_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE,dest,src,maxlength) #define push_string(base_ptr, dest, src, dest_len, flags) push_string_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, dest, src, dest_len, flags) -#define pull_string(base_ptr, smb_flags2, dest, src, dest_len, src_len, flags) pull_string_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, smb_flags2, dest, src, dest_len, src_len, flags) +#define pull_string(base_ptr, dest, src, dest_len, src_len, flags) pull_string_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, dest, src, dest_len, src_len, flags) #define clistr_push(cli, dest, src, dest_len, flags) clistr_push_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, cli, dest, src, dest_len, flags) #define clistr_pull(cli, dest, src, dest_len, src_len, flags) clistr_pull_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, cli, dest, src, dest_len, src_len, flags) #define srvstr_push(base_ptr, dest, src, dest_len, flags) srvstr_push_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, dest, src, dest_len, flags) @@ -193,10 +193,10 @@ size_t __unsafe_string_function_usage_here_char__(void); ? __unsafe_string_function_usage_here_size_t__() \ : push_string_fn(fn_name, fn_line, base_ptr, dest, src, dest_len, flags)) -#define pull_string_fn2(fn_name, fn_line, base_ptr, smb_flags2, dest, src, dest_len, src_len, flags) \ +#define pull_string_fn2(fn_name, fn_line, base_ptr, dest, src, dest_len, src_len, flags) \ (CHECK_STRING_SIZE(dest, dest_len) \ ? __unsafe_string_function_usage_here_size_t__() \ - : pull_string_fn(fn_name, fn_line, base_ptr, smb_flags2, dest, src, dest_len, src_len, flags)) + : pull_string_fn(fn_name, fn_line, base_ptr, dest, src, dest_len, src_len, flags)) #define clistr_push_fn2(fn_name, fn_line, cli, dest, src, dest_len, flags) \ (CHECK_STRING_SIZE(dest, dest_len) \ diff --git a/source/include/session.h b/source/include/session.h index 1220f66dc50..8c8faab5325 100644 --- a/source/include/session.h +++ b/source/include/session.h @@ -36,7 +36,7 @@ struct sessionid { fstring remote_machine; fstring id_str; uint32 id_num; - struct server_id pid; + uint32 pid; fstring ip_addr; time_t connect_start; }; diff --git a/source/include/smb.h b/source/include/smb.h index 95889f86e5d..3f2f2235f66 100644 --- a/source/include/smb.h +++ b/source/include/smb.h @@ -79,7 +79,6 @@ #define WRITE_ERROR 4 /* This error code can go into the client smb_rw_error. */ #define READ_BAD_SIG 5 #define DO_NOT_DO_TDIS 6 /* cli_close_connection() check for this when smbfs wants to keep tree connected */ -#define READ_BAD_DECRYPT 7 #define DIR_STRUCT_SIZE 43 @@ -187,10 +186,9 @@ typedef uint32 codepoint_t; #define PIPE_NETDFS "\\PIPE\\netdfs" #define PIPE_ECHO "\\PIPE\\rpcecho" #define PIPE_SHUTDOWN "\\PIPE\\initshutdown" -#define PIPE_EPMAPPER "\\PIPE\\epmapper" +#define PIPE_EPM "\\PIPE\\epmapper" #define PIPE_SVCCTL "\\PIPE\\svcctl" #define PIPE_EVENTLOG "\\PIPE\\eventlog" -#define PIPE_UNIXINFO "\\PIPE\\unixinfo" #define PIPE_NETLOGON_PLAIN "\\NETLOGON" @@ -203,14 +201,12 @@ typedef uint32 codepoint_t; #define PI_WINREG 6 #define PI_SPOOLSS 7 #define PI_NETDFS 8 -#define PI_RPCECHO 9 -#define PI_INITSHUTDOWN 10 +#define PI_ECHO 9 +#define PI_SHUTDOWN 10 #define PI_SVCCTL 11 #define PI_EVENTLOG 12 -#define PI_UNIXINFO 13 -#define PI_NTSVCS 14 -#define PI_EPMAPPER 15 -#define PI_MAX_PIPES 16 +#define PI_NTSVCS 13 +#define PI_MAX_PIPES 14 /* 64 bit time (100usec) since ????? - cifs6.txt, section 3.5, page 30 */ typedef uint64_t NTTIME; @@ -247,15 +243,26 @@ typedef uint64_t NTTIME; #define SID_MAX_SIZE ((size_t)(8+(MAXSUBAUTHS*4))) -#define LOOKUP_NAME_ISOLATED 0x00000001 /* Look up unqualified names */ -#define LOOKUP_NAME_REMOTE 0x00000002 /* Ask others */ -#define LOOKUP_NAME_GROUP 0x00000004 /* (unused) This is a NASTY hack for - valid users = @foo where foo also - exists in as user. */ -#define LOOKUP_NAME_EXPLICIT 0x00000008 /* Only include - explicitly mapped names and not - the Unix {User,Group} domain */ -#define LOOKUP_NAME_ALL (LOOKUP_NAME_ISOLATED|LOOKUP_NAME_REMOTE) +/* SID Types */ +enum lsa_SidType { + SID_NAME_USE_NONE = 0, + SID_NAME_USER = 1, /* user */ + SID_NAME_DOM_GRP, /* domain group */ + SID_NAME_DOMAIN, /* domain sid */ + SID_NAME_ALIAS, /* local group */ + SID_NAME_WKN_GRP, /* well-known group */ + SID_NAME_DELETED, /* deleted account: needed for c2 rating */ + SID_NAME_INVALID, /* invalid account */ + SID_NAME_UNKNOWN, /* unknown sid type */ + SID_NAME_COMPUTER /* sid for a computer */ +}; + +#define LOOKUP_NAME_ISOLATED 1 /* Look up unqualified names */ +#define LOOKUP_NAME_REMOTE 2 /* Ask others */ +#define LOOKUP_NAME_ALL (LOOKUP_NAME_ISOLATED|LOOKUP_NAME_REMOTE) + +#define LOOKUP_NAME_GROUP 4 /* (unused) This is a NASTY hack for valid users = @foo + * where foo also exists in as user. */ /** * @brief Security Identifier @@ -305,16 +312,7 @@ struct id_map { #include "librpc/ndr/misc.h" #include "librpc/ndr/security.h" #include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/unixinfo.h" -#include "librpc/gen_ndr/lsa.h" -#include "librpc/gen_ndr/dfs.h" -#include "librpc/gen_ndr/initshutdown.h" -#include "librpc/gen_ndr/winreg.h" -#include "librpc/gen_ndr/eventlog.h" -#include "librpc/gen_ndr/srvsvc.h" #include "librpc/gen_ndr/wkssvc.h" -#include "librpc/gen_ndr/echo.h" -#include "librpc/gen_ndr/svcctl.h" struct lsa_dom_info { BOOL valid; @@ -427,9 +425,10 @@ struct fd_handle { * DELETE_ON_CLOSE is not stored in the share * mode database. */ - unsigned long gen_id; + unsigned long file_id; }; +struct messaging_context; struct event_context; struct fd_event; struct timed_event; @@ -491,7 +490,8 @@ typedef struct files_struct { struct fd_handle *fh; unsigned int num_smb_operations; uint16 rap_print_jobid; - struct file_id file_id; + SMB_DEV_T dev; + SMB_INO_T inode; SMB_BIG_UINT initial_allocation_size; /* Faked up initial allocation on disk. */ mode_t mode; uint16 file_pid; @@ -520,6 +520,7 @@ typedef struct files_struct { BOOL modified; BOOL is_directory; BOOL is_stat; + BOOL aio_write_behind; BOOL lockdb_clean; BOOL initial_delete_on_close; /* Only set at NTCreateX if file was created. */ BOOL posix_open; @@ -535,14 +536,12 @@ typedef struct files_struct { #include "sysquotas.h" /* used to hold an arbitrary blob of data */ -typedef struct data_blob { +typedef struct data_blob_ { uint8 *data; size_t length; - void (*free)(struct data_blob *data_blob); + void (*free)(struct data_blob_ *data_blob); } DATA_BLOB; -extern const DATA_BLOB data_blob_null; - /* * Structure used to keep directory state information around. * Used in NT change-notify code. @@ -601,6 +600,8 @@ struct trans_state { /* Include VFS stuff */ +struct security_descriptor_info; + #include "smb_acls.h" #include "vfs.h" @@ -670,6 +671,7 @@ typedef struct connection_struct { name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */ name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */ name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */ + name_compare_entry *aio_write_behind_list; /* Per-share list of files to use aio write behind on. */ struct dfree_cached_info *dfree_info; struct trans_state *pending_trans; struct notify_context *notify_ctx; @@ -682,13 +684,6 @@ struct current_user { NT_USER_TOKEN *nt_user_token; }; -struct smb_request { - uint16 flags2; - uint16 smbpid; - uint16 mid; - uint16 vuid; -}; - /* Defines for the sent_oplock_break field above. */ #define NO_BREAK_SENT 0 #define BREAK_TO_NONE_SENT 1 @@ -757,7 +752,7 @@ struct pending_message_list { /* struct returned by get_share_modes */ struct share_mode_entry { - struct server_id pid; + struct process_id pid; uint16 op_mid; uint16 op_type; uint32 access_mask; /* NTCreateX access bits (FILE_READ_DATA etc.) */ @@ -767,7 +762,8 @@ struct share_mode_entry { * NTCREATEX_OPTIONS_PRIVATE_DENY_FCB for * smbstatus and swat */ struct timeval time; - struct file_id id; + SMB_DEV_T dev; + SMB_INO_T inode; unsigned long share_file_id; uint32 uid; /* uid of file opener. */ uint16 flags; /* See SHARE_MODE_XX above. */ @@ -776,7 +772,7 @@ struct share_mode_entry { /* oplock break message definition - linearization of share_mode_entry. Offset Data length. -0 struct server_id pid 4 +0 struct process_id pid 4 4 uint16 op_mid 2 6 uint16 op_type 2 8 uint32 access_mask 4 @@ -792,23 +788,19 @@ Offset Data length. 54 */ -#ifdef CLUSTER_SUPPORT -#define MSG_SMB_SHARE_MODE_ENTRY_SIZE 58 -#else #define MSG_SMB_SHARE_MODE_ENTRY_SIZE 54 -#endif struct share_mode_lock { const char *servicepath; /* canonicalized. */ const char *filename; - struct file_id id; + SMB_DEV_T dev; + SMB_INO_T ino; int num_share_modes; struct share_mode_entry *share_modes; UNIX_USER_TOKEN *delete_token; BOOL delete_on_close; BOOL fresh; BOOL modified; - struct db_record *record; }; /* @@ -838,7 +830,7 @@ struct locking_data { /* Used to store pipe open records for NetFileEnum() */ struct pipe_open_rec { - struct server_id pid; + struct process_id pid; uid_t uid; int pnum; fstring name; @@ -885,14 +877,14 @@ struct pipe_open_rec { /* key and data in the connections database - used in smbstatus and smbd */ struct connections_key { - struct server_id pid; + struct process_id pid; int cnum; fstring name; }; struct connections_data { int magic; - struct server_id pid; + struct process_id pid; int cnum; uid_t uid; gid_t gid; @@ -1766,9 +1758,9 @@ typedef struct user_struct { gid_t gid; /* gid of a validated user */ userdom_struct user; - const char *homedir; - const char *unix_homedir; - const char *logon_script; + char *homedir; + char *unix_homedir; + char *logon_script; BOOL guest; @@ -1899,7 +1891,6 @@ struct ea_list { #define SAMBA_XATTR_DOS_ATTRIB "user.DOSATTRIB" #define UUID_SIZE 16 - #define UUID_FLAT_SIZE 16 typedef struct uuid_flat { uint8 info[UUID_FLAT_SIZE]; @@ -1927,6 +1918,4 @@ enum usershare_err { /* Different reasons for closing a file. */ enum file_close_type {NORMAL_CLOSE=0,SHUTDOWN_CLOSE,ERROR_CLOSE}; -#include "librpc/gen_ndr/epmapper.h" - #endif /* _SMB_H */ diff --git a/source/include/smb_launchd.h b/source/include/smb_launchd.h deleted file mode 100644 index 2e758a4de16..00000000000 --- a/source/include/smb_launchd.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Launchd integration wrapper API - - Copyright (C) James Peach 2007 - - 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 2 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -struct smb_launch_info -{ - int idle_timeout_secs; - int num_sockets; - int *socket_list; -}; - -/* Retrieve launchd configuration. Returns True if we are running under - * launchd, False otherwise. NOTE this does not guarantee to provide a list of - * sockets since this is a user configuration option. - */ -BOOL smb_launchd_checkin(struct smb_launch_info *linfo); - -/* Retrieve launchd configuration. The variadic arguments are a list of - * constant null-terminated strings. The strings are the names of the socket - * dictionaries to retrieve sockets from. The list of names is terminated by a - * NULL. - */ -BOOL smb_launchd_checkin_names(struct smb_launch_info *linfo, ...); - -/* Free any data or state associated with a successful launchd checkin. */ -void smb_launchd_checkout(struct smb_launch_info *linfo); diff --git a/source/include/smb_macros.h b/source/include/smb_macros.h index 81d4dc06665..a16ea7500f2 100644 --- a/source/include/smb_macros.h +++ b/source/include/smb_macros.h @@ -49,13 +49,12 @@ /* assert macros */ #ifdef DEVELOPER #define SMB_ASSERT(b) ( (b) ? (void)0 : \ - (DEBUG(0,("PANIC: assert failed at %s(%d): %s\n", \ - __FILE__, __LINE__, #b)), smb_panic("assert failed: " #b))) + (DEBUG(0,("PANIC: assert failed at %s(%d)\n", \ + __FILE__, __LINE__)), smb_panic("assert failed"))) #else /* redefine the assert macro for non-developer builds */ #define SMB_ASSERT(b) ( (b) ? (void)0 : \ - (DEBUG(0,("PANIC: assert failed at %s(%d): %s\n", \ - __FILE__, __LINE__, #b)))) + (DEBUG(0,("PANIC: assert failed at %s(%d)\n", __FILE__, __LINE__)))) #endif #define SMB_WARN(condition, message) \ @@ -163,15 +162,16 @@ #define HAS_CACHED_ERROR(fsp) ((fsp)->wbmpx_ptr && \ (fsp)->wbmpx_ptr->wr_discard) /* Macro to turn the cached error into an error packet */ -#define CACHED_ERROR(fsp) cached_error_packet(inbuf,outbuf,fsp,__LINE__,__FILE__) +#define CACHED_ERROR(fsp) cached_error_packet(outbuf,fsp,__LINE__,__FILE__) -#define ERROR_DOS(class,code) error_packet(inbuf,outbuf,class,code,NT_STATUS_OK,__LINE__,__FILE__) -#define ERROR_NT(status) error_packet(inbuf,outbuf,0,0,status,__LINE__,__FILE__) -#define ERROR_FORCE_NT(status) error_packet(inbuf,outbuf,-1,-1,status,__LINE__,__FILE__) -#define ERROR_BOTH(status,class,code) error_packet(inbuf,outbuf,class,code,status,__LINE__,__FILE__) +#define ERROR_DOS(class,code) error_packet(outbuf,class,code,NT_STATUS_OK,__LINE__,__FILE__) +#define ERROR_NT(status) error_packet(outbuf,0,0,status,__LINE__,__FILE__) +#define ERROR_OPEN(status) error_open(outbuf,status,__LINE__,__FILE__) +#define ERROR_FORCE_NT(status) error_packet(outbuf,-1,-1,status,__LINE__,__FILE__) +#define ERROR_BOTH(status,class,code) error_packet(outbuf,class,code,status,__LINE__,__FILE__) /* this is how errors are generated */ -#define UNIXERROR(defclass,deferror) unix_error_packet(inbuf,outbuf,defclass,deferror,NT_STATUS_OK,__LINE__,__FILE__) +#define UNIXERROR(defclass,deferror) unix_error_packet(outbuf,defclass,deferror,NT_STATUS_OK,__LINE__,__FILE__) /* these are the datagram types */ #define DGRAM_DIRECT_UNIQUE 0x10 @@ -192,10 +192,6 @@ #define _smb_setlen(buf,len) do { buf[0] = 0; buf[1] = (len&0x10000)>>16; \ buf[2] = (len&0xFF00)>>8; buf[3] = len&0xFF; } while (0) -#define smb_len_large(buf) (PVAL(buf,3)|(PVAL(buf,2)<<8)|(PVAL(buf,1)<<16)) -#define _smb_setlen_large(buf,len) do { buf[0] = 0; buf[1] = (len&0xFF0000)>>16; \ - buf[2] = (len&0xFF00)>>8; buf[3] = len&0xFF; } while (0) - /******************************************************************* find the difference in milliseconds between two struct timeval values @@ -362,4 +358,12 @@ do { \ #define ADD_TO_LARGE_ARRAY(mem_ctx, type, elem, array, num, size) \ add_to_large_array((mem_ctx), sizeof(type), &(elem), (void *)(array), (num), (size)); +#ifndef ISDOT +#define ISDOT(p) (*(p) == '.' && *((p) + 1) == '\0') +#endif /* ISDOT */ + +#ifndef ISDOTDOT +#define ISDOTDOT(p) (*(p) == '.' && *((p) + 1) == '.' && *((p) + 2) == '\0') +#endif /* ISDOTDOT */ + #endif /* _SMB_MACROS_H */ diff --git a/source/include/smb_share_modes.h b/source/include/smb_share_modes.h index 937a39c97a5..5ed43bda336 100644 --- a/source/include/smb_share_modes.h +++ b/source/include/smb_share_modes.h @@ -51,7 +51,7 @@ struct smb_share_mode_entry { uint32_t access_mask; struct timeval open_time; uint32_t file_id; - struct server_id pid; + struct process_id pid; }; /* diff --git a/source/include/smbldap.h b/source/include/smbldap.h index 67061fec86d..390b8f681a4 100644 --- a/source/include/smbldap.h +++ b/source/include/smbldap.h @@ -128,7 +128,6 @@ extern ATTRIB_MAP_ENTRY trustpw_attr_list[]; have to worry about LDAP structure types */ NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, - struct event_context *event_ctx, const char *location, struct smbldap_state **smbldap_state); @@ -170,8 +169,7 @@ struct smbldap_state { unsigned int num_failures; time_t last_use; - struct event_context *event_context; - struct timed_event *idle_event; + smb_event_id_t event_id; struct timeval last_rebind; }; diff --git a/source/include/smbprofile.h b/source/include/smbprofile.h index 7b04a185b4f..cc501739c16 100644 --- a/source/include/smbprofile.h +++ b/source/include/smbprofile.h @@ -144,10 +144,6 @@ enum profile_stats_values #define syscall_fchown_count __profile_stats_value(PR_VALUE_SYSCALL_FCHOWN, count) #define syscall_fchown_time __profile_stats_value(PR_VALUE_SYSCALL_FCHOWN, time) - PR_VALUE_SYSCALL_LCHOWN, -#define syscall_lchown_count __profile_stats_value(PR_VALUE_SYSCALL_LCHOWN, count) -#define syscall_lchown_time __profile_stats_value(PR_VALUE_SYSCALL_LCHOWN, time) - PR_VALUE_SYSCALL_CHDIR, #define syscall_chdir_count __profile_stats_value(PR_VALUE_SYSCALL_CHDIR, count) #define syscall_chdir_time __profile_stats_value(PR_VALUE_SYSCALL_CHDIR, time) diff --git a/source/include/srvstr.h b/source/include/srvstr.h index 99a7407a6a2..1029df53aee 100644 --- a/source/include/srvstr.h +++ b/source/include/srvstr.h @@ -18,14 +18,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define srvstr_pull(base_ptr, smb_flags2, dest, src, dest_len, src_len, flags) \ - pull_string(base_ptr, smb_flags2, dest, src, dest_len, src_len, flags) +#define srvstr_pull(base_ptr, dest, src, dest_len, src_len, flags) \ + pull_string(base_ptr, dest, src, dest_len, src_len, flags) /* pull a string from the smb_buf part of a packet. In this case the string can either be null terminated or it can be terminated by the end of the smbbuf area */ -#define srvstr_pull_buf(inbuf, smb_flags2, dest, src, dest_len, flags) \ - pull_string(inbuf, smb_flags2, dest, src, dest_len, smb_bufrem(inbuf, src), flags) +#define srvstr_pull_buf(inbuf, dest, src, dest_len, flags) \ + pull_string(inbuf, dest, src, dest_len, smb_bufrem(inbuf, src), flags) diff --git a/source/include/trans2.h b/source/include/trans2.h index 8b31b431c7a..c7faf4f63f6 100644 --- a/source/include/trans2.h +++ b/source/include/trans2.h @@ -529,10 +529,7 @@ findfirst/findnext is SMB_FIND_FILE_UNIX_INFO2. (chflags) and lsattr */ #define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x10 /* Use POSIX pathnames on the wire. */ #define CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP 0x20 /* We can cope with POSIX open/mkdir/unlink etc. */ -#define CIFS_UNIX_LARGE_READ_CAP 0x40 /* We can cope with 24 bit reads in readX. */ -#define CIFS_UNIX_LARGE_WRITE_CAP 0x80 /* We can cope with 24 bit writes in writeX. */ -#define CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP 0x100 /* We can do SPNEGO negotiations for encryption. */ -#define CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP 0x200 /* We *must* SPNEGO negotiations for encryption. */ + #define SMB_QUERY_POSIX_FS_INFO 0x201 @@ -554,21 +551,6 @@ findfirst/findnext is SMB_FIND_FILE_UNIX_INFO2. (NB statfs field flags can come from FILE_SYSTEM_DEVICE_INFO call) */ -#define SMB_QUERY_POSIX_WHO_AM_I 0x202 /* QFS Info */ -/* returns: - __u32 flags; 0 = Authenticated user 1 = GUEST - __u32 mask; which flags bits server understands ie 0x0001 - __u64 unix_user_id; - __u64 unix_user_gid; - __u32 number_of_supplementary_gids; may be zero - __u32 number_of_sids; may be zero - __u32 length_of_sid_array; in bytes - may be zero - __u32 pad; reserved - MBZ - __u64 gid_array[0]; may be empty - __u8 * psid_list may be empty -*/ - - /* ... more as we think of them :-). */ /* SMB POSIX ACL definitions. */ @@ -655,27 +637,6 @@ enum smb_whoami_flags { DOM_SID[] - list of SIDs (may be empty) */ -/* - * The following trans2 is done between client and server - * as a FSINFO call to set up the encryption state for transport - * encryption. - * - * The request looks like : - * - * [data block] -> SPNEGO framed GSSAPI request. - * - * The reply looks like : - * - * [data block] -> SPNEGO framed GSSAPI reply - if error - * is NT_STATUS_OK then we're done, if it's - * NT_STATUS_MORE_PROCESSING_REQUIRED then the - * client needs to keep going. If it's an - * error it can be any NT_STATUS error. - * - */ - -#define SMB_REQUEST_TRANSPORT_ENCRYPTION 0x203 - /* The query/set info levels for POSIX ACLs. */ #define SMB_QUERY_POSIX_ACL 0x204 #define SMB_SET_POSIX_ACL 0x204 diff --git a/source/include/util_tdb.h b/source/include/util_tdb.h index 5fd05f59fc5..a8def46e441 100644 --- a/source/include/util_tdb.h +++ b/source/include/util_tdb.h @@ -41,19 +41,9 @@ struct tdb_wrap { struct tdb_wrap *next, *prev; }; -struct tdb_validation_status { - BOOL tdb_error; - BOOL bad_freelist; - BOOL bad_entry; - BOOL unknown_key; - BOOL success; -}; - -typedef int (*tdb_validate_data_func)(TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *state); - TDB_LIST_NODE *tdb_search_keys(struct tdb_context*, const char*); void tdb_search_list_free(TDB_LIST_NODE*); -int32 tdb_change_int32_atomic(struct tdb_context *tdb, const char *keystr, int32 *oldval, int32 change_val); +int32_t tdb_change_int32_atomic(struct tdb_context *tdb, const char *keystr, int32_t *oldval, int32_t change_val); int tdb_lock_bystring(struct tdb_context *tdb, const char *keyval); int tdb_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval, int timeout); @@ -61,10 +51,10 @@ void tdb_unlock_bystring(struct tdb_context *tdb, const char *keyval); int tdb_read_lock_bystring_with_timeout(TDB_CONTEXT *tdb, const char *keyval, unsigned int timeout); void tdb_read_unlock_bystring(TDB_CONTEXT *tdb, const char *keyval); -int32 tdb_fetch_int32(struct tdb_context *tdb, const char *keystr); -int tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32 value); -int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32 v); -int tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32 *value); +int32_t tdb_fetch_int32(struct tdb_context *tdb, const char *keystr); +int tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32_t value); +int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32_t v); +int tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32_t *value); int tdb_traverse_delete_fn(struct tdb_context *the_tdb, TDB_DATA key, TDB_DATA dbuf, void *state); int tdb_store_bystring(struct tdb_context *tdb, const char *keystr, TDB_DATA data, int flags); @@ -72,14 +62,13 @@ TDB_DATA tdb_fetch_bystring(struct tdb_context *tdb, const char *keystr); int tdb_delete_bystring(struct tdb_context *tdb, const char *keystr); struct tdb_context *tdb_open_log(const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode); -int tdb_unpack(const uint8 *buf, int bufsize, const char *fmt, ...); -size_t tdb_pack(uint8 *buf, int bufsize, const char *fmt, ...); -TDB_DATA make_tdb_data(const uint8 *dptr, size_t dsize); +int tdb_unpack(char *buf, int bufsize, const char *fmt, ...); +size_t tdb_pack(char *buf, int bufsize, const char *fmt, ...); +TDB_DATA make_tdb_data(const char *dptr, size_t dsize); TDB_DATA string_tdb_data(const char *string); -TDB_DATA string_term_tdb_data(const char *string); int tdb_trans_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, int flag); -BOOL tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr, +int tdb_change_uint32_atomic(TDB_CONTEXT *tdb, const char *keystr, uint32 *oldval, uint32 change_val); int tdb_chainlock_with_timeout( TDB_CONTEXT *tdb, TDB_DATA key, unsigned int timeout); diff --git a/source/include/vfs.h b/source/include/vfs.h index d968ba9d82a..29e96f6b506 100644 --- a/source/include/vfs.h +++ b/source/include/vfs.h @@ -70,9 +70,7 @@ /* Changed to version 20, use ntimes call instead of utime (greater * timestamp resolition. JRA. */ /* Changed to version21 to add chflags operation -- jpeach */ -/* Changed to version22 to add lchown operation -- jra */ -/* Leave at 22 - not yet released. But change set_nt_acl to return an NTSTATUS. jra. */ -#define SMB_VFS_INTERFACE_VERSION 22 +#define SMB_VFS_INTERFACE_VERSION 21 /* to bug old modules which are trying to compile with the old functions */ @@ -93,7 +91,7 @@ struct vfs_handle_struct; struct connection_struct; struct files_struct; -struct security_descriptor; +struct security_descriptor_info; struct vfs_statvfs_struct; /* @@ -147,7 +145,6 @@ typedef enum _vfs_op_type { SMB_VFS_OP_FCHMOD, SMB_VFS_OP_CHOWN, SMB_VFS_OP_FCHOWN, - SMB_VFS_OP_LCHOWN, SMB_VFS_OP_CHDIR, SMB_VFS_OP_GETWD, SMB_VFS_OP_NTIMES, @@ -274,7 +271,6 @@ struct vfs_ops { int (*fchmod)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, mode_t mode); int (*chown)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); int (*fchown)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uid_t uid, gid_t gid); - int (*lchown)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); int (*chdir)(struct vfs_handle_struct *handle, const char *path); char *(*getwd)(struct vfs_handle_struct *handle, char *buf); int (*ntimes)(struct vfs_handle_struct *handle, const char *path, const struct timespec ts[2]); @@ -299,10 +295,10 @@ struct vfs_ops { /* NT ACL operations. */ - size_t (*fget_nt_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uint32 security_info, struct security_descriptor **ppdesc); - size_t (*get_nt_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, uint32 security_info, struct security_descriptor **ppdesc); - NTSTATUS (*fset_nt_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uint32 security_info_sent, struct security_descriptor *psd); - NTSTATUS (*set_nt_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, uint32 security_info_sent, struct security_descriptor *psd); + size_t (*fget_nt_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uint32 security_info, struct security_descriptor_info **ppdesc); + size_t (*get_nt_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, uint32 security_info, struct security_descriptor_info **ppdesc); + BOOL (*fset_nt_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, uint32 security_info_sent, struct security_descriptor_info *psd); + BOOL (*set_nt_acl)(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, uint32 security_info_sent, struct security_descriptor_info *psd); /* POSIX ACL operations. */ @@ -399,7 +395,6 @@ struct vfs_ops { struct vfs_handle_struct *fchmod; struct vfs_handle_struct *chown; struct vfs_handle_struct *fchown; - struct vfs_handle_struct *lchown; struct vfs_handle_struct *chdir; struct vfs_handle_struct *getwd; struct vfs_handle_struct *ntimes; diff --git a/source/include/vfs_macros.h b/source/include/vfs_macros.h index 48321ddad05..18c8fef38c4 100644 --- a/source/include/vfs_macros.h +++ b/source/include/vfs_macros.h @@ -47,7 +47,7 @@ #define SMB_VFS_CLOSEDIR(conn, dir) ((conn)->vfs.ops.closedir((conn)->vfs.handles.closedir, dir)) /* File operations */ -#define SMB_VFS_OPEN(conn, fname, fsp, flags, mode) ((conn)->vfs.ops.open((conn)->vfs.handles.open, (fname), (fsp), (flags), (mode))) +#define SMB_VFS_OPEN(conn, fname, fsp, flags, mode) (((conn)->vfs.ops.open)((conn)->vfs.handles.open, (fname), (fsp), (flags), (mode))) #define SMB_VFS_CLOSE(fsp, fd) ((fsp)->conn->vfs.ops.close_fn((fsp)->conn->vfs.handles.close_hnd, (fsp), (fd))) #define SMB_VFS_READ(fsp, fd, data, n) ((fsp)->conn->vfs.ops.read((fsp)->conn->vfs.handles.read, (fsp), (fd), (data), (n))) #define SMB_VFS_PREAD(fsp, fd, data, n, off) ((fsp)->conn->vfs.ops.pread((fsp)->conn->vfs.handles.pread, (fsp), (fd), (data), (n), (off))) @@ -65,7 +65,6 @@ #define SMB_VFS_FCHMOD(fsp, fd, mode) ((fsp)->conn->vfs.ops.fchmod((fsp)->conn->vfs.handles.fchmod, (fsp), (fd), (mode))) #define SMB_VFS_CHOWN(conn, path, uid, gid) ((conn)->vfs.ops.chown((conn)->vfs.handles.chown, (path), (uid), (gid))) #define SMB_VFS_FCHOWN(fsp, fd, uid, gid) ((fsp)->conn->vfs.ops.fchown((fsp)->conn->vfs.handles.fchown, (fsp), (fd), (uid), (gid))) -#define SMB_VFS_LCHOWN(conn, path, uid, gid) ((conn)->vfs.ops.lchown((conn)->vfs.handles.lchown, (path), (uid), (gid))) #define SMB_VFS_CHDIR(conn, path) ((conn)->vfs.ops.chdir((conn)->vfs.handles.chdir, (path))) #define SMB_VFS_GETWD(conn, buf) ((conn)->vfs.ops.getwd((conn)->vfs.handles.getwd, (buf))) #define SMB_VFS_NTIMES(conn, path, ts) ((conn)->vfs.ops.ntimes((conn)->vfs.handles.ntimes, (path), (ts))) @@ -164,7 +163,7 @@ #define SMB_VFS_OPAQUE_CLOSEDIR(conn, dir) ((conn)->vfs_opaque.ops.closedir((conn)->vfs_opaque.handles.closedir, dir)) /* File operations */ -#define SMB_VFS_OPAQUE_OPEN(conn, fname, fsp, flags, mode) ((conn)->vfs_opaque.ops.open((conn)->vfs_opaque.handles.open, (fname), (fsp), (flags), (mode))) +#define SMB_VFS_OPAQUE_OPEN(conn, fname, fsp, flags, mode) (((conn)->vfs_opaque.ops.open)((conn)->vfs_opaque.handles.open, (fname), (fsp), (flags), (mode))) #define SMB_VFS_OPAQUE_CLOSE(fsp, fd) ((fsp)->conn->vfs_opaque.ops.close_fn((fsp)->conn->vfs_opaque.handles.close_hnd, (fsp), (fd))) #define SMB_VFS_OPAQUE_READ(fsp, fd, data, n) ((fsp)->conn->vfs_opaque.ops.read((fsp)->conn->vfs_opaque.handles.read, (fsp), (fd), (data), (n))) #define SMB_VFS_OPAQUE_PREAD(fsp, fd, data, n, off) ((fsp)->conn->vfs_opaque.ops.pread((fsp)->conn->vfs_opaque.handles.pread, (fsp), (fd), (data), (n), (off))) @@ -182,7 +181,6 @@ #define SMB_VFS_OPAQUE_FCHMOD(fsp, fd, mode) ((fsp)->conn->vfs_opaque.ops.fchmod((fsp)->conn->vfs_opaque.handles.fchmod, (fsp), (fd), (mode))) #define SMB_VFS_OPAQUE_CHOWN(conn, path, uid, gid) ((conn)->vfs_opaque.ops.chown((conn)->vfs_opaque.handles.chown, (path), (uid), (gid))) #define SMB_VFS_OPAQUE_FCHOWN(fsp, fd, uid, gid) ((fsp)->conn->vfs_opaque.ops.fchown((fsp)->conn->vfs_opaque.handles.fchown, (fsp), (fd), (uid), (gid))) -#define SMB_VFS_OPAQUE_LCHOWN(conn, path, uid, gid) ((conn)->vfs_opaque.ops.lchown((conn)->vfs_opaque.handles.lchown, (path), (uid), (gid))) #define SMB_VFS_OPAQUE_CHDIR(conn, path) ((conn)->vfs_opaque.ops.chdir((conn)->vfs_opaque.handles.chdir, (path))) #define SMB_VFS_OPAQUE_GETWD(conn, buf) ((conn)->vfs_opaque.ops.getwd((conn)->vfs_opaque.handles.getwd, (buf))) #define SMB_VFS_OPAQUE_NTIMES(conn, path, ts) ((conn)->vfs_opaque.ops.ntimes((conn)->vfs_opaque.handles.ntimes, (path), (ts))) @@ -282,7 +280,7 @@ #define SMB_VFS_NEXT_CLOSEDIR(handle, dir) ((handle)->vfs_next.ops.closedir((handle)->vfs_next.handles.closedir, dir)) /* File operations */ -#define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) ((handle)->vfs_next.ops.open((handle)->vfs_next.handles.open, (fname), (fsp), (flags), (mode))) +#define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) (((handle)->vfs_next.ops.open)((handle)->vfs_next.handles.open, (fname), (fsp), (flags), (mode))) #define SMB_VFS_NEXT_CLOSE(handle, fsp, fd) ((handle)->vfs_next.ops.close_fn((handle)->vfs_next.handles.close_hnd, (fsp), (fd))) #define SMB_VFS_NEXT_READ(handle, fsp, fd, data, n) ((handle)->vfs_next.ops.read((handle)->vfs_next.handles.read, (fsp), (fd), (data), (n))) #define SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, n, off) ((handle)->vfs_next.ops.pread((handle)->vfs_next.handles.pread, (fsp), (fd), (data), (n), (off))) @@ -300,7 +298,6 @@ #define SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode) ((handle)->vfs_next.ops.fchmod((handle)->vfs_next.handles.fchmod, (fsp), (fd), (mode))) #define SMB_VFS_NEXT_CHOWN(handle, path, uid, gid) ((handle)->vfs_next.ops.chown((handle)->vfs_next.handles.chown, (path), (uid), (gid))) #define SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid) ((handle)->vfs_next.ops.fchown((handle)->vfs_next.handles.fchown, (fsp), (fd), (uid), (gid))) -#define SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid) ((handle)->vfs_next.ops.lchown((handle)->vfs_next.handles.lchown, (path), (uid), (gid))) #define SMB_VFS_NEXT_CHDIR(handle, path) ((handle)->vfs_next.ops.chdir((handle)->vfs_next.handles.chdir, (path))) #define SMB_VFS_NEXT_GETWD(handle, buf) ((handle)->vfs_next.ops.getwd((handle)->vfs_next.handles.getwd, (buf))) #define SMB_VFS_NEXT_NTIMES(handle, path, ts) ((handle)->vfs_next.ops.ntimes((handle)->vfs_next.handles.ntimes, (path), (ts))) |