diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-03-05 12:24:35 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-03-05 12:24:35 +1100 |
commit | 41760c18bdab20d526d32568531bdf7c88272879 (patch) | |
tree | b2f421919501a3061afe40f0cb0980f86f448ea8 /source3/include | |
parent | 8249383efb2037bb234dd040ebe151329cc4feb9 (diff) | |
parent | c8ea9d1f13096cd7f51e5972915a61ca65b56ac3 (diff) | |
download | samba-41760c18bdab20d526d32568531bdf7c88272879.tar.gz samba-41760c18bdab20d526d32568531bdf7c88272879.tar.bz2 samba-41760c18bdab20d526d32568531bdf7c88272879.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba into wspp-schema
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/charset.h | 128 | ||||
-rw-r--r-- | source3/include/dbwrap.h | 4 | ||||
-rw-r--r-- | source3/include/includes.h | 10 | ||||
-rw-r--r-- | source3/include/proto.h | 146 | ||||
-rw-r--r-- | source3/include/reg_db.h | 1 | ||||
-rw-r--r-- | source3/include/reg_objects.h | 16 | ||||
-rw-r--r-- | source3/include/regfio.h | 2 | ||||
-rw-r--r-- | source3/include/rpc_secdes.h | 5 | ||||
-rw-r--r-- | source3/include/rpc_spoolss.h | 175 | ||||
-rw-r--r-- | source3/include/smb.h | 24 | ||||
-rw-r--r-- | source3/include/smbprofile.h | 28 |
11 files changed, 101 insertions, 438 deletions
diff --git a/source3/include/charset.h b/source3/include/charset.h deleted file mode 100644 index 1c2a5fb5f0..0000000000 --- a/source3/include/charset.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - Unix SMB/CIFS implementation. - charset defines - Copyright (C) Andrew Tridgell 2001 - Copyright (C) Jelmer Vernooij 2002 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. -*/ - -struct smb_iconv_convenience; - -/* this defines the charset types used in samba */ -typedef enum {CH_UTF16LE=0, CH_UTF16=0, CH_UNIX=1, CH_DISPLAY=2, CH_DOS=3, CH_UTF8=4, CH_UTF16BE=5} charset_t; - -#define NUM_CHARSETS 6 - -/* - * for each charset we have a function that pushes from that charset to a ucs2 - * buffer, and a function that pulls from ucs2 buffer to that charset. - * */ - -struct charset_functions { - const char *name; - size_t (*pull)(void *, const char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft); - size_t (*push)(void *, const char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft); - struct charset_functions *prev, *next; -}; - -/* - * This is auxiliary struct used by source/script/gen-8-bit-gap.sh script - * during generation of an encoding table for charset module - * */ - -struct charset_gap_table { - uint16 start; - uint16 end; - int32 idx; -}; - -/* - * Define stub for charset module which implements 8-bit encoding with gaps. - * Encoding tables for such module should be produced from glibc's CHARMAPs - * using script source/script/gen-8bit-gap.sh - * CHARSETNAME is CAPITALIZED charset name - * - * */ -#define SMB_GENERATE_CHARSET_MODULE_8_BIT_GAP(CHARSETNAME) \ -static size_t CHARSETNAME ## _push(void *cd, const char **inbuf, size_t *inbytesleft, \ - char **outbuf, size_t *outbytesleft) \ -{ \ - while (*inbytesleft >= 2 && *outbytesleft >= 1) { \ - int i; \ - int done = 0; \ - \ - uint16 ch = SVAL(*inbuf,0); \ - \ - for (i=0; from_idx[i].start != 0xffff; i++) { \ - if ((from_idx[i].start <= ch) && (from_idx[i].end >= ch)) { \ - ((unsigned char*)(*outbuf))[0] = from_ucs2[from_idx[i].idx+ch]; \ - (*inbytesleft) -= 2; \ - (*outbytesleft) -= 1; \ - (*inbuf) += 2; \ - (*outbuf) += 1; \ - done = 1; \ - break; \ - } \ - } \ - if (!done) { \ - errno = EINVAL; \ - return -1; \ - } \ - \ - } \ - \ - if (*inbytesleft == 1) { \ - errno = EINVAL; \ - return -1; \ - } \ - \ - if (*inbytesleft > 1) { \ - errno = E2BIG; \ - return -1; \ - } \ - \ - return 0; \ -} \ - \ -static size_t CHARSETNAME ## _pull(void *cd, const char **inbuf, size_t *inbytesleft, \ - char **outbuf, size_t *outbytesleft) \ -{ \ - while (*inbytesleft >= 1 && *outbytesleft >= 2) { \ - *(uint16*)(*outbuf) = to_ucs2[((unsigned char*)(*inbuf))[0]]; \ - (*inbytesleft) -= 1; \ - (*outbytesleft) -= 2; \ - (*inbuf) += 1; \ - (*outbuf) += 2; \ - } \ - \ - if (*inbytesleft > 0) { \ - errno = E2BIG; \ - return -1; \ - } \ - \ - return 0; \ -} \ - \ -struct charset_functions CHARSETNAME ## _functions = \ - {#CHARSETNAME, CHARSETNAME ## _pull, CHARSETNAME ## _push}; \ - \ -NTSTATUS charset_ ## CHARSETNAME ## _init(void); \ -NTSTATUS charset_ ## CHARSETNAME ## _init(void) \ -{ \ - return smb_register_charset(& CHARSETNAME ## _functions); \ -} \ - diff --git a/source3/include/dbwrap.h b/source3/include/dbwrap.h index aad4ccd721..16f10cc125 100644 --- a/source3/include/dbwrap.h +++ b/source3/include/dbwrap.h @@ -46,6 +46,10 @@ struct db_context { int (*transaction_start)(struct db_context *db); int (*transaction_commit)(struct db_context *db); int (*transaction_cancel)(struct db_context *db); + int (*parse_record)(struct db_context *db, TDB_DATA key, + int (*parser)(TDB_DATA key, TDB_DATA data, + void *private_data), + void *private_data); void *private_data; bool persistent; }; diff --git a/source3/include/includes.h b/source3/include/includes.h index 80d7bfc6cf..b48a75526a 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -577,22 +577,20 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx); #include "../talloc/talloc.h" #include "event.h" +#include "../lib/util/tevent_unix.h" +#include "../lib/util/tevent_ntstatus.h" #include "../lib/util/data_blob.h" #include "../lib/util/time.h" #include "../lib/util/asn1.h" -/* And a little extension. Abort on type mismatch */ -#define talloc_get_type_abort(ptr, type) \ - (type *)talloc_check_name_abort(ptr, #type) - #include "ads.h" #include "ads_dns.h" #include "interfaces.h" #include "trans2.h" #include "../libcli/util/error.h" #include "ntioctl.h" -#include "charset.h" +#include "../lib/util/charset/charset.h" #include "dynconfig.h" #include "util_getent.h" #include "debugparse.h" @@ -701,6 +699,8 @@ enum flush_reason_enum { #ifndef NO_PROTO_H #include "proto.h" #endif +#include "libcli/security/secace.h" +#include "libcli/security/secacl.h" #if defined(HAVE_POSIX_ACLS) #include "modules/vfs_posixacl.h" diff --git a/source3/include/proto.h b/source3/include/proto.h index 9366607995..78110161c5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -336,6 +336,7 @@ int bitmap_find(struct bitmap *bm, unsigned ofs); /* The following definitions come from lib/charcnv.c */ +NTSTATUS smb_register_charset(struct charset_functions *funcs); char lp_failed_convert_char(void); void lazy_initialize_conv(void); void gfree_charcnv(void); @@ -347,7 +348,7 @@ bool convert_string_allocate(TALLOC_CTX *ctx, charset_t from, charset_t to, void const *src, size_t srclen, void *dst, size_t *converted_size, bool allow_bad_conv); bool convert_string_talloc(TALLOC_CTX *ctx, charset_t from, charset_t to, - void const *src, size_t srclen, void *dst, + void const *src, size_t srclen, void **dst, size_t *converted_size, bool allow_bad_conv); size_t unix_strupper(const char *src, size_t srclen, char *dest, size_t destlen); char *strdup_upper(const char *s); @@ -528,15 +529,6 @@ void gencache_iterate(void (*fn)(const char* key, const char *value, time_t time int gencache_lock_entry( const char *key ); void gencache_unlock_entry( const char *key ); -/* The following definitions come from lib/iconv.c */ - -NTSTATUS smb_register_charset(struct charset_functions *funcs) ; -size_t smb_iconv(smb_iconv_t cd, - const char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft); -smb_iconv_t smb_iconv_open(const char *tocode, const char *fromcode); -int smb_iconv_close (smb_iconv_t cd); - /* The following definitions come from lib/interface.c */ bool ismyaddr(const struct sockaddr *ip); @@ -659,28 +651,6 @@ ssize_t sys_recvfile(int fromfd, size_t count); ssize_t drain_socket(int sockfd, size_t count); -/* The following definitions come from lib/secace.c */ - -bool sec_ace_object(uint8 type); -void sec_ace_copy(SEC_ACE *ace_dest, SEC_ACE *ace_src); -void init_sec_ace(SEC_ACE *t, const DOM_SID *sid, enum security_ace_type type, - uint32 mask, uint8 flag); -NTSTATUS sec_ace_add_sid(TALLOC_CTX *ctx, SEC_ACE **pp_new, SEC_ACE *old, unsigned *num, DOM_SID *sid, uint32 mask); -NTSTATUS sec_ace_mod_sid(SEC_ACE *ace, size_t num, DOM_SID *sid, uint32 mask); -NTSTATUS sec_ace_del_sid(TALLOC_CTX *ctx, SEC_ACE **pp_new, SEC_ACE *old, uint32 *num, DOM_SID *sid); -bool sec_ace_equal(SEC_ACE *s1, SEC_ACE *s2); -int nt_ace_inherit_comp( SEC_ACE *a1, SEC_ACE *a2); -int nt_ace_canon_comp( SEC_ACE *a1, SEC_ACE *a2); -void dacl_sort_into_canonical_order(SEC_ACE *srclist, unsigned int num_aces); -bool token_sid_in_ace(const NT_USER_TOKEN *token, const SEC_ACE *ace); - -/* The following definitions come from lib/secacl.c */ - -SEC_ACL *make_sec_acl(TALLOC_CTX *ctx, enum security_acl_revision revision, - int num_aces, SEC_ACE *ace_list); -SEC_ACL *dup_sec_acl(TALLOC_CTX *ctx, SEC_ACL *src); -bool sec_acl_equal(SEC_ACL *s1, SEC_ACL *s2); - /* The following definitions come from lib/secdesc.c */ bool sec_desc_equal(SEC_DESC *s1, SEC_DESC *s2); @@ -1203,7 +1173,6 @@ bool mask_match_search(const char *string, const char *pattern, bool is_case_sen bool mask_match_list(const char *string, char **list, int listLen, bool is_case_sensitive); bool unix_wild_match(const char *pattern, const char *string); bool name_to_fqdn(fstring fqdn, const char *name); -void *talloc_check_name_abort(const void *ptr, const char *name); void *talloc_append_blob(TALLOC_CTX *mem_ctx, void *buf, DATA_BLOB blob); uint32 map_share_mode_to_deny_mode(uint32 share_access, uint32 private_options); pid_t procid_to_pid(const struct server_id *proc); @@ -1261,6 +1230,7 @@ NTSTATUS merge_nt_token(TALLOC_CTX *mem_ctx, const struct nt_user_token *token_1, const struct nt_user_token *token_2, struct nt_user_token **token_out); +bool token_sid_in_ace(const NT_USER_TOKEN *token, const SEC_ACE *ace); /* The following definitions come from lib/util_pw.c */ @@ -1423,12 +1393,12 @@ int open_socket_in(int type, bool rebind); NTSTATUS open_socket_out(const struct sockaddr_storage *pss, uint16_t port, int timeout, int *pfd); -struct async_req *open_socket_out_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - const struct sockaddr_storage *pss, - uint16_t port, - int timeout); -NTSTATUS open_socket_out_recv(struct async_req *req, int *pfd); +struct tevent_req *open_socket_out_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + const struct sockaddr_storage *pss, + uint16_t port, + int timeout); +NTSTATUS open_socket_out_recv(struct tevent_req *req, int *pfd); struct async_req *open_socket_out_defer_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct timeval wait_time, @@ -4693,6 +4663,10 @@ NTSTATUS pdb_nds_init(void); NTSTATUS pdb_smbpasswd_init(void) ; +/* The following definitions come from passdb/pdb_wbc_sam.c */ + +NTSTATUS pdb_wbc_sam_init(void); + /* The following definitions come from passdb/pdb_tdb.c */ bool init_sam_from_buffer_v2(struct samu *sampass, uint8 *buf, uint32 buflen); @@ -5045,12 +5019,15 @@ WERROR init_registry_data(void); WERROR regdb_init(void); WERROR regdb_open( void ); int regdb_close( void ); +WERROR regdb_transaction_start(void); +WERROR regdb_transaction_commit(void); +WERROR regdb_transaction_cancel(void); int regdb_get_seqnum(void); -bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr); -int regdb_fetch_keys(const char *key, REGSUBKEY_CTR *ctr); +bool regdb_store_keys(const char *key, struct regsubkey_ctr *ctr); +int regdb_fetch_keys(const char *key, struct regsubkey_ctr *ctr); int regdb_fetch_values( const char* key, REGVAL_CTR *values ); bool regdb_store_values( const char *key, REGVAL_CTR *values ); -bool regdb_subkeys_need_update(REGSUBKEY_CTR *subkeys); +bool regdb_subkeys_need_update(struct regsubkey_ctr *subkeys); bool regdb_values_need_update(REGVAL_CTR *values); /* The following definitions come from registry/reg_backend_hkpt_params.c */ @@ -5086,9 +5063,11 @@ void reghook_dump_cache( int debuglevel ); /* The following definitions come from registry/reg_dispatcher.c */ -bool store_reg_keys( REGISTRY_KEY *key, REGSUBKEY_CTR *subkeys ); +bool store_reg_keys( REGISTRY_KEY *key, struct regsubkey_ctr *subkeys ); bool store_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val ); -int fetch_reg_keys( REGISTRY_KEY *key, REGSUBKEY_CTR *subkey_ctr ); +WERROR create_reg_subkey(REGISTRY_KEY *key, const char *subkey); +WERROR delete_reg_subkey(REGISTRY_KEY *key, const char *subkey); +int fetch_reg_keys( REGISTRY_KEY *key, struct regsubkey_ctr *subkey_ctr ); int fetch_reg_values( REGISTRY_KEY *key, REGVAL_CTR *val ); bool regkey_access_check( REGISTRY_KEY *key, uint32 requested, uint32 *granted, const struct nt_user_token *token ); @@ -5096,7 +5075,7 @@ WERROR regkey_get_secdesc(TALLOC_CTX *mem_ctx, REGISTRY_KEY *key, struct security_descriptor **psecdesc); WERROR regkey_set_secdesc(REGISTRY_KEY *key, struct security_descriptor *psecdesc); -bool reg_subkeys_need_update(REGISTRY_KEY *key, REGSUBKEY_CTR *subkeys); +bool reg_subkeys_need_update(REGISTRY_KEY *key, struct regsubkey_ctr *subkeys); bool reg_values_need_update(REGISTRY_KEY *key, REGVAL_CTR *values); /* The following definitions come from registry/reg_eventlog.c */ @@ -5122,11 +5101,14 @@ WERROR registry_init_smbconf(const char *keyname); /* The following definitions come from registry/reg_objects.c */ -WERROR regsubkey_ctr_addkey( REGSUBKEY_CTR *ctr, const char *keyname ); -int regsubkey_ctr_delkey( REGSUBKEY_CTR *ctr, const char *keyname ); -bool regsubkey_ctr_key_exists( REGSUBKEY_CTR *ctr, const char *keyname ); -int regsubkey_ctr_numkeys( REGSUBKEY_CTR *ctr ); -char* regsubkey_ctr_specific_key( REGSUBKEY_CTR *ctr, uint32 key_index ); +WERROR regsubkey_ctr_init(TALLOC_CTX *mem_ctx, 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 ); +WERROR regsubkey_ctr_delkey( struct regsubkey_ctr *ctr, const char *keyname ); +bool regsubkey_ctr_key_exists( struct regsubkey_ctr *ctr, const char *keyname ); +int regsubkey_ctr_numkeys( struct regsubkey_ctr *ctr ); +char* regsubkey_ctr_specific_key( struct regsubkey_ctr *ctr, uint32 key_index ); int regval_ctr_numvals( REGVAL_CTR *ctr ); REGISTRY_VALUE* dup_registry_value( REGISTRY_VALUE *val ); void free_registry_value( REGISTRY_VALUE *val ); @@ -5476,33 +5458,38 @@ WERROR rpccli_spoolss_getprinterdriver2(struct rpc_pipe_client *cli, union spoolss_DriverInfo *info, uint32_t *server_major_version, uint32_t *server_minor_version); +WERROR rpccli_spoolss_addprinterex(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct spoolss_SetPrinterInfoCtr *info_ctr); +WERROR rpccli_spoolss_getprinter(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t level, + uint32_t offered, + union spoolss_PrinterInfo *info); +WERROR rpccli_spoolss_getjob(struct rpc_pipe_client *cli, + TALLOC_CTX *mem_ctx, + struct policy_handle *handle, + uint32_t job_id, + uint32_t level, + uint32_t offered, + union spoolss_JobInfo *info); WERROR rpccli_spoolss_enum_printers(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, char *name, uint32 flags, uint32 level, uint32 *num_printers, PRINTER_INFO_CTR *ctr); WERROR rpccli_spoolss_enum_ports(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32 level, uint32 *num_ports, PORT_INFO_CTR *ctr); -WERROR rpccli_spoolss_getprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - POLICY_HND *pol, uint32 level, - PRINTER_INFO_CTR *ctr); -WERROR rpccli_spoolss_setprinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - POLICY_HND *pol, uint32 level, - PRINTER_INFO_CTR *ctr, uint32 command); WERROR rpccli_spoolss_enumprinterdrivers (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint32 level, const char *env, uint32 *num_drivers, PRINTER_DRIVER_CTR *ctr); -WERROR rpccli_spoolss_addprinterex (struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - uint32 level, PRINTER_INFO_CTR*ctr); WERROR rpccli_spoolss_enumforms(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *handle, int level, uint32 *num_forms, FORM_1 **forms); WERROR rpccli_spoolss_enumjobs(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, uint32 level, uint32 firstjob, uint32 num_jobs, uint32 *returned, JOB_INFO_CTR *ctr); -WERROR rpccli_spoolss_getjob(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, - POLICY_HND *hnd, uint32 jobid, uint32 level, - JOB_INFO_CTR *ctr); WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, POLICY_HND *hnd, const char *valuename, REGISTRY_VALUE *value); @@ -5804,17 +5791,7 @@ bool sec_io_desc_buf(const char *desc, SEC_DESC_BUF **ppsdb, prs_struct *ps, int bool spoolss_io_system_time(const char *desc, prs_struct *ps, int depth, SYSTEMTIME *systime); bool make_systemtime(SYSTEMTIME *systime, struct tm *unixtime); -bool spool_io_user_level_1( const char *desc, prs_struct *ps, int depth, SPOOL_USER_1 *q_u ); bool spoolss_io_devmode(const char *desc, prs_struct *ps, int depth, DEVICEMODE *devmode); -bool make_spoolss_q_addprinterex( TALLOC_CTX *mem_ctx, SPOOL_Q_ADDPRINTEREX *q_u, - const char *srv_name, const char* clientname, const char* user_name, - uint32 level, PRINTER_INFO_CTR *ctr); -bool make_spoolss_printer_info_2(TALLOC_CTX *ctx, SPOOL_PRINTER_INFO_LEVEL_2 **spool_info2, - PRINTER_INFO_2 *info); -bool make_spoolss_printer_info_3(TALLOC_CTX *mem_ctx, SPOOL_PRINTER_INFO_LEVEL_3 **spool_info3, - PRINTER_INFO_3 *info); -bool make_spoolss_printer_info_7(TALLOC_CTX *mem_ctx, SPOOL_PRINTER_INFO_LEVEL_7 **spool_info7, - PRINTER_INFO_7 *info); bool make_spoolss_q_getprinterdata(SPOOL_Q_GETPRINTERDATA *q_u, const POLICY_HND *handle, const char *valuename, uint32 size); @@ -5884,19 +5861,6 @@ bool spoolss_io_q_enumprinters(const char *desc, SPOOL_Q_ENUMPRINTERS *q_u, prs_ bool spoolss_io_r_enumprinters(const char *desc, SPOOL_R_ENUMPRINTERS *r_u, prs_struct *ps, int depth); bool spoolss_io_r_getprinter(const char *desc, SPOOL_R_GETPRINTER *r_u, prs_struct *ps, int depth); bool spoolss_io_q_getprinter(const char *desc, SPOOL_Q_GETPRINTER *q_u, prs_struct *ps, int depth); -bool make_spoolss_q_getprinter( - TALLOC_CTX *mem_ctx, - SPOOL_Q_GETPRINTER *q_u, - const POLICY_HND *hnd, - uint32 level, - RPC_BUFFER *buffer, - uint32 offered -); -bool make_spoolss_q_setprinter(TALLOC_CTX *mem_ctx, SPOOL_Q_SETPRINTER *q_u, - const POLICY_HND *hnd, uint32 level, PRINTER_INFO_CTR *info, - uint32 command); -bool spoolss_io_r_setprinter(const char *desc, SPOOL_R_SETPRINTER *r_u, prs_struct *ps, int depth); -bool spoolss_io_q_setprinter(const char *desc, SPOOL_Q_SETPRINTER *q_u, prs_struct *ps, int depth); bool spoolss_io_r_enumjobs(const char *desc, SPOOL_R_ENUMJOBS *r_u, prs_struct *ps, int depth); bool make_spoolss_q_enumjobs(SPOOL_Q_ENUMJOBS *q_u, const POLICY_HND *hnd, uint32 firstjob, @@ -5916,17 +5880,7 @@ bool spoolss_io_q_enumforms(const char *desc, SPOOL_Q_ENUMFORMS *q_u, prs_struct bool spoolss_io_r_enumforms(const char *desc, SPOOL_R_ENUMFORMS *r_u, prs_struct *ps, int depth); bool spoolss_io_r_enumports(const char *desc, SPOOL_R_ENUMPORTS *r_u, prs_struct *ps, int depth); bool spoolss_io_q_enumports(const char *desc, SPOOL_Q_ENUMPORTS *q_u, prs_struct *ps, int depth); -bool spool_io_printer_info_level_1(const char *desc, SPOOL_PRINTER_INFO_LEVEL_1 *il, prs_struct *ps, int depth); -bool spool_io_printer_info_level_3(const char *desc, SPOOL_PRINTER_INFO_LEVEL_3 *il, prs_struct *ps, int depth); -bool spool_io_printer_info_level_2(const char *desc, SPOOL_PRINTER_INFO_LEVEL_2 *il, prs_struct *ps, int depth); -bool spool_io_printer_info_level_7(const char *desc, SPOOL_PRINTER_INFO_LEVEL_7 *il, prs_struct *ps, int depth); -bool spool_io_printer_info_level(const char *desc, SPOOL_PRINTER_INFO_LEVEL *il, prs_struct *ps, int depth); -bool spoolss_io_q_addprinterex(const char *desc, SPOOL_Q_ADDPRINTEREX *q_u, prs_struct *ps, int depth); -bool spoolss_io_r_addprinterex(const char *desc, SPOOL_R_ADDPRINTEREX *r_u, - prs_struct *ps, int depth); bool make_spoolss_buffer5(TALLOC_CTX *mem_ctx, BUFFER5 *buf5, uint32 len, uint16 *src); -bool uni_2_asc_printer_info_2(const SPOOL_PRINTER_INFO_LEVEL_2 *uni, - NT_PRINTER_INFO_LEVEL_2 *d); bool spoolss_io_r_enumprintprocessors(const char *desc, SPOOL_R_ENUMPRINTPROCESSORS *r_u, prs_struct *ps, int depth); bool spoolss_io_q_enumprintprocessors(const char *desc, SPOOL_Q_ENUMPRINTPROCESSORS *q_u, prs_struct *ps, int depth); bool spoolss_io_r_enumprintprocdatatypes(const char *desc, SPOOL_R_ENUMPRINTPROCDATATYPES *r_u, prs_struct *ps, int depth); @@ -5966,9 +5920,6 @@ bool spoolss_io_r_enumprinterdataex(const char *desc, SPOOL_R_ENUMPRINTERDATAEX bool make_spoolss_q_enumforms(SPOOL_Q_ENUMFORMS *q_u, POLICY_HND *handle, uint32 level, RPC_BUFFER *buffer, uint32 offered); -bool make_spoolss_q_getjob(SPOOL_Q_GETJOB *q_u, POLICY_HND *handle, - uint32 jobid, uint32 level, RPC_BUFFER *buffer, - uint32 offered); /* The following definitions come from rpc_server/srv_eventlog_lib.c */ @@ -6540,6 +6491,7 @@ files_struct *file_find_fsp(files_struct *orig_fsp); files_struct *file_find_di_first(struct file_id id); files_struct *file_find_di_next(files_struct *start_fsp); files_struct *file_find_print(void); +bool file_find_subpath(files_struct *dir_fsp); void file_sync_all(connection_struct *conn); void file_free(struct smb_request *req, files_struct *fsp); files_struct *file_fnum(uint16 fnum); diff --git a/source3/include/reg_db.h b/source3/include/reg_db.h index 92448ae543..5cafa0a5fb 100644 --- a/source3/include/reg_db.h +++ b/source3/include/reg_db.h @@ -26,5 +26,6 @@ #define REG_VALUE_PREFIX "SAMBA_REGVAL" #define REG_SECDESC_PREFIX "SAMBA_SECDESC" +#define REG_SORTED_SUBKEYS_PREFIX "SAMBA_SORTED_SUBKEYS" #endif /* _REG_DB_H */ diff --git a/source3/include/reg_objects.h b/source3/include/reg_objects.h index d9159dd464..a03ac1bff4 100644 --- a/source3/include/reg_objects.h +++ b/source3/include/reg_objects.h @@ -66,11 +66,7 @@ typedef struct { /* container for registry subkey names */ -typedef struct { - uint32 num_subkeys; - char **subkeys; - int seqnum; -} REGSUBKEY_CTR; +struct regsubkey_ctr; /* * @@ -132,9 +128,11 @@ typedef struct { typedef struct { /* functions for enumerating subkeys and values */ - int (*fetch_subkeys)( const char *key, REGSUBKEY_CTR *subkeys); + int (*fetch_subkeys)( const char *key, struct regsubkey_ctr *subkeys); int (*fetch_values) ( const char *key, REGVAL_CTR *val ); - bool (*store_subkeys)( const char *key, REGSUBKEY_CTR *subkeys ); + bool (*store_subkeys)( const char *key, struct regsubkey_ctr *subkeys ); + WERROR (*create_subkey)(const char *key, const char *subkey); + WERROR (*delete_subkey)(const char *key, const char *subkey); bool (*store_values)( const char *key, REGVAL_CTR *val ); bool (*reg_access_check)( const char *keyname, uint32 requested, uint32 *granted, @@ -143,7 +141,7 @@ typedef struct { struct security_descriptor **psecdesc); WERROR (*set_secdesc)(const char *key, struct security_descriptor *sec_desc); - bool (*subkeys_need_update)(REGSUBKEY_CTR *subkeys); + bool (*subkeys_need_update)(struct regsubkey_ctr *subkeys); bool (*values_need_update)(REGVAL_CTR *values); } REGISTRY_OPS; @@ -164,7 +162,7 @@ typedef struct _RegistryKey { struct registry_key { REGISTRY_KEY *key; - REGSUBKEY_CTR *subkeys; + struct regsubkey_ctr *subkeys; REGVAL_CTR *values; struct nt_user_token *token; }; diff --git a/source3/include/regfio.h b/source3/include/regfio.h index 63516a358d..0e957d51e5 100644 --- a/source3/include/regfio.h +++ b/source3/include/regfio.h @@ -214,7 +214,7 @@ int regfio_close( REGF_FILE *r ); REGF_NK_REC* regfio_rootkey( REGF_FILE *file ); REGF_NK_REC* regfio_fetch_subkey( REGF_FILE *file, REGF_NK_REC *nk ); REGF_NK_REC* regfio_write_key ( REGF_FILE *file, const char *name, - REGVAL_CTR *values, REGSUBKEY_CTR *subkeys, + REGVAL_CTR *values, struct regsubkey_ctr *subkeys, SEC_DESC *sec_desc, REGF_NK_REC *parent ); diff --git a/source3/include/rpc_secdes.h b/source3/include/rpc_secdes.h index a1cfad9003..c74d621f35 100644 --- a/source3/include/rpc_secdes.h +++ b/source3/include/rpc_secdes.h @@ -39,9 +39,6 @@ #define SEC_RIGHTS_RESET_PASSWD SEC_RIGHTS_EXTENDED #define SEC_RIGHTS_FULL_CTRL 0xf01ff -#define SEC_ACE_OBJECT_PRESENT 0x00000001 /* thanks for Jim McDonough <jmcd@us.ibm.com> */ -#define SEC_ACE_OBJECT_INHERITED_PRESENT 0x00000002 - /* * New Windows 2000 bits. */ @@ -72,7 +69,6 @@ /* SEC_ACE */ typedef struct security_ace SEC_ACE; -#define SEC_ACE_HEADER_SIZE (2 * sizeof(uint8) + sizeof(uint16) + sizeof(uint32)) #ifndef ACL_REVISION #define ACL_REVISION 0x3 @@ -81,7 +77,6 @@ typedef struct security_ace SEC_ACE; #ifndef _SEC_ACL /* SEC_ACL */ typedef struct security_acl SEC_ACL; -#define SEC_ACL_HEADER_SIZE (2 * sizeof(uint16) + sizeof(uint32)) #define _SEC_ACL #endif diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h index 48609a3cd6..2b4a036ce8 100644 --- a/source3/include/rpc_spoolss.h +++ b/source3/include/rpc_spoolss.h @@ -121,41 +121,10 @@ #define SPL_XCV_MONITOR_LOCALMON ",XcvMonitor Local Port" #define SPL_XCV_MONITOR_TCPMON ",XcvMonitor Standard TCP/IP Port" - -#define PRINTER_STATUS_OK 0x00000000 -#define JOB_ACCESS_READ 0x00000020 - -/* JOB status codes. */ - -#define JOB_STATUS_QUEUED 0x0000 -#define JOB_STATUS_PAUSED 0x0001 -#define JOB_STATUS_ERROR 0x0002 -#define JOB_STATUS_DELETING 0x0004 -#define JOB_STATUS_SPOOLING 0x0008 -#define JOB_STATUS_PRINTING 0x0010 -#define JOB_STATUS_OFFLINE 0x0020 -#define JOB_STATUS_PAPEROUT 0x0040 -#define JOB_STATUS_PRINTED 0x0080 -#define JOB_STATUS_DELETED 0x0100 -#define JOB_STATUS_BLOCKED 0x0200 -#define JOB_STATUS_USER_INTERVENTION 0x0400 - /* Notify field types */ -#define NOTIFY_ONE_VALUE 1 /* Notify data is stored in value1 */ -#define NOTIFY_TWO_VALUE 2 /* Notify data is stored in value2 */ -#define NOTIFY_POINTER 3 /* Data is a pointer to a buffer */ -#define NOTIFY_STRING 4 /* Data is a pointer to a buffer w/length */ -#define NOTIFY_SECDESC 5 /* Data is a security descriptor */ - #define PRINTER_NOTIFY_TYPE 0x00 #define JOB_NOTIFY_TYPE 0x01 -#define PRINT_TABLE_END 0xFF - -#define MAX_PRINTER_NOTIFY 26 -#define MAX_JOB_NOTIFY 24 - -#define MAX_NOTIFY_TYPE_FOR_NOW 26 #define PRINTER_NOTIFY_SERVER_NAME 0x00 #define PRINTER_NOTIFY_PRINTER_NAME 0x01 @@ -261,25 +230,6 @@ PRINTER_MESSAGE_INFO; #define DRIVER_MAX_VERSION 4 -/* this struct is undocumented */ -/* thanks to the ddk ... */ -typedef struct { - uint32 size; /* length of user_name & client_name + 2? */ - UNISTR2 *client_name; - UNISTR2 *user_name; - uint32 build; - uint32 major; - uint32 minor; - uint32 processor; -} SPOOL_USER_1; - -typedef struct { - uint32 level; - union { - SPOOL_USER_1 *user1; - } user; -} SPOOL_USER_CTR; - /* * Devicemode structure */ @@ -343,19 +293,6 @@ PRINTER_DEFAULT; /********************************************/ -typedef struct s_header_type -{ - uint32 type; - union - { - uint32 value; - UNISTR string; - } - data; -} -HEADER_TYPE; - - typedef struct spool_q_getprinterdata { POLICY_HND handle; @@ -488,11 +425,6 @@ typedef struct printer_info_6 } PRINTER_INFO_6; -#define SPOOL_DS_PUBLISH 1 -#define SPOOL_DS_UPDATE 2 -#define SPOOL_DS_UNPUBLISH 4 -#define SPOOL_DS_PENDING 0x80000000 - typedef struct printer_info_7 { UNISTR guid; /* text form of printer guid */ @@ -872,115 +804,8 @@ typedef struct spool_r_enumforms } SPOOL_R_ENUMFORMS; -typedef struct spool_printer_info_level_1 -{ - uint32 flags; - uint32 description_ptr; - uint32 name_ptr; - uint32 comment_ptr; - UNISTR2 description; - UNISTR2 name; - UNISTR2 comment; -} SPOOL_PRINTER_INFO_LEVEL_1; - -typedef struct spool_printer_info_level_2 -{ - uint32 servername_ptr; - uint32 printername_ptr; - uint32 sharename_ptr; - uint32 portname_ptr; - uint32 drivername_ptr; - uint32 comment_ptr; - uint32 location_ptr; - uint32 devmode_ptr; - uint32 sepfile_ptr; - uint32 printprocessor_ptr; - uint32 datatype_ptr; - uint32 parameters_ptr; - uint32 secdesc_ptr; - uint32 attributes; - uint32 priority; - uint32 default_priority; - uint32 starttime; - uint32 untiltime; - uint32 status; - uint32 cjobs; - uint32 averageppm; - UNISTR2 servername; - UNISTR2 printername; - UNISTR2 sharename; - UNISTR2 portname; - UNISTR2 drivername; - UNISTR2 comment; - UNISTR2 location; - UNISTR2 sepfile; - UNISTR2 printprocessor; - UNISTR2 datatype; - UNISTR2 parameters; -} -SPOOL_PRINTER_INFO_LEVEL_2; - -typedef struct spool_printer_info_level_3 -{ - uint32 secdesc_ptr; -} -SPOOL_PRINTER_INFO_LEVEL_3; - -typedef struct spool_printer_info_level_7 -{ - uint32 guid_ptr; - uint32 action; - UNISTR2 guid; -} -SPOOL_PRINTER_INFO_LEVEL_7; - -typedef struct spool_printer_info_level -{ - uint32 level; - uint32 info_ptr; - SPOOL_PRINTER_INFO_LEVEL_1 *info_1; - SPOOL_PRINTER_INFO_LEVEL_2 *info_2; - SPOOL_PRINTER_INFO_LEVEL_3 *info_3; - SPOOL_PRINTER_INFO_LEVEL_7 *info_7; -} -SPOOL_PRINTER_INFO_LEVEL; - -typedef struct spool_q_setprinter -{ - POLICY_HND handle; - uint32 level; - SPOOL_PRINTER_INFO_LEVEL info; - SEC_DESC_BUF *secdesc_ctr; - DEVMODE_CTR devmode_ctr; - - uint32 command; - -} -SPOOL_Q_SETPRINTER; - -typedef struct spool_r_setprinter -{ - WERROR status; -} -SPOOL_R_SETPRINTER; - /********************************************/ -typedef struct { - UNISTR2 *server_name; - uint32 level; - SPOOL_PRINTER_INFO_LEVEL info; - DEVMODE_CTR devmode_ctr; - SEC_DESC_BUF *secdesc_ctr; - uint32 user_switch; - SPOOL_USER_CTR user_ctr; -} SPOOL_Q_ADDPRINTEREX; - -typedef struct { - POLICY_HND handle; - WERROR status; -} SPOOL_R_ADDPRINTEREX; - typedef struct spool_q_enumprintprocessors { uint32 name_ptr; diff --git a/source3/include/smb.h b/source3/include/smb.h index f02088731d..a0140fe081 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -149,8 +149,6 @@ typedef union unid_t { * smb_ucs2_t is *always* in little endian format. */ -typedef uint16 smb_ucs2_t; - #ifdef WORDS_BIGENDIAN #define UCS2_SHIFT 8 #else @@ -167,10 +165,6 @@ typedef uint16 smb_ucs2_t; #define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\ ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest)) -/* Large data type for manipulating uint32 unicode codepoints */ -typedef uint32 codepoint_t; -#define INVALID_CODEPOINT ((codepoint_t)-1) - /* pipe string names */ #define PIPE_LANMAN "\\PIPE\\LANMAN" @@ -579,6 +573,12 @@ typedef struct connection_struct { */ struct auth_serversupplied_info *server_info; + /* + * If the "force group" parameter is set, this is the primary gid that + * may be used in the users token, depending on the vuid using this tid. + */ + gid_t force_group_gid; + char client_address[INET6_ADDRSTRLEN]; /* String version of client IP address. */ uint16 vuid; /* vuid of user who *opened* this connection, or UID_FIELD_INVALID */ @@ -1831,18 +1831,6 @@ struct unix_error_map { #define SAFE_NETBIOS_CHARS ". -_" -/* generic iconv conversion structure */ -typedef struct _smb_iconv_t { - size_t (*direct)(void *cd, const char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft); - size_t (*pull)(void *cd, const char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft); - size_t (*push)(void *cd, const char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft); - void *cd_direct, *cd_pull, *cd_push; - char *from_name, *to_name; -} *smb_iconv_t; - /* The maximum length of a trust account password. Used when we randomly create it, 15 char passwords exceed NT4's max password length */ diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 131416b685..f9a0436546 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -75,6 +75,10 @@ enum profile_stats_values #define syscall_open_count __profile_stats_value(PR_VALUE_SYSCALL_OPEN, count) #define syscall_open_time __profile_stats_value(PR_VALUE_SYSCALL_OPEN, time) + PR_VALUE_SYSCALL_CREATEFILE, +#define syscall_createfile_count __profile_stats_value(PR_VALUE_SYSCALL_CREATEFILE, count) +#define syscall_createfile_time __profile_stats_value(PR_VALUE_SYSCALL_CREATEFILE, time) + PR_VALUE_SYSCALL_CLOSE, #define syscall_close_count __profile_stats_value(PR_VALUE_SYSCALL_CLOSE, count) #define syscall_close_time __profile_stats_value(PR_VALUE_SYSCALL_CLOSE, time) @@ -111,6 +115,10 @@ enum profile_stats_values #define syscall_rename_count __profile_stats_value(PR_VALUE_SYSCALL_RENAME, count) #define syscall_rename_time __profile_stats_value(PR_VALUE_SYSCALL_RENAME, time) + PR_VALUE_SYSCALL_RENAME_AT, +#define syscall_rename_at_count __profile_stats_value(PR_VALUE_SYSCALL_RENAME_AT, count) +#define syscall_rename_at_time __profile_stats_value(PR_VALUE_SYSCALL_RENAME_AT, time) + PR_VALUE_SYSCALL_FSYNC, #define syscall_fsync_count __profile_stats_value(PR_VALUE_SYSCALL_FSYNC, count) #define syscall_fsync_time __profile_stats_value(PR_VALUE_SYSCALL_FSYNC, time) @@ -215,6 +223,26 @@ enum profile_stats_values #define syscall_set_quota_count __profile_stats_value(PR_VALUE_SYSCALL_SET_QUOTA, count) #define syscall_set_quota_time __profile_stats_value(PR_VALUE_SYSCALL_SET_QUOTA, time) + PR_VALUE_SYSCALL_GET_SD, +#define syscall_get_sd_count __profile_stats_value(PR_VALUE_SYSCALL_GET_SD, count) +#define syscall_get_sd_time __profile_stats_value(PR_VALUE_SYSCALL_GET_SD, time) + + PR_VALUE_SYSCALL_SET_SD, +#define syscall_set_sd_count __profile_stats_value(PR_VALUE_SYSCALL_SET_SD, count) +#define syscall_set_sd_time __profile_stats_value(PR_VALUE_SYSCALL_SET_SD, time) + + PR_VALUE_SYSCALL_BRL_LOCK, +#define syscall_brl_lock_count __profile_stats_value(PR_VALUE_SYSCALL_BRL_LOCK, count) +#define syscall_brl_lock_time __profile_stats_value(PR_VALUE_SYSCALL_BRL_LOCK, time) + + PR_VALUE_SYSCALL_BRL_UNLOCK, +#define syscall_brl_unlock_count __profile_stats_value(PR_VALUE_SYSCALL_BRL_UNLOCK, count) +#define syscall_brl_unlock_time __profile_stats_value(PR_VALUE_SYSCALL_BRL_UNLOCK, time) + + PR_VALUE_SYSCALL_BRL_CANCEL, +#define syscall_brl_cancel_count __profile_stats_value(PR_VALUE_SYSCALL_BRL_CANCEL, count) +#define syscall_brl_cancel_time __profile_stats_value(PR_VALUE_SYSCALL_BRL_CANCEL, time) + /* counters for individual SMB types */ PR_VALUE_SMBMKDIR, #define SMBmkdir_count __profile_stats_value(PR_VALUE_SMBMKDIR, count) |