diff -urN /usr/local/src/samba-4.5.5/build.sh /usr/local/src/samba-4.5.5_orig/build.sh --- /usr/local/src/samba-4.5.5/build.sh 2017-02-14 15:06:32 +0100 +++ /usr/local/src/samba-4.5.5_orig/build.sh 1970-01-01 01:00:00 +0100 @@ -1,30 +0,0 @@ -#!/bin/ksh - -export APPATH="/usr/local/itsvbuild/64" - -print "testing C++ compiler..." - -xlC_r -o /root/hello /root/hello.cpp >/dev/null 2>&1 -if [ $? -ne 0 ]; then -/root/bin/renew_lic.sh -else -print "C++ compiler OK" -fi - - -export CC="xlc_r" -export CXX="xlC_r" -#export PATH="$APPATH/bin:$PATH" -#export LIBPATH="/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" -#export LD_LIBRARY_PATH="/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" -export OBJECT_MODE=64 -export CFLAGS="-q64 -qmaxmem=-1 -qlanglvl=extc99 -qarch=pwr7 -DNDEBUG -DSYSV -D_AIX -D_AIX64 -D_AIX53 -D_AIX61 -D_AIX71 -D_ALL_SOURCE -DFUNCPROTO=15 -O2 -I/opt/freeware/include" -export CXXFLAGS=$CFLAGS -#export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -L/opt/freeware/lib64/python2.7 -Wl,-blibpath:/usr/local/samba4/lib:/usr/local/samba4/lib/private -Wl,-bexpfull -Wl,-b64 -Wl,-bnoipath -Wl,-bbigtoc" - -export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-bexpfull -Wl,-b64" - -#./buildtools/bin/waf configure -#gmake -./configure --prefix=/usr/local/samba4 --with-static-modules=ALL --nonshared-binary=ALL -#./configure --prefix=/usr/local/samba4 --with-shared-modules=ALL --builtin-libraries=ALL diff -urN /usr/local/src/samba-4.5.5/build_gcc.sh /usr/local/src/samba-4.5.5_orig/build_gcc.sh --- /usr/local/src/samba-4.5.5/build_gcc.sh 2017-02-14 09:42:40 +0100 +++ /usr/local/src/samba-4.5.5_orig/build_gcc.sh 1970-01-01 01:00:00 +0100 @@ -1,17 +0,0 @@ -#!/bin/ksh - -#export PATH="$APPATH/bin:$PATH" -#export LIBPATH="/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" -#export LD_LIBRARY_PATH="/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib" -export OBJECT_MODE=64 -export CC="gcc -maix64" -export CFLAGS="-mfull-toc -pthread -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I$APPATH/include -I/opt/freeware/include -w" -export CXX="g++ -maix64" -export CXXFLAGS=$CFLAGS -#export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -L/opt/freeware/lib64/python2.7 -Wl,-blibpath:/usr/local/samba4/lib:/usr/local/samba4/lib/private -Wl,-bexpfull -Wl,-b64 -Wl,-bnoipath -Wl,-bbigtoc" -export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-bexpfull -Wl,-b64" - -#./buildtools/bin/waf configure -#gmake -./configure --prefix=/usr/local/samba4 --with-static-modules=ALL --nonshared-binary=ALL --check-c-compiler=gcc -#./configure --prefix=/usr/local/samba4 --with-shared-modules=ALL --builtin-libraries=ALL Binary files /usr/local/src/samba-4.5.5/buildtools/wafsamba/pkgconfig.pyc and /usr/local/src/samba-4.5.5_orig/buildtools/wafsamba/pkgconfig.pyc differ diff -urN /usr/local/src/samba-4.5.5/lib/tdb/tools/tdbtool.c /usr/local/src/samba-4.5.5_orig/lib/tdb/tools/tdbtool.c --- /usr/local/src/samba-4.5.5/lib/tdb/tools/tdbtool.c 2017-02-09 10:46:40 +0100 +++ /usr/local/src/samba-4.5.5_orig/lib/tdb/tools/tdbtool.c 2016-08-11 09:51:04 +0200 @@ -36,13 +36,7 @@ TDB_DATA iterate_kbuf; char cmdline[1024]; static int disable_mmap; - - -/* To avoid name clashing, do not refactor to disable_lock. - * On AIX "system/filesys.h" includes which declares - * another function named disable_lock. -*/ -static int disable_tdblock; +static int disable_lock; enum commands { CMD_CREATE_TDB, @@ -266,7 +260,7 @@ tdb = tdb_open_ex(tdbname, 0, TDB_CLEAR_IF_FIRST | (disable_mmap?TDB_NOMMAP:0) | - (disable_tdblock?TDB_NOLOCK:0), + (disable_lock?TDB_NOLOCK:0), O_RDWR | O_CREAT | O_TRUNC, 0600, &log_ctx, NULL); if (!tdb) { printf("Could not create %s: %s\n", tdbname, strerror(errno)); @@ -281,7 +275,7 @@ if (tdb) tdb_close(tdb); tdb = tdb_open_ex(tdbname, 0, (disable_mmap?TDB_NOMMAP:0) | - (disable_tdblock?TDB_NOLOCK:0), + (disable_lock?TDB_NOLOCK:0), O_RDWR, 0600, &log_ctx, NULL); @@ -809,7 +803,7 @@ arg2len = 0; if (argv[1] && (strcmp(argv[1], "-l") == 0)) { - disable_tdblock = 1; + disable_lock = 1; argv[1] = argv[0]; argv += 1; argc -= 1; diff -urN /usr/local/src/samba-4.5.5/lib/util/time.c /usr/local/src/samba-4.5.5_orig/lib/util/time.c --- /usr/local/src/samba-4.5.5/lib/util/time.c 2017-02-09 10:37:30 +0100 +++ /usr/local/src/samba-4.5.5_orig/lib/util/time.c 2016-08-11 09:51:04 +0200 @@ -60,7 +60,7 @@ } #endif /* then try the monotonic clock: */ -#ifdef CUSTOM_CLOCK_MONOTONIC != CLOCK_REALTIME +#if CUSTOM_CLOCK_MONOTONIC != CLOCK_REALTIME if (clock_gettime(CUSTOM_CLOCK_MONOTONIC,tp) == 0) { return; } diff -urN /usr/local/src/samba-4.5.5/source3/utils/globals.h /usr/local/src/samba-4.5.5_orig/source3/utils/globals.h --- /usr/local/src/samba-4.5.5/source3/utils/globals.h 2017-02-13 12:36:48 +0100 +++ /usr/local/src/samba-4.5.5_orig/source3/utils/globals.h 1970-01-01 01:00:00 +0100 @@ -1,933 +0,0 @@ -/* - Unix SMB/Netbios implementation. - smbd globals - Copyright (C) Stefan Metzmacher 2009 - Copyright (C) Jeremy Allison 2010 - - 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 . -*/ - -#include "system/select.h" -#include "librpc/gen_ndr/smbXsrv.h" -#include "smbprofile.h" - -#ifdef USE_DMAPI -struct smbd_dmapi_context; -extern struct smbd_dmapi_context *dmapi_ctx; -#endif - -/* how many write cache buffers have been allocated */ -extern unsigned int allocated_write_caches; - -/* A singleton cache to speed up searching by dev/inode. */ -struct fsp_singleton_cache { - files_struct *fsp; - struct file_id id; -}; - -extern const struct mangle_fns *mangle_fns; - -extern unsigned char *chartest; -struct tdb_context; -extern struct tdb_context *tdb_mangled_cache; - -/* - this determines how many characters are used from the original filename - in the 8.3 mangled name. A larger value leads to a weaker hash and more collisions. - The largest possible value is 6. -*/ -extern unsigned mangle_prefix; - -struct msg_state; - -extern bool logged_ioctl_message; - -extern int trans_num; - -extern time_t last_smb_conf_reload_time; -extern time_t last_printer_reload_time; -extern pid_t background_lpq_updater_pid; - -/**************************************************************************** - structure to hold a linked list of queued messages. - for processing. -****************************************************************************/ -extern uint32_t common_flags2; - -extern struct smb_trans_enc_state *partial_srv_trans_enc_ctx; -extern struct smb_trans_enc_state *srv_trans_enc_ctx; - -struct sec_ctx { - struct security_unix_token ut; - struct security_token *token; -}; -/* A stack of security contexts. We include the current context as being - the first one, so there is room for another MAX_SEC_CTX_DEPTH more. */ -extern struct sec_ctx sec_ctx_stack[MAX_SEC_CTX_DEPTH + 1]; -extern int sec_ctx_stack_ndx; -extern bool become_uid_done; -extern bool become_gid_done; - -extern connection_struct *last_conn; -extern uint16_t last_flags; - -extern uint32_t global_client_caps; - -extern uint16_t fnf_handle; - -struct conn_ctx { - connection_struct *conn; - uint64_t vuid; -}; -/* A stack of current_user connection contexts. */ -extern struct conn_ctx conn_ctx_stack[MAX_SEC_CTX_DEPTH]; -extern int conn_ctx_stack_ndx; - -struct vfs_init_function_entry; -extern struct vfs_init_function_entry *backends; -extern char *sparse_buf; -extern char *LastDir; - -struct smbd_parent_context; -extern struct smbd_parent_context *am_parent; -extern struct memcache *smbd_memcache_ctx; -extern bool exit_firsttime; - -struct tstream_context; -struct smbd_smb2_request; - -DATA_BLOB negprot_spnego(TALLOC_CTX *ctx, struct smbXsrv_connection *xconn); - -void smbd_lock_socket(struct smbXsrv_connection *xconn); -void smbd_unlock_socket(struct smbXsrv_connection *xconn); - -NTSTATUS smbd_do_locking(struct smb_request *req, - files_struct *fsp, - uint8_t type, - int32_t timeout, - uint16_t num_locks, - struct smbd_lock_element *locks, - bool *async); -NTSTATUS smbd_do_unlocking(struct smb_request *req, - files_struct *fsp, - uint16_t num_ulocks, - struct smbd_lock_element *ulocks); - -NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn, - TALLOC_CTX *mem_ctx, - uint16_t info_level, - files_struct *fsp, - struct smb_filename *smb_fname, - bool delete_pending, - struct timespec write_time_ts, - struct ea_list *ea_list, - int lock_data_count, - char *lock_data, - uint16_t flags2, - unsigned int max_data_bytes, - size_t *fixed_portion, - char **ppdata, - unsigned int *pdata_size); - -NTSTATUS smbd_do_setfsinfo(connection_struct *conn, - struct smb_request *req, - TALLOC_CTX *mem_ctx, - uint16_t info_level, - files_struct *fsp, - const DATA_BLOB *pdata); - -NTSTATUS smbd_do_setfilepathinfo(connection_struct *conn, - struct smb_request *req, - TALLOC_CTX *mem_ctx, - uint16_t info_level, - files_struct *fsp, - struct smb_filename *smb_fname, - char **ppdata, int total_data, - int *ret_data_size); - -NTSTATUS smbd_do_qfsinfo(struct smbXsrv_connection *xconn, - connection_struct *conn, - TALLOC_CTX *mem_ctx, - uint16_t info_level, - uint16_t flags2, - unsigned int max_data_bytes, - size_t *fixed_portion, - struct smb_filename *smb_fname, - char **ppdata, - int *ret_data_len); - -bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, - struct dptr_struct *dirptr, - const char *mask, - uint32_t dirtype, - bool dont_descend, - bool ask_sharemode, - bool (*match_fn)(TALLOC_CTX *ctx, - void *private_data, - const char *dname, - const char *mask, - char **_fname), - bool (*mode_fn)(TALLOC_CTX *ctx, - void *private_data, - struct smb_filename *smb_fname, - uint32_t *_mode), - void *private_data, - char **_fname, - struct smb_filename **_smb_fname, - uint32_t *_mode, - long *_prev_offset); - -NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx, - connection_struct *conn, - struct dptr_struct *dirptr, - uint16_t flags2, - const char *path_mask, - uint32_t dirtype, - int info_level, - int requires_resume_key, - bool dont_descend, - bool ask_sharemode, - uint8_t align, - bool do_pad, - char **ppdata, - char *base_data, - char *end_data, - int space_remaining, - bool *got_exact_match, - int *_last_entry_off, - struct ea_list *name_list); - -NTSTATUS smbd_calculate_access_mask(connection_struct *conn, - const struct smb_filename *smb_fname, - bool use_privs, - uint32_t access_mask, - uint32_t *access_mask_out); - -void smbd_notify_cancel_by_smbreq(const struct smb_request *smbreq); - -void smbd_server_connection_terminate_ex(struct smbXsrv_connection *xconn, - const char *reason, - const char *location); -#define smbd_server_connection_terminate(xconn, reason) \ - smbd_server_connection_terminate_ex(xconn, reason, __location__) - -const char *smb2_opcode_name(uint16_t opcode); -bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size); - -NTSTATUS smbd_add_connection(struct smbXsrv_client *client, int sock_fd, - struct smbXsrv_connection **_xconn); - -void reply_smb2002(struct smb_request *req, uint16_t choice); -void reply_smb20ff(struct smb_request *req, uint16_t choice); -void smbd_smb2_process_negprot(struct smbXsrv_connection *xconn, - uint64_t expected_seq_low, - const uint8_t *inpdu, size_t size); - -DATA_BLOB smbd_smb2_generate_outbody(struct smbd_smb2_request *req, size_t size); - -NTSTATUS smbd_smb2_request_error_ex(struct smbd_smb2_request *req, - NTSTATUS status, - DATA_BLOB *info, - const char *location); -#define smbd_smb2_request_error(req, status) \ - smbd_smb2_request_error_ex(req, status, NULL, __location__) -NTSTATUS smbd_smb2_request_done_ex(struct smbd_smb2_request *req, - NTSTATUS status, - DATA_BLOB body, DATA_BLOB *dyn, - const char *location); -#define smbd_smb2_request_done(req, body, dyn) \ - smbd_smb2_request_done_ex(req, NT_STATUS_OK, body, dyn, __location__) - -NTSTATUS smbd_smb2_send_oplock_break(struct smbXsrv_connection *xconn, - struct smbXsrv_session *session, - struct smbXsrv_tcon *tcon, - struct smbXsrv_open *op, - uint8_t oplock_level); -NTSTATUS smbd_smb2_send_lease_break(struct smbXsrv_connection *xconn, - uint16_t new_epoch, - uint32_t lease_flags, - struct smb2_lease_key *lease_key, - uint32_t current_lease_state, - uint32_t new_lease_state); - -NTSTATUS smbd_smb2_request_pending_queue(struct smbd_smb2_request *req, - struct tevent_req *subreq, - uint32_t defer_time); - -struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req); -size_t smbd_smb2_unread_bytes(struct smbd_smb2_request *req); -void remove_smb2_chained_fsp(files_struct *fsp); - -NTSTATUS smbd_smb2_request_verify_creditcharge(struct smbd_smb2_request *req, - uint32_t data_length); - -NTSTATUS smbd_smb2_request_verify_sizes(struct smbd_smb2_request *req, - size_t expected_body_size); - -enum protocol_types smbd_smb2_protocol_dialect_match(const uint8_t *indyn, - const int dialect_count, - uint16_t *dialect); -NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_logoff(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_tcon(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_tdis(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_create(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_close(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_flush(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_read(struct smbd_smb2_request *req); -NTSTATUS smb2_read_complete(struct tevent_req *req, ssize_t nread, int err); -NTSTATUS smbd_smb2_request_process_write(struct smbd_smb2_request *req); -NTSTATUS smb2_write_complete(struct tevent_req *req, ssize_t nwritten, int err); -NTSTATUS smb2_write_complete_nosync(struct tevent_req *req, ssize_t nwritten, - int err); -NTSTATUS smbd_smb2_request_process_lock(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_ioctl(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_keepalive(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_query_directory(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_getinfo(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_setinfo(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_process_break(struct smbd_smb2_request *req); -NTSTATUS smbd_smb2_request_dispatch(struct smbd_smb2_request *req); -void smbd_smb2_request_dispatch_immediate(struct tevent_context *ctx, - struct tevent_immediate *im, - void *private_data); - -struct deferred_open_record; - -/* SMB1 -> SMB2 glue. */ -void send_break_message_smb2(files_struct *fsp, - uint32_t break_from, - uint32_t break_to); -struct blocking_lock_record *get_pending_smb2req_blr(struct smbd_smb2_request *smb2req); -bool push_blocking_lock_request_smb2( struct byte_range_lock *br_lck, - struct smb_request *req, - files_struct *fsp, - int lock_timeout, - int lock_num, - uint64_t smblctx, - enum brl_type lock_type, - enum brl_flavour lock_flav, - uint64_t offset, - uint64_t count, - uint64_t blocking_smblctx); -void process_blocking_lock_queue_smb2( - struct smbd_server_connection *sconn, struct timeval tv_curr); -void cancel_pending_lock_requests_by_fid_smb2(files_struct *fsp, - struct byte_range_lock *br_lck, - enum file_close_type close_type); -/* From smbd/smb2_create.c */ -int map_smb2_oplock_levels_to_samba(uint8_t in_oplock_level); -bool get_deferred_open_message_state_smb2(struct smbd_smb2_request *smb2req, - struct timeval *p_request_time, - struct deferred_open_record **open_rec); -bool open_was_deferred_smb2( - struct smbXsrv_connection *xconn, uint64_t mid); -void remove_deferred_open_message_smb2( - struct smbXsrv_connection *xconn, uint64_t mid); -bool schedule_deferred_open_message_smb2( - struct smbXsrv_connection *xconn, uint64_t mid); -bool push_deferred_open_message_smb2(struct smbd_smb2_request *smb2req, - struct timeval request_time, - struct timeval timeout, - struct file_id id, - struct deferred_open_record *open_rec); - -struct smbXsrv_client; - -struct smbXsrv_preauth { - uint8_t sha512_value[64]; -}; - -struct smbXsrv_connection { - struct smbXsrv_connection *prev, *next; - - struct smbXsrv_client *client; - - - const struct tsocket_address *local_address; - const struct tsocket_address *remote_address; - const char *remote_hostname; - - struct tevent_context *ev_ctx; - struct messaging_context *msg_ctx; - - enum protocol_types protocol; - - struct { - NTSTATUS status; - int sock; - struct tevent_fd *fde; - - struct { - bool got_session; - } nbt; - } transport; - - struct { - struct { - /* - * fd for the fcntl lock and process shared - * robust mutex to coordinate access to the - * client socket. When the system supports - * process shared robust mutexes, those are - * used. If not, then the fcntl lock will be - * used. - */ - int socket_lock_fd; -#ifdef HAVE_ROBUST_MUTEXES - pthread_mutex_t *socket_mutex; -#endif - - /* - * fd for the trusted pipe from - * echo handler child - */ - int trusted_fd; - - /* - * fde for the trusted_fd - */ - struct tevent_fd *trusted_fde; - - /* - * Reference count for the fcntl lock to - * allow recursive locks. - */ - int ref_count; - } echo_handler; - - struct { - bool encrypted_passwords; - bool spnego; - struct auth4_context *auth_context; - bool done; - /* - * Size of the data we can receive. Set by us. - * Can be modified by the max xmit parameter. - */ - int max_recv; - } negprot; - - struct { - bool done_sesssetup; - /* - * Size of data we can send to client. Set - * by the client for all protocols above CORE. - * Set by us for CORE protocol. - */ - int max_send; - } sessions; - struct smb_signing_state *signing_state; - - struct { - uint16_t client_major; - uint16_t client_minor; - uint32_t client_cap_low; - uint32_t client_cap_high; - } unix_info; - - struct msg_state *msg_state; - } smb1; - struct { - struct smbd_smb2_request_read_state { - struct smbd_smb2_request *req; - struct { - uint8_t nbt[NBT_HDR_SIZE]; - bool done; - } hdr; - struct iovec vector; - bool doing_receivefile; - size_t min_recv_size; - size_t pktfull; - size_t pktlen; - uint8_t *pktbuf; - } request_read_state; - struct smbd_smb2_send_queue *send_queue; - size_t send_queue_len; - - struct { - /* - * seq_low is the lowest sequence number - * we will accept. - */ - uint64_t seq_low; - /* - * seq_range is the range of credits we have - * granted from the sequence windows starting - * at seq_low. - * - * This gets incremented when new credits are - * granted and gets decremented when the - * lowest sequence number is consumed - * (when seq_low gets incremented). - */ - uint16_t seq_range; - /* - * The number of credits we have currently granted - * to the client. - * - * This gets incremented when new credits are - * granted and gets decremented when any credit - * is comsumed. - * - * Note: the decrementing is different compared - * to seq_range. - */ - uint16_t granted; - /* - * The maximum number of credits we will ever - * grant to the client. - * - * Typically we will only grant 1/16th of - * max_credits. - * - * This is the "server max credits" parameter. - */ - uint16_t max; - /* - * a bitmap of size max_credits - */ - struct bitmap *bitmap; - bool multicredit; - } credits; - - bool allow_2ff; - struct { - uint32_t capabilities; - struct GUID guid; - bool guid_verified; - uint16_t security_mode; - uint16_t num_dialects; - uint16_t *dialects; - } client; - struct { - uint32_t capabilities; - struct GUID guid; - uint16_t security_mode; - uint16_t dialect; - uint32_t max_trans; - uint32_t max_read; - uint32_t max_write; - uint16_t cipher; - } server; - - struct smbXsrv_preauth preauth; - - struct smbd_smb2_request *requests; - } smb2; -}; - -const char *smbXsrv_connection_dbg(const struct smbXsrv_connection *xconn); - -NTSTATUS smbXsrv_version_global_init(const struct server_id *server_id); -uint32_t smbXsrv_version_global_current(void); - -struct smbXsrv_client_table; -NTSTATUS smbXsrv_client_global_init(void); -NTSTATUS smbXsrv_client_create(TALLOC_CTX *mem_ctx, - struct tevent_context *ev_ctx, - struct messaging_context *msg_ctx, - NTTIME now, - struct smbXsrv_client **_client); -NTSTATUS smbXsrv_client_update(struct smbXsrv_client *client); -NTSTATUS smbXsrv_client_remove(struct smbXsrv_client *client); -NTSTATUS smb2srv_client_lookup_global(struct smbXsrv_client *client, - struct GUID client_guid, - TALLOC_CTX *mem_ctx, - struct smbXsrv_client_global0 **_pass); -NTSTATUS smb2srv_client_connection_pass(struct smbd_smb2_request *smb2req, - struct smbXsrv_client_global0 *global); - -NTSTATUS smbXsrv_connection_init_tables(struct smbXsrv_connection *conn, - enum protocol_types protocol); - -NTSTATUS smbXsrv_session_global_init(struct messaging_context *msg_ctx); -NTSTATUS smbXsrv_session_create(struct smbXsrv_connection *conn, - NTTIME now, - struct smbXsrv_session **_session); -NTSTATUS smbXsrv_session_add_channel(struct smbXsrv_session *session, - struct smbXsrv_connection *conn, - struct smbXsrv_channel_global0 **_c); -NTSTATUS smbXsrv_session_update(struct smbXsrv_session *session); -struct smbXsrv_channel_global0; -NTSTATUS smbXsrv_session_find_channel(const struct smbXsrv_session *session, - const struct smbXsrv_connection *conn, - struct smbXsrv_channel_global0 **_c); -NTSTATUS smbXsrv_session_find_auth(const struct smbXsrv_session *session, - const struct smbXsrv_connection *conn, - NTTIME now, - struct smbXsrv_session_auth0 **_a); -NTSTATUS smbXsrv_session_create_auth(struct smbXsrv_session *session, - struct smbXsrv_connection *conn, - NTTIME now, - uint8_t in_flags, - uint8_t in_security_mode, - struct smbXsrv_session_auth0 **_a); -struct tevent_req *smb2srv_session_shutdown_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct smbXsrv_session *session, - struct smbd_smb2_request *current_req); -NTSTATUS smb2srv_session_shutdown_recv(struct tevent_req *req); -NTSTATUS smbXsrv_session_logoff(struct smbXsrv_session *session); -NTSTATUS smbXsrv_session_logoff_all(struct smbXsrv_connection *conn); -NTSTATUS smb1srv_session_table_init(struct smbXsrv_connection *conn); -NTSTATUS smb1srv_session_lookup(struct smbXsrv_connection *conn, - uint16_t vuid, NTTIME now, - struct smbXsrv_session **session); -NTSTATUS smb2srv_session_table_init(struct smbXsrv_connection *conn); -NTSTATUS smb2srv_session_lookup_conn(struct smbXsrv_connection *conn, - uint64_t session_id, NTTIME now, - struct smbXsrv_session **session); -NTSTATUS smb2srv_session_lookup_client(struct smbXsrv_client *client, - uint64_t session_id, NTTIME now, - struct smbXsrv_session **session); -struct smbXsrv_session_global0; -NTSTATUS smbXsrv_session_global_traverse( - int (*fn)(struct smbXsrv_session_global0 *, void *), - void *private_data); -struct tevent_req *smb2srv_session_close_previous_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct smbXsrv_connection *conn, - struct auth_session_info *session_info, - uint64_t previous_session_id, - uint64_t current_session_id); -NTSTATUS smb2srv_session_close_previous_recv(struct tevent_req *req); - -NTSTATUS smbXsrv_tcon_global_init(void); -NTSTATUS smbXsrv_tcon_update(struct smbXsrv_tcon *tcon); -NTSTATUS smbXsrv_tcon_disconnect(struct smbXsrv_tcon *tcon, uint64_t vuid); -NTSTATUS smb1srv_tcon_table_init(struct smbXsrv_connection *conn); -NTSTATUS smb1srv_tcon_create(struct smbXsrv_connection *conn, - NTTIME now, - struct smbXsrv_tcon **_tcon); -NTSTATUS smb1srv_tcon_lookup(struct smbXsrv_connection *conn, - uint16_t tree_id, NTTIME now, - struct smbXsrv_tcon **tcon); -NTSTATUS smb1srv_tcon_disconnect_all(struct smbXsrv_connection *conn); -NTSTATUS smb2srv_tcon_table_init(struct smbXsrv_session *session); -NTSTATUS smb2srv_tcon_create(struct smbXsrv_session *session, - NTTIME now, - struct smbXsrv_tcon **_tcon); -NTSTATUS smb2srv_tcon_lookup(struct smbXsrv_session *session, - uint32_t tree_id, NTTIME now, - struct smbXsrv_tcon **tcon); -NTSTATUS smb2srv_tcon_disconnect_all(struct smbXsrv_session *session); -struct smbXsrv_tcon_global0; -NTSTATUS smbXsrv_tcon_global_traverse( - int (*fn)(struct smbXsrv_tcon_global0 *, void *), - void *private_data); - -NTSTATUS smbXsrv_open_global_init(void); -NTSTATUS smbXsrv_open_create(struct smbXsrv_connection *conn, - struct auth_session_info *session_info, - NTTIME now, - struct smbXsrv_open **_open); -uint32_t smbXsrv_open_hash(struct smbXsrv_open *_open); -NTSTATUS smbXsrv_open_update(struct smbXsrv_open *_open); -NTSTATUS smbXsrv_open_close(struct smbXsrv_open *op, NTTIME now); -NTSTATUS smb1srv_open_table_init(struct smbXsrv_connection *conn); -NTSTATUS smb1srv_open_lookup(struct smbXsrv_connection *conn, - uint16_t fnum, NTTIME now, - struct smbXsrv_open **_open); -NTSTATUS smb2srv_open_table_init(struct smbXsrv_connection *conn); -NTSTATUS smb2srv_open_lookup(struct smbXsrv_connection *conn, - uint64_t persistent_id, - uint64_t volatile_id, - NTTIME now, - struct smbXsrv_open **_open); -NTSTATUS smb2srv_open_lookup_replay_cache(struct smbXsrv_connection *conn, - const struct GUID *create_guid, - NTTIME now, - struct smbXsrv_open **_open); -NTSTATUS smb2srv_open_recreate(struct smbXsrv_connection *conn, - struct auth_session_info *session_info, - uint64_t persistent_id, - const struct GUID *create_guid, - NTTIME now, - struct smbXsrv_open **_open); -struct smbXsrv_open_global0; -NTSTATUS smbXsrv_open_global_traverse( - int (*fn)(struct smbXsrv_open_global0 *, void *), - void *private_data); - -NTSTATUS smbXsrv_open_cleanup(uint64_t persistent_id); -bool smbXsrv_is_encrypted(uint8_t encryption_flags); -bool smbXsrv_is_partially_encrypted(uint8_t encryption_flags); -bool smbXsrv_set_crypto_flag(uint8_t *flags, uint8_t flag); -bool smbXsrv_is_signed(uint8_t signing_flags); -bool smbXsrv_is_partially_signed(uint8_t signing_flags); - -struct smbd_smb2_send_queue { - struct smbd_smb2_send_queue *prev, *next; - - DATA_BLOB *sendfile_header; - NTSTATUS *sendfile_status; - struct iovec *vector; - int count; - - TALLOC_CTX *mem_ctx; -}; - -struct smbd_smb2_request { - struct smbd_smb2_request *prev, *next; - - struct smbd_server_connection *sconn; - struct smbXsrv_connection *xconn; - - struct smbd_smb2_send_queue queue_entry; - - /* the session the request operates on, maybe NULL */ - struct smbXsrv_session *session; - uint64_t last_session_id; - - /* the tcon the request operates on, maybe NULL */ - struct smbXsrv_tcon *tcon; - uint32_t last_tid; - - int current_idx; - bool do_signing; - /* Was the request encrypted? */ - bool was_encrypted; - /* Should we encrypt? */ - bool do_encryption; - struct tevent_timer *async_te; - bool compound_related; - - /* - * the encryption key for the whole - * compound chain - */ - DATA_BLOB first_key; - /* - * the signing key for the last - * request/response of a compound chain - */ - DATA_BLOB last_key; - struct smbXsrv_preauth *preauth; - - struct timeval request_time; - - SMBPROFILE_IOBYTES_ASYNC_STATE(profile); - - /* fake smb1 request. */ - struct smb_request *smb1req; - struct files_struct *compat_chain_fsp; - - /* - * Keep track of whether the outstanding request counters - * had been updated in dispatch, so that they need to be - * adapted again in reply. - */ - bool request_counters_updated; - - /* - * The sub request for async backend calls. - * This is used for SMB2 Cancel. - */ - struct tevent_req *subreq; - -#define SMBD_SMB2_TF_IOV_OFS 0 -#define SMBD_SMB2_HDR_IOV_OFS 1 -#define SMBD_SMB2_BODY_IOV_OFS 2 -#define SMBD_SMB2_DYN_IOV_OFS 3 - -#define SMBD_SMB2_NUM_IOV_PER_REQ 4 - -#define SMBD_SMB2_IOV_IDX_OFS(req,dir,idx,ofs) \ - (&req->dir.vector[(idx)+(ofs)]) - -#define SMBD_SMB2_IDX_TF_IOV(req,dir,idx) \ - SMBD_SMB2_IOV_IDX_OFS(req,dir,idx,SMBD_SMB2_TF_IOV_OFS) -#define SMBD_SMB2_IDX_HDR_IOV(req,dir,idx) \ - SMBD_SMB2_IOV_IDX_OFS(req,dir,idx,SMBD_SMB2_HDR_IOV_OFS) -#define SMBD_SMB2_IDX_BODY_IOV(req,dir,idx) \ - SMBD_SMB2_IOV_IDX_OFS(req,dir,idx,SMBD_SMB2_BODY_IOV_OFS) -#define SMBD_SMB2_IDX_DYN_IOV(req,dir,idx) \ - SMBD_SMB2_IOV_IDX_OFS(req,dir,idx,SMBD_SMB2_DYN_IOV_OFS) - -#define SMBD_SMB2_IN_TF_IOV(req) SMBD_SMB2_IDX_TF_IOV(req,in,req->current_idx) -#define SMBD_SMB2_IN_TF_PTR(req) (uint8_t *)(SMBD_SMB2_IN_TF_IOV(req)->iov_base) -#define SMBD_SMB2_IN_HDR_IOV(req) SMBD_SMB2_IDX_HDR_IOV(req,in,req->current_idx) -#define SMBD_SMB2_IN_HDR_PTR(req) (uint8_t *)(SMBD_SMB2_IN_HDR_IOV(req)->iov_base) -#define SMBD_SMB2_IN_BODY_IOV(req) SMBD_SMB2_IDX_BODY_IOV(req,in,req->current_idx) -#define SMBD_SMB2_IN_BODY_PTR(req) (uint8_t *)(SMBD_SMB2_IN_BODY_IOV(req)->iov_base) -#define SMBD_SMB2_IN_BODY_LEN(req) (SMBD_SMB2_IN_BODY_IOV(req)->iov_len) -#define SMBD_SMB2_IN_DYN_IOV(req) SMBD_SMB2_IDX_DYN_IOV(req,in,req->current_idx) -#define SMBD_SMB2_IN_DYN_PTR(req) (uint8_t *)(SMBD_SMB2_IN_DYN_IOV(req)->iov_base) -#define SMBD_SMB2_IN_DYN_LEN(req) (SMBD_SMB2_IN_DYN_IOV(req)->iov_len) - -#define SMBD_SMB2_OUT_TF_IOV(req) SMBD_SMB2_IDX_TF_IOV(req,out,req->current_idx) -#define SMBD_SMB2_OUT_TF_PTR(req) (uint8_t *)(SMBD_SMB2_OUT_TF_IOV(req)->iov_base) -#define SMBD_SMB2_OUT_HDR_IOV(req) SMBD_SMB2_IDX_HDR_IOV(req,out,req->current_idx) -#define SMBD_SMB2_OUT_HDR_PTR(req) (uint8_t *)(SMBD_SMB2_OUT_HDR_IOV(req)->iov_base) -#define SMBD_SMB2_OUT_BODY_IOV(req) SMBD_SMB2_IDX_BODY_IOV(req,out,req->current_idx) -#define SMBD_SMB2_OUT_BODY_PTR(req) (uint8_t *)(SMBD_SMB2_OUT_BODY_IOV(req)->iov_base) -#define SMBD_SMB2_OUT_BODY_LEN(req) (SMBD_SMB2_OUT_BODY_IOV(req)->iov_len) -#define SMBD_SMB2_OUT_DYN_IOV(req) SMBD_SMB2_IDX_DYN_IOV(req,out,req->current_idx) -#define SMBD_SMB2_OUT_DYN_PTR(req) (uint8_t *)(SMBD_SMB2_OUT_DYN_IOV(req)->iov_base) -#define SMBD_SMB2_OUT_DYN_LEN(req) (SMBD_SMB2_OUT_DYN_IOV(req)->iov_len) - -#define SMBD_SMB2_SHORT_RECEIVEFILE_WRITE_LEN (SMB2_HDR_BODY + 0x30) - - struct { - /* - * vector[0] TRANSPORT HEADER (empty) - * . - * vector[1] SMB2_TRANSFORM (optional) - * vector[2] SMB2 - * vector[3] fixed body - * vector[4] dynamic body - * . - * . - * . - * vector[5] SMB2_TRANSFORM (optional) - * vector[6] SMB2 - * vector[7] fixed body - * vector[8] dynamic body - * . - * . - * . - */ - struct iovec *vector; - int vector_count; - struct iovec _vector[1 + SMBD_SMB2_NUM_IOV_PER_REQ]; - } in; - struct { - /* the NBT header is not allocated */ - uint8_t nbt_hdr[4]; - /* - * vector[0] TRANSPORT HEADER - * . - * vector[1] SMB2_TRANSFORM (optional) - * vector[2] SMB2 - * vector[3] fixed body - * vector[4] dynamic body - * . - * . - * . - * vector[5] SMB2_TRANSFORM (empty) - * vector[6] SMB2 - * vector[7] fixed body - * vector[8] dynamic body - * . - * . - * . - */ - struct iovec *vector; - int vector_count; - struct iovec _vector[1 + SMBD_SMB2_NUM_IOV_PER_REQ]; -#define OUTVEC_ALLOC_SIZE (SMB2_HDR_BODY + 9) - uint8_t _hdr[OUTVEC_ALLOC_SIZE]; - uint8_t _body[0x58]; - } out; -}; - -struct smbd_server_connection; -struct user_struct; - -struct pending_message_list; -struct pending_auth_data; - -struct user_struct { - struct user_struct *next, *prev; - uint64_t vuid; /* Tag for this entry. */ - - char *session_keystr; /* used by utmp and pam session code. - TDB key string */ - int homes_snum; - - struct auth_session_info *session_info; - - struct smbXsrv_session *session; -}; - -struct smbd_server_connection { - const struct tsocket_address *local_address; - const struct tsocket_address *remote_address; - const char *remote_hostname; - struct tevent_context *ev_ctx; - struct messaging_context *msg_ctx; - struct notify_context *notify_ctx; - bool using_smb2; - int trans_num; - - size_t num_users; - struct user_struct *users; - - size_t num_connections; - struct connection_struct *connections; - - size_t num_files; - struct files_struct *files; - - int real_max_open_files; - struct fsp_singleton_cache fsp_fi_cache; - - struct pending_message_list *deferred_open_queue; - - - /* open directory handles. */ - struct { - struct bitmap *dptr_bmap; - struct dptr_struct *dirptrs; - int dirhandles_open; - } searches; - - uint64_t num_requests; - - /* Current number of oplocks we have outstanding. */ - struct { - int32_t exclusive_open; - int32_t level_II_open; - struct kernel_oplocks *kernel_ops; - } oplocks; - - struct { - struct notify_mid_map *notify_mid_maps; - - struct { - /* dlink list we store pending lock records on. */ - struct blocking_lock_record *blocking_lock_queue; - /* dlink list we move cancelled lock records onto. */ - struct blocking_lock_record *blocking_lock_cancelled_queue; - - /* The event that makes us process our blocking lock queue */ - struct tevent_timer *brl_timeout; - - bool blocking_lock_unlock_state; - bool blocking_lock_cancel_state; - } locks; - } smb1; - struct { - struct { - /* The event that makes us process our blocking lock queue */ - struct tevent_timer *brl_timeout; - bool blocking_lock_unlock_state; - } locks; - } smb2; - - /* - * Link into libasys for asynchronous operations - */ - struct asys_context *asys_ctx; - struct tevent_fd *asys_fde; - - struct smbXsrv_client *client; -}; - -extern struct smbXsrv_client *global_smbXsrv_client; - -void smbd_init_globals(void); diff -urN /usr/local/src/samba-4.5.5/source3/utils/notify_msg.c /usr/local/src/samba-4.5.5_orig/source3/utils/notify_msg.c --- /usr/local/src/samba-4.5.5/source3/utils/notify_msg.c 2017-02-13 11:29:56 +0100 +++ /usr/local/src/samba-4.5.5_orig/source3/utils/notify_msg.c 1970-01-01 01:00:00 +0100 @@ -1,307 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * - * Copyright (C) Volker Lendecke 2014 - * - * 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 . - */ - -#include "includes.h" -#include "librpc/gen_ndr/notify.h" -#include "librpc/gen_ndr/messaging.h" -#include "lib/dbwrap/dbwrap.h" -#include "lib/dbwrap/dbwrap_rbt.h" -#include "messages.h" -#include "proto.h" -#include "globals.h" -#include "tdb.h" -#include "util_tdb.h" -#include "lib/util/server_id_db.h" -#include "smbd/notifyd/notifyd.h" - -struct notify_context { - struct server_id notifyd; - struct messaging_context *msg_ctx; - - struct smbd_server_connection *sconn; - void (*callback)(struct smbd_server_connection *sconn, - void *private_data, struct timespec when, - const struct notify_event *ctx); -}; - -static void notify_handler(struct messaging_context *msg, void *private_data, - uint32_t msg_type, struct server_id src, - DATA_BLOB *data); -static int notify_context_destructor(struct notify_context *ctx); - -struct notify_context *notify_init( - TALLOC_CTX *mem_ctx, struct messaging_context *msg, - struct tevent_context *ev, - struct smbd_server_connection *sconn, - void (*callback)(struct smbd_server_connection *sconn, - void *, struct timespec, - const struct notify_event *)) -{ - struct server_id_db *names_db; - struct notify_context *ctx; - NTSTATUS status; - - ctx = talloc(mem_ctx, struct notify_context); - if (ctx == NULL) { - return NULL; - } - ctx->msg_ctx = msg; - - ctx->sconn = sconn; - ctx->callback = callback; - - names_db = messaging_names_db(msg); - if (!server_id_db_lookup_one(names_db, "notify-daemon", - &ctx->notifyd)) { - DEBUG(1, ("No notify daemon around\n")); - TALLOC_FREE(ctx); - return NULL; - } - - { - struct server_id_buf tmp; - DBG_DEBUG("notifyd=%s\n", - server_id_str_buf(ctx->notifyd, &tmp)); - } - - if (callback != NULL) { - status = messaging_register(msg, ctx, MSG_PVFS_NOTIFY, - notify_handler); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(1, ("messaging_register failed: %s\n", - nt_errstr(status))); - TALLOC_FREE(ctx); - return NULL; - } - } - - talloc_set_destructor(ctx, notify_context_destructor); - - return ctx; -} - -static int notify_context_destructor(struct notify_context *ctx) -{ - if (ctx->callback != NULL) { - messaging_deregister(ctx->msg_ctx, MSG_PVFS_NOTIFY, ctx); - } - - return 0; -} - -static void notify_handler(struct messaging_context *msg, void *private_data, - uint32_t msg_type, struct server_id src, - DATA_BLOB *data) -{ - struct notify_context *ctx = talloc_get_type_abort( - private_data, struct notify_context); - struct notify_event_msg *event_msg; - struct notify_event event; - - if (data->length < offsetof(struct notify_event_msg, path) + 1) { - DEBUG(1, ("message too short: %u\n", (unsigned)data->length)); - return; - } - if (data->data[data->length-1] != 0) { - DEBUG(1, ("%s: path not 0-terminated\n", __func__)); - return; - } - - event_msg = (struct notify_event_msg *)data->data; - - event.action = event_msg->action; - event.path = event_msg->path; - event.private_data = event_msg->private_data; - - DEBUG(10, ("%s: Got notify_event action=%u, private_data=%p, " - "path=%s\n", __func__, (unsigned)event.action, - event.private_data, event.path)); - - ctx->callback(ctx->sconn, event.private_data, event_msg->when, &event); -} - -NTSTATUS notify_add(struct notify_context *ctx, - const char *path, uint32_t filter, uint32_t subdir_filter, - void *private_data) -{ - struct notify_rec_change_msg msg = {}; - struct iovec iov[2]; - size_t pathlen; - NTSTATUS status; - - if (ctx == NULL) { - return NT_STATUS_NOT_IMPLEMENTED; - } - - DEBUG(10, ("%s: path=[%s], filter=%u, subdir_filter=%u, " - "private_data=%p\n", __func__, path, (unsigned)filter, - (unsigned)subdir_filter, private_data)); - - pathlen = strlen(path)+1; - - clock_gettime_mono(&msg.instance.creation_time); - msg.instance.filter = filter; - msg.instance.subdir_filter = subdir_filter; - msg.instance.private_data = private_data; - - iov[0].iov_base = &msg; - iov[0].iov_len = offsetof(struct notify_rec_change_msg, path); - iov[1].iov_base = discard_const_p(char, path); - iov[1].iov_len = pathlen; - - status = messaging_send_iov( - ctx->msg_ctx, ctx->notifyd, MSG_SMB_NOTIFY_REC_CHANGE, - iov, ARRAY_SIZE(iov), NULL, 0); - - if (!NT_STATUS_IS_OK(status)) { - DEBUG(10, ("messaging_send_iov returned %s\n", - nt_errstr(status))); - return status; - } - - return NT_STATUS_OK; -} - -NTSTATUS notify_remove(struct notify_context *ctx, void *private_data, - char *path) -{ - struct notify_rec_change_msg msg = {}; - struct iovec iov[2]; - NTSTATUS status; - - /* see if change notify is enabled at all */ - if (ctx == NULL) { - return NT_STATUS_NOT_IMPLEMENTED; - } - - msg.instance.private_data = private_data; - - iov[0].iov_base = &msg; - iov[0].iov_len = offsetof(struct notify_rec_change_msg, path); - iov[1].iov_base = path; - iov[1].iov_len = strlen(path)+1; - - status = messaging_send_iov( - ctx->msg_ctx, ctx->notifyd, MSG_SMB_NOTIFY_REC_CHANGE, - iov, ARRAY_SIZE(iov), NULL, 0); - - return status; -} - -void notify_trigger(struct notify_context *ctx, - uint32_t action, uint32_t filter, - const char *dir, const char *name) -{ - struct notify_trigger_msg msg; - struct iovec iov[4]; - char slash = '/'; - - DEBUG(10, ("notify_trigger called action=0x%x, filter=0x%x, " - "dir=%s, name=%s\n", (unsigned)action, (unsigned)filter, - dir, name)); - - if (ctx == NULL) { - return; - } - - msg.when = timespec_current(); - msg.action = action; - msg.filter = filter; - - iov[0].iov_base = &msg; - iov[0].iov_len = offsetof(struct notify_trigger_msg, path); - iov[1].iov_base = discard_const_p(char, dir); - iov[1].iov_len = strlen(dir); - iov[2].iov_base = &slash; - iov[2].iov_len = 1; - iov[3].iov_base = discard_const_p(char, name); - iov[3].iov_len = strlen(name)+1; - - messaging_send_iov( - ctx->msg_ctx, ctx->notifyd, MSG_SMB_NOTIFY_TRIGGER, - iov, ARRAY_SIZE(iov), NULL, 0); -} - -NTSTATUS notify_walk(struct notify_context *notify, - bool (*fn)(const char *path, struct server_id server, - const struct notify_instance *instance, - void *private_data), - void *private_data) -{ - struct tevent_context *ev; - struct tevent_req *req; - struct messaging_rec *rec; - uint64_t log_idx; - NTSTATUS status; - int ret; - bool ok; - - ev = samba_tevent_context_init(notify); - if (ev == NULL) { - return NT_STATUS_NO_MEMORY; - } - - req = messaging_read_send(ev, ev, notify->msg_ctx, MSG_SMB_NOTIFY_DB); - if (req == NULL) { - TALLOC_FREE(ev); - return NT_STATUS_NO_MEMORY; - } - - ok = tevent_req_set_endtime(req, ev, timeval_current_ofs(10, 0)); - if (!ok) { - TALLOC_FREE(ev); - return NT_STATUS_NO_MEMORY; - } - - status = messaging_send_buf(notify->msg_ctx, notify->notifyd, - MSG_SMB_NOTIFY_GET_DB, NULL, 0); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(10, ("%s: messaging_send_buf failed\n", - nt_errstr(status))); - TALLOC_FREE(ev); - return status; - } - - ok = tevent_req_poll(req, ev); - if (!ok) { - DEBUG(10, ("%s: tevent_req_poll failed\n", __func__)); - TALLOC_FREE(ev); - return NT_STATUS_INTERNAL_ERROR; - } - - ret = messaging_read_recv(req, ev, &rec); - if (ret != 0) { - DEBUG(10, ("%s: messaging_read_recv failed: %s\n", - __func__, strerror(ret))); - TALLOC_FREE(ev); - return map_nt_error_from_unix(ret); - } - - ret = notifyd_parse_db(rec->buf.data, rec->buf.length, &log_idx, - fn, private_data); - if (ret != 0) { - DEBUG(10, ("%s: notifyd_parse_db failed: %s\n", - __func__, strerror(ret))); - TALLOC_FREE(ev); - return map_nt_error_from_unix(ret); - } - - TALLOC_FREE(ev); - return NT_STATUS_OK; -} diff -urN /usr/local/src/samba-4.5.5/source3/wscript_build /usr/local/src/samba-4.5.5_orig/source3/wscript_build --- /usr/local/src/samba-4.5.5/source3/wscript_build 2017-02-13 11:31:31 +0100 +++ /usr/local/src/samba-4.5.5_orig/source3/wscript_build 2016-10-24 21:37:30 +0200 @@ -1191,7 +1191,7 @@ param popt_samba3''') -smbstatus_source = 'utils/status.c utils/notify_msg.c' +smbstatus_source = 'utils/status.c smbd/notify_msg.c' if bld.CONFIG_GET("WITH_PROFILE"): smbstatus_source += ' utils/status_profile.c' diff -urN /usr/local/src/samba-4.5.5/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c /usr/local/src/samba-4.5.5_orig/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c --- /usr/local/src/samba-4.5.5/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c 2017-02-09 10:56:18 +0100 +++ /usr/local/src/samba-4.5.5_orig/source4/dsdb/samdb/ldb_modules/tombstone_reanimate.c 2016-08-11 09:51:04 +0200 @@ -345,7 +345,7 @@ struct tr_context *ac = NULL; int ret; - ldb_debug(ldb, LDB_DEBUG_TRACE, "%s\n", __FUNCTION__); + ldb_debug(ldb, LDB_DEBUG_TRACE, "%s\n", __PRETTY_FUNCTION__); /* do not manipulate our control entries */ if (ldb_dn_is_special(req->op.mod.message->dn)) { Binary files /usr/local/src/samba-4.5.5/source4/heimdal/lib/wind/UnicodeData.pyc and /usr/local/src/samba-4.5.5_orig/source4/heimdal/lib/wind/UnicodeData.pyc differ Binary files /usr/local/src/samba-4.5.5/source4/heimdal/lib/wind/generate.pyc and /usr/local/src/samba-4.5.5_orig/source4/heimdal/lib/wind/generate.pyc differ Binary files /usr/local/src/samba-4.5.5/source4/heimdal/lib/wind/rfc3454.pyc and /usr/local/src/samba-4.5.5_orig/source4/heimdal/lib/wind/rfc3454.pyc differ Binary files /usr/local/src/samba-4.5.5/source4/heimdal/lib/wind/rfc4518.pyc and /usr/local/src/samba-4.5.5_orig/source4/heimdal/lib/wind/rfc4518.pyc differ Binary files /usr/local/src/samba-4.5.5/source4/heimdal/lib/wind/stringprep.pyc and /usr/local/src/samba-4.5.5_orig/source4/heimdal/lib/wind/stringprep.pyc differ Binary files /usr/local/src/samba-4.5.5/source4/heimdal/lib/wind/util.pyc and /usr/local/src/samba-4.5.5_orig/source4/heimdal/lib/wind/util.pyc differ diff -urN /usr/local/src/samba-4.5.5/source4/torture/ndr/krb5pac.c /usr/local/src/samba-4.5.5_orig/source4/torture/ndr/krb5pac.c --- /usr/local/src/samba-4.5.5/source4/torture/ndr/krb5pac.c 2017-02-09 14:47:19 +0100 +++ /usr/local/src/samba-4.5.5_orig/source4/torture/ndr/krb5pac.c 2016-08-11 09:51:05 +0200 @@ -485,26 +485,17 @@ plain_data.length = r->buffers[1].info->credential_info.encrypted_data.length; torture_assert(tctx, plain_data.data, "malloc failed"); -/* torture_assert_krb5_error_equal(tctx, krb5_c_decrypt(ctx, -* -* #ifdef SAMBA4_USES_HEIMDAL -* reply_key, -*#else -* &reply_key, -*#endif -* KRB5_KU_OTHER_ENCRYPTED, -* NULL, -* &input, -* &plain_data), 0, -* "krb5_decrypt"); -*/ - + torture_assert_krb5_error_equal(tctx, krb5_c_decrypt(ctx, #ifdef SAMBA4_USES_HEIMDAL - torture_assert_krb5_error_equal(tctx, krb5_c_decrypt(ctx,reply_key,KRB5_KU_OTHER_ENCRYPTED,NULL,&input,&plain_data), 0,"krb5_decrypt"); + reply_key, #else - torture_assert_krb5_error_equal(tctx, krb5_c_decrypt(ctx,&reply_key,KRB5_KU_OTHER_ENCRYPTED,NULL,&input,&plain_data), 0,"krb5_decrypt"); + &reply_key, #endif - + KRB5_KU_OTHER_ENCRYPTED, + NULL, + &input, + &plain_data), 0, + "krb5_decrypt"); torture_assert_int_equal(tctx, plain_data.length, 112, "plain_data.length"); plain_data_blob = data_blob_talloc(tctx, plain_data.data, plain_data.length); Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/__init__.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/__init__.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/edns.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/edns.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/entropy.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/entropy.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/exception.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/exception.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/flags.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/flags.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/hash.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/hash.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/inet.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/inet.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/ipv4.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/ipv4.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/ipv6.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/ipv6.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/message.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/message.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/name.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/name.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/opcode.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/opcode.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/query.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/query.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/rcode.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/rcode.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/rdata.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/rdata.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/rdataclass.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/rdataclass.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/rdataset.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/rdataset.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/rdatatype.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/rdatatype.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/renderer.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/renderer.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/resolver.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/resolver.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/reversename.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/reversename.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/rrset.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/rrset.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/set.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/set.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/tokenizer.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/tokenizer.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/tsig.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/tsig.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/ttl.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/ttl.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/dnspython/dns/wiredata.pyc and /usr/local/src/samba-4.5.5_orig/third_party/dnspython/dns/wiredata.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/pyiso8601/iso8601/__init__.pyc and /usr/local/src/samba-4.5.5_orig/third_party/pyiso8601/iso8601/__init__.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/pyiso8601/iso8601/iso8601.pyc and /usr/local/src/samba-4.5.5_orig/third_party/pyiso8601/iso8601/iso8601.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/3rdparty/gccdeps.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/3rdparty/gccdeps.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/3rdparty/print_commands.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/3rdparty/print_commands.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Build.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Build.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Configure.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Configure.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Constants.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Constants.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Environment.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Environment.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Logs.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Logs.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Node.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Node.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Options.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Options.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Runner.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Runner.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Scripting.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Scripting.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Task.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Task.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/TaskGen.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/TaskGen.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Tools/ar.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Tools/ar.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Tools/cc.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Tools/cc.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Tools/ccroot.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Tools/ccroot.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Tools/compiler_cc.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Tools/compiler_cc.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Tools/config_c.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Tools/config_c.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Tools/cxx.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Tools/cxx.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Tools/gcc.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Tools/gcc.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Tools/gnu_dirs.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Tools/gnu_dirs.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Tools/perl.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Tools/perl.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Tools/preproc.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Tools/preproc.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Tools/python.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Tools/python.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Tools/xlc.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Tools/xlc.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/Utils.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/Utils.pyc differ Binary files /usr/local/src/samba-4.5.5/third_party/waf/wafadmin/ansiterm.pyc and /usr/local/src/samba-4.5.5_orig/third_party/waf/wafadmin/ansiterm.pyc differ