From a7e620522e72e27361ebe34172048db458fe581a Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Tue, 27 Jan 2009 10:37:35 +0100 Subject: async_req: Fix the S4 build --- source3/include/includes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 9c7f15b9cb..50140c17f7 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -647,7 +647,7 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx); #include "ctdbd_conn.h" #include "../lib/util/talloc_stack.h" #include "memcache.h" -#include "async_req.h" +#include "../lib/async_req/async_req.h" #include "async_smb.h" #include "async_sock.h" #include "services.h" -- cgit From 7d93d3d4b8db230ceb51a81f18650b8114528f1f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 22 Jan 2009 10:19:14 +0100 Subject: s3:namecache: remove unused namecache_shutdown() function metze --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8838419705..c02a41a678 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2944,7 +2944,6 @@ NTSTATUS map_nt_error_from_gss(uint32 gss_maj, uint32 minor); /* The following definitions come from libsmb/namecache.c */ bool namecache_enable(void); -bool namecache_shutdown(void); bool namecache_store(const char *name, int name_type, int num_names, -- cgit From ac61f650ae640c13beee9d48304d7939f700aa11 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 21 Jan 2009 23:24:18 +0100 Subject: s3:smbd: use signal events for SIGTERM, SIGHUP and SIGCHLD metze --- 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 c02a41a678..d625f98186 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -7115,6 +7115,8 @@ SEC_DESC *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname); /* The following definitions come from smbd/process.c */ +void smbd_setup_sig_term_handler(void); +void smbd_setup_sig_hup_handler(void); bool srv_send_smb(int fd, char *buffer, bool do_encrypt); int srv_set_message(char *buf, int num_words, -- cgit From b8c416fe2ac37b3ba0124811cfeddf2015c8d31f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 22 Jan 2009 18:04:17 +0100 Subject: s3:smbd: convert aio to use tevent_signal metze --- source3/include/proto.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d625f98186..dd5b601c2c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6475,8 +6475,6 @@ REGVAL_CTR *svcctl_fetch_regvalues( const char *name, NT_USER_TOKEN *token ); /* The following definitions come from smbd/aio.c */ -void aio_request_done(uint16_t mid); -bool aio_finished(void); void initialize_async_io_handler(void); bool schedule_aio_read_and_X(connection_struct *conn, struct smb_request *req, @@ -6487,23 +6485,9 @@ bool schedule_aio_write_and_X(connection_struct *conn, files_struct *fsp, char *data, SMB_OFF_T startpos, size_t numtowrite); -int process_aio_queue(void); int wait_for_aio_completion(files_struct *fsp); void cancel_aio_by_fsp(files_struct *fsp); -bool aio_finished(void); -void initialize_async_io_handler(void); -int process_aio_queue(void); -bool schedule_aio_read_and_X(connection_struct *conn, - struct smb_request *req, - files_struct *fsp, SMB_OFF_T startpos, - size_t smb_maxcnt); -bool schedule_aio_write_and_X(connection_struct *conn, - struct smb_request *req, - files_struct *fsp, char *data, - SMB_OFF_T startpos, - size_t numtowrite); -void cancel_aio_by_fsp(files_struct *fsp); -int wait_for_aio_completion(files_struct *fsp); +void smbd_aio_complete_mid(unsigned int mid); /* The following definitions come from smbd/blocking.c */ -- cgit From 4a2271349503933776f9d2791edfcb874a2c7261 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 23 Jan 2009 10:07:45 +0100 Subject: s3:smbd: remove pointless respond_to_all_remaining_local_messages() function This the process_kernel_oplock() function never response to messages, it only generates messages to ourself. metze --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index dd5b601c2c..1713760666 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -7126,7 +7126,6 @@ struct idle_event *event_add_idle(struct event_context *event_ctx, void *private_data), void *private_data); NTSTATUS allow_new_trans(struct trans_state *list, int mid); -void respond_to_all_remaining_local_messages(void); void reply_outbuf(struct smb_request *req, uint8 num_words, uint32 num_bytes); const char *smb_fn_name(int type); void add_to_common_flags2(uint32 v); -- cgit From 52f6a4436f9da439fc687894b329898833af7ff8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 23 Jan 2009 10:08:44 +0100 Subject: s3:smbd: make kernel oplocks event driven And use signal events for Linux oplocks. metze --- source3/include/proto.h | 4 +--- source3/include/smb.h | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1713760666..ae49290539 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -7018,13 +7018,11 @@ NTSTATUS get_relative_fid_filename(connection_struct *conn, /* The following definitions come from smbd/oplock.c */ int32 get_number_of_exclusive_open_oplocks(void); -bool oplock_message_waiting(void); -void process_kernel_oplocks(struct messaging_context *msg_ctx); +void break_kernel_oplock(struct messaging_context *msg_ctx, files_struct *fsp); bool set_file_oplock(files_struct *fsp, int oplock_type); void release_file_oplock(files_struct *fsp); bool remove_oplock(files_struct *fsp); bool downgrade_oplock(files_struct *fsp); -int oplock_notify_fd(void); void reply_to_oplock_break_requests(files_struct *fsp); void release_level_2_oplocks_on_change(files_struct *fsp); void share_mode_entry_to_message(char *msg, const struct share_mode_entry *e); diff --git a/source3/include/smb.h b/source3/include/smb.h index aa2db693a3..3f71cde395 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1680,12 +1680,10 @@ struct kernel_oplocks { /* if a kernel does support oplocks then a structure of the following typee is used to describe how to interact with the kernel */ struct kernel_oplocks_ops { - files_struct * (*receive_message)(struct kernel_oplocks *ctx); bool (*set_oplock)(struct kernel_oplocks *ctx, files_struct *fsp, int oplock_type); void (*release_oplock)(struct kernel_oplocks *ctx, files_struct *fsp); - bool (*msg_waiting)(struct kernel_oplocks *ctx); }; #include "smb_macros.h" -- cgit From bf2347bd7df19156da8a2884e41ca5b98a3c94c6 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 26 Jan 2009 14:55:54 +0100 Subject: s3:smbd: make mdns registration event driven. metze --- source3/include/includes.h | 14 -------------- source3/include/proto.h | 11 +++-------- 2 files changed, 3 insertions(+), 22 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 50140c17f7..ea856f1c16 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -678,20 +678,6 @@ struct printjob; #include "smb_ldap.h" -struct dns_reg_state; - -void dns_register_smbd(struct dns_reg_state ** dns_state_ptr, - unsigned port, - int *maxfd, - fd_set *listen_set, - struct timeval *timeout); - -void dns_register_close(struct dns_reg_state ** dns_state_ptr); - - -bool dns_register_smbd_reply(struct dns_reg_state *dns_state, - fd_set *lfds, struct timeval *timeout); - /* * Reasons for cache flush. */ diff --git a/source3/include/proto.h b/source3/include/proto.h index ae49290539..f8a9dbce66 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6651,14 +6651,9 @@ uint32 dmapi_file_flags(const char * const path); /* The following definitions come from smbd/dnsregister.c */ -void dns_register_close(struct dns_reg_state **dns_state_ptr); -void dns_register_smbd(struct dns_reg_state ** dns_state_ptr, - unsigned port, - int *maxfd, - fd_set *listen_set, - struct timeval *timeout); -bool dns_register_smbd_reply(struct dns_reg_state *dns_state, - fd_set *lfds, struct timeval *timeout); +bool smbd_setup_mdns_registration(struct tevent_context *ev, + TALLOC_CTX *mem_ctx, + uint16_t port); /* The following definitions come from smbd/dosmode.c */ -- cgit From 59859b547c81bf398d12a1f9b206a32c6fd55433 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 28 Jan 2009 08:52:53 +0100 Subject: s3: separate tdb validation code out into its own source file So this gets now linked only into its single user: winbindd (needed by winbindd_cache.c) Michael --- source3/include/util_tdb.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'source3/include') diff --git a/source3/include/util_tdb.h b/source3/include/util_tdb.h index 127176b887..21f64fa3d3 100644 --- a/source3/include/util_tdb.h +++ b/source3/include/util_tdb.h @@ -31,16 +31,6 @@ 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_DATA make_tdb_data(const uint8_t *dptr, size_t dsize); TDB_DATA string_tdb_data(const char *string); TDB_DATA string_term_tdb_data(const char *string); @@ -90,9 +80,4 @@ struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx, NTSTATUS map_nt_error_from_tdb(enum TDB_ERROR err); -int tdb_validate(struct tdb_context *tdb, tdb_validate_data_func validate_fn); -int tdb_validate_open(const char *tdb_path, tdb_validate_data_func validate_fn); -int tdb_validate_and_backup(const char *tdb_path, - tdb_validate_data_func validate_fn); - #endif /* __TDBUTIL_H__ */ -- cgit From ac6cf387fff69581940988a65a660c744fa08e99 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 28 Jan 2009 10:35:17 +0100 Subject: s3:util_tdb: remove duplicate prototypes (from ../lib/util/util_tdb.h) Michael --- source3/include/util_tdb.h | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'source3/include') diff --git a/source3/include/util_tdb.h b/source3/include/util_tdb.h index 21f64fa3d3..c79436434f 100644 --- a/source3/include/util_tdb.h +++ b/source3/include/util_tdb.h @@ -24,6 +24,7 @@ #include "talloc.h" /* for tdb_wrap_open() */ #include "../libcli/util/ntstatus.h" /* for map_nt_error_from_tdb() */ +#include "../../lib/util/util_tdb.h" struct tdb_wrap { struct tdb_context *tdb; @@ -31,37 +32,15 @@ struct tdb_wrap { struct tdb_wrap *next, *prev; }; -TDB_DATA make_tdb_data(const uint8_t *dptr, size_t dsize); -TDB_DATA string_tdb_data(const char *string); -TDB_DATA string_term_tdb_data(const char *string); - int tdb_chainlock_with_timeout( struct tdb_context *tdb, TDB_DATA key, unsigned int timeout); -int tdb_lock_bystring(struct tdb_context *tdb, const char *keyval); int tdb_lock_bystring_with_timeout(struct tdb_context *tdb, const char *keyval, int timeout); -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(struct tdb_context *tdb, const char *keyval); - -int32_t tdb_fetch_int32_byblob(struct tdb_context *tdb, TDB_DATA key); -int32_t tdb_fetch_int32(struct tdb_context *tdb, const char *keystr); -bool tdb_store_uint32_byblob(struct tdb_context *tdb, TDB_DATA key, uint32_t value); -bool tdb_store_uint32(struct tdb_context *tdb, const char *keystr, uint32_t value); -int tdb_store_int32_byblob(struct tdb_context *tdb, TDB_DATA key, int32_t v); -int tdb_store_int32(struct tdb_context *tdb, const char *keystr, int32_t v); -bool tdb_fetch_uint32_byblob(struct tdb_context *tdb, TDB_DATA key, uint32_t *value); -bool tdb_fetch_uint32(struct tdb_context *tdb, const char *keystr, uint32_t *value); -int32_t tdb_change_int32_atomic(struct tdb_context *tdb, const char *keystr, int32_t *oldval, int32_t change_val); -bool tdb_change_uint32_atomic(struct tdb_context *tdb, const char *keystr, - uint32_t *oldval, uint32_t change_val); -int tdb_store_bystring(struct tdb_context *tdb, const char *keystr, TDB_DATA data, int flags); int tdb_trans_store_bystring(TDB_CONTEXT *tdb, const char *keystr, TDB_DATA data, int flags); -TDB_DATA tdb_fetch_bystring(struct tdb_context *tdb, const char *keystr); -int tdb_delete_bystring(struct tdb_context *tdb, const char *keystr); int tdb_trans_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, int flag); int tdb_trans_delete(struct tdb_context *tdb, TDB_DATA key); -- cgit From ab63bad94bfc378aca08d3314692de90e1aa1bf3 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Sat, 24 Jan 2009 10:00:13 +0100 Subject: async_sock: Move to top level --- source3/include/async_sock.h | 51 -------------------------------------------- source3/include/includes.h | 2 +- 2 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 source3/include/async_sock.h (limited to 'source3/include') diff --git a/source3/include/async_sock.h b/source3/include/async_sock.h deleted file mode 100644 index c6f95d64d5..0000000000 --- a/source3/include/async_sock.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Unix SMB/CIFS implementation. - async socket operations - Copyright (C) Volker Lendecke 2008 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#ifndef __ASYNC_SOCK_H__ -#define __ASYNC_SOCK_H__ - -#include "includes.h" - -ssize_t async_syscall_result_ssize_t(struct async_req *req, int *perrno); -size_t async_syscall_result_size_t(struct async_req *req, int *perrno); -int async_syscall_result_int(struct async_req *req, int *perrno); - -struct async_req *async_send(TALLOC_CTX *mem_ctx, struct event_context *ev, - int fd, const void *buffer, size_t length, - int flags); -struct async_req *async_recv(TALLOC_CTX *mem_ctx, struct event_context *ev, - int fd, void *buffer, size_t length, - int flags); -struct async_req *async_connect_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - int fd, const struct sockaddr *address, - socklen_t address_len); -NTSTATUS async_connect_recv(struct async_req *req, int *perrno); - -struct async_req *sendall_send(TALLOC_CTX *mem_ctx, struct event_context *ev, - int fd, const void *buffer, size_t length, - int flags); -NTSTATUS sendall_recv(struct async_req *req); - -struct async_req *recvall_send(TALLOC_CTX *mem_ctx, struct event_context *ev, - int fd, void *buffer, size_t length, - int flags); -NTSTATUS recvall_recv(struct async_req *req); - -#endif diff --git a/source3/include/includes.h b/source3/include/includes.h index ea856f1c16..7b0b270f60 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -649,7 +649,7 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx); #include "memcache.h" #include "../lib/async_req/async_req.h" #include "async_smb.h" -#include "async_sock.h" +#include "../lib/async_req/async_sock.h" #include "services.h" #include "eventlog.h" -- cgit From 89caa0e86be9e20702a24fea4f94a11e6e02cc93 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 25 Jan 2009 21:55:05 +0100 Subject: cli_ucs2 --- 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 f8a9dbce66..e2aeb197d0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2462,6 +2462,7 @@ struct async_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev, DATA_BLOB data); NTSTATUS cli_echo_recv(struct async_req *req); NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data); +bool cli_ucs2(struct cli_state *cli); /* The following definitions come from libsmb/clierror.c */ -- cgit From 37da26a06ee0a51f2e6c7b93e2fefc2342613c84 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 26 Jan 2009 20:45:09 +0100 Subject: Add the strlen to push to smb_bytes_push_str, return the converted size The pushed strlen replaces the STR_TERMINATE flag which I personally always find very confusing. --- 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 e2aeb197d0..e00d644852 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2501,7 +2501,8 @@ int cli_nt_create_full(struct cli_state *cli, const char *fname, uint32 CreateDisposition, uint32 CreateOptions, uint8 SecuityFlags); int cli_nt_create(struct cli_state *cli, const char *fname, uint32 DesiredAccess); -uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str); +uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str, + size_t strlen, size_t *pconverted_size); struct async_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct cli_state *cli, const char *fname, int flags, int share_mode); -- cgit From f2224e53b23ffdc0157330527585649c0e5ca635 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 22 Jan 2009 10:24:40 +0100 Subject: s3:idmap: move IDMAP_VERSION to the idmap tdb backend, where it belogns. Michael --- source3/include/idmap.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/idmap.h b/source3/include/idmap.h index 4322192155..672e373108 100644 --- a/source3/include/idmap.h +++ b/source3/include/idmap.h @@ -22,11 +22,6 @@ along with this program. If not, see . */ -/* idmap version determines auto-conversion - this is the database - structure version specifier. */ - -#define IDMAP_VERSION 2 - /* The interface version specifier. Updated to 3 for enum types by JRA. */ -- cgit From aeb23872e25fb720140a10ce01a4211d228b6555 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 22 Jan 2009 12:34:43 +0100 Subject: s3:proto.h: remove duplicate prototypes. Michael --- 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 e00d644852..af5181eca6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1674,8 +1674,6 @@ bool winbind_lookup_rids(TALLOC_CTX *mem_ctx, int num_rids, uint32 *rids, const char **domain_name, const char ***names, enum lsa_SidType **types); -bool winbind_allocate_uid(uid_t *uid); -bool winbind_allocate_gid(gid_t *gid); /* The following definitions come from lib/wins_srv.c */ -- cgit From b8f7cdbd79918bba0fea181f97fff5ab0c79192d Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Mon, 26 Jan 2009 15:39:40 -0800 Subject: s3: Add a new SMB_VFS_GET_ALLOC_SIZE vfs operation This allows module implementors to customize what allocation size is returned to the client. --- source3/include/proto.h | 2 +- source3/include/smbprofile.h | 4 ++++ source3/include/vfs.h | 4 ++++ source3/include/vfs_macros.h | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index af5181eca6..71e2145b83 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1128,6 +1128,7 @@ bool add_gid_to_array_unique(TALLOC_CTX *mem_ctx, gid_t gid, bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf); bool socket_exist(const char *fname); bool directory_exist_stat(char *dname,SMB_STRUCT_STAT *st); +uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf); SMB_OFF_T get_file_size(char *file_name); char *attrib_string(uint16 mode); void show_msg(char *buf); @@ -7377,7 +7378,6 @@ int sys_statvfs(const char *path, vfs_statvfs_struct *statbuf); /* The following definitions come from smbd/trans2.c */ uint64_t smb_roundup(connection_struct *conn, uint64_t val); -uint64_t get_allocation_size(connection_struct *conn, files_struct *fsp, const SMB_STRUCT_STAT *sbuf); NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn, files_struct *fsp, const char *fname, const char *ea_name, struct ea_struct *pea); diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 8945708ca3..131416b685 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -127,6 +127,10 @@ enum profile_stats_values #define syscall_lstat_count __profile_stats_value(PR_VALUE_SYSCALL_LSTAT, count) #define syscall_lstat_time __profile_stats_value(PR_VALUE_SYSCALL_LSTAT, time) + PR_VALUE_SYSCALL_GET_ALLOC_SIZE, +#define syscall_get_alloc_size_count __profile_stats_value(PR_VALUE_SYSCALL_GET_ALLOC_SIZE, count) +#define syscall_get_alloc_size_time __profile_stats_value(PR_VALUE_SYSCALL_GET_ALLOC_SIZE, time) + PR_VALUE_SYSCALL_UNLINK, #define syscall_unlink_count __profile_stats_value(PR_VALUE_SYSCALL_UNLINK, count) #define syscall_unlink_time __profile_stats_value(PR_VALUE_SYSCALL_UNLINK, time) diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 5df71da905..e9115ab807 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -112,6 +112,7 @@ /* Changed to version 25 - Jelmer's change from SMB_BIG_UINT to uint64_t. */ /* Leave at 25 - not yet released. Add create_file call. -- tprouty. */ /* Leave at 25 - not yet released. Add create time to ntimes. -- tstecher. */ +/* Leave at 25 - not yet released. Add get_alloc_size call. -- tprouty. */ #define SMB_VFS_INTERFACE_VERSION 25 @@ -189,6 +190,7 @@ typedef enum _vfs_op_type { SMB_VFS_OP_STAT, SMB_VFS_OP_FSTAT, SMB_VFS_OP_LSTAT, + SMB_VFS_OP_GET_ALLOC_SIZE, SMB_VFS_OP_UNLINK, SMB_VFS_OP_CHMOD, SMB_VFS_OP_FCHMOD, @@ -342,6 +344,7 @@ struct vfs_ops { int (*stat)(struct vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf); int (*fstat)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_STAT *sbuf); int (*lstat)(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf); + uint64_t (*get_alloc_size)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf); int (*unlink)(struct vfs_handle_struct *handle, const char *path); int (*chmod)(struct vfs_handle_struct *handle, const char *path, mode_t mode); int (*fchmod)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode); @@ -496,6 +499,7 @@ struct vfs_ops { struct vfs_handle_struct *stat; struct vfs_handle_struct *fstat; struct vfs_handle_struct *lstat; + struct vfs_handle_struct *get_alloc_size; struct vfs_handle_struct *unlink; struct vfs_handle_struct *chmod; struct vfs_handle_struct *fchmod; diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index c6ccd4912a..e7a9cfdc76 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -62,6 +62,7 @@ #define SMB_VFS_STAT(conn, fname, sbuf) ((conn)->vfs.ops.stat((conn)->vfs.handles.stat, (fname), (sbuf))) #define SMB_VFS_FSTAT(fsp, sbuf) ((fsp)->conn->vfs.ops.fstat((fsp)->conn->vfs.handles.fstat, (fsp), (sbuf))) #define SMB_VFS_LSTAT(conn, path, sbuf) ((conn)->vfs.ops.lstat((conn)->vfs.handles.lstat, (path), (sbuf))) +#define SMB_VFS_GET_ALLOC_SIZE(conn, fsp, sbuf) ((conn)->vfs.ops.get_alloc_size((conn)->vfs.handles.get_alloc_size, (fsp), (sbuf))) #define SMB_VFS_UNLINK(conn, path) ((conn)->vfs.ops.unlink((conn)->vfs.handles.unlink, (path))) #define SMB_VFS_CHMOD(conn, path, mode) ((conn)->vfs.ops.chmod((conn)->vfs.handles.chmod, (path), (mode))) #define SMB_VFS_FCHMOD(fsp, mode) ((fsp)->conn->vfs.ops.fchmod((fsp)->conn->vfs.handles.fchmod, (fsp), (mode))) @@ -189,6 +190,7 @@ #define SMB_VFS_OPAQUE_STAT(conn, fname, sbuf) ((conn)->vfs_opaque.ops.stat((conn)->vfs_opaque.handles.stat, (fname), (sbuf))) #define SMB_VFS_OPAQUE_FSTAT(fsp, sbuf) ((fsp)->conn->vfs_opaque.ops.fstat((fsp)->conn->vfs_opaque.handles.fstat, (fsp), (sbuf))) #define SMB_VFS_OPAQUE_LSTAT(conn, path, sbuf) ((conn)->vfs_opaque.ops.lstat((conn)->vfs_opaque.handles.lstat, (path), (sbuf))) +#define SMB_VFS_OPAQUE_GET_ALLOC_SIZE(conn, fsp, sbuf) ((conn)->vfs_opaque.ops.get_alloc_size((conn)->vfs_opaque.handles.get_alloc_size, (fsp), (sbuf))) #define SMB_VFS_OPAQUE_UNLINK(conn, path) ((conn)->vfs_opaque.ops.unlink((conn)->vfs_opaque.handles.unlink, (path))) #define SMB_VFS_OPAQUE_CHMOD(conn, path, mode) ((conn)->vfs_opaque.ops.chmod((conn)->vfs_opaque.handles.chmod, (path), (mode))) #define SMB_VFS_OPAQUE_FCHMOD(fsp, mode) ((fsp)->conn->vfs_opaque.ops.fchmod((fsp)->conn->vfs_opaque.handles.fchmod, (fsp), (mode))) @@ -317,6 +319,7 @@ #define SMB_VFS_NEXT_STAT(handle, fname, sbuf) ((handle)->vfs_next.ops.stat((handle)->vfs_next.handles.stat, (fname), (sbuf))) #define SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf) ((handle)->vfs_next.ops.fstat((handle)->vfs_next.handles.fstat, (fsp), (sbuf))) #define SMB_VFS_NEXT_LSTAT(handle, path, sbuf) ((handle)->vfs_next.ops.lstat((handle)->vfs_next.handles.lstat, (path), (sbuf))) +#define SMB_VFS_NEXT_GET_ALLOC_SIZE(conn, fsp, sbuf) ((conn)->vfs_next.ops.get_alloc_size((conn)->vfs_next.handles.get_alloc_size, (fsp), (sbuf))) #define SMB_VFS_NEXT_UNLINK(handle, path) ((handle)->vfs_next.ops.unlink((handle)->vfs_next.handles.unlink, (path))) #define SMB_VFS_NEXT_CHMOD(handle, path, mode) ((handle)->vfs_next.ops.chmod((handle)->vfs_next.handles.chmod, (path), (mode))) #define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) ((handle)->vfs_next.ops.fchmod((handle)->vfs_next.handles.fchmod, (fsp), (mode))) -- cgit From d1ab1b6482d7413337b42de83d7de1ae016d33e1 Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Thu, 29 Jan 2009 14:50:18 -0800 Subject: s3 build: Fix "shadows global declaration warning" --- 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 71e2145b83..8276847706 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2501,7 +2501,7 @@ int cli_nt_create_full(struct cli_state *cli, const char *fname, uint8 SecuityFlags); int cli_nt_create(struct cli_state *cli, const char *fname, uint32 DesiredAccess); uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str, - size_t strlen, size_t *pconverted_size); + size_t str_len, size_t *pconverted_size); struct async_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct cli_state *cli, const char *fname, int flags, int share_mode); -- cgit From 7b934c6af3f80c9d75151906eed929045cec28a2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 25 Jan 2009 21:54:55 +0100 Subject: Make cli_session_setup_guest async --- source3/include/proto.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8276847706..943ab5e3f1 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2323,6 +2323,10 @@ NTSTATUS cli_session_setup(struct cli_state *cli, const char *pass, int passlen, const char *ntpass, int ntpasslen, const char *workgroup); +struct async_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct cli_state *cli); +NTSTATUS cli_session_setup_guest_recv(struct async_req *req); bool cli_ulogoff(struct cli_state *cli); bool cli_send_tconX(struct cli_state *cli, const char *share, const char *dev, const char *pass, int passlen); -- cgit From 0bd92281e49b91a9b9a14486adbe6f44affb7a13 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 26 Jan 2009 08:37:13 +0100 Subject: Make cli_tcon_andx async --- source3/include/proto.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 943ab5e3f1..b06d8d6758 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2328,8 +2328,14 @@ struct async_req *cli_session_setup_guest_send(TALLOC_CTX *mem_ctx, struct cli_state *cli); NTSTATUS cli_session_setup_guest_recv(struct async_req *req); bool cli_ulogoff(struct cli_state *cli); -bool cli_send_tconX(struct cli_state *cli, - const char *share, const char *dev, const char *pass, int passlen); +struct async_req *cli_tcon_andx_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct cli_state *cli, + const char *share, const char *dev, + const char *pass, int passlen); +NTSTATUS cli_tcon_andx_recv(struct async_req *req); +NTSTATUS cli_tcon_andx(struct cli_state *cli, const char *share, + const char *dev, const char *pass, int passlen); bool cli_tdis(struct cli_state *cli); void cli_negprot_sendsync(struct cli_state *cli); NTSTATUS cli_negprot(struct cli_state *cli); -- cgit From a0d52e7d54da450a734d7bc7f3827a2791e802b1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 26 Jan 2009 20:45:19 +0100 Subject: Add async cli_ntcreate --- source3/include/proto.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b06d8d6758..04740f5cae 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2509,6 +2509,28 @@ int cli_nt_create_full(struct cli_state *cli, const char *fname, uint32 FileAttributes, uint32 ShareAccess, uint32 CreateDisposition, uint32 CreateOptions, uint8 SecuityFlags); +struct async_req *cli_ntcreate_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct cli_state *cli, + const char *fname, + uint32_t CreatFlags, + uint32_t DesiredAccess, + uint32_t FileAttributes, + uint32_t ShareAccess, + uint32_t CreateDisposition, + uint32_t CreateOptions, + uint8_t SecurityFlags); +NTSTATUS cli_ntcreate_recv(struct async_req *req, uint16_t *pfnum); +NTSTATUS cli_ntcreate(struct cli_state *cli, + const char *fname, + uint32_t CreatFlags, + uint32_t DesiredAccess, + uint32_t FileAttributes, + uint32_t ShareAccess, + uint32_t CreateDisposition, + uint32_t CreateOptions, + uint8_t SecurityFlags, + uint16_t *pfid); int cli_nt_create(struct cli_state *cli, const char *fname, uint32 DesiredAccess); uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str, size_t str_len, size_t *pconverted_size); -- cgit From b873ede89d3155438f7f9938d9a027cb4e3791e7 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 29 Jan 2009 22:41:33 +0100 Subject: Make rpc_transport_np_init async --- source3/include/proto.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 04740f5cae..60e80bd87d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5329,6 +5329,13 @@ NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx, /* The following definitions come from rpc_client/rpc_transport_np.c */ +struct async_req *rpc_transport_np_init_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct cli_state *cli, + const struct ndr_syntax_id *abstract_syntax); +NTSTATUS rpc_transport_np_init_recv(struct async_req *req, + TALLOC_CTX *mem_ctx, + struct rpc_cli_transport **presult); NTSTATUS rpc_transport_np_init(TALLOC_CTX *mem_ctx, struct cli_state *cli, const struct ndr_syntax_id *abstract_syntax, struct rpc_cli_transport **presult); -- cgit From 22e3004829fe742efdbf750611749b9aaf585515 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 29 Jan 2009 22:54:55 +0100 Subject: Add the "SMBD" rpc transport The idea of this is that all client utils like smbpasswd and also for example "net join" do not access our internal databases like passdb and secrets.tdb directly anymore but pass everything throught the well-established RPC interfaces. The way you use this is the following: With rpc_cli_smbd_conn_init() or its async variant you initialize a "struct rpc_cli_smbd_conn". This structure is the link to a freshly forked smbd, ready to be used for RPC services. You should only ever have one such structure in your program. More don't hurt, but are plainly unnecessary. If you want to use the SAMR pipe to change a passwort, you connect to that pipe with rpc_pipe_open_local. Do you normal rpccli_samr calls on that and your locally forked smbd will connect to passdb for you. GD, this might make the distinction between the _l and _r calls in libnetapi mostly unnecessary. At least it is intended to do so... :-) --- source3/include/proto.h | 34 ++++++++++++++++++++++++++++++++++ source3/include/smb.h | 1 + 2 files changed, 35 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 60e80bd87d..d30eb09f6a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5326,6 +5326,10 @@ NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli, NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx, struct rpc_pipe_client *cli, DATA_BLOB *session_key); +NTSTATUS rpc_pipe_open_local(TALLOC_CTX *mem_ctx, + struct rpc_cli_smbd_conn *conn, + const struct ndr_syntax_id *syntax, + struct rpc_pipe_client **presult); /* The following definitions come from rpc_client/rpc_transport_np.c */ @@ -5341,6 +5345,36 @@ NTSTATUS rpc_transport_np_init(TALLOC_CTX *mem_ctx, struct cli_state *cli, struct rpc_cli_transport **presult); struct cli_state *rpc_pipe_np_smb_conn(struct rpc_pipe_client *p); +/* The following definitions come from rpc_client/rpc_transport_smbd.c */ + +struct async_req *rpc_cli_smbd_conn_init_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + void (*stdout_callback)(char *buf, + size_t len, + void *priv), + void *priv); +NTSTATUS rpc_cli_smbd_conn_init_recv(struct async_req *req, + TALLOC_CTX *mem_ctx, + struct rpc_cli_smbd_conn **pconn); +NTSTATUS rpc_cli_smbd_conn_init(TALLOC_CTX *mem_ctx, + struct rpc_cli_smbd_conn **pconn, + void (*stdout_callback)(char *buf, + size_t len, + void *priv), + void *priv); + +struct async_req *rpc_transport_smbd_init_send(TALLOC_CTX *mem_ctx, + struct event_context *ev, + struct rpc_cli_smbd_conn *conn, + const struct ndr_syntax_id *abstract_syntax); +NTSTATUS rpc_transport_smbd_init_recv(struct async_req *req, + TALLOC_CTX *mem_ctx, + struct rpc_cli_transport **presult); +NTSTATUS rpc_transport_smbd_init(TALLOC_CTX *mem_ctx, + struct rpc_cli_smbd_conn *conn, + const struct ndr_syntax_id *abstract_syntax, + struct rpc_cli_transport **presult); + /* The following definitions come from rpc_client/rpc_transport_sock.c */ NTSTATUS rpc_transport_sock_init(TALLOC_CTX *mem_ctx, int fd, diff --git a/source3/include/smb.h b/source3/include/smb.h index 3f71cde395..9451710255 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -367,6 +367,7 @@ struct uuid; struct named_mutex; struct pcap_cache; struct wb_context; +struct rpc_cli_smbd_conn; struct vfs_fsp_data { struct vfs_fsp_data *next; -- cgit From b99859b948f31dbe474b6ce0c6cab601e7e7bc56 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 30 Jan 2009 23:29:37 +0100 Subject: Make is_andx_req non-static --- 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 d30eb09f6a..c10db31d2a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2472,6 +2472,7 @@ struct async_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev, NTSTATUS cli_echo_recv(struct async_req *req); NTSTATUS cli_echo(struct cli_state *cli, uint16_t num_echos, DATA_BLOB data); bool cli_ucs2(struct cli_state *cli); +bool is_andx_req(uint8_t cmd); /* The following definitions come from libsmb/clierror.c */ -- cgit From d94e9c802ceddeff93168337b6fc5533db7f2d33 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 30 Jan 2009 23:44:21 +0100 Subject: Remove the global variable "chain_size" --- source3/include/proto.h | 2 ++ source3/include/smb.h | 5 ----- source3/include/smb_macros.h | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c10db31d2a..d58dcef0b4 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -7201,6 +7201,7 @@ void remove_from_common_flags2(uint32 v); void construct_reply_common_req(struct smb_request *req, char *outbuf); size_t req_wct_ofs(struct smb_request *req); void chain_reply(struct smb_request *req); +bool req_is_in_chain(struct smb_request *req); void check_reload(time_t t); void smbd_process(void); @@ -7275,6 +7276,7 @@ NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req, uint32 dirtype, const char *name_in, bool has_wild); void reply_unlink(struct smb_request *req); void send_file_readbraw(connection_struct *conn, + struct smb_request *req, files_struct *fsp, SMB_OFF_T startpos, size_t nread, diff --git a/source3/include/smb.h b/source3/include/smb.h index 9451710255..be6ccbf597 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1549,11 +1549,6 @@ enum acl_compatibility {ACL_COMPAT_AUTO, ACL_COMPAT_WINNT, ACL_COMPAT_WIN2K}; */ #define COPYBUF_SIZE (8*1024) -/* - * Used in chaining code. - */ -extern int chain_size; - /* * Map the Core and Extended Oplock requesst bits down * to common bits (EXCLUSIVE_OPLOCK & BATCH_OPLOCK). diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 92c60a7530..fd1bba16a7 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -135,7 +135,7 @@ /* Note that chain_size must be available as an extern int to this macro. */ -#define smb_offset(p,buf) (PTR_DIFF(p,buf+4) + chain_size) +#define smb_offset(p,buf) (PTR_DIFF(p,buf+4)) #define smb_len(buf) (PVAL(buf,3)|(PVAL(buf,2)<<8)|((PVAL(buf,1)&1)<<16)) #define _smb_setlen(buf,len) do { buf[0] = 0; buf[1] = ((len)&0x10000)>>16; \ -- cgit From cee0d85e0b2be27d9314206f3fe832fc0c75b0f3 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 30 Jan 2009 23:45:35 +0100 Subject: make send_file_readbraw static --- source3/include/proto.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index d58dcef0b4..9199d6c0d3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -7275,12 +7275,6 @@ void reply_ctemp(struct smb_request *req); NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req, uint32 dirtype, const char *name_in, bool has_wild); void reply_unlink(struct smb_request *req); -void send_file_readbraw(connection_struct *conn, - struct smb_request *req, - files_struct *fsp, - SMB_OFF_T startpos, - size_t nread, - ssize_t mincount); void reply_readbraw(struct smb_request *req); void reply_lockread(struct smb_request *req); void reply_read(struct smb_request *req); -- cgit From e60d69d67d4064d4aa26644c6bca2dfc1b0f4983 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 31 Jan 2009 12:43:25 +0100 Subject: Add an async np_write wrapper --- source3/include/proto.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9199d6c0d3..b308e86af7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6314,6 +6314,10 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name, const char *client_address, struct auth_serversupplied_info *server_info, struct fake_file_handle **phandle); +struct async_req *np_write_send(TALLOC_CTX *mem_ctx, struct event_context *ev, + struct fake_file_handle *handle, + const uint8_t *data, size_t len); +NTSTATUS np_write_recv(struct async_req *req, ssize_t *nwritten); NTSTATUS np_write(struct fake_file_handle *handle, const uint8_t *data, size_t len, ssize_t *nwritten); NTSTATUS np_read(struct fake_file_handle *handle, uint8_t *data, size_t len, -- cgit From b797c056a60b519da6595ce728846dace5d1dfbd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 31 Jan 2009 13:36:09 +0100 Subject: Add an async np_read wrapper --- source3/include/proto.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index b308e86af7..ca10b7097f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6320,6 +6320,11 @@ struct async_req *np_write_send(TALLOC_CTX *mem_ctx, struct event_context *ev, NTSTATUS np_write_recv(struct async_req *req, ssize_t *nwritten); NTSTATUS np_write(struct fake_file_handle *handle, const uint8_t *data, size_t len, ssize_t *nwritten); +struct async_req *np_read_send(TALLOC_CTX *mem_ctx, struct event_context *ev, + struct fake_file_handle *handle, + uint8_t *data, size_t len); +NTSTATUS np_read_recv(struct async_req *req, ssize_t *nread, + bool *is_data_outstanding); NTSTATUS np_read(struct fake_file_handle *handle, uint8_t *data, size_t len, ssize_t *nread, bool *is_data_outstanding); -- cgit From c2fe28ba598e7db2915b3bb5e7b8d281361a4c95 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 14 Oct 2008 15:53:35 +0200 Subject: Convert api_rpc_trans_reply to async np_* --- source3/include/smb.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index be6ccbf597..491dd763ff 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -624,7 +624,18 @@ struct smb_request { uint16_t buflen; const uint8_t *buf; const uint8 *inbuf; + + /* + * Async handling in the main smb processing loop is directed by + * outbuf: reply_xxx routines indicate sync behaviour by putting their + * reply into "outbuf". If they leave it as NULL, they take of it + * themselves, possibly later. + * + * If async handling is wanted, the reply_xxx routine must make sure + * that it talloc_move()s the smb_req somewhere else. + */ uint8 *outbuf; + size_t unread_bytes; bool encrypted; connection_struct *conn; @@ -638,6 +649,11 @@ struct smb_request { * Here we collect the outbufs from the chain handlers */ uint8_t *chain_outbuf; + + /* + * state information for async smb handling + */ + void *async_priv; }; /* Defines for the sent_oplock_break field above. */ -- cgit From 8b480b52cef385f555ca90c804132472e2173129 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 31 Jan 2009 14:44:04 +0100 Subject: Remove unused np_write sync wrapper --- 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 ca10b7097f..081225614f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6318,8 +6318,6 @@ struct async_req *np_write_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct fake_file_handle *handle, const uint8_t *data, size_t len); NTSTATUS np_write_recv(struct async_req *req, ssize_t *nwritten); -NTSTATUS np_write(struct fake_file_handle *handle, const uint8_t *data, - size_t len, ssize_t *nwritten); struct async_req *np_read_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct fake_file_handle *handle, uint8_t *data, size_t len); -- cgit From fa7ddc78b8da8265096b1cc45471e1c7c96ac994 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 31 Jan 2009 16:17:25 +0100 Subject: Remove unused np_read sync wrapper --- 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 081225614f..fd556690aa 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6323,8 +6323,6 @@ struct async_req *np_read_send(TALLOC_CTX *mem_ctx, struct event_context *ev, uint8_t *data, size_t len); NTSTATUS np_read_recv(struct async_req *req, ssize_t *nread, bool *is_data_outstanding); -NTSTATUS np_read(struct fake_file_handle *handle, uint8_t *data, size_t len, - ssize_t *nread, bool *is_data_outstanding); /* The following definitions come from rpc_server/srv_samr_util.c */ -- cgit From 57de60a83f3f88566d356547eb20a6f0569f76ec Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 1 Feb 2009 00:30:04 +0100 Subject: cli_get_pipe_name_from_interface does not really need a talloc_ctx --- 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 fd556690aa..6a97d81a61 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5852,8 +5852,7 @@ bool prs_data_blob(prs_struct *prs, DATA_BLOB *blob, TALLOC_CTX *mem_ctx); /* The following definitions come from rpc_parse/parse_rpc.c */ -const char *cli_get_pipe_name_from_iface(TALLOC_CTX *mem_ctx, - const struct ndr_syntax_id *interface); +const char *get_pipe_name_from_iface(const struct ndr_syntax_id *interface); void init_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags, uint32 call_id, int data_len, int auth_len); bool smb_io_rpc_hdr(const char *desc, RPC_HDR *rpc, prs_struct *ps, int depth); -- cgit From 53394980ad7dc09af4412a6c4ee75241798b0e7c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 1 Feb 2009 12:03:31 +0100 Subject: Replace pipe names in pipes_struct by ndr_syntax_id This was mainly used for debugging output --- source3/include/ntdomain.h | 3 +-- source3/include/proto.h | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 3f501550da..2d6a358391 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -214,8 +214,7 @@ typedef struct pipes_struct { struct auth_serversupplied_info *server_info; - fstring name; - fstring pipe_srv_name; + struct ndr_syntax_id syntax; /* linked list of rpc dispatch tables associated with the open rpc contexts */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 6a97d81a61..c97adaa1c0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6271,7 +6271,8 @@ NTSTATUS _eventlog_read_eventlog( pipes_struct * p, /* The following definitions come from rpc_server/srv_lsa_hnd.c */ -bool init_pipe_handle_list(pipes_struct *p, const char *pipe_name); +bool init_pipe_handle_list(pipes_struct *p, + const struct ndr_syntax_id *syntax); bool create_policy_hnd(pipes_struct *p, POLICY_HND *hnd, void *data_ptr); bool find_policy_by_hnd(pipes_struct *p, POLICY_HND *hnd, void **data_p); bool close_policy_hnd(pipes_struct *p, POLICY_HND *hnd); @@ -6294,7 +6295,7 @@ NTSTATUS rpc_srv_register(int version, const char *clnt, const char *srv, const struct ndr_interface_table *iface, const struct api_struct *cmds, int size); -bool is_known_pipename(const char *cli_filename); +bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax); bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p); bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p); bool api_pipe_ntlmssp_auth_process(pipes_struct *p, prs_struct *rpc_in, -- cgit From c14b7e648bcfc4865da4b290e46977fff81d4500 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 1 Feb 2009 16:32:02 +0100 Subject: Split up async_req into a generic and a NTSTATUS specific part --- source3/include/includes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 7b0b270f60..c58ebcdbfe 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -647,7 +647,7 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx); #include "ctdbd_conn.h" #include "../lib/util/talloc_stack.h" #include "memcache.h" -#include "../lib/async_req/async_req.h" +#include "../lib/async_req/async_req_ntstatus.h" #include "async_smb.h" #include "../lib/async_req/async_sock.h" #include "services.h" -- cgit From d96248a9b46559552f53b0ecd3861387ea7ff050 Mon Sep 17 00:00:00 2001 From: Dan Sledz Date: Thu, 15 Jan 2009 17:02:41 -0800 Subject: Add two new parameters to control how we verify kerberos tickets. Removes lp_use_kerberos_keytab parameter. The first is "kerberos method" and replaces the "use kerberos keytab" with an enum. Valid options are: secrets only - use only the secrets for ticket verification (default) system keytab - use only the system keytab for ticket verification dedicated keytab - use a dedicated keytab for ticket verification. secrets and keytab - use the secrets.tdb first, then the system keytab For existing installs: "use kerberos keytab = yes" corresponds to secrets and keytab "use kerberos keytab = no" corresponds to secrets only The major difference between "system keytab" and "dedicated keytab" is that the latter method relies on kerberos to find the correct keytab entry instead of filtering based on expected principals. The second parameter is "dedicated keytab file", which is the keytab to use when in "dedicated keytab" mode. This keytab is only used in ads_verify_ticket. --- source3/include/includes.h | 19 ++++++++++++++++++- source3/include/proto.h | 3 ++- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index c58ebcdbfe..ebd8923769 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -879,8 +879,25 @@ char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...) PRINTF_ATT #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ #endif -#if defined(HAVE_KRB5) +/* + * This should be under the HAVE_KRB5 flag but since they're used + * in lp_kerberos_method(), they ned to be always available + */ +#define KERBEROS_VERIFY_SECRETS 0 +#define KERBEROS_VERIFY_SYSTEM_KEYTAB 1 +#define KERBEROS_VERIFY_DEDICATED_KEYTAB 2 +#define KERBEROS_VERIFY_SECRETS_AND_KEYTAB 3 +/* + * If you add any entries to the above, please modify the below expressions + * so they remain accurate. + */ +#define USE_KERBEROS_KEYTAB (KERBEROS_VERIFY_SECRETS != lp_kerberos_method()) +#define USE_SYSTEM_KEYTAB \ + ((KERBEROS_VERIFY_SECRETS_AND_KEYTAB == lp_kerberos_method()) || \ + (KERBEROS_VERIFY_SYSTEM_KEYTAB == lp_kerberos_method())) + +#if defined(HAVE_KRB5) krb5_error_code smb_krb5_parse_name(krb5_context context, const char *name, /* in unix charset */ krb5_principal *principal); diff --git a/source3/include/proto.h b/source3/include/proto.h index c97adaa1c0..285b44dcde 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4060,7 +4060,8 @@ bool lp_client_use_spnego(void); bool lp_hostname_lookups(void); bool lp_change_notify(const struct share_params *p ); bool lp_kernel_change_notify(const struct share_params *p ); -bool lp_use_kerberos_keytab(void); +char * lp_dedicated_keytab_file(void); +int lp_kerberos_method(void); bool lp_defer_sharing_violations(void); bool lp_enable_privileges(void); bool lp_enable_asu_support(void); -- cgit From 6ed02233c3d873d4aa6ee4306d61cc2aad465a5d Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Mon, 2 Feb 2009 22:14:57 +0100 Subject: s3-wbclient: Use new tevent data types --- 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 285b44dcde..dfe42db245 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -7671,7 +7671,7 @@ NTSTATUS nss_info_template_init( void ); /* Misc protos */ -struct async_req *wb_trans_send(TALLOC_CTX *mem_ctx, struct event_context *ev, +struct async_req *wb_trans_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct wb_context *wb_ctx, bool need_priv, const struct winbindd_request *wb_req); NTSTATUS wb_trans_recv(struct async_req *req, TALLOC_CTX *mem_ctx, -- cgit From 553818add80818909268557665e2760a16f2d8a0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 2 Feb 2009 17:10:27 -0800 Subject: Fix bug #6082 - smbd_gpfs_getacl failed: Windows client can´t rename or delete file This fixes the generic rename/delete problem for 3.3.0 and above. Fixed slightly differently to discussions, user viewable modified ACLs are not a good idea :-). Jeremy. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 491dd763ff..b441b3476a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1259,7 +1259,7 @@ struct bitmap { /* Mapping of access rights to UNIX perms. for a UNIX directory. */ #define UNIX_DIRECTORY_ACCESS_RWX FILE_GENERIC_ALL #define UNIX_DIRECTORY_ACCESS_R FILE_GENERIC_READ -#define UNIX_DIRECTORY_ACCESS_W FILE_GENERIC_WRITE +#define UNIX_DIRECTORY_ACCESS_W (FILE_GENERIC_WRITE|FILE_DELETE_CHILD) #define UNIX_DIRECTORY_ACCESS_X FILE_GENERIC_EXECUTE #if 0 -- cgit From 8fb6b18bac436d4babdafc4d8b97de70881c1238 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 22 Jan 2009 19:46:14 +0100 Subject: s3-eventlog: allow to open eventlog tdbs readonly. Guenther --- 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 dfe42db245..f68c354642 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6258,7 +6258,7 @@ char *elog_tdbname(TALLOC_CTX *ctx, const char *name ); int elog_tdb_size( TDB_CONTEXT * tdb, int *MaxSize, int *Retention ); bool prune_eventlog( TDB_CONTEXT * tdb ); bool can_write_to_eventlog( TDB_CONTEXT * tdb, int32 needed ); -ELOG_TDB *elog_open_tdb( char *logname, bool force_clear ); +ELOG_TDB *elog_open_tdb( char *logname, bool force_clear, bool read_only ); int elog_close_tdb( ELOG_TDB *etdb, bool force_close ); int write_eventlog_tdb( TDB_CONTEXT * the_tdb, Eventlog_entry * ee ); void fixup_eventlog_entry( Eventlog_entry * ee ); -- cgit From 4976777e3b0f3d8c18182a822937f62c082027c7 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 2 Feb 2009 14:00:01 +0100 Subject: s3-eventlog: make logname in elog_open_tdb const. Guenther --- 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 f68c354642..6f9474e3fb 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6258,7 +6258,7 @@ char *elog_tdbname(TALLOC_CTX *ctx, const char *name ); int elog_tdb_size( TDB_CONTEXT * tdb, int *MaxSize, int *Retention ); bool prune_eventlog( TDB_CONTEXT * tdb ); bool can_write_to_eventlog( TDB_CONTEXT * tdb, int32 needed ); -ELOG_TDB *elog_open_tdb( char *logname, bool force_clear, bool read_only ); +ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only ); int elog_close_tdb( ELOG_TDB *etdb, bool force_close ); int write_eventlog_tdb( TDB_CONTEXT * the_tdb, Eventlog_entry * ee ); void fixup_eventlog_entry( Eventlog_entry * ee ); -- cgit From b94946697dc1d2915f6330f3a02cca7d69bc7cff Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 2 Feb 2009 13:38:38 +0100 Subject: s3-eventlog: pass down talloc context to parse_logentry(). Guenther --- 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 6f9474e3fb..19d131cb63 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6262,7 +6262,7 @@ ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only ) int elog_close_tdb( ELOG_TDB *etdb, bool force_close ); int write_eventlog_tdb( TDB_CONTEXT * the_tdb, Eventlog_entry * ee ); void fixup_eventlog_entry( Eventlog_entry * ee ); -bool parse_logentry( char *line, Eventlog_entry * entry, bool * eor ); +bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, Eventlog_entry * entry, bool * eor ); /* The following definitions come from rpc_server/srv_eventlog_nt.c */ -- cgit From cf3be5ce7a7f318cfb84baba4d1fc56ddd8f5497 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 15 Jan 2009 20:28:30 +0100 Subject: s3-eventlog: add evlog_pull_record_tdb function. Guenther --- 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 19d131cb63..bf4976ec49 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6263,6 +6263,9 @@ int elog_close_tdb( ELOG_TDB *etdb, bool force_close ); int write_eventlog_tdb( TDB_CONTEXT * the_tdb, Eventlog_entry * ee ); void fixup_eventlog_entry( Eventlog_entry * ee ); bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, Eventlog_entry * entry, bool * eor ); +struct eventlog_Record_tdb *evlog_pull_record_tdb(TALLOC_CTX *mem_ctx, + TDB_CONTEXT *tdb, + uint32_t record_number); /* The following definitions come from rpc_server/srv_eventlog_nt.c */ -- cgit From dd306249f23cacc01d6e6ea375450714109ebaa7 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 21 Jan 2009 19:36:19 +0100 Subject: s3-eventlog: add evlog_push_record_tdb function. This is almost a copy of write_eventlog_tdb() and still needs to be modified to use tdb transactions. Guenther --- source3/include/proto.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index bf4976ec49..5c68e12566 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6266,6 +6266,10 @@ bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, Eventlog_entry * entry, bo struct eventlog_Record_tdb *evlog_pull_record_tdb(TALLOC_CTX *mem_ctx, TDB_CONTEXT *tdb, uint32_t record_number); +NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx, + TDB_CONTEXT *tdb, + struct eventlog_Record_tdb *r, + uint32_t *record_number); /* The following definitions come from rpc_server/srv_eventlog_nt.c */ -- cgit From 16f83ae75003107084c50b8e45d1922889158d80 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 4 Feb 2009 10:01:38 +0100 Subject: s3-eventlog: add fixup_eventlog_record_tdb. Guenther --- 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 5c68e12566..0b58460beb 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6263,6 +6263,7 @@ int elog_close_tdb( ELOG_TDB *etdb, bool force_close ); int write_eventlog_tdb( TDB_CONTEXT * the_tdb, Eventlog_entry * ee ); void fixup_eventlog_entry( Eventlog_entry * ee ); bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, Eventlog_entry * entry, bool * eor ); +size_t fixup_eventlog_record_tdb(struct eventlog_Record_tdb *r); struct eventlog_Record_tdb *evlog_pull_record_tdb(TALLOC_CTX *mem_ctx, TDB_CONTEXT *tdb, uint32_t record_number); -- cgit From de7f0a70c8293f1b87f9c821f16fd3c6f7b184b7 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 2 Feb 2009 17:24:28 +0100 Subject: s3-eventlogadm: use struct eventlog_Record_tdb for storing entries in tdbs. Guenther --- 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 0b58460beb..9f0caa2fa8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6262,7 +6262,7 @@ ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only ) int elog_close_tdb( ELOG_TDB *etdb, bool force_close ); int write_eventlog_tdb( TDB_CONTEXT * the_tdb, Eventlog_entry * ee ); void fixup_eventlog_entry( Eventlog_entry * ee ); -bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, Eventlog_entry * entry, bool * eor ); +bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, struct eventlog_Record_tdb *entry, bool * eor ); size_t fixup_eventlog_record_tdb(struct eventlog_Record_tdb *r); struct eventlog_Record_tdb *evlog_pull_record_tdb(TALLOC_CTX *mem_ctx, TDB_CONTEXT *tdb, -- cgit From df5e231a6fad8c913881432294432e8feef6ea9f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 29 Jan 2009 15:11:39 +0100 Subject: s3-eventlog: add evlog_evt_entry_to_tdb_entry. Guenther --- 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 9f0caa2fa8..bb9d87eb53 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6271,6 +6271,9 @@ NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx, TDB_CONTEXT *tdb, struct eventlog_Record_tdb *r, uint32_t *record_number); +NTSTATUS evlog_evt_entry_to_tdb_entry(TALLOC_CTX *mem_ctx, + const struct EVENTLOGRECORD *e, + struct eventlog_Record_tdb *t); /* The following definitions come from rpc_server/srv_eventlog_nt.c */ -- cgit From 65200328eea3ab2179796ecf88a7ef276f8e2c9c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 4 Feb 2009 18:31:04 +0100 Subject: s3-eventlog: add evlog_tdb_entry_to_evt_entry. Guenther --- 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 bb9d87eb53..3ae2448e4b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6274,6 +6274,9 @@ NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx, NTSTATUS evlog_evt_entry_to_tdb_entry(TALLOC_CTX *mem_ctx, const struct EVENTLOGRECORD *e, struct eventlog_Record_tdb *t); +NTSTATUS evlog_tdb_entry_to_evt_entry(TALLOC_CTX *mem_ctx, + const struct eventlog_Record_tdb *t, + struct EVENTLOGRECORD *e); /* The following definitions come from rpc_server/srv_eventlog_nt.c */ -- cgit From 1b71fa5c59f3af4f096a640839c7d48b20b2266a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 3 Feb 2009 13:09:59 +0100 Subject: s3-eventlog: add evlog_pull_record function. Guenther --- 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 3ae2448e4b..0f9779f2f8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6271,6 +6271,9 @@ NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx, TDB_CONTEXT *tdb, struct eventlog_Record_tdb *r, uint32_t *record_number); +struct EVENTLOGRECORD *evlog_pull_record(TALLOC_CTX *mem_ctx, + TDB_CONTEXT *tdb, + uint32_t record_number); NTSTATUS evlog_evt_entry_to_tdb_entry(TALLOC_CTX *mem_ctx, const struct EVENTLOGRECORD *e, struct eventlog_Record_tdb *t); -- cgit From 63a992168db48568c91fe622e81141ca00c9bc45 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 3 Feb 2009 13:08:44 +0100 Subject: s3-eventlog: add evlog_push_record function. Guenther --- source3/include/proto.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 0f9779f2f8..68c4c8b8e3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6271,6 +6271,10 @@ NTSTATUS evlog_push_record_tdb(TALLOC_CTX *mem_ctx, TDB_CONTEXT *tdb, struct eventlog_Record_tdb *r, uint32_t *record_number); +NTSTATUS evlog_push_record(TALLOC_CTX *mem_ctx, + TDB_CONTEXT *tdb, + struct EVENTLOGRECORD *r, + uint32_t *record_number); struct EVENTLOGRECORD *evlog_pull_record(TALLOC_CTX *mem_ctx, TDB_CONTEXT *tdb, uint32_t record_number); -- cgit From 64e3a90530e4231fc9725652535a4881b149228a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 3 Feb 2009 20:48:43 +0100 Subject: s3-eventlog: make can_write_to_eventlog static. Guenther --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 68c4c8b8e3..5cef54f82c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6257,7 +6257,6 @@ TDB_CONTEXT *elog_init_tdb( char *tdbfilename ); char *elog_tdbname(TALLOC_CTX *ctx, const char *name ); int elog_tdb_size( TDB_CONTEXT * tdb, int *MaxSize, int *Retention ); bool prune_eventlog( TDB_CONTEXT * tdb ); -bool can_write_to_eventlog( TDB_CONTEXT * tdb, int32 needed ); ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only ); int elog_close_tdb( ELOG_TDB *etdb, bool force_close ); int write_eventlog_tdb( TDB_CONTEXT * the_tdb, Eventlog_entry * ee ); -- cgit From 7ade5cf776a4aa04ae578cfeb46a54bfde53700f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 4 Feb 2009 21:32:20 +0100 Subject: s3-eventlog: remove old hand marshalling for eventlog read call. Guenther --- source3/include/proto.h | 12 ------------ source3/include/rpc_eventlog.h | 19 ------------------- 2 files changed, 31 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 5cef54f82c..9067dcd4dc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5677,14 +5677,6 @@ uint32 size_of_relative_string(UNISTR *string); /* The following definitions come from rpc_parse/parse_eventlog.c */ -bool eventlog_io_q_read_eventlog(const char *desc, EVENTLOG_Q_READ_EVENTLOG *q_u, - prs_struct *ps, int depth); -bool eventlog_io_r_read_eventlog(const char *desc, - EVENTLOG_Q_READ_EVENTLOG *q_u, - EVENTLOG_R_READ_EVENTLOG *r_u, - prs_struct *ps, - int depth); - /* The following definitions come from rpc_parse/parse_misc.c */ bool smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth); @@ -6286,10 +6278,6 @@ NTSTATUS evlog_tdb_entry_to_evt_entry(TALLOC_CTX *mem_ctx, /* The following definitions come from rpc_server/srv_eventlog_nt.c */ -NTSTATUS _eventlog_read_eventlog( pipes_struct * p, - EVENTLOG_Q_READ_EVENTLOG * q_u, - EVENTLOG_R_READ_EVENTLOG * r_u ); - /* The following definitions come from rpc_server/srv_lsa_hnd.c */ bool init_pipe_handle_list(pipes_struct *p, diff --git a/source3/include/rpc_eventlog.h b/source3/include/rpc_eventlog.h index f17e448d9e..43bbc18285 100644 --- a/source3/include/rpc_eventlog.h +++ b/source3/include/rpc_eventlog.h @@ -37,14 +37,6 @@ /***********************************/ -typedef struct -{ - POLICY_HND handle; - uint32 flags; - uint32 offset; - uint32 max_read_size; -} EVENTLOG_Q_READ_EVENTLOG; - typedef struct { uint32 length; uint32 reserved1; @@ -85,16 +77,5 @@ typedef struct eventlog_entry { uint8 *end_of_data_padding; struct eventlog_entry *next; } Eventlog_entry; - -typedef struct { - uint32 num_bytes_in_resp; - uint32 bytes_in_next_record; - uint32 num_records; - Eventlog_entry *entry; - uint8 *end_of_entries_padding; - uint32 sent_size; - uint32 real_size; - NTSTATUS status; -} EVENTLOG_R_READ_EVENTLOG; #endif /* _RPC_EVENTLOG_H */ -- cgit From 8b126e942d5251cc7be08634dd73a598f8a834eb Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 3 Feb 2009 14:14:39 +0100 Subject: s3-eventlog: remove write_eventlog_tdb. Guenther --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 9067dcd4dc..db45d979cb 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6251,7 +6251,6 @@ int elog_tdb_size( TDB_CONTEXT * tdb, int *MaxSize, int *Retention ); bool prune_eventlog( TDB_CONTEXT * tdb ); ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only ); int elog_close_tdb( ELOG_TDB *etdb, bool force_close ); -int write_eventlog_tdb( TDB_CONTEXT * the_tdb, Eventlog_entry * ee ); void fixup_eventlog_entry( Eventlog_entry * ee ); bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, struct eventlog_Record_tdb *entry, bool * eor ); size_t fixup_eventlog_record_tdb(struct eventlog_Record_tdb *r); -- cgit From d7e2384dba448753580c698cb3b460ba8849ccb9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 4 Feb 2009 21:42:32 +0100 Subject: s3-eventlog: remove fixup_eventlog_entry. Guenther --- source3/include/proto.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index db45d979cb..f1580cbb55 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6251,7 +6251,6 @@ int elog_tdb_size( TDB_CONTEXT * tdb, int *MaxSize, int *Retention ); bool prune_eventlog( TDB_CONTEXT * tdb ); ELOG_TDB *elog_open_tdb( const char *logname, bool force_clear, bool read_only ); int elog_close_tdb( ELOG_TDB *etdb, bool force_close ); -void fixup_eventlog_entry( Eventlog_entry * ee ); bool parse_logentry( TALLOC_CTX *mem_ctx, char *line, struct eventlog_Record_tdb *entry, bool * eor ); size_t fixup_eventlog_record_tdb(struct eventlog_Record_tdb *r); struct eventlog_Record_tdb *evlog_pull_record_tdb(TALLOC_CTX *mem_ctx, -- cgit From a63d4c5ed1d6fc6dd253d5bf99edbef7d9d0341b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 4 Feb 2009 21:49:06 +0100 Subject: s3-eventlog: remove old eventlog server. Guenther --- source3/include/proto.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f1580cbb55..6987e9968b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6238,11 +6238,6 @@ bool spoolss_io_r_xcvdataport(const char *desc, SPOOL_R_XCVDATAPORT *r_u, prs_st bool make_monitorui_buf( RPC_BUFFER *buf, const char *dllname ); bool convert_port_data_1( NT_PORT_DATA_1 *port1, RPC_BUFFER *buf ) ; -/* The following definitions come from rpc_server/srv_eventlog.c */ - -NTSTATUS rpc_eventlog2_init(void); -void eventlog2_get_pipe_fns(struct api_struct **fns, int *n_fns); - /* The following definitions come from rpc_server/srv_eventlog_lib.c */ TDB_CONTEXT *elog_init_tdb( char *tdbfilename ); -- cgit From 8450e6677bfc2b42d7fe54fbf24c9f8ff07b40e1 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 4 Feb 2009 21:50:51 +0100 Subject: s3-eventlog: w00t! remove last traces of old eventlog rpc marshalling. spoolss, I'm coming! Guenther --- source3/include/includes.h | 1 - source3/include/proto.h | 2 -- source3/include/rpc_eventlog.h | 81 ------------------------------------------ 3 files changed, 84 deletions(-) delete mode 100644 source3/include/rpc_eventlog.h (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index ebd8923769..a20a17c33d 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -623,7 +623,6 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx); #include "reg_objects.h" #include "reg_db.h" #include "rpc_spoolss.h" -#include "rpc_eventlog.h" #include "rpc_perfcount.h" #include "rpc_perfcount_defs.h" #include "librpc/gen_ndr/notify.h" diff --git a/source3/include/proto.h b/source3/include/proto.h index 6987e9968b..88742c451d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5675,8 +5675,6 @@ bool smb_io_relarraystr(const char *desc, RPC_BUFFER *buffer, int depth, uint16 bool smb_io_relsecdesc(const char *desc, RPC_BUFFER *buffer, int depth, SEC_DESC **secdesc); uint32 size_of_relative_string(UNISTR *string); -/* The following definitions come from rpc_parse/parse_eventlog.c */ - /* The following definitions come from rpc_parse/parse_misc.c */ bool smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth); diff --git a/source3/include/rpc_eventlog.h b/source3/include/rpc_eventlog.h deleted file mode 100644 index 43bbc18285..0000000000 --- a/source3/include/rpc_eventlog.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * RPC Pipe client / server routines - * Copyright (C) Marcin Krzysztof Porwit 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 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 . - */ - -#ifndef _RPC_EVENTLOG_H /* _RPC_EVENTLOG_H */ -#define _RPC_EVENTLOG_H - -/* opcodes */ - -#define EVENTLOG_CLEAREVENTLOG 0x00 -#define EVENTLOG_CLOSEEVENTLOG 0x02 -#define EVENTLOG_GETNUMRECORDS 0x04 -#define EVENTLOG_GETOLDESTENTRY 0x05 -#define EVENTLOG_OPENEVENTLOG 0x07 -#define EVENTLOG_READEVENTLOG 0x0a - -/* Eventlog read flags */ -/* defined in librpc/gen_ndr/eventlog.h */ - -/* Event types */ -/* defined in librpc/gen_ndr/eventlog.h */ - -/***********************************/ - -typedef struct { - uint32 length; - uint32 reserved1; - uint32 record_number; - uint32 time_generated; - uint32 time_written; - uint32 event_id; - uint16 event_type; - uint16 num_strings; - uint16 event_category; - uint16 reserved2; - uint32 closing_record_number; - uint32 string_offset; - uint32 user_sid_length; - uint32 user_sid_offset; - uint32 data_length; - uint32 data_offset; -} Eventlog_record; - -typedef struct { - uint32 source_name_len; - smb_ucs2_t *source_name; - uint32 computer_name_len; - smb_ucs2_t *computer_name; - uint32 sid_padding; - smb_ucs2_t *sid; - uint32 strings_len; - smb_ucs2_t *strings; - uint32 user_data_len; - char *user_data; - uint32 data_padding; -} Eventlog_data_record; - -typedef struct eventlog_entry { - Eventlog_record record; - Eventlog_data_record data_record; - uint8 *data; - uint8 *end_of_data_padding; - struct eventlog_entry *next; -} Eventlog_entry; - -#endif /* _RPC_EVENTLOG_H */ -- cgit From e28a806a6b65320e5727a4237da57f879c509d26 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 4 Feb 2009 23:49:43 +0100 Subject: s3-parsing: remove a lot of unused structures and their hand marshalling. Guenther --- source3/include/proto.h | 62 -------------- source3/include/rpc_misc.h | 201 --------------------------------------------- 2 files changed, 263 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 88742c451d..53781563df 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5679,86 +5679,25 @@ uint32 size_of_relative_string(UNISTR *string); bool smb_io_time(const char *desc, NTTIME *nttime, prs_struct *ps, int depth); bool smb_io_nttime(const char *desc, prs_struct *ps, int depth, NTTIME *nttime); -uint32 get_enum_hnd(ENUM_HND *enh); -void init_enum_hnd(ENUM_HND *enh, uint32 hnd); -bool smb_io_enum_hnd(const char *desc, ENUM_HND *hnd, prs_struct *ps, int depth); bool smb_io_dom_sid(const char *desc, DOM_SID *sid, prs_struct *ps, int depth); -void init_dom_sid2(DOM_SID2 *sid2, const DOM_SID *sid); -bool smb_io_dom_sid2_p(const char *desc, prs_struct *ps, int depth, DOM_SID2 **sid2); -bool smb_io_dom_sid2(const char *desc, DOM_SID2 *sid, prs_struct *ps, int depth); bool smb_io_uuid(const char *desc, struct GUID *uuid, prs_struct *ps, int depth); -void init_str_hdr(STRHDR *hdr, int max_len, int len, uint32 buffer); -bool smb_io_strhdr(const char *desc, STRHDR *hdr, prs_struct *ps, int depth); -void init_uni_hdr(UNIHDR *hdr, UNISTR2 *str2); -bool smb_io_unihdr(const char *desc, UNIHDR *hdr, prs_struct *ps, int depth); -void init_buf_hdr(BUFHDR *hdr, int max_len, int len); -bool smb_io_hdrbuf_pre(const char *desc, BUFHDR *hdr, prs_struct *ps, int depth, uint32 *offset); -bool smb_io_hdrbuf_post(const char *desc, BUFHDR *hdr, prs_struct *ps, int depth, - uint32 ptr_hdrbuf, uint32 max_len, uint32 len); -bool smb_io_hdrbuf(const char *desc, BUFHDR *hdr, prs_struct *ps, int depth); void init_unistr(UNISTR *str, const char *buf); bool smb_io_unistr(const char *desc, UNISTR *uni, prs_struct *ps, int depth); -void init_rpc_blob_uint32(RPC_DATA_BLOB *str, uint32 val); -void init_rpc_blob_str(RPC_DATA_BLOB *str, const char *buf, int len); -void init_rpc_blob_hex(RPC_DATA_BLOB *str, const char *buf); -void init_rpc_blob_bytes(RPC_DATA_BLOB *str, uint8 *buf, size_t len); bool smb_io_buffer5(const char *desc, BUFFER5 *buf5, prs_struct *ps, int depth); void init_buf_unistr2(UNISTR2 *str, uint32 *ptr, const char *buf); void copy_unistr2(UNISTR2 *str, const UNISTR2 *from); -void init_string2(STRING2 *str, const char *buf, size_t max_len, size_t str_len); -bool smb_io_string2(const char *desc, STRING2 *str2, uint32 buffer, prs_struct *ps, int depth); void init_unistr2(UNISTR2 *str, const char *buf, enum unistr2_term_codes flags); -void init_unistr4(UNISTR4 *uni4, const char *buf, enum unistr2_term_codes flags); -void init_unistr4_w( TALLOC_CTX *ctx, UNISTR4 *uni4, const smb_ucs2_t *buf ); void init_unistr2_w(TALLOC_CTX *ctx, UNISTR2 *str, const smb_ucs2_t *buf); void init_unistr2_from_unistr(TALLOC_CTX *ctx, UNISTR2 *to, const UNISTR *from); void init_unistr2_from_datablob(UNISTR2 *str, DATA_BLOB *blob) ; bool prs_io_unistr2_p(const char *desc, prs_struct *ps, int depth, UNISTR2 **uni2); bool prs_io_unistr2(const char *desc, prs_struct *ps, int depth, UNISTR2 *uni2 ); bool smb_io_unistr2(const char *desc, UNISTR2 *uni2, uint32 buffer, prs_struct *ps, int depth); -bool prs_unistr4(const char *desc, prs_struct *ps, int depth, UNISTR4 *uni4); -bool prs_unistr4_hdr(const char *desc, prs_struct *ps, int depth, UNISTR4 *uni4); -bool prs_unistr4_str(const char *desc, prs_struct *ps, int depth, UNISTR4 *uni4); -bool prs_unistr4_array(const char *desc, prs_struct *ps, int depth, UNISTR4_ARRAY *array ); -bool init_unistr4_array( UNISTR4_ARRAY *array, uint32 count, const char **strings ); -void init_dom_rid(DOM_RID *prid, uint32 rid, uint16 type, uint32 idx); -bool smb_io_dom_rid(const char *desc, DOM_RID *rid, prs_struct *ps, int depth); -bool smb_io_dom_rid2(const char *desc, DOM_RID2 *rid, prs_struct *ps, int depth); -void init_dom_rid3(DOM_RID3 *rid3, uint32 rid, uint8 type); -bool smb_io_dom_rid3(const char *desc, DOM_RID3 *rid3, prs_struct *ps, int depth); -void init_dom_rid4(DOM_RID4 *rid4, uint16 unknown, uint16 attr, uint32 rid); -void init_clnt_srv(DOM_CLNT_SRV *logcln, const char *logon_srv, - const char *comp_name); -bool smb_io_clnt_srv(const char *desc, DOM_CLNT_SRV *logcln, prs_struct *ps, int depth); -void init_log_info(DOM_LOG_INFO *loginfo, const char *logon_srv, const char *acct_name, - uint16 sec_chan, const char *comp_name); -bool smb_io_log_info(const char *desc, DOM_LOG_INFO *loginfo, prs_struct *ps, int depth); -bool smb_io_chal(const char *desc, DOM_CHAL *chal, prs_struct *ps, int depth); -bool smb_io_cred(const char *desc, DOM_CRED *cred, prs_struct *ps, int depth); -void init_clnt_info2(DOM_CLNT_INFO2 *clnt, - const char *logon_srv, const char *comp_name, - const DOM_CRED *clnt_cred); -bool smb_io_clnt_info2(const char *desc, DOM_CLNT_INFO2 *clnt, prs_struct *ps, int depth); -void init_clnt_info(DOM_CLNT_INFO *clnt, - const char *logon_srv, const char *acct_name, - uint16 sec_chan, const char *comp_name, - const DOM_CRED *cred); -bool smb_io_clnt_info(const char *desc, DOM_CLNT_INFO *clnt, prs_struct *ps, int depth); -void init_logon_id(DOM_LOGON_ID *logonid, uint32 log_id_low, uint32 log_id_high); -bool smb_io_logon_id(const char *desc, DOM_LOGON_ID *logonid, prs_struct *ps, int depth); -void init_owf_info(OWF_INFO *hash, const uint8 data[16]); -bool smb_io_owf_info(const char *desc, OWF_INFO *hash, prs_struct *ps, int depth); -bool smb_io_gid(const char *desc, DOM_GID *gid, prs_struct *ps, int depth); bool smb_io_pol_hnd(const char *desc, POLICY_HND *pol, prs_struct *ps, int depth); void init_unistr3(UNISTR3 *str, const char *buf); bool smb_io_unistr3(const char *desc, UNISTR3 *name, prs_struct *ps, int depth); bool prs_uint64(const char *name, prs_struct *ps, int depth, uint64 *data64); -bool smb_io_bufhdr2(const char *desc, BUFHDR2 *hdr, prs_struct *ps, int depth); -bool smb_io_bufhdr4(const char *desc, BUFHDR4 *hdr, prs_struct *ps, int depth); -bool smb_io_rpc_blob(const char *desc, RPC_DATA_BLOB *blob, prs_struct *ps, int depth); -bool make_uni_hdr(UNIHDR *hdr, int len); -bool make_bufhdr2(BUFHDR2 *hdr, uint32 info_level, uint32 length, uint32 buffer); uint32 str_len_uni(UNISTR *source); bool policy_handle_is_valid(const POLICY_HND *hnd); @@ -5816,7 +5755,6 @@ bool prs_uint16s(bool charmode, const char *name, prs_struct *ps, int depth, uin 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_buffer5(bool charmode, const char *name, prs_struct *ps, int depth, BUFFER5 *str); -bool prs_string2(bool charmode, const char *name, prs_struct *ps, int depth, STRING2 *str); bool prs_unistr2(bool charmode, const char *name, prs_struct *ps, int depth, UNISTR2 *str); bool prs_unistr3(bool charmode, const char *name, UNISTR3 *str, prs_struct *ps, int depth); bool prs_unistr(const char *name, prs_struct *ps, int depth, UNISTR *str); diff --git a/source3/include/rpc_misc.h b/source3/include/rpc_misc.h index 3a3c61ecec..1e9d43bfa0 100644 --- a/source3/include/rpc_misc.h +++ b/source3/include/rpc_misc.h @@ -92,10 +92,6 @@ 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" : \ @@ -103,53 +99,6 @@ typedef struct { ((unsigned int)sys_getpid() ) -/********************************************************************** - * Buffer Headers -- use by SEC_DESC_BUF in winreg and netlogon code - **********************************************************************/ - -/* TODO: replace this with an encompassing buffer structure */ -typedef struct { - uint32 buf_max_len; - uint32 buf_len; -} BUFHDR; - -/* this is a BUFHDR + a pointer to a buffer */ -typedef struct { - uint32 info_level; - uint32 length; /* uint8 chars */ - uint32 buffer; -} BUFHDR2; - -/* generic buffer ? wrapped around void*? */ -typedef struct { - uint32 size; - uint32 buffer; -} BUFHDR4; - - -/********************************************************************** - * Buffers - **********************************************************************/ - -/* buffer used by \winreg\ calls to fill in arbitrary REG_XXX values. - It *may* look like a UNISTR2 but it is *not*. This is not a goof - by the winreg developers. It is a generic buffer. buffer length - is stored in bytes (not # of uint16's) */ - -typedef struct { - uint32 buf_max_len; - uint32 offset; - uint32 buf_len; - uint16 *buffer; -} REGVAL_BUFFER; - -/* generic rpc version of the DATA_BLOB. Just a length and uint8 array */ - -typedef struct { - uint32 buf_len; - uint8 *buffer; -} RPC_DATA_BLOB; - /********************************************************************** * Buffers use by spoolss (i might be able to replace it with * an RPC_DATA_BLOB) @@ -161,22 +110,6 @@ typedef struct { } BUFFER5; -/********************************************************************** - * Unicode and basic string headers - **********************************************************************/ - -typedef struct { - uint16 str_str_len; - uint16 str_max_len; - uint32 buffer; /* non-zero */ -} STRHDR; - -typedef struct { - uint16 uni_str_len; - uint16 uni_max_len; - uint32 buffer; -} UNIHDR; - /********************************************************************** * UNICODE string variations **********************************************************************/ @@ -205,138 +138,4 @@ typedef struct { /* UNISTR3 - XXXX not sure about this structure */ UNISTR str; } UNISTR3; -typedef struct { /* Buffer wrapped around a UNISTR2 */ - uint16 length; /* number of bytes not counting NULL terminatation */ - uint16 size; /* number of bytes including NULL terminatation */ - UNISTR2 *string; -} UNISTR4; - -typedef struct { - uint32 count; - UNISTR4 *strings; -} UNISTR4_ARRAY; - - -/********************************************************************** - * String variations - **********************************************************************/ - -typedef struct { /* STRING2 - string size (in uint8 chars) and buffer */ - uint32 str_max_len; - uint32 offset; - uint32 str_str_len; - uint8 *buffer; /* uint8 characters. **NOT** necessarily null-terminated */ -} STRING2; - - - - -/********************************************************************** - * Domain SID structures - **********************************************************************/ - -typedef struct { - uint32 num_auths; /* length, bytes, including length of len :-) */ - DOM_SID sid; -} DOM_SID2; - - -/********************************************************************** - * Domain SID structures - **********************************************************************/ - -/* DOM_RID - domain RID structure for ntlsa pipe */ -typedef struct { - uint16 type; /* value is SID_NAME_USE enum */ - uint32 rid; - uint32 rid_idx; /* referenced domain index */ -} DOM_RID; - -/* DOM_RID2 - second domain RID structure for ntlsa pipe */ -typedef struct { - uint16 type; /* value is SID_NAME_USE enum */ - uint32 rid; - uint32 rid_idx; /* referenced domain index */ - uint32 unknown; -} DOM_RID2; - -typedef struct { /* DOM_RID3 - domain RID structure for samr pipe */ - uint32 rid; /* domain-relative (to a SID) id */ - uint32 type1; /* value is 0x1 */ - uint32 ptr_type; /* undocumented pointer */ - uint32 type2; /* value is 0x1 */ - uint32 unk; /* value is 0x2 */ -} DOM_RID3; - -/* DOM_RID4 - rid + user attributes */ -typedef struct domrid4_info -{ - uint32 unknown; - uint16 attr; - uint32 rid; /* user RID */ -} DOM_RID4; - -/* DOM_GID - group id + user attributes */ -typedef struct { - uint32 g_rid; /* a group RID */ - uint32 attr; -} DOM_GID; - -/********************************************************************** - * ???? - **********************************************************************/ - -/* DOM_CLNT_SRV - client / server names */ -typedef struct clnt_srv_info { - uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ - UNISTR2 uni_logon_srv; /* logon server name */ - uint32 undoc_buffer2; /* undocumented 32 bit buffer pointer */ - UNISTR2 uni_comp_name; /* client machine name */ -} DOM_CLNT_SRV; - -/* DOM_LOG_INFO - login info */ -typedef struct log_info { - uint32 undoc_buffer; /* undocumented 32 bit buffer pointer */ - UNISTR2 uni_logon_srv; /* logon server name */ - UNISTR2 uni_acct_name; /* account name */ - uint16 sec_chan; /* secure channel type */ - UNISTR2 uni_comp_name; /* client machine name */ -} DOM_LOG_INFO; - -/* DOM_CHAL - challenge info */ -typedef struct chal_info { - unsigned char data[8]; /* credentials */ -} DOM_CHAL; - -/* DOM_CREDs - timestamped client or server credentials */ -typedef struct cred_info { - DOM_CHAL challenge; /* credentials */ - UTIME timestamp; /* credential time-stamp */ -} DOM_CRED; - -/* DOM_CLNT_INFO - client info */ -typedef struct clnt_info { - DOM_LOG_INFO login; - DOM_CRED cred; -} DOM_CLNT_INFO; - -/* DOM_CLNT_INFO2 - client info */ -typedef struct clnt_info2 { - DOM_CLNT_SRV login; - uint32 ptr_cred; - DOM_CRED cred; -} DOM_CLNT_INFO2; - -/* DOM_LOGON_ID - logon id */ -typedef struct logon_info { - uint32 low; - uint32 high; -} DOM_LOGON_ID; - -/* OWF INFO */ -typedef struct owf_info { - uint8 data[16]; -} OWF_INFO; - - #endif /* _RPC_MISC_H */ -- cgit From ef098bd621b544a651636db4b7d6cdd777c83d18 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 5 Feb 2009 01:05:09 +0100 Subject: s3-lsa: move remaining lsa policy access_mask defines to idl. Guenther --- source3/include/includes.h | 1 - source3/include/rpc_lsa.h | 60 ---------------------------------------------- 2 files changed, 61 deletions(-) delete mode 100644 source3/include/rpc_lsa.h (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index a20a17c33d..4aa3c07343 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -619,7 +619,6 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx); #include "ntlmssp.h" #include "auth.h" #include "ntdomain.h" -#include "rpc_lsa.h" #include "reg_objects.h" #include "reg_db.h" #include "rpc_spoolss.h" diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h deleted file mode 100644 index 1dc5ba4a7b..0000000000 --- a/source3/include/rpc_lsa.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - 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) 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 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 . -*/ - -#ifndef _RPC_LSA_H /* _RPC_LSA_H */ -#define _RPC_LSA_H - -#define LSA_POLICY_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS |\ - LSA_POLICY_VIEW_LOCAL_INFORMATION |\ - LSA_POLICY_VIEW_AUDIT_INFORMATION |\ - LSA_POLICY_GET_PRIVATE_INFORMATION |\ - LSA_POLICY_TRUST_ADMIN |\ - LSA_POLICY_CREATE_ACCOUNT |\ - LSA_POLICY_CREATE_SECRET |\ - LSA_POLICY_CREATE_PRIVILEGE |\ - LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS |\ - LSA_POLICY_SET_AUDIT_REQUIREMENTS |\ - LSA_POLICY_AUDIT_LOG_ADMIN |\ - LSA_POLICY_SERVER_ADMIN |\ - LSA_POLICY_LOOKUP_NAMES ) - - -#define LSA_POLICY_READ ( STANDARD_RIGHTS_READ_ACCESS |\ - LSA_POLICY_VIEW_LOCAL_INFORMATION |\ - LSA_POLICY_VIEW_AUDIT_INFORMATION |\ - LSA_POLICY_GET_PRIVATE_INFORMATION) - -#define LSA_POLICY_WRITE ( STD_RIGHT_READ_CONTROL_ACCESS |\ - LSA_POLICY_TRUST_ADMIN |\ - LSA_POLICY_CREATE_ACCOUNT |\ - LSA_POLICY_CREATE_SECRET |\ - LSA_POLICY_CREATE_PRIVILEGE |\ - LSA_POLICY_SET_DEFAULT_QUOTA_LIMITS |\ - LSA_POLICY_SET_AUDIT_REQUIREMENTS |\ - LSA_POLICY_AUDIT_LOG_ADMIN |\ - LSA_POLICY_SERVER_ADMIN) - -#define LSA_POLICY_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS |\ - LSA_POLICY_VIEW_LOCAL_INFORMATION |\ - LSA_POLICY_LOOKUP_NAMES ) - -#endif /* _RPC_LSA_H */ -- cgit From 3f9daf434ab572044e4826d69dd6b7d6c963c547 Mon Sep 17 00:00:00 2001 From: Karolin Seeger Date: Thu, 5 Feb 2009 15:55:14 +0100 Subject: s3/libads: Change "ldap ssl:ads" parameter to "ldap ssl ads". Karolin --- 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 53781563df..267ee74482 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -3985,6 +3985,7 @@ bool lp_passdb_expand_explicit(void); char *lp_ldap_suffix(void); char *lp_ldap_admin_dn(void); int lp_ldap_ssl(void); +bool lp_ldap_ssl_ads(void); int lp_ldap_passwd_sync(void); bool lp_ldap_delete_dn(void); int lp_ldap_replication_sleep(void); -- cgit