From c624a704be96488f0aee27930cbd4c8d99df464b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 9 Jul 2009 22:03:52 +0200 Subject: Make escape_ldap_string take a talloc context --- source3/include/proto.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f887b4e796..c0f4dc10d8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -554,7 +554,7 @@ void init_ldap_debugging(void); /* The following definitions come from lib/ldap_escape.c */ -char *escape_ldap_string_alloc(const char *s); +char *escape_ldap_string(TALLOC_CTX *mem_ctx, const char *s); char *escape_rdn_val_string_alloc(const char *s); /* The following definitions come from lib/module.c */ -- cgit From 2000421c592b672898f85758638be74d8485da1e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 10 Jul 2009 18:23:00 -0700 Subject: Remove reply_unixerror() - no longer needed. Should make Metze's refactoring a lot easier. Jeremy. --- source3/include/proto.h | 2 -- source3/include/smb_macros.h | 1 - 2 files changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c0f4dc10d8..27b5f45eb0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6260,8 +6260,6 @@ void reply_dos_error(struct smb_request *req, uint8 eclass, uint32 ecode, void reply_both_error(struct smb_request *req, uint8 eclass, uint32 ecode, NTSTATUS status, int line, const char *file); void reply_openerror(struct smb_request *req, NTSTATUS status); -void reply_unix_error(struct smb_request *req, uint8 defclass, uint32 defcode, - NTSTATUS defstatus, int line, const char *file); /* The following definitions come from smbd/fake_file.c */ diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 7528883c2d..10ee78b394 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -115,7 +115,6 @@ #define reply_force_nterror(req,status) reply_force_nt_error(req,status,__LINE__,__FILE__) #define reply_doserror(req,eclass,ecode) reply_dos_error(req,eclass,ecode,__LINE__,__FILE__) #define reply_botherror(req,status,eclass,ecode) reply_both_error(req,eclass,ecode,status,__LINE__,__FILE__) -#define reply_unixerror(req,defclass,deferror) reply_unix_error(req,defclass,deferror,NT_STATUS_OK,__LINE__,__FILE__) #if 0 /* defined in IDL */ -- cgit From 8db45607f8d19781d33ebff0d0b13c473f34009b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 12 Jun 2009 14:27:19 +0200 Subject: libds: share UF_ flags between samba3 and 4. Guenther --- source3/include/ads.h | 127 +------------------------------------------------- 1 file changed, 2 insertions(+), 125 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ads.h b/source3/include/ads.h index afa4e12175..9761d54086 100644 --- a/source3/include/ads.h +++ b/source3/include/ads.h @@ -6,6 +6,8 @@ basically this is a wrapper around ldap */ +#include "../libds/common/flags.h" + enum wb_posix_mapping { WB_POSIX_MAP_UNKNOWN = -1, WB_POSIX_MAP_TEMPLATE = 0, @@ -202,124 +204,6 @@ typedef void **ADS_MODLIST; #define ADS_LDAP_MATCHING_RULE_BIT_AND "1.2.840.113556.1.4.803" #define ADS_LDAP_MATCHING_RULE_BIT_OR "1.2.840.113556.1.4.804" -/* UserFlags for userAccountControl */ -#define UF_SCRIPT 0x00000001 -#define UF_ACCOUNTDISABLE 0x00000002 -#define UF_UNUSED_1 0x00000004 -#define UF_HOMEDIR_REQUIRED 0x00000008 - -#define UF_LOCKOUT 0x00000010 -#define UF_PASSWD_NOTREQD 0x00000020 -#define UF_PASSWD_CANT_CHANGE 0x00000040 -#define UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED 0x00000080 - -#define UF_TEMP_DUPLICATE_ACCOUNT 0x00000100 -#define UF_NORMAL_ACCOUNT 0x00000200 -#define UF_UNUSED_2 0x00000400 -#define UF_INTERDOMAIN_TRUST_ACCOUNT 0x00000800 - -#define UF_WORKSTATION_TRUST_ACCOUNT 0x00001000 -#define UF_SERVER_TRUST_ACCOUNT 0x00002000 -#define UF_UNUSED_3 0x00004000 -#define UF_UNUSED_4 0x00008000 - -#define UF_DONT_EXPIRE_PASSWD 0x00010000 -#define UF_MNS_LOGON_ACCOUNT 0x00020000 -#define UF_SMARTCARD_REQUIRED 0x00040000 -#define UF_TRUSTED_FOR_DELEGATION 0x00080000 - -#define UF_NOT_DELEGATED 0x00100000 -#define UF_USE_DES_KEY_ONLY 0x00200000 -#define UF_DONT_REQUIRE_PREAUTH 0x00400000 -#define UF_PASSWORD_EXPIRED 0x00800000 - -#define UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION 0x01000000 -#define UF_NO_AUTH_DATA_REQUIRED 0x02000000 -#define UF_UNUSED_8 0x04000000 -#define UF_UNUSED_9 0x08000000 - -#define UF_UNUSED_10 0x10000000 -#define UF_UNUSED_11 0x20000000 -#define UF_UNUSED_12 0x40000000 -#define UF_UNUSED_13 0x80000000 - -#define UF_MACHINE_ACCOUNT_MASK (\ - UF_INTERDOMAIN_TRUST_ACCOUNT |\ - UF_WORKSTATION_TRUST_ACCOUNT |\ - UF_SERVER_TRUST_ACCOUNT \ - ) - -#define UF_ACCOUNT_TYPE_MASK (\ - UF_TEMP_DUPLICATE_ACCOUNT |\ - UF_NORMAL_ACCOUNT |\ - UF_INTERDOMAIN_TRUST_ACCOUNT |\ - UF_WORKSTATION_TRUST_ACCOUNT |\ - UF_SERVER_TRUST_ACCOUNT \ - ) - -#define UF_SETTABLE_BITS (\ - UF_SCRIPT |\ - UF_ACCOUNTDISABLE |\ - UF_HOMEDIR_REQUIRED |\ - UF_LOCKOUT |\ - UF_PASSWD_NOTREQD |\ - UF_PASSWD_CANT_CHANGE |\ - UF_ACCOUNT_TYPE_MASK | \ - UF_DONT_EXPIRE_PASSWD | \ - UF_MNS_LOGON_ACCOUNT |\ - UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED |\ - UF_SMARTCARD_REQUIRED |\ - UF_TRUSTED_FOR_DELEGATION |\ - UF_NOT_DELEGATED |\ - UF_USE_DES_KEY_ONLY |\ - UF_DONT_REQUIRE_PREAUTH \ - ) - -/* sAMAccountType */ -#define ATYPE_NORMAL_ACCOUNT 0x30000000 /* 805306368 */ -#define ATYPE_WORKSTATION_TRUST 0x30000001 /* 805306369 */ -#define ATYPE_INTERDOMAIN_TRUST 0x30000002 /* 805306370 */ -#define ATYPE_SECURITY_GLOBAL_GROUP 0x10000000 /* 268435456 */ -#define ATYPE_DISTRIBUTION_GLOBAL_GROUP 0x10000001 /* 268435457 */ -#define ATYPE_DISTRIBUTION_UNIVERSAL_GROUP ATYPE_DISTRIBUTION_GLOBAL_GROUP -#define ATYPE_SECURITY_LOCAL_GROUP 0x20000000 /* 536870912 */ -#define ATYPE_DISTRIBUTION_LOCAL_GROUP 0x20000001 /* 536870913 */ - -#define ATYPE_ACCOUNT ATYPE_NORMAL_ACCOUNT /* 0x30000000 805306368 */ -#define ATYPE_GLOBAL_GROUP ATYPE_SECURITY_GLOBAL_GROUP /* 0x10000000 268435456 */ -#define ATYPE_LOCAL_GROUP ATYPE_SECURITY_LOCAL_GROUP /* 0x20000000 536870912 */ - -/* groupType */ -#define GROUP_TYPE_BUILTIN_LOCAL_GROUP 0x00000001 -#define GROUP_TYPE_ACCOUNT_GROUP 0x00000002 -#define GROUP_TYPE_RESOURCE_GROUP 0x00000004 -#define GROUP_TYPE_UNIVERSAL_GROUP 0x00000008 -#define GROUP_TYPE_APP_BASIC_GROUP 0x00000010 -#define GROUP_TYPE_APP_QUERY_GROUP 0x00000020 -#define GROUP_TYPE_SECURITY_ENABLED 0x80000000 - -#define GTYPE_SECURITY_BUILTIN_LOCAL_GROUP ( /* 0x80000005 -2147483643 */ \ - GROUP_TYPE_BUILTIN_LOCAL_GROUP| \ - GROUP_TYPE_RESOURCE_GROUP| \ - GROUP_TYPE_SECURITY_ENABLED \ - ) -#define GTYPE_SECURITY_DOMAIN_LOCAL_GROUP ( /* 0x80000004 -2147483644 */ \ - GROUP_TYPE_RESOURCE_GROUP| \ - GROUP_TYPE_SECURITY_ENABLED \ - ) -#define GTYPE_SECURITY_GLOBAL_GROUP ( /* 0x80000002 -2147483646 */ \ - 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 */ - #define ADS_PINGS 0x0000FFFF /* Ping response */ #define ADS_DNS_CONTROLLER 0x20000000 /* DomainControllerName is a DNS name*/ #define ADS_DNS_DOMAIN 0x40000000 /* DomainName is a DNS name */ @@ -411,11 +295,4 @@ typedef struct { #define ADS_IGNORE_PRINCIPAL "not_defined_in_RFC4178@please_ignore" -/* Settings for the domainFunctionality attribute in the rootDSE */ - -#define DS_DOMAIN_FUNCTION_2000 0 -#define DS_DOMAIN_FUCNTION_2003_MIXED 1 -#define DS_DOMAIN_FUNCTION_2003 2 -#define DS_DOMAIN_FUNCTION_2008 3 - #endif /* _INCLUDE_ADS_H_ */ -- cgit From 05fbe0c7f763fbe8c1c48eb82ebdfe04bfa034ea Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 12 Jun 2009 15:20:48 +0200 Subject: libds: merge the UF<->ACB flag mapping functions. Guenther --- source3/include/proto.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 27b5f45eb0..44132b6519 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1678,13 +1678,6 @@ ADS_STRUCT *ads_init(const char *realm, const char *ldap_server); void ads_destroy(ADS_STRUCT **ads); -/* The following definitions come from libads/ads_utils.c */ - -uint32 ads_acb2uf(uint32 acb); -uint32 ads_uf2acb(uint32 uf); -uint32 ads_uf2atype(uint32 uf); -uint32 ads_gtype2atype(uint32 gtype); -enum lsa_SidType ads_atype_map(uint32 atype); const char *ads_get_ldap_server_name(ADS_STRUCT *ads); /* The following definitions come from libads/authdata.c */ @@ -7262,4 +7255,13 @@ NTSTATUS access_check_object( SEC_DESC *psd, NT_USER_TOKEN *token, const char *debug); void map_max_allowed_access(const NT_USER_TOKEN *token, uint32_t *pacc_requested); + +/* The following definitions come from ../libds/common/flag_mapping.c */ + +uint32_t ds_acb2uf(uint32_t acb); +uint32_t ds_uf2acb(uint32_t uf); +uint32_t ds_uf2atype(uint32_t uf); +uint32_t ds_gtype2atype(uint32_t gtype); +enum lsa_SidType ds_atype_map(uint32_t atype); + #endif /* _PROTO_H_ */ -- cgit From f7ff6bd1425cc4f0aa13ce8e7498cdac3967acf3 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 29 Jun 2009 20:34:03 +0200 Subject: s3-rpc_server: pass down full unix token to map_max_allowed_access(). Also use unix_token->uid instead of geteuid() when checking for mapping of the SEC_FLAG_MAXIMUM_ALLOWED flag. Guenther --- source3/include/proto.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 44132b6519..c0ce35a865 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -7253,8 +7253,9 @@ NTSTATUS access_check_object( SEC_DESC *psd, NT_USER_TOKEN *token, SE_PRIV *rights, uint32 rights_mask, uint32 des_access, uint32 *acc_granted, const char *debug); -void map_max_allowed_access(const NT_USER_TOKEN *token, - uint32_t *pacc_requested); +void map_max_allowed_access(const NT_USER_TOKEN *nt_token, + const struct unix_user_token *unix_token, + uint32_t *pacc_requested); /* The following definitions come from ../libds/common/flag_mapping.c */ -- cgit From e67de63ba6c6de60400e7deb4664d259f6dfb638 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 13 Jul 2009 18:43:10 -0700 Subject: Make cli_posix_lock/unlock asynchronous. Jeremy. --- source3/include/proto.h | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c0ce35a865..7b3eaa0659 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2516,11 +2516,26 @@ bool cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t bool cli_lock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type); bool cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len); -bool cli_posix_lock(struct cli_state *cli, uint16_t fnum, +struct tevent_req *cli_posix_lock_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct cli_state *cli, + uint16_t fnum, + uint64_t offset, + uint64_t len, + bool wait_lock, + enum brl_type lock_type); +NTSTATUS cli_posix_lock_recv(struct tevent_req *req); +NTSTATUS cli_posix_lock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len, bool wait_lock, enum brl_type lock_type); -bool cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len); -bool cli_posix_getlock(struct cli_state *cli, uint16_t fnum, uint64_t *poffset, uint64_t *plen); +struct tevent_req *cli_posix_unlock_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct cli_state *cli, + uint16_t fnum, + uint64_t offset, + uint64_t len); +NTSTATUS cli_posix_unlock_recv(struct tevent_req *req); +NTSTATUS cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len); struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct cli_state *cli, -- cgit From 9f15ef11bdf75dbc1a1af3c2bc35b1d653216f62 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 13 Jul 2009 23:53:49 +0200 Subject: s3-account_policy: add pdb_policy_type enum. Guenther --- source3/include/passdb.h | 22 ++++++++++++++++++++-- source3/include/proto.h | 22 +++++++++++----------- source3/include/smb.h | 14 -------------- 3 files changed, 31 insertions(+), 27 deletions(-) (limited to 'source3/include') diff --git a/source3/include/passdb.h b/source3/include/passdb.h index 4e53311eba..2b4f9c2e43 100644 --- a/source3/include/passdb.h +++ b/source3/include/passdb.h @@ -205,6 +205,22 @@ struct pdb_domain_info { struct GUID guid; }; +/* + * Types of account policy. + */ +enum pdb_policy_type { + PDB_POLICY_MIN_PASSWORD_LEN = 1, + PDB_POLICY_PASSWORD_HISTORY = 2, + PDB_POLICY_USER_MUST_LOGON_TO_CHG_PASS = 3, + PDB_POLICY_MAX_PASSWORD_AGE = 4, + PDB_POLICY_MIN_PASSWORD_AGE = 5, + PDB_POLICY_LOCK_ACCOUNT_DURATION = 6, + PDB_POLICY_RESET_COUNT_TIME = 7, + PDB_POLICY_BAD_ATTEMPT_LOCKOUT = 8, + PDB_POLICY_TIME_TO_LOGOUT = 9, + PDB_POLICY_REFUSE_MACHINE_PW_CHANGE = 10 +}; + #define PDB_CAP_STORE_RIDS 0x0001 #define PDB_CAP_ADS 0x0002 @@ -351,10 +367,12 @@ struct pdb_methods enum lsa_SidType *attrs); NTSTATUS (*get_account_policy)(struct pdb_methods *methods, - int policy_index, uint32 *value); + enum pdb_policy_type type, + uint32_t *value); NTSTATUS (*set_account_policy)(struct pdb_methods *methods, - int policy_index, uint32 value); + enum pdb_policy_type type, + uint32_t value); NTSTATUS (*get_seq_num)(struct pdb_methods *methods, time_t *seq_num); diff --git a/source3/include/proto.h b/source3/include/proto.h index 7b3eaa0659..0dd1e98c86 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -290,16 +290,16 @@ bool check_access(int sock, const char **allow_list, const char **deny_list); /* The following definitions come from lib/account_pol.c */ void account_policy_names_list(const char ***names, int *num_names); -const char *decode_account_policy_name(int field); -const char *get_account_policy_attr(int field); -const char *account_policy_get_desc(int field); -int account_policy_name_to_fieldnum(const char *name); -bool account_policy_get_default(int account_policy, uint32 *val); +const char *decode_account_policy_name(enum pdb_policy_type type); +const char *get_account_policy_attr(enum pdb_policy_type type); +const char *account_policy_get_desc(enum pdb_policy_type type); +enum pdb_policy_type account_policy_name_to_typenum(const char *name); +bool account_policy_get_default(enum pdb_policy_type type, uint32_t *val); bool init_account_policy(void); -bool account_policy_get(int field, uint32 *value); -bool account_policy_set(int field, uint32 value); -bool cache_account_policy_set(int field, uint32 value); -bool cache_account_policy_get(int field, uint32 *value); +bool account_policy_get(enum pdb_policy_type type, uint32_t *value); +bool account_policy_set(enum pdb_policy_type type, uint32_t value); +bool cache_account_policy_set(enum pdb_policy_type type, uint32_t value); +bool cache_account_policy_get(enum pdb_policy_type type, uint32_t *value); struct db_context *get_account_pol_db( void ); /* The following definitions come from lib/adt_tree.c */ @@ -4595,8 +4595,8 @@ NTSTATUS pdb_lookup_names(const DOM_SID *domain_sid, const char **names, uint32 *rids, enum lsa_SidType *attrs); -bool pdb_get_account_policy(int policy_index, uint32 *value); -bool pdb_set_account_policy(int policy_index, uint32 value); +bool pdb_get_account_policy(enum pdb_policy_type type, uint32_t *value); +bool pdb_set_account_policy(enum pdb_policy_type type, uint32_t value); bool pdb_get_seq_num(time_t *seq_num); bool pdb_uid_to_rid(uid_t uid, uint32 *rid); bool pdb_uid_to_sid(uid_t uid, DOM_SID *sid); diff --git a/source3/include/smb.h b/source3/include/smb.h index 9afeb67b00..2e9cf1b54a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -833,20 +833,6 @@ struct pipe_open_rec { #define PW_HISTORY_ENTRY_LEN (PW_HISTORY_SALT_LEN+SALTED_MD5_HASH_LEN) #define MAX_PW_HISTORY_LEN 24 -/* - * Flags for account policy. - */ -#define AP_MIN_PASSWORD_LEN 1 -#define AP_PASSWORD_HISTORY 2 -#define AP_USER_MUST_LOGON_TO_CHG_PASS 3 -#define AP_MAX_PASSWORD_AGE 4 -#define AP_MIN_PASSWORD_AGE 5 -#define AP_LOCK_ACCOUNT_DURATION 6 -#define AP_RESET_COUNT_TIME 7 -#define AP_BAD_ATTEMPT_LOCKOUT 8 -#define AP_TIME_TO_LOGOUT 9 -#define AP_REFUSE_MACHINE_PW_CHANGE 10 - /* * Flags for local user manipulation. */ -- cgit From 9ef6af73b319048fc6f3891573f0e10066dffee6 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Wed, 15 Jul 2009 15:34:10 +0800 Subject: s3: Make smbd aware of permission change of usershare. Since usershare are relatively volatile and non-previledge users must disconnect from smbd and reconnect to it to make share permission in effect. --- source3/include/proto.h | 7 ++++++- source3/include/smb.h | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 0dd1e98c86..d141de44cf 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4296,6 +4296,7 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, char **pp_comment, SEC_DESC **ppsd, bool *pallow_guest); +bool am_usershare(int iService); int load_usershare_service(const char *servicename); int load_usershare_shares(void); void gfree_loadparm(void); @@ -7063,7 +7064,8 @@ void reply_transs2(struct smb_request *req); bool change_to_guest(void); void conn_clear_vuid_cache(connection_struct *conn, uint16_t vuid); -bool change_to_user(connection_struct *conn, uint16 vuid); +bool change_to_user_force_recheck(connection_struct *conn, uint16 vuid, + bool recheck, NTSTATUS *pstatus); bool change_to_root_user(void); bool become_authenticated_pipe_user(pipes_struct *p); bool unbecome_authenticated_pipe_user(void); @@ -7072,6 +7074,9 @@ void unbecome_root(void); bool become_user(connection_struct *conn, uint16 vuid); bool unbecome_user(void); +#define change_to_user(conn, vuid) \ + change_to_user_force_recheck(conn, vuid, 0, NULL) + /* The following definitions come from smbd/utmp.c */ void sys_utmp_claim(const char *username, const char *hostname, diff --git a/source3/include/smb.h b/source3/include/smb.h index 2e9cf1b54a..44216f856a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -550,6 +550,7 @@ typedef struct connection_struct { unsigned cnum; /* an index passed over the wire */ struct share_params *params; bool force_user; + bool force_recheck_perm; struct vuid_cache vuid_cache; struct dptr_struct *dirptr; bool printer; @@ -1398,6 +1399,11 @@ struct bitmap { #define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200 #define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800 +#define FILE_NOTIFY_CHANGE_FILE_CONTENT \ + (FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME \ + | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_SIZE \ + | FILE_NOTIFY_CHANGE_CREATION | FILE_NOTIFY_CHANGE_EA \ + | FILE_NOTIFY_CHANGE_SECURITY) #define FILE_NOTIFY_CHANGE_NAME \ (FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_DIR_NAME) -- cgit From d57e67f9eb5a6a05f0e173d48e86dd1fe050635e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 14 Jul 2009 11:25:45 -0700 Subject: Revert this commit : s3: Make smbd aware of permission change of usershare. Since usershare are relatively volatile and non-previledge users must disconnect from smbd and reconnect to it to make share permission in effect. For now. This is a feature request and I think we need to design it a little differently so as not to touch core change_to_user() code. Jeremy. --- source3/include/proto.h | 7 +------ source3/include/smb.h | 6 ------ 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d141de44cf..0dd1e98c86 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4296,7 +4296,6 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, char **pp_comment, SEC_DESC **ppsd, bool *pallow_guest); -bool am_usershare(int iService); int load_usershare_service(const char *servicename); int load_usershare_shares(void); void gfree_loadparm(void); @@ -7064,8 +7063,7 @@ void reply_transs2(struct smb_request *req); bool change_to_guest(void); void conn_clear_vuid_cache(connection_struct *conn, uint16_t vuid); -bool change_to_user_force_recheck(connection_struct *conn, uint16 vuid, - bool recheck, NTSTATUS *pstatus); +bool change_to_user(connection_struct *conn, uint16 vuid); bool change_to_root_user(void); bool become_authenticated_pipe_user(pipes_struct *p); bool unbecome_authenticated_pipe_user(void); @@ -7074,9 +7072,6 @@ void unbecome_root(void); bool become_user(connection_struct *conn, uint16 vuid); bool unbecome_user(void); -#define change_to_user(conn, vuid) \ - change_to_user_force_recheck(conn, vuid, 0, NULL) - /* The following definitions come from smbd/utmp.c */ void sys_utmp_claim(const char *username, const char *hostname, diff --git a/source3/include/smb.h b/source3/include/smb.h index 44216f856a..2e9cf1b54a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -550,7 +550,6 @@ typedef struct connection_struct { unsigned cnum; /* an index passed over the wire */ struct share_params *params; bool force_user; - bool force_recheck_perm; struct vuid_cache vuid_cache; struct dptr_struct *dirptr; bool printer; @@ -1399,11 +1398,6 @@ struct bitmap { #define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200 #define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800 -#define FILE_NOTIFY_CHANGE_FILE_CONTENT \ - (FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME \ - | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_SIZE \ - | FILE_NOTIFY_CHANGE_CREATION | FILE_NOTIFY_CHANGE_EA \ - | FILE_NOTIFY_CHANGE_SECURITY) #define FILE_NOTIFY_CHANGE_NAME \ (FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_DIR_NAME) -- cgit From e5a34b2533720ebb9181c0edebad6774ceeff189 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 10 Jul 2009 12:03:35 +0200 Subject: Remove gencache_[un]lock_key --- source3/include/proto.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 0dd1e98c86..52ca7826ed 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -524,8 +524,6 @@ bool gencache_get_data_blob(const char *keystr, DATA_BLOB *blob, bool *expired); bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob, time_t timeout); void gencache_iterate(void (*fn)(const char* key, const char *value, time_t timeout, void* dptr), void* data, const char* keystr_pattern); -int gencache_lock_entry( const char *key ); -void gencache_unlock_entry( const char *key ); /* The following definitions come from lib/interface.c */ -- cgit From 3edcd55bf140d09833284ba5a0f04f86b04ef7dc Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 10 Jul 2009 12:24:56 +0200 Subject: Remove gencache_init/shutdown gencache_get/set/del/iterate call gencache_init() internally anyway. And we've been very lazy calling gencache_shutdown, so this seems not really required. --- source3/include/proto.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 52ca7826ed..23bd22aadc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -515,8 +515,6 @@ void pull_file_id_24(char *buf, struct file_id *id); /* The following definitions come from lib/gencache.c */ -bool gencache_init(void); -bool gencache_shutdown(void); bool gencache_set(const char *keystr, const char *value, time_t timeout); bool gencache_del(const char *keystr); bool gencache_get(const char *keystr, char **valstr, time_t *timeout); -- cgit From ed87594e5fd3251f9cb3beaca06c8eee1dcd4ed2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 13 Jul 2009 17:03:52 +0200 Subject: Add tdb_data_cmp --- source3/include/util_tdb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/util_tdb.h b/source3/include/util_tdb.h index c79436434f..80b95921d7 100644 --- a/source3/include/util_tdb.h +++ b/source3/include/util_tdb.h @@ -59,4 +59,6 @@ struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx, NTSTATUS map_nt_error_from_tdb(enum TDB_ERROR err); +int tdb_data_cmp(TDB_DATA t1, TDB_DATA t2); + #endif /* __TDBUTIL_H__ */ -- cgit From 8a17cd810fa6cbe7b11139ff0f6f24e7bacd318b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 13 Jul 2009 17:04:29 +0200 Subject: Make gencache more stable This provides a compromise between stability and performance: gencache is a persistent database these days that for performance reasons can not use tdb transactions for all writes. This patch splits up gencache into gencache.tdb and gencache_notrans.tdb. gencache_notrans is used with CLEAR_IF_FIRST, writes to it don't use transactions. By default every 5 minutes and when a program exits, all entries from _notrans.tdb are transferred to gencache.tdb in one transaction. --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 23bd22aadc..dd49e53338 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -519,6 +519,7 @@ bool gencache_set(const char *keystr, const char *value, time_t timeout); bool gencache_del(const char *keystr); bool gencache_get(const char *keystr, char **valstr, time_t *timeout); bool gencache_get_data_blob(const char *keystr, DATA_BLOB *blob, bool *expired); +bool gencache_stabilize(void); bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob, time_t timeout); void gencache_iterate(void (*fn)(const char* key, const char *value, time_t timeout, void* dptr), void* data, const char* keystr_pattern); -- cgit From 3d7dfc1197017c34bdb8dbc6e62460f19bd7d141 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 14 Jul 2009 11:33:04 +0200 Subject: Consolidate string and data_blob routines in gencache --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index dd49e53338..df7815587c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -518,7 +518,8 @@ void pull_file_id_24(char *buf, struct file_id *id); bool gencache_set(const char *keystr, const char *value, time_t timeout); bool gencache_del(const char *keystr); bool gencache_get(const char *keystr, char **valstr, time_t *timeout); -bool gencache_get_data_blob(const char *keystr, DATA_BLOB *blob, bool *expired); +bool gencache_get_data_blob(const char *keystr, DATA_BLOB *blob, + time_t *timeout); bool gencache_stabilize(void); bool gencache_set_data_blob(const char *keystr, const DATA_BLOB *blob, time_t timeout); void gencache_iterate(void (*fn)(const char* key, const char *value, time_t timeout, void* dptr), -- cgit From 5b594c695884aebdfbb199549901fea954122929 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 15 Jul 2009 14:00:42 +0200 Subject: s3:dbwrap: add a wrapper dbwrap_trans_do() This function wraps the action() callback into a db transaction and the transaction is either committed or cancelled, depending on the return value of the action function. Michael --- source3/include/proto.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index df7815587c..74cedcec18 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -454,6 +454,9 @@ NTSTATUS dbwrap_trans_store_uint32(struct db_context *db, const char *keystr, NTSTATUS dbwrap_trans_store_bystring(struct db_context *db, const char *key, TDB_DATA data, int flags); NTSTATUS dbwrap_trans_delete_bystring(struct db_context *db, const char *key); +NTSTATUS dbwrap_trans_do(struct db_context *db, + NTSTATUS (*action)(struct db_context *, void *), + void *private_data); /* The following definitions come from lib/debug.c */ -- cgit From 804d3f897be01e9088deefe807cd06fe194c5d58 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 8 Jul 2009 16:02:19 +0200 Subject: s3:dbwrap: add dbwrap_delete_bystring_upper() To delete a key whose name is not given in but stored in uppercase. Michael --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 74cedcec18..4bc4cd197b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -457,6 +457,7 @@ NTSTATUS dbwrap_trans_delete_bystring(struct db_context *db, const char *key); NTSTATUS dbwrap_trans_do(struct db_context *db, NTSTATUS (*action)(struct db_context *, void *), void *private_data); +NTSTATUS dbwrap_delete_bystring_upper(struct db_context *db, const char *key); /* The following definitions come from lib/debug.c */ -- cgit From 32a3275344819cfcbcb4540a1909617b8db6dc63 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 8 Jul 2009 16:08:41 +0200 Subject: s3:dbwrap: add dbwrap_store_bystring_upper(). This stores a key under the uppercase version of the given keyname. Michael --- source3/include/proto.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 4bc4cd197b..81892f294d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -458,6 +458,8 @@ NTSTATUS dbwrap_trans_do(struct db_context *db, NTSTATUS (*action)(struct db_context *, void *), void *private_data); NTSTATUS dbwrap_delete_bystring_upper(struct db_context *db, const char *key); +NTSTATUS dbwrap_store_bystring_upper(struct db_context *db, const char *key, + TDB_DATA data, int flags); /* The following definitions come from lib/debug.c */ -- cgit From 3b3125fc23dc4b7a403d17af2ad2d5c592d3d090 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 8 Jul 2009 16:13:07 +0200 Subject: s3:dbwrap: add dbwrap_fetch_bystring_upper(). To fetch a key whose name is stored but not given in upper case. Michael --- source3/include/proto.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 81892f294d..56bffd5ce7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -460,6 +460,8 @@ NTSTATUS dbwrap_trans_do(struct db_context *db, NTSTATUS dbwrap_delete_bystring_upper(struct db_context *db, const char *key); NTSTATUS dbwrap_store_bystring_upper(struct db_context *db, const char *key, TDB_DATA data, int flags); +TDB_DATA dbwrap_fetch_bystring_upper(struct db_context *db, TALLOC_CTX *mem_ctx, + const char *key); /* The following definitions come from lib/debug.c */ -- cgit From 92df5e4a0243bde6fbc5261bf6758090c4c35eee Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 15 Jul 2009 12:47:12 +0200 Subject: s3:registry: add function regsubkey_ctr_reinit() This reinitializes an already allocated regsubkey_ctr structure, emptying out the subkey array and hash table. Michael --- source3/include/proto.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 56bffd5ce7..7bbdc04ae7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5097,6 +5097,7 @@ WERROR registry_init_smbconf(const char *keyname); /* The following definitions come from registry/reg_objects.c */ WERROR regsubkey_ctr_init(TALLOC_CTX *mem_ctx, struct regsubkey_ctr **ctr); +WERROR regsubkey_ctr_reinit(struct regsubkey_ctr *ctr); WERROR regsubkey_ctr_set_seqnum(struct regsubkey_ctr *ctr, int seqnum); int regsubkey_ctr_get_seqnum(struct regsubkey_ctr *ctr); WERROR regsubkey_ctr_addkey( struct regsubkey_ctr *ctr, const char *keyname ); -- cgit From 1f5aec877fc48ff96b14a0e95f01c68a29dd8718 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 15 Jul 2009 11:49:33 -0700 Subject: Make cli_unlock and cli_unlock64 async. Fix POSIX lock test. Jeremy. --- source3/include/proto.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 7bbdc04ae7..15e3f325aa 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2518,10 +2518,24 @@ NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum, int timeout, unsigned char locktype); bool cli_lock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len, int timeout, enum brl_type lock_type); -bool cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len); +struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct cli_state *cli, + uint16_t fnum, + uint64_t offset, + uint64_t len); +NTSTATUS cli_unlock_recv(struct tevent_req *req); +NTSTATUS cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len); bool cli_lock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type); -bool cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len); +struct tevent_req *cli_unlock64_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct cli_state *cli, + uint16_t fnum, + uint64_t offset, + uint64_t len); +NTSTATUS cli_unlock64_recv(struct tevent_req *req); +NTSTATUS cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len); struct tevent_req *cli_posix_lock_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct cli_state *cli, -- cgit From 33768fea073fb24763728c1da3424465ebabc1f0 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 15 Jul 2009 21:59:05 +0200 Subject: s3-spoolss: make some of the command hooks static. Guenther --- source3/include/proto.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 15e3f325aa..740cc4198b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5906,7 +5906,6 @@ void copy_id26_to_sam_passwd(struct samu *to, /* The following definitions come from rpc_server/srv_spoolss_nt.c */ -WERROR delete_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const char *sharename ); void do_drv_upgrade_printer(struct messaging_context *msg, void *private_data, uint32_t msg_type, @@ -5995,9 +5994,7 @@ void construct_info_data(struct spoolss_Notify *info_data, int id); struct spoolss_DeviceMode *construct_dev_mode(TALLOC_CTX *mem_ctx, const char *servicename); -WERROR add_port_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const char *portname, const char *uri ); bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, NT_PRINTER_INFO_LEVEL *printer); -WERROR enumports_hook(TALLOC_CTX *ctx, int *count, char ***lines ); /* The following definitions come from rpc_server/srv_srvsvc_nt.c */ -- cgit From f982c912f47d5bfd00b4736573c7e4219a31a6c8 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 15 Jul 2009 23:16:19 +0200 Subject: s3-rpc_parse: remove more unused code. Guenther --- source3/include/proto.h | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 740cc4198b..d68aa4b619 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5676,32 +5676,16 @@ void prs_switch_type(prs_struct *ps, bool io); void prs_force_dynamic(prs_struct *ps); void prs_set_session_key(prs_struct *ps, const char sess_key[16]); bool prs_uint8(const char *name, prs_struct *ps, int depth, uint8 *data8); -bool prs_pointer( const char *name, prs_struct *ps, int depth, - void *dta, size_t data_size, - bool (*prs_fn)(const char*, prs_struct*, int, void*) ); bool prs_uint16(const char *name, prs_struct *ps, int depth, uint16 *data16); bool prs_uint32(const char *name, prs_struct *ps, int depth, uint32 *data32); bool prs_int32(const char *name, prs_struct *ps, int depth, int32 *data32); bool prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64); -bool prs_ntstatus(const char *name, prs_struct *ps, int depth, NTSTATUS *status); bool prs_dcerpc_status(const char *name, prs_struct *ps, int depth, NTSTATUS *status); -bool prs_werror(const char *name, prs_struct *ps, int depth, WERROR *status); bool prs_uint8s(bool charmode, const char *name, prs_struct *ps, int depth, uint8 *data8s, int len); bool prs_uint16s(bool charmode, const char *name, prs_struct *ps, int depth, uint16 *data16s, int len); -bool prs_uint16uni(bool charmode, const char *name, prs_struct *ps, int depth, uint16 *data16s, int len); bool prs_uint32s(bool charmode, const char *name, prs_struct *ps, int depth, uint32 *data32s, int len); bool prs_unistr(const char *name, prs_struct *ps, int depth, UNISTR *str); bool prs_string(const char *name, prs_struct *ps, int depth, char *str, int max_buf_size); -bool prs_string_alloc(const char *name, prs_struct *ps, int depth, const char **str); -bool prs_uint16_pre(const char *name, prs_struct *ps, int depth, uint16 *data16, uint32 *offset); -bool prs_uint16_post(const char *name, prs_struct *ps, int depth, uint16 *data16, - uint32 ptr_uint16, uint32 start_offset); -bool prs_uint32_pre(const char *name, prs_struct *ps, int depth, uint32 *data32, uint32 *offset); -bool prs_uint32_post(const char *name, prs_struct *ps, int depth, uint32 *data32, - uint32 ptr_uint32, uint32 data_size); -int tdb_prs_store(TDB_CONTEXT *tdb, TDB_DATA kbuf, prs_struct *ps); -int tdb_prs_fetch(TDB_CONTEXT *tdb, TDB_DATA kbuf, prs_struct *ps, TALLOC_CTX *mem_ctx); -bool prs_hash1(prs_struct *ps, uint32 offset, int len); void schannel_encode(struct schannel_auth_struct *a, enum pipe_auth_level auth_level, enum schannel_direction direction, RPC_AUTH_SCHANNEL_CHK * verf, -- cgit From 93570491712bf42b5c8dba825e7d2a40e71c0378 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 20 Jul 2009 15:15:08 -0700 Subject: Make cli_send_mailslot() static. Preparing to do away with unexpected.tdb.... Jeremy. --- source3/include/proto.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d68aa4b619..695e14b53c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2270,13 +2270,6 @@ bool cli_resolve_path(TALLOC_CTX *ctx, /* The following definitions come from libsmb/clidgram.c */ -bool cli_send_mailslot(struct messaging_context *msg_ctx, - bool unique, const char *mailslot, - uint16 priority, - char *buf, int len, - const char *srcname, int src_type, - const char *dstname, int dest_type, - const struct sockaddr_storage *dest_ss); bool send_getdc_request(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, struct sockaddr_storage *dc_ss, -- cgit From 5a8d70d465f28ae02f4df7a3c2905e028c2e3142 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Fri, 10 Jul 2009 14:50:37 -0700 Subject: s3: Change fsp->fsp_name to be an smb_filename struct! --- source3/include/proto.h | 5 ++++- source3/include/smb.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 695e14b53c..830d2284c4 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6365,9 +6365,12 @@ void file_sync_all(connection_struct *conn); void file_free(struct smb_request *req, files_struct *fsp); files_struct *file_fnum(uint16 fnum); files_struct *file_fsp(struct smb_request *req, uint16 fid); -void dup_file_fsp(struct smb_request *req, files_struct *from, +NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *from, uint32 access_mask, uint32 share_access, uint32 create_options, files_struct *to); +const char *fsp_str_dbg(const struct files_struct *fsp); +NTSTATUS fsp_set_smb_fname(struct files_struct *fsp, + const struct smb_filename *smb_fname_in); /* The following definitions come from smbd/ipc.c */ diff --git a/source3/include/smb.h b/source3/include/smb.h index 2e9cf1b54a..94ed2186fb 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -452,7 +452,7 @@ typedef struct files_struct { bool lockdb_clean; bool initial_delete_on_close; /* Only set at NTCreateX if file was created. */ bool posix_open; - char *fsp_name; + struct smb_filename *fsp_name; struct vfs_fsp_data *vfs_extension; struct fake_file_handle *fake_file_handle; -- cgit From 82c3f505fe2e50022b5102e6388dc3b830d235da Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Fri, 10 Jul 2009 15:10:35 -0700 Subject: s3: Move is_ntfs_stream*() to filename.c --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 830d2284c4..cdc58437f0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6325,6 +6325,8 @@ const char *smb_fname_str_dbg(const struct smb_filename *smb_fname); NTSTATUS copy_smb_filename(TALLOC_CTX *ctx, const struct smb_filename *smb_fname_in, struct smb_filename **smb_fname_out); +bool is_ntfs_stream_smb_fname(const struct smb_filename *smb_fname); +bool is_ntfs_default_stream_smb_fname(const struct smb_filename *smb_fname); NTSTATUS unix_convert(TALLOC_CTX *ctx, connection_struct *conn, const char *orig_path, @@ -6548,8 +6550,6 @@ void send_nt_replies(connection_struct *conn, struct smb_request *req, NTSTATUS nt_error, char *params, int paramsize, char *pdata, int datasize); -bool is_ntfs_stream_smb_fname(const struct smb_filename *smb_fname); -bool is_ntfs_default_stream_smb_fname(const struct smb_filename *smb_fname); void reply_ntcreate_and_X(struct smb_request *req); void reply_ntcancel(struct smb_request *req); void reply_ntrename(struct smb_request *req); -- cgit From 841efce8b5e931a7ec910afb7d0d8b6a123c6900 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Fri, 10 Jul 2009 15:35:08 -0700 Subject: s3: Separate out a new file: filename_utils.c This is to ease the linking pain of everything that links LOCKING_OBJ --- source3/include/proto.h | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index cdc58437f0..c26f2a7c3a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6307,6 +6307,24 @@ int fsp_stat(files_struct *fsp, SMB_STRUCT_STAT *pst); /* The following definitions come from smbd/filename.c */ +NTSTATUS unix_convert(TALLOC_CTX *ctx, + connection_struct *conn, + const char *orig_path, + struct smb_filename **smb_fname, + uint32_t ucf_flags); +NTSTATUS check_name(connection_struct *conn, const char *name); +int get_real_filename(connection_struct *conn, const char *path, + const char *name, TALLOC_CTX *mem_ctx, + char **found_name); +NTSTATUS filename_convert(TALLOC_CTX *mem_ctx, + connection_struct *conn, + bool dfs_path, + const char *name_in, + struct smb_filename **pp_smb_fname, + char **pp_name); + +/* The following definitions come from smbd/filename_utils.c */ + NTSTATUS get_full_smb_filename(TALLOC_CTX *ctx, const struct smb_filename *smb_fname, char **full_name); NTSTATUS create_synthetic_smb_fname(TALLOC_CTX *ctx, const char *base_name, @@ -6317,31 +6335,13 @@ NTSTATUS create_synthetic_smb_fname_split(TALLOC_CTX *ctx, const char *fname, const SMB_STRUCT_STAT *psbuf, struct smb_filename **smb_fname_out); -int vfs_stat_smb_fname(struct connection_struct *conn, const char *fname, - SMB_STRUCT_STAT *psbuf); -int vfs_lstat_smb_fname(struct connection_struct *conn, const char *fname, - SMB_STRUCT_STAT *psbuf); const char *smb_fname_str_dbg(const struct smb_filename *smb_fname); +const char *fsp_str_dbg(const struct files_struct *fsp); NTSTATUS copy_smb_filename(TALLOC_CTX *ctx, const struct smb_filename *smb_fname_in, struct smb_filename **smb_fname_out); bool is_ntfs_stream_smb_fname(const struct smb_filename *smb_fname); bool is_ntfs_default_stream_smb_fname(const struct smb_filename *smb_fname); -NTSTATUS unix_convert(TALLOC_CTX *ctx, - connection_struct *conn, - const char *orig_path, - struct smb_filename **smb_fname, - uint32_t ucf_flags); -NTSTATUS check_name(connection_struct *conn, const char *name); -int get_real_filename(connection_struct *conn, const char *path, - const char *name, TALLOC_CTX *mem_ctx, - char **found_name); -NTSTATUS filename_convert(TALLOC_CTX *mem_ctx, - connection_struct *conn, - bool dfs_path, - const char *name_in, - struct smb_filename **pp_smb_fname, - char **pp_name); /* The following definitions come from smbd/files.c */ @@ -6370,7 +6370,6 @@ files_struct *file_fsp(struct smb_request *req, uint16 fid); NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *from, uint32 access_mask, uint32 share_access, uint32 create_options, files_struct *to); -const char *fsp_str_dbg(const struct files_struct *fsp); NTSTATUS fsp_set_smb_fname(struct files_struct *fsp, const struct smb_filename *smb_fname_in); @@ -7117,6 +7116,10 @@ char *vfs_readdirname(connection_struct *conn, void *p, SMB_STRUCT_STAT *sbuf); int vfs_ChDir(connection_struct *conn, const char *path); char *vfs_GetWd(TALLOC_CTX *ctx, connection_struct *conn); NTSTATUS check_reduced_name(connection_struct *conn, const char *fname); +int vfs_stat_smb_fname(struct connection_struct *conn, const char *fname, + SMB_STRUCT_STAT *psbuf); +int vfs_lstat_smb_fname(struct connection_struct *conn, const char *fname, + SMB_STRUCT_STAT *psbuf); /* The following definitions come from torture/denytest.c */ -- cgit From f4530f6d2a0688e350c3c7be23f256ebceffa636 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Fri, 10 Jul 2009 15:43:21 -0700 Subject: s3: Plumb smb_filename through open_fake_file --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c26f2a7c3a..c48cebce11 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6266,11 +6266,11 @@ void reply_openerror(struct smb_request *req, NTSTATUS status); /* The following definitions come from smbd/fake_file.c */ -enum FAKE_FILE_TYPE is_fake_file(const char *fname); +enum FAKE_FILE_TYPE is_fake_file(const struct smb_filename *smb_fname); NTSTATUS open_fake_file(struct smb_request *req, connection_struct *conn, uint16_t current_vuid, enum FAKE_FILE_TYPE fake_file_type, - const char *fname, + const struct smb_filename *smb_fname, uint32 access_mask, files_struct **result); NTSTATUS close_fake_file(struct smb_request *req, files_struct *fsp); -- cgit From 6b49f28592af5c998642bd5d5f76b77c79a22cd7 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Tue, 21 Jul 2009 09:29:59 -0700 Subject: s3: Plumb smb_filename through map_open_params_to_ntcreate --- source3/include/proto.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c48cebce11..fe81bd2c97 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6589,7 +6589,8 @@ NTSTATUS fcb_or_dos_open(struct smb_request *req, uint32 access_mask, uint32 share_access, uint32 create_options); -bool map_open_params_to_ntcreate(const char *fname, int deny_mode, int open_func, +bool map_open_params_to_ntcreate(const struct smb_filename *smb_fname, + int deny_mode, int open_func, uint32 *paccess_mask, uint32 *pshare_mode, uint32 *pcreate_disposition, -- cgit From 00e267008defe18475115a4300addf3cbcabff5a Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Tue, 21 Jul 2009 10:28:28 -0700 Subject: s3: Remove the now unused fname parameter from filename_convert() --- source3/include/proto.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index fe81bd2c97..77283d9cf0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6320,8 +6320,7 @@ NTSTATUS filename_convert(TALLOC_CTX *mem_ctx, connection_struct *conn, bool dfs_path, const char *name_in, - struct smb_filename **pp_smb_fname, - char **pp_name); + struct smb_filename **pp_smb_fname); /* The following definitions come from smbd/filename_utils.c */ -- cgit