From d7aa2eb7b664c10551cb45c36d3b564d829e9d44 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 23 Apr 2011 11:10:05 +0200 Subject: s3:includes: simplify BIG_UINT macros metze --- source3/include/includes.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index a76942faad..e524b2afff 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -323,11 +323,10 @@ typedef sig_atomic_t volatile SIG_ATOMIC_T; # endif #endif -#define SBIG_UINT(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32)) -#define BIG_UINT(p, ofs) ((((uint64_t) IVAL(p,(ofs)+4))<<32)|IVAL(p,ofs)) -#define IVAL2_TO_SMB_BIG_UINT(buf,off) ( (((uint64_t)(IVAL((buf),(off)))) & ((uint64_t)0xFFFFFFFF)) | \ - (( ((uint64_t)(IVAL((buf),(off+4)))) & ((uint64_t)0xFFFFFFFF) ) << 32 ) ) - +/* TODO: remove this macros */ +#define SBIG_UINT(p, ofs, v) SBVAL(p, ofs, v) +#define BIG_UINT(p, ofs) BVAL(p, ofs) +#define IVAL2_TO_SMB_BIG_UINT(p, ofs) BVAL(p, ofs) /* this should really be a 64 bit type if possible */ typedef uint64_t br_off; -- cgit From 5b327085775f279976c66cdd5f105132fda0965a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 23 Apr 2011 11:15:30 +0200 Subject: s3:includes: simplify INO_T_VAL macros metze --- source3/include/includes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index e524b2afff..8f220dfaec 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -308,10 +308,10 @@ typedef sig_atomic_t volatile SIG_ATOMIC_T; #endif #ifdef LARGE_SMB_INO_T -#define SINO_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32)) -#define INO_T_VAL(p, ofs) ((SMB_INO_T)(((uint64_t)(IVAL(p,ofs)))| (((uint64_t)(IVAL(p,(ofs)+4))) << 32))) +#define SINO_T_VAL(p, ofs, v) SBVAL(p, ofs, v) +#define INO_T_VAL(p, ofs) ((SMB_INO_T)BVAL(p, ofs)) #else -#define SINO_T_VAL(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0)) +#define SINO_T_VAL(p, ofs, v) SBVAL(p, ofs, ((uint64_t)(v)) & UINT32_MAX) #define INO_T_VAL(p, ofs) ((SMB_INO_T)(IVAL((p),(ofs)))) #endif -- cgit From 23a6af46c84cd9b738af403d80c5187d858eac03 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 17 Apr 2011 20:16:07 +0200 Subject: s3: Add a 10-second timeout for the 445 or netbios connection to a DC --- 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 36f0235b02..69672cfdf5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2837,7 +2837,7 @@ NTSTATUS smbsock_connect_recv(struct tevent_req *req, int *sock, NTSTATUS smbsock_connect(const struct sockaddr_storage *addr, uint16_t port, const char *called_name, int called_type, const char *calling_name, int calling_type, - int *pfd, uint16_t *ret_port); + int *pfd, uint16_t *ret_port, int sec_timeout); struct tevent_req *smbsock_any_connect_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, @@ -2856,6 +2856,7 @@ NTSTATUS smbsock_any_connect(const struct sockaddr_storage *addrs, int *calling_types, size_t num_addrs, uint16_t port, + int sec_timeout, int *pfd, size_t *chosen_index, uint16_t *chosen_port); -- cgit From 62689d8166b8e070f855e6910470796dd7e1b2c8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 22 Apr 2011 11:47:11 +0200 Subject: s3: Many pthreadpool fixes In particular, this makes it fork-safe --- source3/include/pthreadpool.h | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 source3/include/pthreadpool.h (limited to 'source3/include') diff --git a/source3/include/pthreadpool.h b/source3/include/pthreadpool.h deleted file mode 100644 index 7ef7ddf419..0000000000 --- a/source3/include/pthreadpool.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Unix SMB/CIFS implementation. - * threadpool implementation based on pthreads - * Copyright (C) Volker Lendecke 2009 - * - * 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 __PTHREADPOOL_H__ -#define __PTHREADPOOL_H__ - -struct pthreadpool; - -int pthreadpool_init(unsigned max_threads, struct pthreadpool **presult); -int pthreadpool_destroy(struct pthreadpool *pool); - -/* - * Add a job to a pthreadpool. - */ -int pthreadpool_add_job(struct pthreadpool *pool, int job_id, - void (*fn)(void *private_data), void *private_data); - -/* - * Get the signalling fd out of a thread pool. This fd will become readable - * when a job is finished. The job that finished can be retrieved via - * pthreadpool_finished_job(). - */ -int pthreadpool_sig_fd(struct pthreadpool *pool); -int pthreadpool_finished_job(struct pthreadpool *pool); - -#endif -- cgit From d018fccb705e91f33f3211cdc5b8a4006d032f65 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 26 Apr 2011 10:52:39 -0700 Subject: s3: Add cli_writeall Signed-off-by: Jeremy Allison --- 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 69672cfdf5..a729cf6057 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1773,6 +1773,10 @@ struct tevent_req *cli_write_andx_send(TALLOC_CTX *mem_ctx, off_t offset, size_t size); NTSTATUS cli_write_andx_recv(struct tevent_req *req, size_t *pwritten); +NTSTATUS cli_writeall(struct cli_state *cli, uint16_t fnum, uint16_t mode, + const uint8_t *buf, off_t offset, size_t size, + size_t *pwritten); + struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct cli_state *cli, uint16_t fnum, uint16_t mode, -- cgit From ca9ac7c4c7adc9d726f1fc1fa2b061bd181e3d7a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 2 Apr 2011 16:44:40 +0200 Subject: s3: Remove cli_write Signed-off-by: Jeremy Allison --- 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 a729cf6057..2a1e1389a6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1191,9 +1191,6 @@ bool cli_state_seqnum_remove(struct cli_state *cli, uint16_t mid); bool cli_receive_smb(struct cli_state *cli); bool cli_send_smb(struct cli_state *cli); -bool cli_send_smb_direct_writeX(struct cli_state *cli, - const char *p, - size_t extradata); void cli_setup_packet_buf(struct cli_state *cli, char *buf); void cli_setup_packet(struct cli_state *cli); void cli_setup_bcc(struct cli_state *cli, void *p); @@ -1753,9 +1750,6 @@ NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum, void *priv, SMB_OFF_T *received); ssize_t cli_read(struct cli_state *cli, uint16_t fnum, char *buf, off_t offset, size_t size); -ssize_t cli_write(struct cli_state *cli, - uint16_t fnum, uint16 write_mode, - const char *buf, off_t offset, size_t size); NTSTATUS cli_smbwrite(struct cli_state *cli, uint16_t fnum, char *buf, off_t offset, size_t size1, size_t *ptotal); struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx, -- cgit From e04bab4a19658009e53949b814a58d177966a9cd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 20 Apr 2011 17:39:50 +1000 Subject: libcli/auth Move Samba4's gssapi_error_string from GENSEC to libcli/auth This will allow the GSSAPI PAC fetch code to use it. Andrew Bartlett --- source3/include/smb_krb5.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb_krb5.h b/source3/include/smb_krb5.h index d87dc79ff9..8109747b70 100644 --- a/source3/include/smb_krb5.h +++ b/source3/include/smb_krb5.h @@ -14,14 +14,6 @@ #include "libcli/auth/krb5_wrap.h" -#if HAVE_GSSAPI_GSSAPI_H -#include -#elif HAVE_GSSAPI_GSSAPI_GENERIC_H -#include -#elif HAVE_GSSAPI_H -#include -#endif - #ifndef KRB5_ADDR_NETBIOS #define KRB5_ADDR_NETBIOS 0x14 #endif -- cgit From 3e85b960fae391af7a0592d5d38c18ae5a157209 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 27 Apr 2011 16:39:42 +1000 Subject: dynconfig: Have only one dynconfig.o in the common code. --- source3/include/dynconfig.h | 100 -------------------------------------------- source3/include/includes.h | 2 +- 2 files changed, 1 insertion(+), 101 deletions(-) delete mode 100644 source3/include/dynconfig.h (limited to 'source3/include') diff --git a/source3/include/dynconfig.h b/source3/include/dynconfig.h deleted file mode 100644 index d0e42dc9f5..0000000000 --- a/source3/include/dynconfig.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Copyright (C) 2001 by Martin Pool - Copyright (C) 2003 by Jim McDonough - - 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 . -*/ - -/** - * @file dynconfig.h - * - * @brief Exported global configurations. - **/ - -const char *get_dyn_SBINDIR(void); -const char *set_dyn_SBINDIR(const char *newpath); -bool is_default_dyn_SBINDIR(void); - -const char *get_dyn_BINDIR(void); -const char *set_dyn_BINDIR(const char *newpath); -bool is_default_dyn_BINDIR(void); - -const char *get_dyn_SWATDIR(void); -const char *set_dyn_SWATDIR(const char *newpath); -bool is_default_dyn_SWATDIR(void); - -const char *get_dyn_CONFIGFILE(void); -const char *set_dyn_CONFIGFILE(const char *newpath); -bool is_default_dyn_CONFIGFILE(void); - -const char *get_dyn_LOGFILEBASE(void); -const char *set_dyn_LOGFILEBASE(const char *newpath); -bool is_default_dyn_LOGFILEBASE(void); - -const char *get_dyn_LMHOSTSFILE(void); -const char *set_dyn_LMHOSTSFILE(const char *newpath); -bool is_default_dyn_LMHOSTSFILE(void); - -const char *get_dyn_CODEPAGEDIR(void); -const char *set_dyn_CODEPAGEDIR(const char *newpath); -bool is_default_dyn_CODEPAGEDIR(void); - -const char *get_dyn_LIBDIR(void); -const char *set_dyn_LIBDIR(const char *newpath); -bool is_default_dyn_LIBDIR(void); - -const char *get_dyn_MODULESDIR(void); -const char *set_dyn_MODULESDIR(const char *newpath); -bool is_default_dyn_MODULESDIR(void); - -const char *get_dyn_SHLIBEXT(void); -const char *set_dyn_SHLIBEXT(const char *newpath); -bool is_default_dyn_SHLIBEXT(void); - -const char *get_dyn_LOCKDIR(void); -const char *set_dyn_LOCKDIR(const char *newpath); -bool is_default_dyn_LOCKDIR(void); - -const char *get_dyn_STATEDIR(void); -const char *set_dyn_STATEDIR(const char *newpath); -bool is_default_dyn_STATEDIR(void); - -const char *get_dyn_CACHEDIR(void); -const char *set_dyn_CACHEDIR(const char *newpath); -bool is_default_dyn_CACHEDIR(void); - -const char *get_dyn_PIDDIR(void); -const char *set_dyn_PIDDIR(const char *newpath); -bool is_default_dyn_PIDDIR(void); - -const char *get_dyn_NMBDSOCKETDIR(void); -const char *set_dyn_NMBDSOCKETDIR(const char *newpath); -bool is_default_dyn_NMBDSOCKETDIR(void); - -const char *get_dyn_NCALRPCDIR(void); -const char *set_dyn_NCALRPCDIR(const char *newpath); -bool is_default_dyn_NCALRPCDIR(void); - -const char *get_dyn_SMB_PASSWD_FILE(void); -const char *set_dyn_SMB_PASSWD_FILE(const char *newpath); -bool is_default_dyn_SMB_PASSWD_FILE(void); - -const char *get_dyn_PRIVATE_DIR(void); -const char *set_dyn_PRIVATE_DIR(const char *newpath); -bool is_default_dyn_PRIVATE_DIR(void); - -const char *get_dyn_LOCALEDIR(void); -const char *set_dyn_LOCALEDIR(const char *newpath); -bool is_default_dyn_LOCALEDIR(void); diff --git a/source3/include/includes.h b/source3/include/includes.h index 8f220dfaec..014d1d44bd 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -532,7 +532,7 @@ typedef char fstring[FSTRING_LEN]; #include "libads/ads_status.h" #include "../libcli/util/error.h" #include "../lib/util/charset/charset.h" -#include "dynconfig.h" +#include "dynconfig/dynconfig.h" #include "locking.h" #include "smb_perfcount.h" #include "smb.h" -- cgit From 1815f0298f33c949f78e181477e8474a37663ccd Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 27 Apr 2011 12:06:25 -0700 Subject: Remove fstrings from client struct. Properly talloc strings (ensuring we never end up with a NULL pointer). --- source3/include/client.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index 9e4a61dbac..b51da90973 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -71,7 +71,7 @@ struct cli_state { int rap_error; int privileges; - fstring desthost; + char *desthost; /* The credentials used to open the cli_state connection. */ char *domain; @@ -83,12 +83,12 @@ struct cli_state { * ones returned by the server if * the protocol > NT1. */ - fstring server_type; - fstring server_os; - fstring server_domain; + char *server_type; + char *server_os; + char *server_domain; - fstring share; - fstring dev; + char *share; + char *dev; struct nmb_name called; struct nmb_name calling; struct sockaddr_storage dest_ss; -- cgit From 0df4061cffd32d4a989c5fd177136c2cc3730e7c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 28 Apr 2011 11:41:31 +1000 Subject: lib/util/charset Merge talloc-based pull and push charset functions These were copied from source3/lib/charcnv.c Andrew Bartlett --- source3/include/proto.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2a1e1389a6..27a8990e20 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -94,16 +94,6 @@ size_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len, size_t pull_ascii_fstring(char *dest, const void *src); size_t pull_ascii_nstring(char *dest, size_t dest_len, const void *src); size_t push_ucs2(const void *base_ptr, void *dest, const char *src, size_t dest_len, int flags); -bool push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src, - size_t *converted_size); -bool push_ucs2_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src, - size_t *converted_size); -bool pull_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src, - size_t *converted_size); -bool pull_ucs2_talloc(TALLOC_CTX *ctx, char **dest, const smb_ucs2_t *src, - size_t *converted_size); -bool pull_ascii_talloc(TALLOC_CTX *ctx, char **dest, const char *src, - size_t *converted_size); size_t push_string_check_fn(void *dest, const char *src, size_t dest_len, int flags); size_t push_string_base(const char *base, uint16 flags2, -- cgit From a427652010820fdf8fa82cf425f5162cc70348e0 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 26 Apr 2011 13:53:45 +1000 Subject: s3-libads: Use ldap_init_fd() to connect to AD server in socket_wrapper This means that we control the connection setup, don't rely on signals for timeouts and the connection uses socket_wrapper where that is required in our test environment. According to bug reports, this method is also used by curl and other tools, so we are not the first to (ab)use the OpenLDAP libs in this way. It is ONLY enabled for socket_wrapper at this time, as this is the best way to get 'make test' working for S3 winbind tests in an S4 domain. Andrew Bartlett --- source3/include/smb_ldap.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb_ldap.h b/source3/include/smb_ldap.h index 45e586859d..7165de19bf 100644 --- a/source3/include/smb_ldap.h +++ b/source3/include/smb_ldap.h @@ -37,7 +37,14 @@ typedef int ber_int_t; #endif /* function declarations not included in proto.h */ -LDAP *ldap_open_with_timeout(const char *server, int port, unsigned int to); +LDAP *ldap_open_with_timeout(const char *server, + struct sockaddr_storage *ss, + int port, unsigned int to); + +#ifdef HAVE_LDAP_PVT_H +#include +#endif +int ldap_init_fd(ber_socket_t fd, int proto, char *uri, LDAP **ldp); #endif /* HAVE_LDAP_H */ -- cgit From a3ec6052f90562a1e973ca7fc8a2acf9f41de7f0 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 28 Apr 2011 15:49:21 +1000 Subject: s3-ldap Move ldap prototypes to inside #ifdef HAVE_LDAP_H This fixes the build without LDAP development headers. --- source3/include/smb_ldap.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb_ldap.h b/source3/include/smb_ldap.h index 7165de19bf..613f6dcac4 100644 --- a/source3/include/smb_ldap.h +++ b/source3/include/smb_ldap.h @@ -22,6 +22,17 @@ typedef int ber_int_t; #ifndef LDAP_CONST #define LDAP_CONST const #endif + +#ifdef HAVE_LDAP_PVT_H +#include +#endif /* HAVE_LDAP_PVT_H */ +int ldap_init_fd(ber_socket_t fd, int proto, char *uri, LDAP **ldp); + +/* function declarations not included in proto.h */ +LDAP *ldap_open_with_timeout(const char *server, + struct sockaddr_storage *ss, + int port, unsigned int to); + #ifndef LDAP_OPT_SUCCESS #define LDAP_OPT_SUCCESS 0 #endif @@ -36,16 +47,6 @@ typedef int ber_int_t; #define LDAPS_PORT 636 #endif -/* function declarations not included in proto.h */ -LDAP *ldap_open_with_timeout(const char *server, - struct sockaddr_storage *ss, - int port, unsigned int to); - -#ifdef HAVE_LDAP_PVT_H -#include -#endif -int ldap_init_fd(ber_socket_t fd, int proto, char *uri, LDAP **ldp); - #endif /* HAVE_LDAP_H */ #ifndef HAVE_LDAP -- cgit From 9f75b7cbb3d25b3a799f0dc50587260036e40719 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 11:25:56 +1000 Subject: libcli/smb Move FILE_ATTRIBUTE defines to the top level --- source3/include/smb.h | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 8ebde2f4ad..01866e2e8a 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1084,26 +1084,6 @@ struct bitmap { #define FILE_SHARE_WRITE 2 #define FILE_SHARE_DELETE 4 -/* FileAttributesField */ -#define FILE_ATTRIBUTE_READONLY 0x001L -#define FILE_ATTRIBUTE_HIDDEN 0x002L -#define FILE_ATTRIBUTE_SYSTEM 0x004L -#define FILE_ATTRIBUTE_DIRECTORY 0x010L -#define FILE_ATTRIBUTE_ARCHIVE 0x020L -#define FILE_ATTRIBUTE_NORMAL 0x080L -#define FILE_ATTRIBUTE_TEMPORARY 0x100L -#define FILE_ATTRIBUTE_SPARSE 0x200L -#define FILE_ATTRIBUTE_REPARSE_POINT 0x400L -#define FILE_ATTRIBUTE_COMPRESSED 0x800L -#define FILE_ATTRIBUTE_OFFLINE 0x1000L -#define FILE_ATTRIBUTE_NONINDEXED 0x2000L -#define FILE_ATTRIBUTE_ENCRYPTED 0x4000L -#define SAMBA_ATTRIBUTES_MASK (FILE_ATTRIBUTE_READONLY|\ - FILE_ATTRIBUTE_HIDDEN|\ - FILE_ATTRIBUTE_SYSTEM|\ - FILE_ATTRIBUTE_DIRECTORY|\ - FILE_ATTRIBUTE_ARCHIVE) - /* Flags - combined with attributes. */ #define FILE_FLAG_WRITE_THROUGH 0x80000000L #define FILE_FLAG_NO_BUFFERING 0x20000000L -- cgit From 7f66ebde2e2975b079f6c135b131d064dab38624 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 11:36:14 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_READONLY intead of aRONLY This means we use just one constant for this file attribute. Andrew Bartlett --- source3/include/smb.h | 1 - source3/include/smb_macros.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 01866e2e8a..61a2602fa5 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -86,7 +86,6 @@ enum smb_read_errors { #define DIR_STRUCT_SIZE 43 /* these define the attribute byte as seen by DOS */ -#define aRONLY (1L<<0) /* 0x01 */ #define aHIDDEN (1L<<1) /* 0x02 */ #define aSYSTEM (1L<<2) /* 0x04 */ #define aVOLID (1L<<3) /* 0x08 */ diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 93bda975bf..e4dda7cb93 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -28,7 +28,7 @@ #define BITSETW(ptr,bit) ((SVAL(ptr,0) & (1<<(bit)))!=0) /* for readability... */ -#define IS_DOS_READONLY(test_mode) (((test_mode) & aRONLY) != 0) +#define IS_DOS_READONLY(test_mode) (((test_mode) & FILE_ATTRIBUTE_READONLY) != 0) #define IS_DOS_DIR(test_mode) (((test_mode) & aDIR) != 0) #define IS_DOS_ARCHIVE(test_mode) (((test_mode) & aARCH) != 0) #define IS_DOS_SYSTEM(test_mode) (((test_mode) & aSYSTEM) != 0) -- cgit From 317e19aeb3fbdb21573b6ef1bc8c2af646a7e61e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 11:43:35 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDEN This means we use just one constant for this file attribute. Andrew Bartlett --- source3/include/smb.h | 1 - source3/include/smb_macros.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 61a2602fa5..148b444086 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -86,7 +86,6 @@ enum smb_read_errors { #define DIR_STRUCT_SIZE 43 /* these define the attribute byte as seen by DOS */ -#define aHIDDEN (1L<<1) /* 0x02 */ #define aSYSTEM (1L<<2) /* 0x04 */ #define aVOLID (1L<<3) /* 0x08 */ #define aDIR (1L<<4) /* 0x10 */ diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index e4dda7cb93..c949125782 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -32,7 +32,7 @@ #define IS_DOS_DIR(test_mode) (((test_mode) & aDIR) != 0) #define IS_DOS_ARCHIVE(test_mode) (((test_mode) & aARCH) != 0) #define IS_DOS_SYSTEM(test_mode) (((test_mode) & aSYSTEM) != 0) -#define IS_DOS_HIDDEN(test_mode) (((test_mode) & aHIDDEN) != 0) +#define IS_DOS_HIDDEN(test_mode) (((test_mode) & FILE_ATTRIBUTE_HIDDEN) != 0) #define SMB_WARN(condition, message) \ ((condition) ? (void)0 : \ -- cgit From 0a3c84b554f3862b3e558f62e67ceb8311b248ce Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 13:23:14 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEM This means we use just one constant for this file attribute. Andrew Bartlett --- source3/include/smb.h | 1 - source3/include/smb_macros.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 148b444086..d65ec379fe 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -86,7 +86,6 @@ enum smb_read_errors { #define DIR_STRUCT_SIZE 43 /* these define the attribute byte as seen by DOS */ -#define aSYSTEM (1L<<2) /* 0x04 */ #define aVOLID (1L<<3) /* 0x08 */ #define aDIR (1L<<4) /* 0x10 */ #define aARCH (1L<<5) /* 0x20 */ diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index c949125782..a60ccedeef 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -31,7 +31,7 @@ #define IS_DOS_READONLY(test_mode) (((test_mode) & FILE_ATTRIBUTE_READONLY) != 0) #define IS_DOS_DIR(test_mode) (((test_mode) & aDIR) != 0) #define IS_DOS_ARCHIVE(test_mode) (((test_mode) & aARCH) != 0) -#define IS_DOS_SYSTEM(test_mode) (((test_mode) & aSYSTEM) != 0) +#define IS_DOS_SYSTEM(test_mode) (((test_mode) & FILE_ATTRIBUTE_SYSTEM) != 0) #define IS_DOS_HIDDEN(test_mode) (((test_mode) & FILE_ATTRIBUTE_HIDDEN) != 0) #define SMB_WARN(condition, message) \ -- cgit From 08c90d6f2df85499f43c5766a62839e80437290f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 11:52:48 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_VOLUME intead of aVOLID This means we use just one constant for this file attribute. Andrew Bartlett --- source3/include/smb.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index d65ec379fe..bb192cd5e8 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -86,7 +86,6 @@ enum smb_read_errors { #define DIR_STRUCT_SIZE 43 /* these define the attribute byte as seen by DOS */ -#define aVOLID (1L<<3) /* 0x08 */ #define aDIR (1L<<4) /* 0x10 */ #define aARCH (1L<<5) /* 0x20 */ -- cgit From 0eca33bbf620678759bbe39efaa74f33f96efb74 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 11:57:02 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIR This means we use just one constant for this file attribute. Andrew Bartlett --- source3/include/smb.h | 1 - source3/include/smb_macros.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index bb192cd5e8..12b089442b 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -86,7 +86,6 @@ enum smb_read_errors { #define DIR_STRUCT_SIZE 43 /* these define the attribute byte as seen by DOS */ -#define aDIR (1L<<4) /* 0x10 */ #define aARCH (1L<<5) /* 0x20 */ /* deny modes */ diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index a60ccedeef..1a6ef3b318 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -29,7 +29,7 @@ /* for readability... */ #define IS_DOS_READONLY(test_mode) (((test_mode) & FILE_ATTRIBUTE_READONLY) != 0) -#define IS_DOS_DIR(test_mode) (((test_mode) & aDIR) != 0) +#define IS_DOS_DIR(test_mode) (((test_mode) & FILE_ATTRIBUTE_DIRECTORY) != 0) #define IS_DOS_ARCHIVE(test_mode) (((test_mode) & aARCH) != 0) #define IS_DOS_SYSTEM(test_mode) (((test_mode) & FILE_ATTRIBUTE_SYSTEM) != 0) #define IS_DOS_HIDDEN(test_mode) (((test_mode) & FILE_ATTRIBUTE_HIDDEN) != 0) -- cgit From 0520da2bbe246c45d89bfdec0d399862ecb867ba Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 12:00:57 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH This means we use just one constant for this file attribute. Andrew Bartlett --- source3/include/smb.h | 3 --- source3/include/smb_macros.h | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 12b089442b..8885ef2d14 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -85,9 +85,6 @@ enum smb_read_errors { #define DIR_STRUCT_SIZE 43 -/* these define the attribute byte as seen by DOS */ -#define aARCH (1L<<5) /* 0x20 */ - /* deny modes */ #define DENY_DOS 0 #define DENY_ALL 1 diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 1a6ef3b318..79aa4c5406 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -30,7 +30,7 @@ /* for readability... */ #define IS_DOS_READONLY(test_mode) (((test_mode) & FILE_ATTRIBUTE_READONLY) != 0) #define IS_DOS_DIR(test_mode) (((test_mode) & FILE_ATTRIBUTE_DIRECTORY) != 0) -#define IS_DOS_ARCHIVE(test_mode) (((test_mode) & aARCH) != 0) +#define IS_DOS_ARCHIVE(test_mode) (((test_mode) & FILE_ATTRIBUTE_ARCHIVE) != 0) #define IS_DOS_SYSTEM(test_mode) (((test_mode) & FILE_ATTRIBUTE_SYSTEM) != 0) #define IS_DOS_HIDDEN(test_mode) (((test_mode) & FILE_ATTRIBUTE_HIDDEN) != 0) -- cgit From 724915f721819705c7cf5c850a24b32f815c07e3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 12:05:07 +1000 Subject: s3-client Add TALLOC_CTX argument to attrib_string(). This ensures the caller knows where the memory was allocated. Andrew Bartlett --- 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 27a8990e20..a697188abc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -630,7 +630,7 @@ bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf, bool socket_exist(const char *fname); 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); +char *attrib_string(TALLOC_CTX *mem_ctx, uint16 mode); void show_msg(char *buf); void smb_set_enclen(char *buf,int len,uint16 enc_ctx_num); void smb_setlen(char *buf,int len); -- cgit From 6021af4fd38d2a712dca42a3cacf8537007fd160 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 12:41:27 +1000 Subject: libcli/smb Move attrib_string in common --- 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 a697188abc..058356e0d6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -630,7 +630,6 @@ bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf, bool socket_exist(const char *fname); uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf); SMB_OFF_T get_file_size(char *file_name); -char *attrib_string(TALLOC_CTX *mem_ctx, uint16 mode); void show_msg(char *buf); void smb_set_enclen(char *buf,int len,uint16 enc_ctx_num); void smb_setlen(char *buf,int len); -- cgit From 93ace5cc2484b53fc33d4689ccc286defbe2b728 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 13:20:51 +1000 Subject: lib/util Re-merge the string_sub() and all_string_sub() from source3 Andrew Bartlett --- 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 058356e0d6..c9552d7554 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -960,12 +960,6 @@ char *StrnCpy(char *dest,const char *src,size_t n); bool in_list(const char *s, const char *list, bool casesensitive); void string_free(char **s); bool string_set(char **dest,const char *src); -void string_sub2(char *s,const char *pattern, const char *insert, size_t len, - bool remove_unsafe_characters, bool replace_once, - bool allow_trailing_dollar); -void string_sub_once(char *s, const char *pattern, - const char *insert, size_t len); -void string_sub(char *s,const char *pattern, const char *insert, size_t len); void fstring_sub(char *s,const char *pattern,const char *insert); char *realloc_string_sub2(char *string, const char *pattern, -- cgit From 4d41a5effdc9a13921367be3412b53a39f75d73a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 18:43:30 +1000 Subject: s3-ldap Only prototype ldap_init_fd() when we have found it in the libraries Autobuild-User: Andrew Bartlett Autobuild-Date: Fri Apr 29 11:47:07 CEST 2011 on sn-devel-104 --- source3/include/smb_ldap.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb_ldap.h b/source3/include/smb_ldap.h index 613f6dcac4..389a734227 100644 --- a/source3/include/smb_ldap.h +++ b/source3/include/smb_ldap.h @@ -26,7 +26,10 @@ typedef int ber_int_t; #ifdef HAVE_LDAP_PVT_H #include #endif /* HAVE_LDAP_PVT_H */ + +#ifdef HAVE_LDAP_INIT_FD int ldap_init_fd(ber_socket_t fd, int proto, char *uri, LDAP **ldp); +#endif /* function declarations not included in proto.h */ LDAP *ldap_open_with_timeout(const char *server, -- cgit From 12476223c6aa7473c55bcf529639eefce8450680 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 28 Apr 2011 17:26:40 +0200 Subject: s3-tsocket: only include ../lib/tsocket/tsocket.h where needed. Guenther --- source3/include/includes.h | 1 - source3/include/proto.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 014d1d44bd..6c1e0b4d4e 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -522,7 +522,6 @@ typedef char fstring[FSTRING_LEN]; #include "event.h" #include "../lib/util/tevent_unix.h" #include "../lib/util/tevent_ntstatus.h" -#include "../lib/tsocket/tsocket.h" #include "../lib/util/data_blob.h" #include "../lib/util/time.h" diff --git a/source3/include/proto.h b/source3/include/proto.h index c9552d7554..b4a910917e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -925,6 +925,7 @@ struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx, int getaddrinfo_recv(struct tevent_req *req, struct addrinfo **res); int poll_one_fd(int fd, int events, int timeout, int *revents); int poll_intr_one_fd(int fd, int events, int timeout, int *revents); +struct tstream_context; struct tevent_req *tstream_read_packet_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct tstream_context *stream, -- cgit From 50883cfeb4eed3d538f71443060745f8747044c9 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 28 Apr 2011 17:38:09 +0200 Subject: s3-tevent: only include ../lib/util/tevent wrappers where needed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104 --- source3/include/includes.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 6c1e0b4d4e..f4cac1a88f 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -520,8 +520,6 @@ typedef char fstring[FSTRING_LEN]; #include #include "event.h" -#include "../lib/util/tevent_unix.h" -#include "../lib/util/tevent_ntstatus.h" #include "../lib/util/data_blob.h" #include "../lib/util/time.h" -- cgit From d6289641f5d421d188c37819f5fe8ceeb5a86aba Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Apr 2011 15:02:49 +0200 Subject: s3-proto: remove remaining nss_info prototypes to nss_info.h Guenther --- source3/include/nss_info.h | 7 +++++++ source3/include/proto.h | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nss_info.h b/source3/include/nss_info.h index bf66ef0a8c..f92937e990 100644 --- a/source3/include/nss_info.h +++ b/source3/include/nss_info.h @@ -95,5 +95,12 @@ NTSTATUS nss_map_from_alias( TALLOC_CTX *mem_ctx, const char *domain, NTSTATUS nss_close( const char *parameters ); +/* The following definitions come from winbindd/nss_info.c */ + + +/* The following definitions come from winbindd/nss_info_template.c */ + +NTSTATUS nss_info_template_init( void ); + #endif /* _IDMAP_NSS_H_ */ diff --git a/source3/include/proto.h b/source3/include/proto.h index b4a910917e..c08b204bb0 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2782,13 +2782,6 @@ int sessionid_traverse_read(int (*fn)(const char *key, char *stdin_new_passwd( void); char *get_pass( const char *prompt, bool stdin_get); -/* The following definitions come from winbindd/nss_info.c */ - - -/* The following definitions come from winbindd/nss_info_template.c */ - -NTSTATUS nss_info_template_init( void ); - /* The following definitions come from lib/avahi.c */ struct AvahiPoll *tevent_avahi_poll(TALLOC_CTX *mem_ctx, -- cgit From faf11751255202274505d72848c54ee6e5dce7b6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Apr 2011 15:13:55 +0200 Subject: s3-proto: move more librpc prototypes to librpc/rpc/dcerpc.h Guenther --- source3/include/proto.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index c08b204bb0..2626639da6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2619,14 +2619,6 @@ void set_server_role(void); uint32 get_int_param( const char* param ); char* get_string_param( const char* param ); -/* The following definitions come from librpc/rpc/rpc_common.c */ -struct ndr_interface_table; -bool smb_register_ndr_interface(const struct ndr_interface_table *interface); -const struct ndr_interface_table *get_iface_from_syntax( - const struct ndr_syntax_id *syntax); -const char *get_pipe_name_from_syntax(TALLOC_CTX *mem_ctx, - const struct ndr_syntax_id *syntax); - /* The following definitions come from rpc_server/rpc_ncacn_np.c */ struct auth_serversupplied_info; struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx, @@ -2635,6 +2627,7 @@ struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx, const struct auth_serversupplied_info *session_info, struct messaging_context *msg_ctx); struct dcerpc_binding_handle; +struct ndr_interface_table; NTSTATUS rpcint_binding_handle(TALLOC_CTX *mem_ctx, const struct ndr_interface_table *ndr_table, struct client_address *client_id, -- cgit From c7d38f49c8bcf5899b186ebb495c31f4ade3c8d6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Apr 2011 15:22:29 +0200 Subject: s3-proto: move rpc_server/rpc_handles.c protos to ntdomain.h Guenther --- source3/include/ntdomain.h | 28 ++++++++++++++++++++++++++++ source3/include/proto.h | 28 ---------------------------- 2 files changed, 28 insertions(+), 28 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 077924d6f4..9cd00da21a 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -207,4 +207,32 @@ struct api_struct { bool (*fn) (struct pipes_struct *); }; +/* The following definitions come from rpc_server/rpc_handles.c */ + +size_t num_pipe_handles(struct pipes_struct *p); +bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id *syntax); +bool create_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd, void *data_ptr); +bool find_policy_by_hnd(struct pipes_struct *p, const struct policy_handle *hnd, + void **data_p); +bool close_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd); +void close_policy_by_pipe(struct pipes_struct *p); +bool pipe_access_check(struct pipes_struct *p); + +void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd, + uint32_t access_granted, size_t data_size, + const char *type, NTSTATUS *pstatus); +#define policy_handle_create(_p, _hnd, _access, _type, _pstatus) \ + (_type *)_policy_handle_create((_p), (_hnd), (_access), sizeof(_type), #_type, \ + (_pstatus)) + +void *_policy_handle_find(struct pipes_struct *p, + const struct policy_handle *hnd, + uint32_t access_required, uint32_t *paccess_granted, + const char *name, const char *location, + NTSTATUS *pstatus); +#define policy_handle_find(_p, _hnd, _access_required, _access_granted, _type, _pstatus) \ + (_type *)_policy_handle_find((_p), (_hnd), (_access_required), \ + (_access_granted), #_type, __location__, (_pstatus)) + + #endif /* _NT_DOMAIN_H */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 2626639da6..215fa015c4 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2647,34 +2647,6 @@ NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx, struct rpc_pipe_client **cli_pipe); -/* The following definitions come from rpc_server/rpc_handles.c */ - -size_t num_pipe_handles(struct pipes_struct *p); -bool init_pipe_handles(struct pipes_struct *p, const struct ndr_syntax_id *syntax); -bool create_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd, void *data_ptr); -bool find_policy_by_hnd(struct pipes_struct *p, const struct policy_handle *hnd, - void **data_p); -bool close_policy_hnd(struct pipes_struct *p, struct policy_handle *hnd); -void close_policy_by_pipe(struct pipes_struct *p); -bool pipe_access_check(struct pipes_struct *p); - -void *_policy_handle_create(struct pipes_struct *p, struct policy_handle *hnd, - uint32_t access_granted, size_t data_size, - const char *type, NTSTATUS *pstatus); -#define policy_handle_create(_p, _hnd, _access, _type, _pstatus) \ - (_type *)_policy_handle_create((_p), (_hnd), (_access), sizeof(_type), #_type, \ - (_pstatus)) - -void *_policy_handle_find(struct pipes_struct *p, - const struct policy_handle *hnd, - uint32_t access_required, uint32_t *paccess_granted, - const char *name, const char *location, - NTSTATUS *pstatus); -#define policy_handle_find(_p, _hnd, _access_required, _access_granted, _type, _pstatus) \ - (_type *)_policy_handle_find((_p), (_hnd), (_access_required), \ - (_access_granted), #_type, __location__, (_pstatus)) - - /* The following definitions come from rpc_server/srv_rpc_register.c */ struct rpc_srv_callbacks { -- cgit From bc781bf7d98baca57c8043bf7dc0a95f8ffd1345 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Apr 2011 16:20:27 +0200 Subject: s3-proto: remove duplicate prototypes. Guenther --- source3/include/proto.h | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 215fa015c4..948c24de42 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2619,34 +2619,6 @@ void set_server_role(void); uint32 get_int_param( const char* param ); char* get_string_param( const char* param ); -/* The following definitions come from rpc_server/rpc_ncacn_np.c */ -struct auth_serversupplied_info; -struct pipes_struct *make_internal_rpc_pipe_p(TALLOC_CTX *mem_ctx, - const struct ndr_syntax_id *syntax, - struct client_address *client_id, - const struct auth_serversupplied_info *session_info, - struct messaging_context *msg_ctx); -struct dcerpc_binding_handle; -struct ndr_interface_table; -NTSTATUS rpcint_binding_handle(TALLOC_CTX *mem_ctx, - const struct ndr_interface_table *ndr_table, - struct client_address *client_id, - const struct auth_serversupplied_info *session_info, - struct messaging_context *msg_ctx, - struct dcerpc_binding_handle **binding_handle); -NTSTATUS rpc_pipe_open_internal(TALLOC_CTX *mem_ctx, - const struct ndr_syntax_id *abstract_syntax, - const struct auth_serversupplied_info *serversupplied_info, - struct client_address *client_id, - struct messaging_context *msg_ctx, - struct rpc_pipe_client **presult); -NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx, - const struct ndr_syntax_id *syntax, - const struct auth_serversupplied_info *session_info, - struct client_address *client_id, - struct messaging_context *msg_ctx, - struct rpc_pipe_client **cli_pipe); - /* The following definitions come from rpc_server/srv_rpc_register.c */ struct rpc_srv_callbacks { @@ -2656,6 +2628,8 @@ struct rpc_srv_callbacks { }; struct api_struct; +struct ndr_interface_table; +struct pipes_struct; NTSTATUS rpc_srv_register(int version, const char *clnt, const char *srv, const struct ndr_interface_table *iface, -- cgit From bbacaec4e9365b128eb11467c95412de7473c1ec Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Apr 2011 16:40:24 +0200 Subject: s3-proto: move more headers to rpc_server/rpc_ncacn_np.h where they origin from. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Fri Apr 29 22:05:07 CEST 2011 on sn-devel-104 --- 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 948c24de42..170b9ad5e6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2651,11 +2651,6 @@ bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax); /* The following definitions come from rpc_server/srv_pipe_hnd.c */ -struct pipes_struct *get_first_internal_pipe(void); -struct pipes_struct *get_next_internal_pipe(struct pipes_struct *p); -bool check_open_pipes(void); -int close_internal_rpc_pipe_hnd(struct pipes_struct *p); - bool fsp_is_np(struct files_struct *fsp); struct tsocket_address; NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name, -- cgit From 1018dd182686f5b3a6db3d08294c78305521e4f4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 30 Apr 2011 12:52:11 +1000 Subject: s3-lib: Rely on uint64_t in conv_str_size() Autobuild-User: Andrew Bartlett Autobuild-Date: Sat Apr 30 05:58:35 CEST 2011 on sn-devel-104 --- 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 170b9ad5e6..fe981f1d54 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1007,7 +1007,7 @@ char *ipstr_list_make(char **ipstr_list, int ipstr_list_parse(const char *ipstr_list, struct ip_service **ip_list); void ipstr_list_free(char* ipstr_list); uint64_t STR_TO_SMB_BIG_UINT(const char *nptr, const char **entptr); -SMB_OFF_T conv_str_size(const char * str); +uint64_t conv_str_size(const char * str); bool add_string_to_array(TALLOC_CTX *mem_ctx, const char *str, const char ***strings, int *num); -- cgit From 020b691cf842f30ff42474c2b0102751b5fa17ac Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 30 Apr 2011 17:10:35 +0200 Subject: s3: Remove ip_sevice from get_ipc_connect_master_ip Autobuild-User: Volker Lendecke Autobuild-Date: Sat Apr 30 18:16:28 CEST 2011 on sn-devel-104 --- 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 fe981f1d54..eccf0f9400 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1114,7 +1114,7 @@ struct cli_state *get_ipc_connect(char *server, struct sockaddr_storage *server_ss, const struct user_auth_info *user_info); struct cli_state *get_ipc_connect_master_ip(TALLOC_CTX *ctx, - struct ip_service *mb_ip, + struct sockaddr_storage *mb_ip, const struct user_auth_info *user_info, char **pp_workgroup_out); struct cli_state *get_ipc_connect_master_ip_bcast(TALLOC_CTX *ctx, -- cgit From d87427973c0f43d85546f5875b223929ac1a50d4 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 30 Apr 2011 19:23:55 +0200 Subject: s3: Make name_resolve_bcast return sockaddr_storage Autobuild-User: Volker Lendecke Autobuild-Date: Sat Apr 30 20:40:46 CEST 2011 on sn-devel-104 --- 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 eccf0f9400..c296487eac 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1958,7 +1958,8 @@ NTSTATUS name_query(const char *name, int name_type, int *num_addrs, uint8_t *flags); NTSTATUS name_resolve_bcast(const char *name, int name_type, - struct ip_service **return_iplist, + TALLOC_CTX *mem_ctx, + struct sockaddr_storage **return_iplist, int *return_count); NTSTATUS resolve_wins(const char *name, int name_type, -- cgit From 49d5f62b42d821bb8a11b595efb53eb88ec3c570 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Apr 2011 22:32:12 +0200 Subject: s3-proto: move rpc_srv_register protos and structs to town headerfile. Guenther --- source3/include/ntdomain.h | 1 + source3/include/proto.h | 21 ++------------------- 2 files changed, 3 insertions(+), 19 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 9cd00da21a..2c5fa2b669 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -234,5 +234,6 @@ void *_policy_handle_find(struct pipes_struct *p, (_type *)_policy_handle_find((_p), (_hnd), (_access_required), \ (_access_granted), #_type, __location__, (_pstatus)) +#include "rpc_server/srv_pipe_register.h" #endif /* _NT_DOMAIN_H */ diff --git a/source3/include/proto.h b/source3/include/proto.h index c296487eac..5ff1c056ce 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2620,27 +2620,10 @@ void set_server_role(void); uint32 get_int_param( const char* param ); char* get_string_param( const char* param ); -/* The following definitions come from rpc_server/srv_rpc_register.c */ - -struct rpc_srv_callbacks { - bool (*init)(void *private_data); - bool (*shutdown)(void *private_data); - void *private_data; -}; - -struct api_struct; -struct ndr_interface_table; -struct pipes_struct; -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, - const struct rpc_srv_callbacks *rpc_srv_cb); - -NTSTATUS rpc_srv_unregister(const struct ndr_interface_table *iface); - /* The following definitions come from rpc_server/srv_pipe.c */ struct ncacn_packet; +struct api_struct; +struct pipes_struct; bool create_next_pdu(struct pipes_struct *p); bool api_pipe_bind_auth3(struct pipes_struct *p, struct ncacn_packet *pkt); bool setup_fault_pdu(struct pipes_struct *p, NTSTATUS status); -- cgit From c1f3ff734043082a9488c787324e76a37702f94d Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Apr 2011 22:34:56 +0200 Subject: s3-util: move valid_share_pathname() to lib/util.c Guenther --- source3/include/proto.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 5ff1c056ce..aee1da9768 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -736,6 +736,7 @@ bool tevent_req_poll_ntstatus(struct tevent_req *req, NTSTATUS *status); bool any_nt_status_not_ok(NTSTATUS err1, NTSTATUS err2, NTSTATUS *result); int timeval_to_msec(struct timeval t); +char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname); /* The following definitions come from lib/util_cmdline.c */ @@ -2667,10 +2668,6 @@ void do_drv_upgrade_printer(struct messaging_context *msg, DATA_BLOB *data); void update_monitored_printq_cache(struct messaging_context *msg_ctx); -/* The following definitions come from rpc_server/srv_srvsvc_nt.c */ - -char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname); - /* The following definitions come from rpc_server/srv_svcctl_nt.c */ bool init_service_op_table( void ); -- cgit From c6fe379a4637dd1d5db34cbe4f566d3913b21fd2 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Apr 2011 22:43:59 +0200 Subject: s3-rpc_server: remove proto of nonexisting function (rpc_pipe_register_commands). Guenther --- source3/include/proto.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index aee1da9768..5a4604cbf6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2628,10 +2628,6 @@ struct pipes_struct; bool create_next_pdu(struct pipes_struct *p); bool api_pipe_bind_auth3(struct pipes_struct *p, struct ncacn_packet *pkt); bool setup_fault_pdu(struct pipes_struct *p, NTSTATUS status); -NTSTATUS rpc_pipe_register_commands(int version, const char *clnt, - const char *srv, - const struct ndr_syntax_id *interface, - const struct api_struct *cmds, int size); bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax); /* The following definitions come from rpc_server/srv_pipe_hnd.c */ -- cgit From 047d8c073b57bc12648a251deaceedb65f4f59cf Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Apr 2011 23:32:28 +0200 Subject: s3-proto: move more rpc_server prototypes out of proto.h Guenther --- source3/include/proto.h | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 5a4604cbf6..cec11ad7eb 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2630,30 +2630,6 @@ bool api_pipe_bind_auth3(struct pipes_struct *p, struct ncacn_packet *pkt); bool setup_fault_pdu(struct pipes_struct *p, NTSTATUS status); bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax); -/* The following definitions come from rpc_server/srv_pipe_hnd.c */ - -bool fsp_is_np(struct files_struct *fsp); -struct tsocket_address; -NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name, - const struct tsocket_address *local_address, - const struct tsocket_address *remote_address, - struct client_address *client_id, - struct auth_serversupplied_info *session_info, - struct messaging_context *msg_ctx, - struct fake_file_handle **phandle); -bool np_read_in_progress(struct fake_file_handle *handle); -struct tevent_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 tevent_req *req, ssize_t *pnwritten); -struct tevent_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 tevent_req *req, ssize_t *nread, - bool *is_data_outstanding); - -ssize_t process_incoming_data(struct pipes_struct *p, char *data, size_t n); - /* The following definitions come from rpc_server/srv_spoolss_nt.c */ void srv_spoolss_cleanup(void); -- cgit From c233c21425a183dd1124329fdbca13ab92cc6d6a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Apr 2011 23:47:25 +0200 Subject: s3-proto: move remaining spoolss protos to own header file. Guenther --- source3/include/proto.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index cec11ad7eb..a2751c7558 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2630,16 +2630,6 @@ bool api_pipe_bind_auth3(struct pipes_struct *p, struct ncacn_packet *pkt); bool setup_fault_pdu(struct pipes_struct *p, NTSTATUS status); bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax); -/* The following definitions come from rpc_server/srv_spoolss_nt.c */ -void srv_spoolss_cleanup(void); - -void do_drv_upgrade_printer(struct messaging_context *msg, - void *private_data, - uint32_t msg_type, - struct server_id server_id, - DATA_BLOB *data); -void update_monitored_printq_cache(struct messaging_context *msg_ctx); - /* The following definitions come from rpc_server/srv_svcctl_nt.c */ bool init_service_op_table( void ); -- cgit From daa02f34b181a3ec7224e920f787cc677bc3cdf2 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 29 Apr 2011 23:57:49 +0200 Subject: s3-proto: move remaining srvsvc protos to own header file. 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 a2751c7558..a3f9efcf31 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2630,11 +2630,6 @@ bool api_pipe_bind_auth3(struct pipes_struct *p, struct ncacn_packet *pkt); bool setup_fault_pdu(struct pipes_struct *p, NTSTATUS status); bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax); -/* The following definitions come from rpc_server/srv_svcctl_nt.c */ - -bool init_service_op_table( void ); -bool shutdown_service_op_table(void); - /* The following definitions come from lib/server_contexts.c */ struct tevent_context *server_event_context(void); void server_event_context_free(void); -- cgit From cd5b2b242b39437081592d41d297bce0668b40ab Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Sat, 30 Apr 2011 00:09:09 +0200 Subject: s3-printing: avoid using pipes_struct when only session_info is needed. Guenther --- source3/include/nt_printing.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h index 02a72b32f1..ad6262ecff 100644 --- a/source3/include/nt_printing.h +++ b/source3/include/nt_printing.h @@ -23,7 +23,7 @@ #define NT_PRINTING_H_ #include "client.h" -#include "../librpc/gen_ndr/srv_spoolss.h" +#include "../librpc/gen_ndr/spoolss.h" #ifndef SAMBA_PRINTER_PORT_NAME #define SAMBA_PRINTER_PORT_NAME "Samba Printer Port" @@ -169,11 +169,11 @@ bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx, bool delete_driver_files(const struct auth_serversupplied_info *server_info, const struct spoolss_DriverInfo8 *r); -WERROR move_driver_to_download_area(struct pipes_struct *p, +WERROR move_driver_to_download_area(struct auth_serversupplied_info *session_info, struct spoolss_AddDriverInfoCtr *r); WERROR clean_up_driver_struct(TALLOC_CTX *mem_ctx, - struct pipes_struct *rpc_pipe, + struct auth_serversupplied_info *session_info, struct spoolss_AddDriverInfoCtr *r); void map_printer_permissions(struct security_descriptor *sd); -- cgit From 80fa624861e6f45c4b6837969253d5fbac2f3b1e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 2 May 2011 12:36:25 +0200 Subject: s3: move pipe_auth_data to dcerpc.h Guenther --- source3/include/ntdomain.h | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index 2c5fa2b669..ed97182b25 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -97,20 +97,6 @@ typedef struct pipe_rpc_fns { struct gse_context; -/* auth state for all bind types. */ - -struct pipe_auth_data { - enum dcerpc_AuthType auth_type; - enum dcerpc_AuthLevel auth_level; - - void *auth_ctx; - - /* Only the client code uses these 3 for now */ - char *domain; - char *user_name; - DATA_BLOB user_session_key; -}; - struct dcesrv_ep_entry_list; /* -- cgit From 56cd3b3bbbb595cb0c98fa2dfa397c915fbf37d2 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 2 May 2011 13:27:45 +0200 Subject: s3-rpc_server: (re)move last globally included rpc_server prototypes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Mon May 2 16:05:31 CEST 2011 on sn-devel-104 --- source3/include/proto.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index a3f9efcf31..ebfa5e633a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2621,15 +2621,6 @@ void set_server_role(void); uint32 get_int_param( const char* param ); char* get_string_param( const char* param ); -/* The following definitions come from rpc_server/srv_pipe.c */ -struct ncacn_packet; -struct api_struct; -struct pipes_struct; -bool create_next_pdu(struct pipes_struct *p); -bool api_pipe_bind_auth3(struct pipes_struct *p, struct ncacn_packet *pkt); -bool setup_fault_pdu(struct pipes_struct *p, NTSTATUS status); -bool is_known_pipename(const char *cli_filename, struct ndr_syntax_id *syntax); - /* The following definitions come from lib/server_contexts.c */ struct tevent_context *server_event_context(void); void server_event_context_free(void); -- cgit From 85fa87ea82a1dcbd4d0145e417d615ffca116751 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 2 May 2011 11:38:41 +1000 Subject: s3-ctdb Rename packet file and files to ctdb_packet This avoids a conflicts with the Samba4 packet.c, as these is only used in CTDB Andrew Bartlett --- source3/include/ctdb_packet.h | 85 +++++++++++++++++++++++++++++++++++++++++++ source3/include/packet.h | 85 ------------------------------------------- 2 files changed, 85 insertions(+), 85 deletions(-) create mode 100644 source3/include/ctdb_packet.h delete mode 100644 source3/include/packet.h (limited to 'source3/include') diff --git a/source3/include/ctdb_packet.h b/source3/include/ctdb_packet.h new file mode 100644 index 0000000000..267a98825f --- /dev/null +++ b/source3/include/ctdb_packet.h @@ -0,0 +1,85 @@ +/* + Unix SMB/CIFS implementation. + CTDB Packet handling + Copyright (C) Volker Lendecke 2007 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 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 . +*/ + +/* + * A ctdb_packet context is a wrapper around a bidirectional file descriptor, + * hiding the handling of individual requests. + */ + +struct ctdb_packet_context; + +/* + * Initialize a ctdb_packet context. The fd is given to the ctdb_packet context, meaning + * that it is automatically closed when the ctdb_packet context is freed. + */ +struct ctdb_packet_context *ctdb_packet_init(TALLOC_CTX *mem_ctx, int fd); + +/* + * Pull data from the fd + */ +NTSTATUS ctdb_packet_fd_read(struct ctdb_packet_context *ctx); + +/* + * Sync read, wait for the next chunk + */ +NTSTATUS ctdb_packet_fd_read_sync(struct ctdb_packet_context *ctx, int timeout); + +/* + * Handle an incoming ctdb_packet: + * Return False if none is available + * Otherwise return True and store the callback result in *status + * Callback must either talloc_move or talloc_free buf + */ +bool ctdb_packet_handler(struct ctdb_packet_context *ctx, + bool (*full_req)(const uint8_t *buf, + size_t available, + size_t *length, + void *private_data), + NTSTATUS (*callback)(uint8_t *buf, size_t length, + void *private_data), + void *private_data, + NTSTATUS *status); + +/* + * How many bytes of outgoing data do we have pending? + */ +size_t ctdb_packet_outgoing_bytes(struct ctdb_packet_context *ctx); + +/* + * Push data to the fd + */ +NTSTATUS ctdb_packet_fd_write(struct ctdb_packet_context *ctx); + +/* + * Sync flush all outgoing bytes + */ +NTSTATUS ctdb_packet_flush(struct ctdb_packet_context *ctx); + +/* + * Send a list of DATA_BLOBs + * + * Example: ctdb_packet_send(ctx, 2, data_blob_const(&size, sizeof(size)), + * data_blob_const(buf, size)); + */ +NTSTATUS ctdb_packet_send(struct ctdb_packet_context *ctx, int num_blobs, ...); + +/* + * Get the ctdb_packet context's file descriptor + */ +int ctdb_packet_get_fd(struct ctdb_packet_context *ctx); diff --git a/source3/include/packet.h b/source3/include/packet.h deleted file mode 100644 index c96a8017f8..0000000000 --- a/source3/include/packet.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Packet handling - Copyright (C) Volker Lendecke 2007 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 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 . -*/ - -/* - * A packet context is a wrapper around a bidirectional file descriptor, - * hiding the handling of individual requests. - */ - -struct packet_context; - -/* - * Initialize a packet context. The fd is given to the packet context, meaning - * that it is automatically closed when the packet context is freed. - */ -struct packet_context *packet_init(TALLOC_CTX *mem_ctx, int fd); - -/* - * Pull data from the fd - */ -NTSTATUS packet_fd_read(struct packet_context *ctx); - -/* - * Sync read, wait for the next chunk - */ -NTSTATUS packet_fd_read_sync(struct packet_context *ctx, int timeout); - -/* - * Handle an incoming packet: - * Return False if none is available - * Otherwise return True and store the callback result in *status - * Callback must either talloc_move or talloc_free buf - */ -bool packet_handler(struct packet_context *ctx, - bool (*full_req)(const uint8_t *buf, - size_t available, - size_t *length, - void *private_data), - NTSTATUS (*callback)(uint8_t *buf, size_t length, - void *private_data), - void *private_data, - NTSTATUS *status); - -/* - * How many bytes of outgoing data do we have pending? - */ -size_t packet_outgoing_bytes(struct packet_context *ctx); - -/* - * Push data to the fd - */ -NTSTATUS packet_fd_write(struct packet_context *ctx); - -/* - * Sync flush all outgoing bytes - */ -NTSTATUS packet_flush(struct packet_context *ctx); - -/* - * Send a list of DATA_BLOBs - * - * Example: packet_send(ctx, 2, data_blob_const(&size, sizeof(size)), - * data_blob_const(buf, size)); - */ -NTSTATUS packet_send(struct packet_context *ctx, int num_blobs, ...); - -/* - * Get the packet context's file descriptor - */ -int packet_get_fd(struct packet_context *ctx); -- cgit From fbea52f74a80268446f45936a0cf40400aba8565 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 2 May 2011 15:23:08 +1000 Subject: lib/util Move more network utility functions from source3 into lib/util This will help with the merge of the interfaces layer. Andrew Bartlett --- source3/include/proto.h | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ebfa5e633a..3c2e30d6be 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -532,16 +532,6 @@ int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb); int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb); int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb); int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout); -int sys_getpeereid( int s, uid_t *uid); -int sys_getnameinfo(const struct sockaddr *psa, - socklen_t salen, - char *host, - size_t hostlen, - char *service, - size_t servlen, - int flags); -int sys_connect(int fd, const struct sockaddr * addr); - /* The following definitions come from lib/system_smbd.c */ bool getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user, -- cgit From 1d165c080300c7ecef63164c323b1ec0a37bc012 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 2 May 2011 12:05:02 +1000 Subject: s3-include: use new roles.h Pair-Programmed-With: Andrew Bartlett --- source3/include/smb.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 8885ef2d14..827a9db018 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -27,6 +27,7 @@ #define _SMB_H #include "libcli/smb/smb_common.h" +#include "libds/common/roles.h" /* logged when starting the various Samba daemons */ #define COPYRIGHT_STARTUP_MESSAGE "Copyright Andrew Tridgell and the Samba Team 1992-2011" @@ -1298,14 +1299,6 @@ enum protocol_types { /* security levels */ enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER,SEC_DOMAIN,SEC_ADS}; -/* server roles */ -enum server_types { - ROLE_STANDALONE, - ROLE_DOMAIN_MEMBER, - ROLE_DOMAIN_BDC, - ROLE_DOMAIN_PDC -}; - /* printing types */ enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, PRINT_QNX,PRINT_PLP,PRINT_LPRNG,PRINT_SOFTQ, -- cgit From 7c083caf741d4f12cdf630026e02d9f07a64d0fb Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 3 May 2011 12:25:29 +1000 Subject: s3-lib make push_ucs2() static --- 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 3c2e30d6be..086ba6c557 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -93,7 +93,6 @@ size_t push_ascii_nstring(void *dest, const char *src); size_t pull_ascii(char *dest, const void *src, size_t dest_len, size_t src_len, int flags); size_t pull_ascii_fstring(char *dest, const void *src); size_t pull_ascii_nstring(char *dest, size_t dest_len, const void *src); -size_t push_ucs2(const void *base_ptr, void *dest, const char *src, size_t dest_len, int flags); size_t push_string_check_fn(void *dest, const char *src, size_t dest_len, int flags); size_t push_string_base(const char *base, uint16 flags2, -- cgit From 80f1d49b61560f326fb55f2df09cc4f30e7a85ea Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 3 May 2011 12:29:12 +1000 Subject: lib/util/charset Use push_string and talloc_strupper/strlower from common code The only caller of push_string() (not to be confused with push_string_check()) in the common code was encode_pw_buffer(), and it didn't use the alignment or STR_UPPER flags. The talloc_strupper() and talloc_strlower() functions are tested in smbtorture, and are next_codepoint() based. Andrew Bartlett --- source3/include/proto.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 086ba6c557..e8ce418ab2 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -82,10 +82,6 @@ bool convert_string_error(charset_t from, charset_t to, void const *src, size_t srclen, void *dest, size_t destlen, size_t *converted_size); -char *talloc_strdup_upper(TALLOC_CTX *ctx, const char *s); -char *strupper_talloc(TALLOC_CTX *ctx, const char *s); -char *talloc_strdup_lower(TALLOC_CTX *ctx, const char *s); -char *strlower_talloc(TALLOC_CTX *ctx, const char *s); size_t ucs2_align(const void *base_ptr, const void *p, int flags); size_t push_ascii(void *dest, const char *src, size_t dest_len, int flags); size_t push_ascii_fstring(void *dest, const char *src); -- cgit From f08250eb55930bd8613c7ebe1a0de2fb0ccbff30 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 3 May 2011 19:11:38 +1000 Subject: s3-ctdb Fix duplicate function name due to packet -> ctdb_packet rename. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Günther Deschner --- source3/include/ctdb_packet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/ctdb_packet.h b/source3/include/ctdb_packet.h index 267a98825f..026b23f90e 100644 --- a/source3/include/ctdb_packet.h +++ b/source3/include/ctdb_packet.h @@ -38,7 +38,7 @@ NTSTATUS ctdb_packet_fd_read(struct ctdb_packet_context *ctx); /* * Sync read, wait for the next chunk */ -NTSTATUS ctdb_packet_fd_read_sync(struct ctdb_packet_context *ctx, int timeout); +NTSTATUS ctdb_packet_fd_read_sync_timeout(struct ctdb_packet_context *ctx, int timeout); /* * Handle an incoming ctdb_packet: -- cgit From 9c48345e32c9aebd93c67103ea6984d74f2061b4 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 3 May 2011 12:05:47 +0200 Subject: s3-proto: move remaining krb5 protos to krb5_protos.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Tue May 3 15:38:40 CEST 2011 on sn-devel-104 --- source3/include/krb5_protos.h | 6 ++++++ source3/include/proto.h | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/krb5_protos.h b/source3/include/krb5_protos.h index d80e77d2eb..c53588890c 100644 --- a/source3/include/krb5_protos.h +++ b/source3/include/krb5_protos.h @@ -131,3 +131,9 @@ int cli_krb5_get_ticket(TALLOC_CTX *mem_ctx, time_t *tgs_expire, const char *impersonate_princ_s); +/* The following definitions come from libsmb/clikrb5.c */ + +bool unwrap_edata_ntstatus(TALLOC_CTX *mem_ctx, + DATA_BLOB *edata, + DATA_BLOB *edata_out); +bool unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, DATA_BLOB *unwrapped_pac_data); diff --git a/source3/include/proto.h b/source3/include/proto.h index e8ce418ab2..bb2c64b671 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1620,13 +1620,6 @@ NTSTATUS cli_force_encryption(struct cli_state *c, const char *password, const char *domain); -/* The following definitions come from libsmb/clikrb5.c */ - -bool unwrap_edata_ntstatus(TALLOC_CTX *mem_ctx, - DATA_BLOB *edata, - DATA_BLOB *edata_out); -bool unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, DATA_BLOB *unwrapped_pac_data); - /* The following definitions come from libsmb/clilist.c */ NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute, -- cgit From 4fa2bac6e7ebe11447b535d9c8ec4348a2bbd39e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 3 May 2011 14:45:47 +0200 Subject: s3-system: move LOCK_ defines to lib/system.c Guenther --- source3/include/includes.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index f4cac1a88f..7ebb81e6df 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -602,15 +602,6 @@ enum flush_reason_enum { #endif -#if HAVE_KERNEL_SHARE_MODES -#ifndef LOCK_MAND -#define LOCK_MAND 32 /* This is a mandatory flock */ -#define LOCK_READ 64 /* ... Which allows concurrent read operations */ -#define LOCK_WRITE 128 /* ... Which allows concurrent write operations */ -#define LOCK_RW 192 /* ... Which allows concurrent read & write ops */ -#endif -#endif - #define MAX_SEC_CTX_DEPTH 8 /* Maximum number of security contexts */ -- cgit From a3609457912123037ca9fc51349d89d7921bc4e7 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 3 May 2011 16:16:50 +0200 Subject: s3-includes: remove ipv6 related prototype which is already defined in ../lib/util/util_net.h. Guenther --- source3/include/includes.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 7ebb81e6df..503299842b 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -681,11 +681,6 @@ void exit_server(const char *const reason) _NORETURN_; void exit_server_cleanly(const char *const reason) _NORETURN_; void exit_server_fault(void) _NORETURN_; -#if defined(HAVE_IPV6) -void in6_addr_to_sockaddr_storage(struct sockaddr_storage *ss, - struct in6_addr ip); -#endif - /* samba3 doesn't use uwrap yet */ #define uwrap_enabled() 0 -- cgit From 89e60556065c6e3dc7a8447cdba5a8fed1d19ea4 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 3 May 2011 16:25:20 +0200 Subject: s3-includes: move enum flush_reason_enum to smb.h Guenther --- source3/include/includes.h | 16 ---------------- source3/include/smb.h | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 503299842b..6be6b01133 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -542,22 +542,6 @@ typedef char fstring[FSTRING_LEN]; #include "../lib/util/smb_threads.h" #include "../lib/util/smb_threads_internal.h" -/* - * Reasons for cache flush. - */ - -enum flush_reason_enum { - SEEK_FLUSH, - READ_FLUSH, - WRITE_FLUSH, - READRAW_FLUSH, - OPLOCK_RELEASE_FLUSH, - CLOSE_FLUSH, - SYNC_FLUSH, - SIZECHANGE_FLUSH, - /* NUM_FLUSH_REASONS must remain the last value in the enumeration. */ - NUM_FLUSH_REASONS}; - /***** prototypes *****/ #ifndef NO_PROTO_H #include "proto.h" diff --git a/source3/include/smb.h b/source3/include/smb.h index 827a9db018..57de387661 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1701,4 +1701,20 @@ struct deferred_open_record; /* Used inside aio code. */ struct aio_extra; +/* + * Reasons for cache flush. + */ + +enum flush_reason_enum { + SEEK_FLUSH, + READ_FLUSH, + WRITE_FLUSH, + READRAW_FLUSH, + OPLOCK_RELEASE_FLUSH, + CLOSE_FLUSH, + SYNC_FLUSH, + SIZECHANGE_FLUSH, + /* NUM_FLUSH_REASONS must remain the last value in the enumeration. */ + NUM_FLUSH_REASONS}; + #endif /* _SMB_H */ -- cgit From c616379e14f7db35429ac849bbc6eb3d4dc641ec Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 3 May 2011 16:28:44 +0200 Subject: s3-includes: when MADVISE support was reverted back in 2009, someone forgot this hunk. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Tue May 3 22:06:20 CEST 2011 on sn-devel-104 --- source3/include/includes.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 6be6b01133..0079619372 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -173,10 +173,6 @@ #include #endif -#ifdef WITH_MADVISE_PROTECTED -#include -#endif - /* Special macros that are no-ops except when run under Valgrind on * x86. They've moved a little bit from valgrind 1.0.4 to 1.9.4 */ #if HAVE_VALGRIND_MEMCHECK_H -- cgit From b8eaec6b666b1f0d3711540c492edd79cd02b1fe Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 3 May 2011 21:42:04 +0200 Subject: s3-vfs: make vfswrap_llistxattr and vfswrap_flistxattr static. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Wed May 4 12:31:10 CEST 2011 on sn-devel-104 --- 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 bb2c64b671..dfe44a141e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2093,12 +2093,6 @@ bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain, struct dom_sid **sids ); NTSTATUS change_trust_account_password( const char *domain, const char *remote_machine); -/* The following definitions come from modules/vfs_default.c */ - -ssize_t vfswrap_llistxattr(struct vfs_handle_struct *handle, const char *path, char *list, size_t size); -ssize_t vfswrap_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size); -NTSTATUS vfs_default_init(void); - /* The following definitions come from param/loadparm.c */ char *lp_smb_ports(void); -- cgit From ff215f5c89c91a22c910400c8ac81d82d7459ba0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 3 May 2011 16:43:27 -0700 Subject: I added them, so I get to kill them :-). Finally remove all uses of safe_strcpy and safe_strcat. Change to strlcpy, strlcat. Autobuild-User: Jeremy Allison Autobuild-Date: Wed May 4 22:14:14 CEST 2011 on sn-devel-104 --- 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 dfe44a141e..2dd30d988b 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -937,12 +937,6 @@ size_t str_charnum(const char *s); bool trim_char(char *s,char cfront,char cback); bool strhasupper(const char *s); bool strhaslower(const char *s); -char *safe_strcpy_fn(char *dest, - const char *src, - size_t maxlength); -char *safe_strcat_fn(char *dest, - const char *src, - size_t maxlength); char *StrnCpy(char *dest,const char *src,size_t n); bool in_list(const char *s, const char *list, bool casesensitive); void string_free(char **s); -- cgit From 4f41be356a4e6b311d30de3b2e36e4c33aa72ca3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 May 2011 10:41:59 -0700 Subject: Fix many const compiler warnings. --- source3/include/proto.h | 2 +- source3/include/smb.h | 2 +- source3/include/smb_macros.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 2dd30d988b..2305a7ac68 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -615,7 +615,7 @@ bool file_exist_stat(const char *fname,SMB_STRUCT_STAT *sbuf, bool socket_exist(const char *fname); uint64_t get_file_size_stat(const SMB_STRUCT_STAT *sbuf); SMB_OFF_T get_file_size(char *file_name); -void show_msg(char *buf); +void show_msg(const char *buf); void smb_set_enclen(char *buf,int len,uint16 enc_ctx_num); void smb_setlen(char *buf,int len); int set_message_bcc(char *buf,int num_bytes); diff --git a/source3/include/smb.h b/source3/include/smb.h index 57de387661..28bc49f858 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1205,7 +1205,7 @@ struct bitmap { /* where to find the base of the SMB packet proper */ -#define smb_base(buf) (((char *)(buf))+4) +#define smb_base(buf) (((const char *)(buf))+4) /* we don't allow server strings to be longer than 48 characters as otherwise NT will not honour the announce packets */ diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 79aa4c5406..f7cfaaf325 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -123,6 +123,7 @@ /* Extra macros added by Ying Chen at IBM - speed increase by inlining. */ #define smb_buf(buf) (((char *)(buf)) + smb_size + CVAL(buf,smb_wct)*2) +#define smb_buf_const(buf) (((const char *)(buf)) + smb_size + CVAL(buf,smb_wct)*2) #define smb_buflen(buf) (SVAL(buf,smb_vwv0 + (int)CVAL(buf, smb_wct)*2)) /* the remaining number of bytes in smb buffer 'buf' from pointer 'p'. */ -- cgit From e131c94ac1b06cc49b1c25717d3496dba8b0b3df Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 May 2011 13:42:05 -0700 Subject: More const fixes for compiler warnings from the waf build. --- source3/include/libsmb_internal.h | 2 +- source3/include/proto.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/libsmb_internal.h b/source3/include/libsmb_internal.h index 61dc95e0ad..7f16ab6859 100644 --- a/source3/include/libsmb_internal.h +++ b/source3/include/libsmb_internal.h @@ -366,7 +366,7 @@ SMBC_close_ctx(SMBCCTX *context, bool SMBC_getatr(SMBCCTX * context, SMBCSRV *srv, - char *path, + const char *path, uint16 *mode, SMB_OFF_T *size, struct timespec *create_time_ts, diff --git a/source3/include/proto.h b/source3/include/proto.h index 2305a7ac68..60a34d1164 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -649,7 +649,7 @@ void smb_panic_s3(const char *why); void log_stack_trace(void); const char *readdirname(SMB_STRUCT_DIR *p); bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive); -void set_namearray(name_compare_entry **ppname_array, const char *namelist); +void set_namearray(name_compare_entry **ppname_array, char *namelist); void free_namearray(name_compare_entry *name_array); bool fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); bool fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid); -- cgit From 7d6ebe0de7d99c20854cafb8af50fe8f30ed778a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 May 2011 16:19:49 -0700 Subject: More const fixes. Remove CONST_DISCARD. --- source3/include/includes.h | 4 ---- source3/include/popt_common.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index 0079619372..59aa45afd7 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -652,10 +652,6 @@ char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...) PRINTF_ATT #undef HAVE_MMAP #endif -#ifndef CONST_DISCARD -#define CONST_DISCARD(type, ptr) ((type) ((void *) (ptr))) -#endif - void dump_core(void) _NORETURN_; void exit_server(const char *const reason) _NORETURN_; void exit_server_cleanly(const char *const reason) _NORETURN_; diff --git a/source3/include/popt_common.h b/source3/include/popt_common.h index 70d7278f01..10dd2f4ebe 100644 --- a/source3/include/popt_common.h +++ b/source3/include/popt_common.h @@ -42,7 +42,7 @@ extern const struct poptOption popt_common_dynconfig[]; #define POPT_COMMON_CONFIGFILE { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_configfile, 0, "Common samba config:", NULL }, #define POPT_COMMON_CREDENTIALS { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials, 0, "Authentication options:", NULL }, #define POPT_COMMON_DYNCONFIG { NULL, 0, POPT_ARG_INCLUDE_TABLE, \ - CONST_DISCARD(poptOption *, popt_common_dynconfig), 0, \ + discard_const_p(poptOption, popt_common_dynconfig), 0, \ "Build-time configuration overrides:", NULL }, #define POPT_COMMON_DEBUGLEVEL { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_debuglevel, 0, "Common samba debugging:", NULL }, #define POPT_COMMON_OPTION { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_option, 0, "Common samba commandline config:", NULL }, -- cgit From a5a84415e238a861aa9a574f0b486f4ba417aaa6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 May 2011 16:32:01 -0700 Subject: Fix broken interface to set_namearray() - don't modify incoming string. --- 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 60a34d1164..2305a7ac68 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -649,7 +649,7 @@ void smb_panic_s3(const char *why); void log_stack_trace(void); const char *readdirname(SMB_STRUCT_DIR *p); bool is_in_path(const char *name, name_compare_entry *namelist, bool case_sensitive); -void set_namearray(name_compare_entry **ppname_array, char *namelist); +void set_namearray(name_compare_entry **ppname_array, const char *namelist); void free_namearray(name_compare_entry *name_array); bool fcntl_lock(int fd, int op, SMB_OFF_T offset, SMB_OFF_T count, int type); bool fcntl_getlock(int fd, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid); -- cgit From 14750139639b3531e57a3ca3f9e481d6e458dc06 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 4 May 2011 10:28:15 +1000 Subject: lib/util Move source3 tdb_wrap_open() into the common code. This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in the top level build, these options are not available for these databases. However, having two different tdb_wrap lists is a worse fate, so this will do for now. Andrew Bartlett --- source3/include/util_tdb.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/util_tdb.h b/source3/include/util_tdb.h index 3bdb6977d8..a6144ba44d 100644 --- a/source3/include/util_tdb.h +++ b/source3/include/util_tdb.h @@ -26,10 +26,6 @@ #include "../libcli/util/ntstatus.h" /* for map_nt_error_from_tdb() */ #include "../../lib/util/util_tdb.h" -struct tdb_wrap { - struct tdb_context *tdb; -}; - int tdb_chainlock_with_timeout( struct tdb_context *tdb, TDB_DATA key, unsigned int timeout); int tdb_lock_bystring_with_timeout(struct tdb_context *tdb, const char *keyval, @@ -51,10 +47,6 @@ bool tdb_pack_append(TALLOC_CTX *mem_ctx, uint8 **buf, size_t *len, struct tdb_context *tdb_open_log(const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode); -struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx, - const char *name, int hash_size, int tdb_flags, - int open_flags, mode_t mode); - NTSTATUS map_nt_error_from_tdb(enum TDB_ERROR err); int tdb_data_cmp(TDB_DATA t1, TDB_DATA t2); -- cgit From fa289e8982ea260a87548c145ef061e7eb64acf6 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 4 May 2011 11:39:21 +1000 Subject: s3-lib Remove unused dos error codes from errmap_unix This also makes unix_nt_errmap private to errmap_unix.c and errormap.c so the tables themselves cannot be duplicate symbols until merged. Andrew Bartlett --- source3/include/smb.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index 28bc49f858..d584a9db45 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1549,13 +1549,6 @@ typedef struct user_struct { struct auth_ntlmssp_state *auth_ntlmssp_state; } user_struct; -struct unix_error_map { - int unix_error; - int dos_class; - int dos_code; - NTSTATUS nt_error; -}; - /* Do you want session setups at user level security with a invalid password to be rejected or allowed in as guest? WinNT rejects them -- cgit From 344eb08ee4e444c1fc1beac26e50c6a85b942885 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 4 May 2011 15:30:01 +1000 Subject: nterr: Add mem_ctx for return string from get_nt_error_c_code() It is clearer to avoid the implicit return on talloc_tos() Andrew Bartlett --- 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 2305a7ac68..a6e9cf9b5d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1976,7 +1976,6 @@ bool get_dc_name(const char *domain, const char *nt_errstr(NTSTATUS nt_code); const char *get_friendly_nt_error_msg(NTSTATUS nt_code); -const char *get_nt_error_c_code(NTSTATUS nt_code); NTSTATUS nt_status_string_to_code(const char *nt_status_str); NTSTATUS nt_status_squash(NTSTATUS nt_status); -- cgit From 8f1810362df7ef9e5c394a9cba83cf0e7c04bd9e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 4 May 2011 20:57:12 +1000 Subject: lib/util Use lib/util/ms_fnmatch.c in common for gen_fnmatch() gen_fnmatch was a duplicate symbol in the top level build. gen_fnmatch() used for simple non-CIFS pattern matching, so selecting the lib/util implementation should not be a concern. Andrew Bartlett --- 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 a6e9cf9b5d..6be4643818 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -217,7 +217,6 @@ void init_modules(void); int ms_fnmatch(const char *pattern, const char *string, bool translate_pattern, bool is_case_sensitive); -int gen_fnmatch(const char *pattern, const char *string); /* The following definitions come from lib/pidfile.c */ -- cgit From e3b858496ffe213f66387e4f11b311543af4dc54 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 4 May 2011 21:19:46 +1000 Subject: libcli/smb Move cifs posix helper functions and headers in common unix_perms_to_wire() was a duplicate symbol in the top level build. Andrew Bartlett --- source3/include/trans2.h | 429 ----------------------------------------------- 1 file changed, 429 deletions(-) (limited to 'source3/include') diff --git a/source3/include/trans2.h b/source3/include/trans2.h index 076780dec0..7a8c411396 100644 --- a/source3/include/trans2.h +++ b/source3/include/trans2.h @@ -355,433 +355,4 @@ Byte offset Type name description #define FLAG_TRANS2_FIND_CONTINUE 0x8 #define FLAG_TRANS2_FIND_BACKUP_INTENT 0x10 -/* UNIX CIFS Extensions - created by HP */ -/* - * UNIX CIFS Extensions have the range 0x200 - 0x2FF reserved. - * Supposedly Microsoft have agreed to this. - */ - -#define MIN_UNIX_INFO_LEVEL 0x200 -#define MAX_UNIX_INFO_LEVEL 0x2FF - -#define INFO_LEVEL_IS_UNIX(level) (((level) >= MIN_UNIX_INFO_LEVEL) && ((level) <= MAX_UNIX_INFO_LEVEL)) - -#define SMB_QUERY_FILE_UNIX_BASIC 0x200 /* UNIX File Info*/ -#define SMB_SET_FILE_UNIX_BASIC 0x200 -#define SMB_SET_FILE_UNIX_INFO2 0x20B /* UNIX File Info2 */ - -#define SMB_MODE_NO_CHANGE 0xFFFFFFFF /* file mode value which */ - /* means "don't change it" */ -#define SMB_UID_NO_CHANGE 0xFFFFFFFF -#define SMB_GID_NO_CHANGE 0xFFFFFFFF - -#define SMB_SIZE_NO_CHANGE_LO 0xFFFFFFFF -#define SMB_SIZE_NO_CHANGE_HI 0xFFFFFFFF - -#define SMB_TIME_NO_CHANGE_LO 0xFFFFFFFF -#define SMB_TIME_NO_CHANGE_HI 0xFFFFFFFF - -/* -Offset Size Name -0 LARGE_INTEGER EndOfFile File size -8 LARGE_INTEGER Blocks Number of bytes used on disk (st_blocks). -16 LARGE_INTEGER CreationTime Creation time -24 LARGE_INTEGER LastAccessTime Last access time -32 LARGE_INTEGER LastModificationTime Last modification time -40 LARGE_INTEGER Uid Numeric user id for the owner -48 LARGE_INTEGER Gid Numeric group id of owner -56 ULONG Type Enumeration specifying the pathname type: - 0 -- File - 1 -- Directory - 2 -- Symbolic link - 3 -- Character device - 4 -- Block device - 5 -- FIFO (named pipe) - 6 -- Unix domain socket - -60 LARGE_INTEGER devmajor Major device number if type is device -68 LARGE_INTEGER devminor Minor device number if type is device -76 LARGE_INTEGER uniqueid This is a server-assigned unique id for the file. The client - will typically map this onto an inode number. The scope of - uniqueness is the share. -84 LARGE_INTEGER permissions Standard UNIX file permissions - see below. -92 LARGE_INTEGER nlinks The number of directory entries that map to this entry - (number of hard links) - -100 - end. -*/ - -#define SMB_FILE_UNIX_BASIC_SIZE 100 - -/* UNIX filetype mappings. */ - -#define UNIX_TYPE_FILE 0 -#define UNIX_TYPE_DIR 1 -#define UNIX_TYPE_SYMLINK 2 -#define UNIX_TYPE_CHARDEV 3 -#define UNIX_TYPE_BLKDEV 4 -#define UNIX_TYPE_FIFO 5 -#define UNIX_TYPE_SOCKET 6 -#define UNIX_TYPE_UNKNOWN 0xFFFFFFFF - -/* - * Oh this is fun. "Standard UNIX permissions" has no - * meaning in POSIX. We need to define the mapping onto - * and off the wire as this was not done in the original HP - * spec. JRA. - */ - -#define UNIX_X_OTH 0000001 -#define UNIX_W_OTH 0000002 -#define UNIX_R_OTH 0000004 -#define UNIX_X_GRP 0000010 -#define UNIX_W_GRP 0000020 -#define UNIX_R_GRP 0000040 -#define UNIX_X_USR 0000100 -#define UNIX_W_USR 0000200 -#define UNIX_R_USR 0000400 -#define UNIX_STICKY 0001000 -#define UNIX_SET_GID 0002000 -#define UNIX_SET_UID 0004000 - -/* Masks for the above */ -#define UNIX_OTH_MASK 0000007 -#define UNIX_GRP_MASK 0000070 -#define UNIX_USR_MASK 0000700 -#define UNIX_PERM_MASK 0000777 -#define UNIX_EXTRA_MASK 0007000 -#define UNIX_ALL_MASK 0007777 - -/* Flags for chflags (CIFS_UNIX_EXTATTR_CAP capability) and - * SMB_QUERY_FILE_UNIX_INFO2. - */ -#define EXT_SECURE_DELETE 0x00000001 -#define EXT_ENABLE_UNDELETE 0x00000002 -#define EXT_SYNCHRONOUS 0x00000004 -#define EXT_IMMUTABLE 0x00000008 -#define EXT_OPEN_APPEND_ONLY 0x00000010 -#define EXT_DO_NOT_BACKUP 0x00000020 -#define EXT_NO_UPDATE_ATIME 0x00000040 -#define EXT_HIDDEN 0x00000080 - -#define SMB_QUERY_FILE_UNIX_LINK 0x201 -#define SMB_SET_FILE_UNIX_LINK 0x201 -#define SMB_SET_FILE_UNIX_HLINK 0x203 -/* SMB_QUERY_POSIX_ACL 0x204 see below */ -#define SMB_QUERY_XATTR 0x205 /* need for non-user XATTRs */ -#define SMB_QUERY_ATTR_FLAGS 0x206 /* chflags, chattr */ -#define SMB_SET_ATTR_FLAGS 0x206 -#define SMB_QUERY_POSIX_PERMISSION 0x207 -/* Only valid for qfileinfo */ -#define SMB_QUERY_POSIX_LOCK 0x208 -/* Only valid for setfileinfo */ -#define SMB_SET_POSIX_LOCK 0x208 - -/* The set info levels for POSIX path operations. */ -#define SMB_POSIX_PATH_OPEN 0x209 -#define SMB_POSIX_PATH_UNLINK 0x20A - -#define SMB_QUERY_FILE_UNIX_INFO2 0x20B /* UNIX File Info2 */ -#define SMB_SET_FILE_UNIX_INFO2 0x20B - -/* -SMB_QUERY_FILE_UNIX_INFO2 is SMB_QUERY_FILE_UNIX_BASIC with create -time and file flags appended. The corresponding info level for -findfirst/findnext is SMB_FIND_FILE_UNIX_INFO2. - Size Offset Value - --------------------- - 0 LARGE_INTEGER EndOfFile File size - 8 LARGE_INTEGER Blocks Number of blocks used on disk - 16 LARGE_INTEGER ChangeTime Attribute change time - 24 LARGE_INTEGER LastAccessTime Last access time - 32 LARGE_INTEGER LastModificationTime Last modification time - 40 LARGE_INTEGER Uid Numeric user id for the owner - 48 LARGE_INTEGER Gid Numeric group id of owner - 56 ULONG Type Enumeration specifying the file type - 60 LARGE_INTEGER devmajor Major device number if type is device - 68 LARGE_INTEGER devminor Minor device number if type is device - 76 LARGE_INTEGER uniqueid This is a server-assigned unique id - 84 LARGE_INTEGER permissions Standard UNIX permissions - 92 LARGE_INTEGER nlinks Number of hard links - 100 LARGE_INTEGER CreationTime Create/birth time - 108 ULONG FileFlags File flags enumeration - 112 ULONG FileFlagsMask Mask of valid flags -*/ - -/* Transact 2 Find First levels */ -#define SMB_FIND_FILE_UNIX 0x202 -#define SMB_FIND_FILE_UNIX_INFO2 0x20B /* UNIX File Info2 */ - -#define SMB_FILE_UNIX_INFO2_SIZE 116 - -/* - Info level for TRANS2_QFSINFO - returns version of CIFS UNIX extensions, plus - 64-bits worth of capability fun :-). - Use the same info level for TRANS2_SETFSINFO -*/ - -#define SMB_QUERY_CIFS_UNIX_INFO 0x200 -#define SMB_SET_CIFS_UNIX_INFO 0x200 - -/* Returns or sets the following. - - UINT16 major version number - UINT16 minor version number - LARGE_INTEGER capability bitfield - -*/ - -#define CIFS_UNIX_MAJOR_VERSION 1 -#define CIFS_UNIX_MINOR_VERSION 0 - -#define CIFS_UNIX_FCNTL_LOCKS_CAP 0x1 -#define CIFS_UNIX_POSIX_ACLS_CAP 0x2 -#define CIFS_UNIX_XATTTR_CAP 0x4 /* for support of other xattr - namespaces such as system, - security and trusted */ -#define CIFS_UNIX_EXTATTR_CAP 0x8 /* for support of chattr - (chflags) and lsattr */ -#define CIFS_UNIX_POSIX_PATHNAMES_CAP 0x10 /* Use POSIX pathnames on the wire. */ -#define CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP 0x20 /* We can cope with POSIX open/mkdir/unlink etc. */ -#define CIFS_UNIX_LARGE_READ_CAP 0x40 /* We can cope with 24 bit reads in readX. */ -#define CIFS_UNIX_LARGE_WRITE_CAP 0x80 /* We can cope with 24 bit writes in writeX. */ -#define CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP 0x100 /* We can do SPNEGO negotiations for encryption. */ -#define CIFS_UNIX_TRANSPORT_ENCRYPTION_MANDATORY_CAP 0x200 /* We *must* SPNEGO negotiations for encryption. */ - -#define SMB_QUERY_POSIX_FS_INFO 0x201 - -/* Returns FILE_SYSTEM_POSIX_INFO struct as follows - (NB For undefined values return -1 in that field) - le32 OptimalTransferSize; bsize on some os, iosize on other os, This - is a hint to the client about best size. Server - can return -1 if no preference, ie if SMB - negotiated size is adequate for optimal - read/write performance - le32 BlockSize; (often 512 bytes) NB: BlockSize * TotalBlocks = disk space - le64 TotalBlocks; redundant with other infolevels but easy to ret here - le64 BlocksAvail; although redundant, easy to return - le64 UserBlocksAvail; bavail - le64 TotalFileNodes; - le64 FreeFileNodes; - le64 FileSysIdentifier; fsid - (NB statfs field Namelen comes from FILE_SYSTEM_ATTRIBUTE_INFO call) - (NB statfs field flags can come from FILE_SYSTEM_DEVICE_INFO call) -*/ - -#define SMB_QUERY_POSIX_WHO_AM_I 0x202 /* QFS Info */ -/* returns: - __u32 flags; 0 = Authenticated user 1 = GUEST - __u32 mask; which flags bits server understands ie 0x0001 - __u64 unix_user_id; - __u64 unix_user_gid; - __u32 number_of_supplementary_gids; may be zero - __u32 number_of_sids; may be zero - __u32 length_of_sid_array; in bytes - may be zero - __u32 pad; reserved - MBZ - __u64 gid_array[0]; may be empty - __u8 * psid_list may be empty -*/ - -/* ... more as we think of them :-). */ - -/* SMB POSIX ACL definitions. */ -/* Wire format is (all little endian) : - -[2 bytes] - Version number. -[2 bytes] - Number of ACE entries to follow. -[2 bytes] - Number of default ACE entries to follow. -------------------------------------- -^ -| -ACE entries -| -v -------------------------------------- -^ -| -Default ACE entries -| -v -------------------------------------- - -Where an ACE entry looks like : - -[1 byte] - Entry type. - -Entry types are : - -ACL_USER_OBJ 0x01 -ACL_USER 0x02 -ACL_GROUP_OBJ 0x04 -ACL_GROUP 0x08 -ACL_MASK 0x10 -ACL_OTHER 0x20 - -[1 byte] - permissions (perm_t) - -perm_t types are : - -ACL_READ 0x04 -ACL_WRITE 0x02 -ACL_EXECUTE 0x01 - -[8 bytes] - uid/gid to apply this permission to. - -In the same format as the uid/gid fields in the other -UNIX extensions definitions. Use 0xFFFFFFFFFFFFFFFF for -the MASK and OTHER entry types. - -If the Number of ACE entries for either file or default ACE's -is set to 0xFFFF this means ignore this kind of ACE (and the -number of entries sent will be zero. - -*/ - -#define SMB_QUERY_POSIX_WHOAMI 0x202 - -enum smb_whoami_flags { - SMB_WHOAMI_GUEST = 0x1 /* Logged in as (or squashed to) guest */ -}; - -/* Mask of which WHOAMI bits are valid. This should make it easier for clients - * to cope with servers that have different sets of WHOAMI flags (as more get - * added). - */ -#define SMB_WHOAMI_MASK 0x00000001 - -/* - SMBWhoami - Query the user mapping performed by the server for the - connected tree. This is a subcommand of the TRANS2_QFSINFO. - - Returns: - 4 bytes unsigned - mapping flags (smb_whoami_flags) - 4 bytes unsigned - flags mask - - 8 bytes unsigned - primary UID - 8 bytes unsigned - primary GID - 4 bytes unsigned - number of supplementary GIDs - 4 bytes unsigned - number of SIDs - 4 bytes unsigned - SID list byte count - 4 bytes - pad / reserved (must be zero) - - 8 bytes unsigned[] - list of GIDs (may be empty) - struct dom_sid[] - list of SIDs (may be empty) -*/ - -/* - * The following trans2 is done between client and server - * as a FSINFO call to set up the encryption state for transport - * encryption. - * This is a subcommand of the TRANS2_QFSINFO. - * - * The request looks like : - * - * [data block] -> SPNEGO framed GSSAPI request. - * - * The reply looks like : - * - * [data block] -> SPNEGO framed GSSAPI reply - if error - * is NT_STATUS_OK then we're done, if it's - * NT_STATUS_MORE_PROCESSING_REQUIRED then the - * client needs to keep going. If it's an - * error it can be any NT_STATUS error. - * - */ - -#define SMB_REQUEST_TRANSPORT_ENCRYPTION 0x203 /* QFSINFO */ - - -/* The query/set info levels for POSIX ACLs. */ -#define SMB_QUERY_POSIX_ACL 0x204 -#define SMB_SET_POSIX_ACL 0x204 - -/* Current on the wire ACL version. */ -#define SMB_POSIX_ACL_VERSION 1 - -/* ACE entry type. */ -#define SMB_POSIX_ACL_USER_OBJ 0x01 -#define SMB_POSIX_ACL_USER 0x02 -#define SMB_POSIX_ACL_GROUP_OBJ 0x04 -#define SMB_POSIX_ACL_GROUP 0x08 -#define SMB_POSIX_ACL_MASK 0x10 -#define SMB_POSIX_ACL_OTHER 0x20 - -/* perm_t types. */ -#define SMB_POSIX_ACL_READ 0x04 -#define SMB_POSIX_ACL_WRITE 0x02 -#define SMB_POSIX_ACL_EXECUTE 0x01 - -#define SMB_POSIX_ACL_HEADER_SIZE 6 -#define SMB_POSIX_ACL_ENTRY_SIZE 10 - -#define SMB_POSIX_IGNORE_ACE_ENTRIES 0xFFFF - -/* Definition of data block of SMB_SET_POSIX_LOCK */ -/* - [2 bytes] lock_type - 0 = Read, 1 = Write, 2 = Unlock - [2 bytes] lock_flags - 1 = Wait (only valid for setlock) - [4 bytes] pid = locking context. - [8 bytes] start = unsigned 64 bits. - [8 bytes] length = unsigned 64 bits. -*/ - -#define POSIX_LOCK_TYPE_OFFSET 0 -#define POSIX_LOCK_FLAGS_OFFSET 2 -#define POSIX_LOCK_PID_OFFSET 4 -#define POSIX_LOCK_START_OFFSET 8 -#define POSIX_LOCK_LEN_OFFSET 16 -#define POSIX_LOCK_DATA_SIZE 24 - -#define POSIX_LOCK_FLAG_NOWAIT 0 -#define POSIX_LOCK_FLAG_WAIT 1 - -#define POSIX_LOCK_TYPE_READ 0 -#define POSIX_LOCK_TYPE_WRITE 1 -#define POSIX_LOCK_TYPE_UNLOCK 2 - -/* SMB_POSIX_PATH_OPEN "open_mode" definitions. */ -#define SMB_O_RDONLY 0x1 -#define SMB_O_WRONLY 0x2 -#define SMB_O_RDWR 0x4 - -#define SMB_ACCMODE 0x7 - -#define SMB_O_CREAT 0x10 -#define SMB_O_EXCL 0x20 -#define SMB_O_TRUNC 0x40 -#define SMB_O_APPEND 0x80 -#define SMB_O_SYNC 0x100 -#define SMB_O_DIRECTORY 0x200 -#define SMB_O_NOFOLLOW 0x400 -#define SMB_O_DIRECT 0x800 - -/* Definition of request data block for SMB_POSIX_PATH_OPEN */ -/* - [4 bytes] flags (as smb_ntcreate_Flags). - [4 bytes] open_mode - SMB_O_xxx flags above. - [8 bytes] mode_t (permissions) - same encoding as "Standard UNIX permissions" above in SMB_SET_FILE_UNIX_BASIC. - [2 bytes] ret_info_level - optimization. Info level to be returned. -*/ - -/* Definition of reply data block for SMB_POSIX_PATH_OPEN */ - -#define SMB_NO_INFO_LEVEL_RETURNED 0xFFFF - -/* - [2 bytes] - flags field. Identical to flags reply for oplock response field in SMBNTCreateX) - [2 bytes] - FID returned. - [4 bytes] - CreateAction (same as in NTCreateX response). - [2 bytes] - reply info level - as requested or 0xFFFF if not available. - [2 bytes] - padding (must be zero) - [n bytes] - info level reply - if available. -*/ - -/* Definition of request data block for SMB_POSIX_UNLINK */ -/* - [2 bytes] flags (defined below). -*/ - -#define SMB_POSIX_UNLINK_FILE_TARGET 0 -#define SMB_POSIX_UNLINK_DIRECTORY_TARGET 1 - #endif -- cgit From d8cfca3a9bd2b6b6c562fd202377d95a98eb5472 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 5 May 2011 11:25:29 +0200 Subject: s3: only include tdb headers where needed. Guenther --- source3/include/ctdbd_conn.h | 2 ++ source3/include/dbwrap.h | 2 ++ source3/include/includes.h | 3 +-- source3/include/printing.h | 7 +++++-- 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index ef291fb4ad..36b6542da0 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -20,6 +20,8 @@ #ifndef _CTDBD_CONN_H #define _CTDBD_CONN_H +#include + struct ctdbd_connection; struct messaging_context; struct messaging_rec; diff --git a/source3/include/dbwrap.h b/source3/include/dbwrap.h index ef35b0071d..d657ee7f30 100644 --- a/source3/include/dbwrap.h +++ b/source3/include/dbwrap.h @@ -20,6 +20,8 @@ #ifndef __DBWRAP_H__ #define __DBWRAP_H__ +#include + struct db_record { TDB_DATA key, value; NTSTATUS (*store)(struct db_record *rec, TDB_DATA data, int flag); diff --git a/source3/include/includes.h b/source3/include/includes.h index 59aa45afd7..ddac6d02d1 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -510,8 +510,6 @@ typedef char fstring[FSTRING_LEN]; #include "../lib/util/attr.h" #include "../lib/util/tsort.h" #include "../lib/util/dlinklist.h" -#include -#include "util_tdb.h" #include @@ -522,6 +520,7 @@ typedef char fstring[FSTRING_LEN]; #include "../lib/util/debug.h" #include "../lib/util/debug_s3.h" +#include "../libcli/util/ntstatus.h" #include "libads/ads_status.h" #include "../libcli/util/error.h" #include "../lib/util/charset/charset.h" diff --git a/source3/include/printing.h b/source3/include/printing.h index 084c699c5b..bba7d53a16 100644 --- a/source3/include/printing.h +++ b/source3/include/printing.h @@ -158,9 +158,12 @@ extern struct printif iprint_printif; /* There can be this many printing tdb's open, plus any locked ones. */ #define MAX_PRINT_DBS_OPEN 1 +struct TDB_DATA; +struct tdb_context; + struct tdb_print_db { struct tdb_print_db *next, *prev; - TDB_CONTEXT *tdb; + struct tdb_context *tdb; int ref_count; fstring printer_name; }; @@ -249,7 +252,7 @@ uint32_t print_parse_jobid(const char *fname); struct tdb_print_db *get_print_db_byname(const char *printername); void release_print_db( struct tdb_print_db *pdb); void close_all_print_db(void); -TDB_DATA get_printer_notify_pid_list(TDB_CONTEXT *tdb, const char *printer_name, bool cleanlist); +struct TDB_DATA get_printer_notify_pid_list(struct tdb_context *tdb, const char *printer_name, bool cleanlist); void print_queue_receive(struct messaging_context *msg, void *private_data, -- cgit From 41134f7f4bb6cd2ff84422782dfb82845d881950 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 May 2011 14:03:00 +0200 Subject: s3-proto: remove some duplicate prototypes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Autobuild-User: Günther Deschner Autobuild-Date: Fri May 6 16:21:08 CEST 2011 on sn-devel-104 --- source3/include/proto.h | 54 ------------------------------------------------- 1 file changed, 54 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6be4643818..352e092f4d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -364,60 +364,6 @@ int sys_acl_valid(SMB_ACL_T acl_d); SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, const char *path_p, SMB_ACL_TYPE_T type); SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); -int sys_acl_set_file(vfs_handle_struct *handle, - const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); -int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, - SMB_ACL_T acl_d); -int sys_acl_delete_def_file(vfs_handle_struct *handle, - const char *path); -SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, - const char *path_p, SMB_ACL_TYPE_T type); -SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); -int sys_acl_set_file(vfs_handle_struct *handle, - const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); -int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, - SMB_ACL_T acl_d); -int sys_acl_delete_def_file(vfs_handle_struct *handle, - const char *path); -SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, - const char *path_p, SMB_ACL_TYPE_T type); -SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); -int sys_acl_set_file(vfs_handle_struct *handle, - const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); -int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, - SMB_ACL_T acl_d); -int sys_acl_delete_def_file(vfs_handle_struct *handle, - const char *path); -SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, - const char *path_p, SMB_ACL_TYPE_T type); -SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); -int sys_acl_set_file(vfs_handle_struct *handle, - const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); -int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, - SMB_ACL_T acl_d); -int sys_acl_delete_def_file(vfs_handle_struct *handle, - const char *path); -SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, - const char *path_p, SMB_ACL_TYPE_T type); -SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); -int sys_acl_set_file(vfs_handle_struct *handle, - const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); -int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, - SMB_ACL_T acl_d); -int sys_acl_delete_def_file(vfs_handle_struct *handle, - const char *path); -SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, - const char *path_p, SMB_ACL_TYPE_T type); -SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); -int sys_acl_set_file(vfs_handle_struct *handle, - const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); -int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, - SMB_ACL_T acl_d); -int sys_acl_delete_def_file(vfs_handle_struct *handle, - const char *path); -SMB_ACL_T sys_acl_get_file(vfs_handle_struct *handle, - const char *path_p, SMB_ACL_TYPE_T type); -SMB_ACL_T sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp); int sys_acl_set_file(vfs_handle_struct *handle, const char *name, SMB_ACL_TYPE_T type, SMB_ACL_T acl_d); int sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, -- cgit From 27022587e31769718ab53f4d114e03ac2f205f27 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 May 2011 11:47:43 +0200 Subject: s3-libsmb: move protos to libsmb/proto.h Guenther --- source3/include/proto.h | 812 ------------------------------------------------ 1 file changed, 812 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 352e092f4d..c7d0827665 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -964,735 +964,6 @@ void wins_srv_tags_free(char **list); struct in_addr wins_srv_ip_tag(const char *tag, struct in_addr src_ip); unsigned wins_srv_count_tag(const char *tag); -/* The following definitions come from libsmb/cliconnect.c */ - -ADS_STATUS cli_session_setup_spnego(struct cli_state *cli, const char *user, - const char *pass, const char *user_domain, - const char * dest_realm); - -NTSTATUS cli_session_setup(struct cli_state *cli, - const char *user, - const char *pass, int passlen, - const char *ntpass, int ntpasslen, - const char *workgroup); -struct tevent_req *cli_session_setup_guest_create(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - struct tevent_req **psmbreq); -struct tevent_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 tevent_req *req); -struct tevent_req *cli_ulogoff_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct cli_state *cli); -NTSTATUS cli_ulogoff_recv(struct tevent_req *req); -NTSTATUS cli_ulogoff(struct cli_state *cli); -struct tevent_req *cli_tcon_andx_create(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *share, const char *dev, - const char *pass, int passlen, - struct tevent_req **psmbreq); -struct tevent_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 tevent_req *req); -NTSTATUS cli_tcon_andx(struct cli_state *cli, const char *share, - const char *dev, const char *pass, int passlen); -struct tevent_req *cli_tdis_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct cli_state *cli); -NTSTATUS cli_tdis_recv(struct tevent_req *req); -NTSTATUS cli_tdis(struct cli_state *cli); -NTSTATUS cli_negprot(struct cli_state *cli); -struct tevent_req *cli_negprot_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli); -NTSTATUS cli_negprot_recv(struct tevent_req *req); -bool cli_session_request(struct cli_state *cli, - struct nmb_name *calling, struct nmb_name *called); -NTSTATUS cli_connect(struct cli_state *cli, - const char *host, - struct sockaddr_storage *dest_ss); -NTSTATUS cli_start_connection(struct cli_state **output_cli, - const char *my_name, - const char *dest_host, - struct sockaddr_storage *dest_ss, int port, - int signing_state, int flags); -NTSTATUS cli_full_connection(struct cli_state **output_cli, - const char *my_name, - const char *dest_host, - struct sockaddr_storage *dest_ss, int port, - const char *service, const char *service_type, - const char *user, const char *domain, - const char *password, int flags, - int signing_state); -bool attempt_netbios_session_request(struct cli_state **ppcli, const char *srchost, const char *desthost, - struct sockaddr_storage *pdest_ss); -NTSTATUS cli_raw_tcon(struct cli_state *cli, - const char *service, const char *pass, const char *dev, - uint16 *max_xmit, uint16 *tid); -struct cli_state *get_ipc_connect(char *server, - struct sockaddr_storage *server_ss, - const struct user_auth_info *user_info); -struct cli_state *get_ipc_connect_master_ip(TALLOC_CTX *ctx, - struct sockaddr_storage *mb_ip, - const struct user_auth_info *user_info, - char **pp_workgroup_out); -struct cli_state *get_ipc_connect_master_ip_bcast(TALLOC_CTX *ctx, - const struct user_auth_info *user_info, - char **pp_workgroup_out); - -/* The following definitions come from libsmb/clidfs.c */ - -NTSTATUS cli_cm_force_encryption(struct cli_state *c, - const char *username, - const char *password, - const char *domain, - const char *sharename); -struct cli_state *cli_cm_open(TALLOC_CTX *ctx, - struct cli_state *referring_cli, - const char *server, - const char *share, - const struct user_auth_info *auth_info, - bool show_hdr, - bool force_encrypt, - int max_protocol, - int port, - int name_type); -void cli_cm_display(const struct cli_state *c); -struct client_dfs_referral; -NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx, - struct cli_state *cli, - const char *path, - struct client_dfs_referral **refs, - size_t *num_refs, - size_t *consumed); -bool cli_resolve_path(TALLOC_CTX *ctx, - const char *mountpt, - const struct user_auth_info *dfs_auth_info, - struct cli_state *rootcli, - const char *path, - struct cli_state **targetcli, - char **pp_targetpath); - -bool cli_check_msdfs_proxy(TALLOC_CTX *ctx, - struct cli_state *cli, - const char *sharename, - char **pp_newserver, - char **pp_newshare, - bool force_encrypt, - const char *username, - const char *password, - const char *domain); - -/* The following definitions come from libsmb/clientgen.c */ - -int cli_set_message(char *buf,int num_words,int num_bytes,bool zero); -unsigned int cli_set_timeout(struct cli_state *cli, unsigned int timeout); -void cli_set_port(struct cli_state *cli, int port); -bool cli_state_seqnum_persistent(struct cli_state *cli, - uint16_t mid); -bool cli_state_seqnum_remove(struct cli_state *cli, - uint16_t mid); -bool cli_receive_smb(struct cli_state *cli); -bool cli_send_smb(struct cli_state *cli); -void cli_setup_packet_buf(struct cli_state *cli, char *buf); -void cli_setup_packet(struct cli_state *cli); -void cli_setup_bcc(struct cli_state *cli, void *p); -NTSTATUS cli_set_domain(struct cli_state *cli, const char *domain); -NTSTATUS cli_set_username(struct cli_state *cli, const char *username); -NTSTATUS cli_set_password(struct cli_state *cli, const char *password); -NTSTATUS cli_init_creds(struct cli_state *cli, const char *username, const char *domain, const char *password); -struct cli_state *cli_initialise(void); -struct cli_state *cli_initialise_ex(int signing_state); -void cli_nt_pipes_close(struct cli_state *cli); -void cli_shutdown(struct cli_state *cli); -void cli_sockopt(struct cli_state *cli, const char *options); -uint16 cli_setpid(struct cli_state *cli, uint16 pid); -bool cli_set_case_sensitive(struct cli_state *cli, bool case_sensitive); -struct tevent_req *cli_echo_send(TALLOC_CTX *mem_ctx, struct event_context *ev, - struct cli_state *cli, uint16_t num_echos, - DATA_BLOB data); -NTSTATUS cli_echo_recv(struct tevent_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); -NTSTATUS cli_smb(TALLOC_CTX *mem_ctx, struct cli_state *cli, - uint8_t smb_command, uint8_t additional_flags, - uint8_t wct, uint16_t *vwv, - uint32_t num_bytes, const uint8_t *bytes, - struct tevent_req **result_parent, - uint8_t min_wct, uint8_t *pwct, uint16_t **pvwv, - uint32_t *pnum_bytes, uint8_t **pbytes); - -/* The following definitions come from libsmb/clierror.c */ - -const char *cli_errstr(struct cli_state *cli); -NTSTATUS cli_nt_error(struct cli_state *cli); -void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *ecode); -int cli_errno(struct cli_state *cli); -bool cli_is_error(struct cli_state *cli); -bool cli_is_nt_error(struct cli_state *cli); -bool cli_is_dos_error(struct cli_state *cli); -NTSTATUS cli_get_nt_error(struct cli_state *cli); -void cli_set_nt_error(struct cli_state *cli, NTSTATUS status); -void cli_reset_error(struct cli_state *cli); -bool cli_state_is_connected(struct cli_state *cli); - -/* The following definitions come from libsmb/clifile.c */ - -struct tevent_req *cli_setpathinfo_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct cli_state *cli, - uint16_t level, - const char *path, - uint8_t *data, - size_t data_len); -NTSTATUS cli_setpathinfo_recv(struct tevent_req *req); -NTSTATUS cli_setpathinfo(struct cli_state *cli, - uint16_t level, - const char *path, - uint8_t *data, - size_t data_len); - -struct tevent_req *cli_posix_symlink_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *oldname, - const char *newname); -NTSTATUS cli_posix_symlink_recv(struct tevent_req *req); -NTSTATUS cli_posix_symlink(struct cli_state *cli, - const char *oldname, - const char *newname); -struct tevent_req *cli_posix_readlink_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname, - size_t len); -NTSTATUS cli_posix_readlink_recv(struct tevent_req *req, struct cli_state *cli, - char *retpath, size_t len); -NTSTATUS cli_posix_readlink(struct cli_state *cli, const char *fname, - char *linkpath, size_t len); -struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *oldname, - const char *newname); -NTSTATUS cli_posix_hardlink_recv(struct tevent_req *req); -NTSTATUS cli_posix_hardlink(struct cli_state *cli, - const char *oldname, - const char *newname); -uint32_t unix_perms_to_wire(mode_t perms); -mode_t wire_perms_to_unix(uint32_t perms); -struct tevent_req *cli_posix_getfacl_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname); -NTSTATUS cli_posix_getfacl_recv(struct tevent_req *req, - TALLOC_CTX *mem_ctx, - size_t *prb_size, - char **retbuf); -NTSTATUS cli_posix_getfacl(struct cli_state *cli, - const char *fname, - TALLOC_CTX *mem_ctx, - size_t *prb_size, - char **retbuf); -struct tevent_req *cli_posix_stat_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname); -NTSTATUS cli_posix_stat_recv(struct tevent_req *req, - SMB_STRUCT_STAT *sbuf); -NTSTATUS cli_posix_stat(struct cli_state *cli, - const char *fname, - SMB_STRUCT_STAT *sbuf); -struct tevent_req *cli_posix_chmod_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname, - mode_t mode); -NTSTATUS cli_posix_chmod_recv(struct tevent_req *req); -NTSTATUS cli_posix_chmod(struct cli_state *cli, const char *fname, mode_t mode); -struct tevent_req *cli_posix_chown_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname, - uid_t uid, - gid_t gid); -NTSTATUS cli_posix_chown_recv(struct tevent_req *req); -NTSTATUS cli_posix_chown(struct cli_state *cli, - const char *fname, - uid_t uid, - gid_t gid); -struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname_src, - const char *fname_dst); -NTSTATUS cli_rename_recv(struct tevent_req *req); -NTSTATUS cli_rename(struct cli_state *cli, const char *fname_src, const char *fname_dst); -struct tevent_req *cli_ntrename_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname_src, - const char *fname_dst); -NTSTATUS cli_ntrename_recv(struct tevent_req *req); -NTSTATUS cli_ntrename(struct cli_state *cli, const char *fname_src, const char *fname_dst); - -struct tevent_req *cli_nt_hardlink_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname_src, - const char *fname_dst); -NTSTATUS cli_nt_hardlink_recv(struct tevent_req *req); -NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const char *fname_dst); - -struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname, - uint16_t mayhave_attrs); -NTSTATUS cli_unlink_recv(struct tevent_req *req); -NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint16_t mayhave_attrs); - -struct tevent_req *cli_mkdir_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *dname); -NTSTATUS cli_mkdir_recv(struct tevent_req *req); -NTSTATUS cli_mkdir(struct cli_state *cli, const char *dname); -struct tevent_req *cli_rmdir_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *dname); -NTSTATUS cli_rmdir_recv(struct tevent_req *req); -NTSTATUS cli_rmdir(struct cli_state *cli, const char *dname); -struct tevent_req *cli_nt_delete_on_close_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - uint16_t fnum, - bool flag); -NTSTATUS cli_nt_delete_on_close_recv(struct tevent_req *req); -NTSTATUS cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag); -struct tevent_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 tevent_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); -uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2, const char *str, - size_t str_len, size_t *pconverted_size); -uint8_t *smb_bytes_push_bytes(uint8_t *buf, uint8_t prefix, - const uint8_t *bytes, size_t num_bytes); -struct tevent_req *cli_open_create(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, const char *fname, - int flags, int share_mode, - struct tevent_req **psmbreq); -struct tevent_req *cli_open_send(TALLOC_CTX *mem_ctx, struct event_context *ev, - struct cli_state *cli, const char *fname, - int flags, int share_mode); -NTSTATUS cli_open_recv(struct tevent_req *req, uint16_t *fnum); -NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags, int share_mode, uint16_t *pfnum); -struct tevent_req *cli_close_create(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, uint16_t fnum, - struct tevent_req **psubreq); -struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, uint16_t fnum); -NTSTATUS cli_close_recv(struct tevent_req *req); -NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum); -struct tevent_req *cli_ftruncate_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - uint16_t fnum, - uint64_t size); -NTSTATUS cli_ftruncate_recv(struct tevent_req *req); -NTSTATUS cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size); -NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum, - uint32_t offset, uint32_t len, - int timeout, unsigned char locktype); -bool cli_lock(struct cli_state *cli, uint16_t fnum, - uint32_t offset, uint32_t len, int timeout, enum brl_type lock_type); -struct tevent_req *cli_unlock_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - uint16_t fnum, - uint64_t offset, - uint64_t len); -NTSTATUS cli_unlock_recv(struct tevent_req *req); -NTSTATUS cli_unlock(struct cli_state *cli, uint16_t fnum, uint32_t offset, uint32_t len); -bool cli_lock64(struct cli_state *cli, uint16_t fnum, - uint64_t offset, uint64_t len, int timeout, enum brl_type lock_type); -struct tevent_req *cli_unlock64_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - uint16_t fnum, - uint64_t offset, - uint64_t len); -NTSTATUS cli_unlock64_recv(struct tevent_req *req); -NTSTATUS cli_unlock64(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len); -struct tevent_req *cli_posix_lock_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - uint16_t fnum, - uint64_t offset, - uint64_t len, - bool wait_lock, - enum brl_type lock_type); -NTSTATUS cli_posix_lock_recv(struct tevent_req *req); -NTSTATUS cli_posix_lock(struct cli_state *cli, uint16_t fnum, - uint64_t offset, uint64_t len, - bool wait_lock, enum brl_type lock_type); -struct tevent_req *cli_posix_unlock_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - uint16_t fnum, - uint64_t offset, - uint64_t len); -NTSTATUS cli_posix_unlock_recv(struct tevent_req *req); -NTSTATUS cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset, uint64_t len); -struct tevent_req *cli_getattrE_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - uint16_t fnum); -NTSTATUS cli_getattrE_recv(struct tevent_req *req, - uint16_t *attr, - SMB_OFF_T *size, - time_t *change_time, - time_t *access_time, - time_t *write_time); -NTSTATUS cli_getattrE(struct cli_state *cli, - uint16_t fnum, - uint16_t *attr, - SMB_OFF_T *size, - time_t *change_time, - time_t *access_time, - time_t *write_time); -struct tevent_req *cli_setattrE_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - uint16_t fnum, - time_t change_time, - time_t access_time, - time_t write_time); -NTSTATUS cli_setattrE_recv(struct tevent_req *req); -NTSTATUS cli_setattrE(struct cli_state *cli, - uint16_t fnum, - time_t change_time, - time_t access_time, - time_t write_time); -struct tevent_req *cli_getatr_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname); -NTSTATUS cli_getatr_recv(struct tevent_req *req, - uint16_t *attr, - SMB_OFF_T *size, - time_t *write_time); -NTSTATUS cli_getatr(struct cli_state *cli, - const char *fname, - uint16_t *attr, - SMB_OFF_T *size, - time_t *write_time); -struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname, - uint16_t attr, - time_t mtime); -NTSTATUS cli_setatr_recv(struct tevent_req *req); -NTSTATUS cli_setatr(struct cli_state *cli, - const char *fname, - uint16_t attr, - time_t mtime); -struct tevent_req *cli_chkpath_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname); -NTSTATUS cli_chkpath_recv(struct tevent_req *req); -NTSTATUS cli_chkpath(struct cli_state *cli, const char *path); -struct tevent_req *cli_dskattr_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli); -NTSTATUS cli_dskattr_recv(struct tevent_req *req, int *bsize, int *total, - int *avail); -NTSTATUS cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail); -struct tevent_req *cli_ctemp_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *path); -NTSTATUS cli_ctemp_recv(struct tevent_req *req, - TALLOC_CTX *ctx, - uint16_t *pfnum, - char **outfile); -NTSTATUS cli_ctemp(struct cli_state *cli, - TALLOC_CTX *ctx, - const char *path, - uint16_t *pfnum, - char **out_path); -NTSTATUS cli_raw_ioctl(struct cli_state *cli, uint16_t fnum, uint32_t code, DATA_BLOB *blob); -NTSTATUS cli_set_ea_path(struct cli_state *cli, const char *path, - const char *ea_name, const char *ea_val, - size_t ea_len); -NTSTATUS cli_set_ea_fnum(struct cli_state *cli, uint16_t fnum, - const char *ea_name, const char *ea_val, - size_t ea_len); -struct tevent_req *cli_get_ea_list_path_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct cli_state *cli, - const char *fname); -NTSTATUS cli_get_ea_list_path_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, - size_t *pnum_eas, struct ea_struct **peas); -NTSTATUS cli_get_ea_list_path(struct cli_state *cli, const char *path, - TALLOC_CTX *ctx, - size_t *pnum_eas, - struct ea_struct **pea_list); -struct tevent_req *cli_posix_open_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname, - int flags, - mode_t mode); -NTSTATUS cli_posix_open_recv(struct tevent_req *req, uint16_t *pfnum); -NTSTATUS cli_posix_open(struct cli_state *cli, const char *fname, - int flags, mode_t mode, uint16_t *fnum); -struct tevent_req *cli_posix_mkdir_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname, - mode_t mode); -NTSTATUS cli_posix_mkdir_recv(struct tevent_req *req); -NTSTATUS cli_posix_mkdir(struct cli_state *cli, const char *fname, mode_t mode); - -struct tevent_req *cli_posix_unlink_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname); -NTSTATUS cli_posix_unlink_recv(struct tevent_req *req); -NTSTATUS cli_posix_unlink(struct cli_state *cli, const char *fname); - -struct tevent_req *cli_posix_rmdir_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - const char *fname); -NTSTATUS cli_posix_rmdir_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx); -NTSTATUS cli_posix_rmdir(struct cli_state *cli, const char *fname); -struct tevent_req *cli_notify_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct cli_state *cli, uint16_t fnum, - uint32_t buffer_size, - uint32_t completion_filter, bool recursive); -NTSTATUS cli_notify_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, - uint32_t *pnum_changes, - struct notify_change **pchanges); - -/* The following definitions come from libsmb/clifsinfo.c */ - -struct tevent_req *cli_unix_extensions_version_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct cli_state *cli); -NTSTATUS cli_unix_extensions_version_recv(struct tevent_req *req, - uint16_t *pmajor, uint16_t *pminor, - uint32_t *pcaplow, - uint32_t *pcaphigh); -NTSTATUS cli_unix_extensions_version(struct cli_state *cli, uint16 *pmajor, - uint16 *pminor, uint32 *pcaplow, - uint32 *pcaphigh); -struct tevent_req *cli_set_unix_extensions_capabilities_send( - TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli, - uint16_t major, uint16_t minor, uint32_t caplow, uint32_t caphigh); -NTSTATUS cli_set_unix_extensions_capabilities_recv(struct tevent_req *req); -NTSTATUS cli_set_unix_extensions_capabilities(struct cli_state *cli, - uint16 major, uint16 minor, - uint32 caplow, uint32 caphigh); -struct tevent_req *cli_get_fs_attr_info_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct cli_state *cli); -NTSTATUS cli_get_fs_attr_info_recv(struct tevent_req *req, uint32_t *fs_attr); -NTSTATUS cli_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr); -NTSTATUS cli_get_fs_volume_info(struct cli_state *cli, fstring volume_name, - uint32 *pserial_number, time_t *pdate); -NTSTATUS cli_get_fs_full_size_info(struct cli_state *cli, - uint64_t *total_allocation_units, - uint64_t *caller_allocation_units, - uint64_t *actual_allocation_units, - uint64_t *sectors_per_allocation_unit, - uint64_t *bytes_per_sector); -NTSTATUS cli_get_posix_fs_info(struct cli_state *cli, - uint32 *optimal_transfer_size, - uint32 *block_size, - uint64_t *total_blocks, - uint64_t *blocks_available, - uint64_t *user_blocks_available, - uint64_t *total_file_nodes, - uint64_t *free_file_nodes, - uint64_t *fs_identifier); -NTSTATUS cli_raw_ntlm_smb_encryption_start(struct cli_state *cli, - const char *user, - const char *pass, - const char *domain); -NTSTATUS cli_gss_smb_encryption_start(struct cli_state *cli); -NTSTATUS cli_force_encryption(struct cli_state *c, - const char *username, - const char *password, - const char *domain); - -/* The following definitions come from libsmb/clilist.c */ - -NTSTATUS cli_list_old(struct cli_state *cli,const char *Mask,uint16 attribute, - NTSTATUS (*fn)(const char *, struct file_info *, - const char *, void *), void *state); -NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask, - uint16_t attribute, int info_level, - NTSTATUS (*fn)(const char *mnt, struct file_info *finfo, - const char *mask, void *private_data), - void *private_data); -struct tevent_req *cli_list_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct cli_state *cli, - const char *mask, - uint16_t attribute, - uint16_t info_level); -NTSTATUS cli_list_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, - struct file_info **finfo, size_t *num_finfo); -NTSTATUS cli_list(struct cli_state *cli,const char *Mask,uint16 attribute, - NTSTATUS (*fn)(const char *, struct file_info *, const char *, - void *), void *state); - -/* The following definitions come from libsmb/climessage.c */ - -struct tevent_req *cli_message_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct cli_state *cli, - const char *host, const char *username, - const char *message); -NTSTATUS cli_message_recv(struct tevent_req *req); -NTSTATUS cli_message(struct cli_state *cli, const char *host, - const char *username, const char *message); - -/* The following definitions come from libsmb/clioplock.c */ - -struct tevent_req *cli_oplock_ack_send(TALLOC_CTX *mem_ctx, - struct tevent_context *ev, - struct cli_state *cli, - uint16_t fnum, uint8_t level); -NTSTATUS cli_oplock_ack_recv(struct tevent_req *req); -NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char level); -void cli_oplock_handler(struct cli_state *cli, - NTSTATUS (*handler)(struct cli_state *, uint16_t, unsigned char)); - -/* The following definitions come from libsmb/cliprint.c */ - -int cli_print_queue(struct cli_state *cli, - void (*fn)(struct print_job_info *)); -int cli_printjob_del(struct cli_state *cli, int job); - -/* The following definitions come from libsmb/cliquota.c */ - -NTSTATUS cli_get_quota_handle(struct cli_state *cli, uint16_t *quota_fnum); -void free_ntquota_list(SMB_NTQUOTA_LIST **qt_list); -NTSTATUS cli_get_user_quota(struct cli_state *cli, int quota_fnum, - SMB_NTQUOTA_STRUCT *pqt); -NTSTATUS cli_set_user_quota(struct cli_state *cli, int quota_fnum, - SMB_NTQUOTA_STRUCT *pqt); -NTSTATUS cli_list_user_quota(struct cli_state *cli, int quota_fnum, - SMB_NTQUOTA_LIST **pqt_list); -NTSTATUS cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, - SMB_NTQUOTA_STRUCT *pqt); -NTSTATUS cli_set_fs_quota_info(struct cli_state *cli, int quota_fnum, - SMB_NTQUOTA_STRUCT *pqt); - -/* The following definitions come from libsmb/clireadwrite.c */ - -struct tevent_req *cli_read_andx_create(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, uint16_t fnum, - off_t offset, size_t size, - struct tevent_req **psmbreq); -struct tevent_req *cli_read_andx_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, uint16_t fnum, - off_t offset, size_t size); -NTSTATUS cli_read_andx_recv(struct tevent_req *req, ssize_t *received, - uint8_t **rcvbuf); -struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, - uint16_t fnum, off_t start_offset, - SMB_OFF_T size, size_t window_size, - NTSTATUS (*sink)(char *buf, size_t n, - void *priv), - void *priv); -NTSTATUS cli_pull_recv(struct tevent_req *req, SMB_OFF_T *received); -NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum, - off_t start_offset, SMB_OFF_T size, size_t window_size, - NTSTATUS (*sink)(char *buf, size_t n, void *priv), - void *priv, SMB_OFF_T *received); -ssize_t cli_read(struct cli_state *cli, uint16_t fnum, char *buf, - off_t offset, size_t size); -NTSTATUS cli_smbwrite(struct cli_state *cli, uint16_t fnum, char *buf, - off_t offset, size_t size1, size_t *ptotal); -struct tevent_req *cli_write_andx_create(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, uint16_t fnum, - uint16_t mode, const uint8_t *buf, - off_t offset, size_t size, - struct tevent_req **reqs_before, - int num_reqs_before, - struct tevent_req **psmbreq); -struct tevent_req *cli_write_andx_send(TALLOC_CTX *mem_ctx, - struct event_context *ev, - struct cli_state *cli, uint16_t fnum, - uint16_t mode, const uint8_t *buf, - off_t offset, size_t size); -NTSTATUS cli_write_andx_recv(struct tevent_req *req, size_t *pwritten); - -NTSTATUS cli_writeall(struct cli_state *cli, uint16_t fnum, uint16_t mode, - const uint8_t *buf, off_t offset, size_t size, - size_t *pwritten); - -struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev, - struct cli_state *cli, - uint16_t fnum, uint16_t mode, - off_t start_offset, size_t window_size, - size_t (*source)(uint8_t *buf, size_t n, - void *priv), - void *priv); -NTSTATUS cli_push_recv(struct tevent_req *req); -NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode, - off_t start_offset, size_t window_size, - size_t (*source)(uint8_t *buf, size_t n, void *priv), - void *priv); - -/* The following definitions come from libsmb/clisecdesc.c */ - -struct security_descriptor *cli_query_secdesc(struct cli_state *cli, uint16_t fnum, - TALLOC_CTX *mem_ctx); -NTSTATUS cli_set_secdesc(struct cli_state *cli, uint16_t fnum, - struct security_descriptor *sd); - /* The following definitions come from libsmb/clispnego.c */ DATA_BLOB spnego_gen_negTokenInit(TALLOC_CTX *ctx, @@ -1736,57 +1007,6 @@ DATA_BLOB spnego_gen_auth_response_and_mic(TALLOC_CTX *ctx, bool spnego_mech_list_blob(TALLOC_CTX *mem_ctx, char **oid_list, DATA_BLOB *data); -/* The following definitions come from libsmb/clistr.c */ - -size_t clistr_push_fn(struct cli_state *cli, - void *dest, - const char *src, - int dest_len, - int flags); -size_t clistr_pull_fn(const char *inbuf, - char *dest, - const void *src, - int dest_len, - int src_len, - int flags); -size_t clistr_pull_talloc(TALLOC_CTX *ctx, - const char *base, - uint16_t flags2, - char **pp_dest, - const void *src, - int src_len, - int flags); -size_t clistr_align_out(struct cli_state *cli, const void *p, int flags); - -/* The following definitions come from libsmb/clitrans.c */ - -struct tevent_req *cli_trans_send( - TALLOC_CTX *mem_ctx, struct event_context *ev, - struct cli_state *cli, uint8_t cmd, - const char *pipe_name, uint16_t fid, uint16_t function, int flags, - uint16_t *setup, uint8_t num_setup, uint8_t max_setup, - uint8_t *param, uint32_t num_param, uint32_t max_param, - uint8_t *data, uint32_t num_data, uint32_t max_data); -NTSTATUS cli_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, - uint16_t *recv_flags2, - uint16_t **setup, uint8_t min_setup, - uint8_t *num_setup, - uint8_t **param, uint32_t min_param, - uint32_t *num_param, - uint8_t **data, uint32_t min_data, - uint32_t *num_data); -NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli, - uint8_t trans_cmd, - const char *pipe_name, uint16_t fid, uint16_t function, - int flags, - uint16_t *setup, uint8_t num_setup, uint8_t max_setup, - uint8_t *param, uint32_t num_param, uint32_t max_param, - uint8_t *data, uint32_t num_data, uint32_t max_data, - uint16_t *recv_flags2, - uint16_t **rsetup, uint8_t min_rsetup, uint8_t *num_rsetup, - uint8_t **rparam, uint32_t min_rparam, uint32_t *num_rparam, - uint8_t **rdata, uint32_t min_rdata, uint32_t *num_rdata); - /* The following definitions come from libsmb/conncache.c */ NTSTATUS check_negative_conn_cache( const char *domain, const char *server); @@ -1964,38 +1184,6 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3); struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct dom_sid *user_sid); bool netsamlogon_cache_have(const struct dom_sid *user_sid); -/* The following definitions come from libsmb/smb_seal.c */ - -NTSTATUS get_enc_ctx_num(const uint8_t *buf, uint16 *p_enc_ctx_num); -bool common_encryption_on(struct smb_trans_enc_state *es); -NTSTATUS common_ntlm_decrypt_buffer(struct ntlmssp_state *ntlmssp_state, char *buf); -NTSTATUS common_ntlm_encrypt_buffer(struct ntlmssp_state *ntlmssp_state, - uint16 enc_ctx_num, - char *buf, - char **ppbuf_out); -NTSTATUS common_encrypt_buffer(struct smb_trans_enc_state *es, char *buffer, char **buf_out); -NTSTATUS common_decrypt_buffer(struct smb_trans_enc_state *es, char *buf); -void common_free_encryption_state(struct smb_trans_enc_state **pp_es); -void common_free_enc_buffer(struct smb_trans_enc_state *es, char *buf); -bool cli_encryption_on(struct cli_state *cli); -void cli_free_encryption_context(struct cli_state *cli); -void cli_free_enc_buffer(struct cli_state *cli, char *buf); -NTSTATUS cli_decrypt_message(struct cli_state *cli); -NTSTATUS cli_encrypt_message(struct cli_state *cli, char *buf, char **buf_out); - -/* The following definitions come from libsmb/clisigning.c */ - -bool cli_simple_set_signing(struct cli_state *cli, - const DATA_BLOB user_session_key, - const DATA_BLOB response); -bool cli_temp_set_signing(struct cli_state *cli); -void cli_calculate_sign_mac(struct cli_state *cli, char *buf, uint32_t *seqnum); -bool cli_check_sign_mac(struct cli_state *cli, const char *buf, uint32_t seqnum); -bool client_is_signing_on(struct cli_state *cli); -bool client_is_signing_allowed(struct cli_state *cli); -bool client_is_signing_mandatory(struct cli_state *cli); -void cli_set_signing_negotiated(struct cli_state *cli); - /* The following definitions come from libsmb/smberr.c */ const char *smb_dos_err_name(uint8 e_class, uint16 num); -- cgit From 675573d54b717ffc24cf3b49301ff649aecc259a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 May 2011 12:53:38 +0200 Subject: s3-includes: finally only include client.h when libsmb is used. Guenther --- source3/include/async_smb.h | 2 +- source3/include/includes.h | 2 -- source3/include/proto.h | 1 + 3 files changed, 2 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/async_smb.h b/source3/include/async_smb.h index d2303cc703..a8852b2eea 100644 --- a/source3/include/async_smb.h +++ b/source3/include/async_smb.h @@ -20,7 +20,7 @@ #ifndef __ASYNC_SMB_H__ #define __ASYNC_SMB_H__ -#include "includes.h" +struct cli_state; /* * Fetch an error out of a NBT packet diff --git a/source3/include/includes.h b/source3/include/includes.h index ddac6d02d1..5e8b21235d 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -530,8 +530,6 @@ typedef char fstring[FSTRING_LEN]; #include "smb.h" #include "../lib/util/byteorder.h" -#include "client.h" - #include "module.h" #include "../lib/util/talloc_stack.h" #include "../lib/util/smb_threads.h" diff --git a/source3/include/proto.h b/source3/include/proto.h index c7d0827665..e0bdabc780 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1695,6 +1695,7 @@ const char *lp_printcapname(void); bool lp_disable_spoolss( void ); void lp_set_spoolss_state( uint32 state ); uint32 lp_get_spoolss_state( void ); +struct smb_signing_state; bool lp_use_sendfile(int snum, struct smb_signing_state *signing_state); void set_use_sendfile(int snum, bool val); void set_store_dos_attributes(int snum, bool val); -- cgit From 1e208a705718adb105d89093041c0ba5d51f2429 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 May 2011 12:54:59 +0200 Subject: s3-includes: no need to globally include libads/ads_status.h. Guenther --- source3/include/ads.h | 1 + source3/include/includes.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/ads.h b/source3/include/ads.h index ee6e5b8649..8a8ce28e53 100644 --- a/source3/include/ads.h +++ b/source3/include/ads.h @@ -6,6 +6,7 @@ basically this is a wrapper around ldap */ +#include "libads/ads_status.h" #include "smb_ldap.h" struct ads_struct; diff --git a/source3/include/includes.h b/source3/include/includes.h index 5e8b21235d..e6b70c782c 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -521,7 +521,6 @@ typedef char fstring[FSTRING_LEN]; #include "../lib/util/debug_s3.h" #include "../libcli/util/ntstatus.h" -#include "libads/ads_status.h" #include "../libcli/util/error.h" #include "../lib/util/charset/charset.h" #include "dynconfig/dynconfig.h" -- cgit From 8b2ba64d603dd1ef1afde621f594dc46f2133708 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 7 May 2011 13:32:20 +0200 Subject: libds: moved enum security_types to a common header Pair-Programmed-With: Andrew Bartlett --- source3/include/smb.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb.h b/source3/include/smb.h index d584a9db45..863ba7cf1f 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1296,9 +1296,6 @@ enum protocol_types { PROTOCOL_SMB2 }; -/* security levels */ -enum security_types {SEC_SHARE,SEC_USER,SEC_SERVER,SEC_DOMAIN,SEC_ADS}; - /* printing types */ enum printing_types {PRINT_BSD,PRINT_SYSV,PRINT_AIX,PRINT_HPUX, PRINT_QNX,PRINT_PLP,PRINT_LPRNG,PRINT_SOFTQ, -- cgit From 45e26fdeec4c6d3c4e75d648399ce2a8b3e26364 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 3 May 2011 09:32:01 +1000 Subject: s3-smbd: expose smbd_set_server_fd() this allows the fd to be setup by subsystems that want to use the s3 server core code Pair-Programmed-With: Andrew Bartlett Autobuild-User: Andrew Bartlett Autobuild-Date: Sun May 8 12:01:13 CEST 2011 on sn-devel-104 --- 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 e0bdabc780..7e25f8e3ad 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1856,6 +1856,7 @@ void send_stat_cache_delete_message(struct messaging_context *msg_ctx, NTSTATUS can_delete_directory(struct connection_struct *conn, const char *dirname); bool change_to_root_user(void); +void smbd_set_server_fd(int fd); struct event_context *smbd_event_context(void); void contend_level2_oplocks_begin(files_struct *fsp, enum level2_contention_type type); -- cgit From 897ef820a40afffbf337b5487a49d957464def67 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 2 May 2011 12:20:21 +1000 Subject: s3-lib Use common lib/socket code for get_interfaces() et al --- source3/include/interfaces.h | 49 -------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 source3/include/interfaces.h (limited to 'source3/include') diff --git a/source3/include/interfaces.h b/source3/include/interfaces.h deleted file mode 100644 index 6ba0e21f6d..0000000000 --- a/source3/include/interfaces.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Machine customisation and include handling - Copyright (C) Jeremy Allison 2007 - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 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 . -*/ -/* - This structure is used by lib/interfaces.c to return the list of network - interfaces on the machine -*/ - -#ifndef _INTERFACES_H -#define _INTERFACES_H - -#include "../replace/replace.h" -#include "../replace/system/network.h" - -struct iface_struct { - char name[16]; - int flags; - struct sockaddr_storage ip; - struct sockaddr_storage netmask; - struct sockaddr_storage bcast; -}; - -bool make_netmask(struct sockaddr_storage *pss_out, - const struct sockaddr_storage *pss_in, - unsigned long masklen); -void make_bcast(struct sockaddr_storage *pss_out, - const struct sockaddr_storage *pss_in, - const struct sockaddr_storage *nmask); -void make_net(struct sockaddr_storage *pss_out, - const struct sockaddr_storage *pss_in, - const struct sockaddr_storage *nmask); -int get_interfaces(TALLOC_CTX *mem_ctx, struct iface_struct **pifaces); - -#endif -- cgit From 7e8f086798c36f64581ed7444df535e85fa0b5af Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 9 May 2011 10:59:15 +0200 Subject: s3-build: Move generated config.h and config.h.in to include/autoconf This ensures that these are not found by the waf build, which causes issues when the wrong config.h is used by the recursive smbtorture build Andrew Bartlett --- source3/include/autoconf/README | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 source3/include/autoconf/README (limited to 'source3/include') diff --git a/source3/include/autoconf/README b/source3/include/autoconf/README new file mode 100644 index 0000000000..21afbc70ea --- /dev/null +++ b/source3/include/autoconf/README @@ -0,0 +1,5 @@ +This directory added so that the autoconf build can generate a +config.h in a location that the recursive waf build for smbtorture +won't find. + +Andrew Bartlett \ No newline at end of file -- cgit From 854467851da48e02dcd8f869cb031c8943707017 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 13 May 2011 10:02:42 +0200 Subject: s3-printing: Get the location info from cups. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Günther Deschner --- 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 7e25f8e3ad..8c00e3a274 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1634,7 +1634,8 @@ bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal); struct parm_struct *lp_get_parameter(const char *param_name); struct parm_struct *lp_next_parameter(int snum, int *i, int allparameters); bool lp_snum_ok(int iService); -void lp_add_one_printer(const char *name, const char *comment, void *pdata); +void lp_add_one_printer(const char *name, const char *comment, + const char *location, void *pdata); bool lp_loaded(void); void lp_killunused(bool (*snumused) (int)); void lp_kill_all_services(void); -- cgit From 9dd5704aba465520213068cc6c5dd54c41266cd6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 16 May 2011 15:39:01 -0700 Subject: Remove duplicate definition of SMB_VFS_NEXT_STRICT_UNLOCK. Found by herb@samba.org --- source3/include/vfs_macros.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index d04be9b5aa..4b1d1d258b 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -364,9 +364,6 @@ #define SMB_VFS_NEXT_TRANSLATE_NAME(handle, name, direction, mem_ctx, mapped_name) \ smb_vfs_call_translate_name((handle)->next, (name), (direction), (mem_ctx), (mapped_name)) -#define SMB_VFS_NEXT_STRICT_UNLOCK(handle, fsp, plock) \ - smb_vfs_call_strict_unlock((handle)->next, (fsp), (plock)) - #define SMB_VFS_FGET_NT_ACL(fsp, security_info, ppdesc) \ smb_vfs_call_fget_nt_acl((fsp)->conn->vfs_handles, (fsp), (security_info), (ppdesc)) #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc) \ -- cgit From b3258addb4bc861d8d0cf8842397c209ec2d3704 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 16 May 2011 22:26:00 +1000 Subject: s3-param: remove unused share_iterator functions --- source3/include/proto.h | 3 --- source3/include/smb.h | 4 ---- 2 files changed, 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8c00e3a274..39d607c205 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1675,9 +1675,6 @@ int lp_servicenumber(const char *pszServiceName); bool share_defined(const char *service_name); struct share_params *get_share_params(TALLOC_CTX *mem_ctx, const char *sharename); -struct share_iterator *share_list_all(TALLOC_CTX *mem_ctx); -struct share_params *next_share(struct share_iterator *list); -struct share_params *next_printer(struct share_iterator *list); struct share_params *snum2params_static(int snum); const char *volume_label(int snum); bool lp_domain_master(void); diff --git a/source3/include/smb.h b/source3/include/smb.h index 863ba7cf1f..ec78317b9b 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -397,10 +397,6 @@ struct share_params { int service; }; -struct share_iterator { - int next_id; -}; - typedef struct connection_struct { struct connection_struct *next, *prev; struct smbd_server_connection *sconn; /* can be NULL */ -- cgit From 7a11e5de395c928e4a37c58a7a7ac21a314449fe Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 16 May 2011 22:27:28 +1000 Subject: s3-param: Remove unused snum2params_static --- 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 39d607c205..96ccd34345 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1675,7 +1675,6 @@ int lp_servicenumber(const char *pszServiceName); bool share_defined(const char *service_name); struct share_params *get_share_params(TALLOC_CTX *mem_ctx, const char *sharename); -struct share_params *snum2params_static(int snum); const char *volume_label(int snum); bool lp_domain_master(void); bool lp_domain_master_true_or_auto(void); -- cgit From c615ebed6e3d273a682806b952d543e834e5630d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 13 May 2011 20:21:30 +0200 Subject: s3-lib Replace StrCaseCmp() with strcasecmp_m() strcasecmp_m() never needs to call to talloc, and via next_codepoint() still has an ASCII fast-path bypassing iconv() calls. Andrew Bartlett --- 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 96ccd34345..e886c1f8ba 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -871,7 +871,6 @@ ssize_t tstream_read_packet_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, /* The following definitions come from lib/util_str.c */ bool next_token(const char **ptr, char *buff, const char *sep, size_t bufsize); -int StrCaseCmp(const char *s, const char *t); int StrnCaseCmp(const char *s, const char *t, size_t len); bool strnequal(const char *s1,const char *s2,size_t n); bool strcsequal(const char *s1,const char *s2); -- cgit From da662b82b87cdbe07762974b1f9e825ef15951bd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 13 May 2011 20:23:36 +0200 Subject: s3-lib Replace StrnCaseCmp() with strncasecmp_m() strncasecmp_m() never needs to call to talloc, and via next_codepoint() still has an ASCII fast-path bypassing iconv() calls. Andrew Bartlett --- 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 e886c1f8ba..76d9b64e01 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -871,7 +871,6 @@ ssize_t tstream_read_packet_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, /* The following definitions come from lib/util_str.c */ bool next_token(const char **ptr, char *buff, const char *sep, size_t bufsize); -int StrnCaseCmp(const char *s, const char *t, size_t len); bool strnequal(const char *s1,const char *s2,size_t n); bool strcsequal(const char *s1,const char *s2); void strnorm(char *s, int case_default); -- cgit From 01386ff3132ff5c786e83fc24328a80661de6bb7 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 29 May 2011 10:58:05 +0200 Subject: s3: Extract the guest_login field in sesssetup --- source3/include/client.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index b51da90973..7d66bf912c 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -109,6 +109,7 @@ struct cli_state { int initialised; int win95; bool is_samba; + bool is_guestlogin; uint32 capabilities; /* What the server offered. */ uint32_t server_posix_capabilities; -- cgit From 8524924a460349a9aa56db475d771b8884fbe517 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 25 May 2011 13:00:22 +1000 Subject: s3-smbd provide struct smbd_server_connection * to conn_snum_used This provides the 'sconn' parameter to this key functions, that is currently duplicated in dummysmbd.c, which causes duplicate symbol issues in the waf build. This has natrually caused a number of consequential changes across the codebase, includning not passing a messaging context into initial reload_services(): This causes problems because the global smbd_server_connection isn't yet set up, as there isn't a connection here, just the initial process. Andrew Bartlett --- source3/include/proto.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 76d9b64e01..ac5e755360 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1635,7 +1635,8 @@ bool lp_snum_ok(int iService); void lp_add_one_printer(const char *name, const char *comment, const char *location, void *pdata); bool lp_loaded(void); -void lp_killunused(bool (*snumused) (int)); +void lp_killunused(struct smbd_server_connection *sconn, + bool (*snumused) (struct smbd_server_connection *, int)); void lp_kill_all_services(void); void lp_killservice(int iServiceIn); const char* server_role_str(uint32 role); @@ -1651,7 +1652,7 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx, struct security_descriptor **ppsd, bool *pallow_guest); int load_usershare_service(const char *servicename); -int load_usershare_shares(void); +int load_usershare_shares(struct smbd_server_connection *sconn); void gfree_loadparm(void); void lp_set_in_client(bool b); bool lp_is_in_client(void); @@ -1842,7 +1843,7 @@ void unbecome_root(void); /* The following definitions come from lib/dummysmbd.c */ int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out); -bool conn_snum_used(int snum); +bool conn_snum_used(struct smbd_server_connection *sconn, int snum); void cancel_pending_lock_requests_by_fid(files_struct *fsp, struct byte_range_lock *br_lck, enum file_close_type close_type); -- cgit From e5dd03d1991f125fa3cfddac9a41d2f9e6391c42 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 25 May 2011 18:51:56 +1000 Subject: s3-globals Remove smbd_event_context() (use server_event_context()) This has been a wrapper around server_event_context() for some time now, and removing this from dummmysmbd.c assists with library dependencies. Andrew Bartlett --- 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 ac5e755360..8cd3ec2ea8 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1853,7 +1853,6 @@ NTSTATUS can_delete_directory(struct connection_struct *conn, const char *dirname); bool change_to_root_user(void); void smbd_set_server_fd(int fd); -struct event_context *smbd_event_context(void); void contend_level2_oplocks_begin(files_struct *fsp, enum level2_contention_type type); void contend_level2_oplocks_end(files_struct *fsp, -- cgit From 381423b1bdba4c7d1931b162d872134c42e432cf Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 30 May 2011 13:23:56 +1000 Subject: libcli/security: move secdesc.c to the top level libcli/security This code does not rely on lp_ or other source3 only functions, so can be part of the common library. Andrew Bartlett --- source3/include/proto.h | 41 ----------------------------------------- 1 file changed, 41 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 8cd3ec2ea8..ba9497e6ca 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -236,47 +236,6 @@ ssize_t sys_recvfile(int fromfd, size_t count); ssize_t drain_socket(int sockfd, size_t count); -/* The following definitions come from lib/secdesc.c */ - -uint32_t get_sec_info(const struct security_descriptor *sd); -struct security_descriptor *sec_desc_merge(TALLOC_CTX *ctx, struct security_descriptor *new_sdb, struct security_descriptor *old_sdb); -struct sec_desc_buf *sec_desc_merge_buf(TALLOC_CTX *ctx, struct sec_desc_buf *new_sdb, struct sec_desc_buf *old_sdb); -struct security_descriptor *make_sec_desc(TALLOC_CTX *ctx, - enum security_descriptor_revision revision, - uint16 type, - const struct dom_sid *owner_sid, const struct dom_sid *grp_sid, - struct security_acl *sacl, struct security_acl *dacl, size_t *sd_size); -struct security_descriptor *dup_sec_desc(TALLOC_CTX *ctx, const struct security_descriptor *src); -NTSTATUS marshall_sec_desc(TALLOC_CTX *mem_ctx, - struct security_descriptor *secdesc, - uint8 **data, size_t *len); -NTSTATUS marshall_sec_desc_buf(TALLOC_CTX *mem_ctx, - struct sec_desc_buf *secdesc_buf, - uint8_t **data, size_t *len); -NTSTATUS unmarshall_sec_desc(TALLOC_CTX *mem_ctx, uint8 *data, size_t len, - struct security_descriptor **psecdesc); -NTSTATUS unmarshall_sec_desc_buf(TALLOC_CTX *mem_ctx, uint8_t *data, size_t len, - struct sec_desc_buf **psecdesc_buf); -struct security_descriptor *make_standard_sec_desc(TALLOC_CTX *ctx, const struct dom_sid *owner_sid, const struct dom_sid *grp_sid, - struct security_acl *dacl, size_t *sd_size); -struct sec_desc_buf *make_sec_desc_buf(TALLOC_CTX *ctx, size_t len, struct security_descriptor *sec_desc); -struct sec_desc_buf *dup_sec_desc_buf(TALLOC_CTX *ctx, struct sec_desc_buf *src); -NTSTATUS sec_desc_add_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, const struct dom_sid *sid, uint32 mask, size_t *sd_size); -NTSTATUS sec_desc_mod_sid(struct security_descriptor *sd, struct dom_sid *sid, uint32 mask); -NTSTATUS sec_desc_del_sid(TALLOC_CTX *ctx, struct security_descriptor **psd, struct dom_sid *sid, size_t *sd_size); -bool sd_has_inheritable_components(const struct security_descriptor *parent_ctr, bool container); -NTSTATUS se_create_child_secdesc(TALLOC_CTX *ctx, - struct security_descriptor **ppsd, - size_t *psize, - const struct security_descriptor *parent_ctr, - const struct dom_sid *owner_sid, - const struct dom_sid *group_sid, - bool container); -NTSTATUS se_create_child_secdesc_buf(TALLOC_CTX *ctx, - struct sec_desc_buf **ppsdb, - const struct security_descriptor *parent_ctr, - bool container); - /* The following definitions come from lib/sendfile.c */ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); -- cgit From 8d639feed9493a099c57d494254f1ea262b28277 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 30 May 2011 13:40:33 +1000 Subject: s3-param Move init_iconv() to loadparm.c This assists with some dependency loops Andrew Bartlett --- 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 ba9497e6ca..c17377cd2f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -73,7 +73,6 @@ int bitmap_find(struct bitmap *bm, unsigned ofs); /* The following definitions come from lib/charcnv.c */ void gfree_charcnv(void); -void init_iconv(void); bool convert_string(charset_t from, charset_t to, void const *src, size_t srclen, void *dest, size_t destlen, -- cgit From a5a2373979a9484bb68271e9c1c518f05a8ec564 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 30 May 2011 16:15:01 +1000 Subject: s3-lib Move sstring_sub() to it's only user and make static This should not be used more generally, as it is specifically not for multibyte strings, and uses malloc rather than talloc. Andrew Bartlett --- 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 c17377cd2f..1f094617ad 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -897,7 +897,6 @@ void sprintf_append(TALLOC_CTX *mem_ctx, char **string, ssize_t *len, int asprintf_strupper_m(char **strp, const char *fmt, ...); char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...); char *talloc_asprintf_strlower_m(TALLOC_CTX *t, const char *fmt, ...); -char *sstring_sub(const char *src, char front, char back); bool validate_net_name( const char *name, const char *invalid_chars, int max_len); -- cgit From 52399f3177515fce777d85288650ff89f9028dc9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 31 May 2011 10:41:42 +1000 Subject: lib/util Move sys_memalign into lib/util/system.c --- 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 1f094617ad..23654e1ec6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -352,7 +352,6 @@ int sys_set_nfs_quota(const char *path, const char *bdev, /* The following definitions come from lib/system.c */ -void *sys_memalign( size_t align, size_t size ); int sys_usleep(long usecs); ssize_t sys_read(int fd, void *buf, size_t count); ssize_t sys_write(int fd, const void *buf, size_t count); -- cgit From 0ec9a90c29b86435f32c1d47d89df85fa51742f2 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 30 May 2011 12:06:31 +0200 Subject: s3: Remove SHADOW_COPY_DATA typedef --- source3/include/ntioctl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ntioctl.h b/source3/include/ntioctl.h index 41b1dcefa2..3ed4a194a7 100644 --- a/source3/include/ntioctl.h +++ b/source3/include/ntioctl.h @@ -77,13 +77,13 @@ /* For FSCTL_GET_SHADOW_COPY_DATA ...*/ typedef char SHADOW_COPY_LABEL[25]; -typedef struct shadow_copy_data { +struct shadow_copy_data { TALLOC_CTX *mem_ctx; /* Total number of shadow volumes currently mounted */ uint32 num_volumes; /* Concatenated list of labels */ SHADOW_COPY_LABEL *labels; -} SHADOW_COPY_DATA; +}; #endif /* _NTIOCTL_H */ -- cgit From d77854fbb22bc9237cea14aae1179bbfe3bd0998 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 30 May 2011 12:11:53 +0200 Subject: struct make "struct shadow_copy_data" its own talloc context --- source3/include/ntioctl.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/ntioctl.h b/source3/include/ntioctl.h index 3ed4a194a7..18707c5bbe 100644 --- a/source3/include/ntioctl.h +++ b/source3/include/ntioctl.h @@ -78,7 +78,6 @@ typedef char SHADOW_COPY_LABEL[25]; struct shadow_copy_data { - TALLOC_CTX *mem_ctx; /* Total number of shadow volumes currently mounted */ uint32 num_volumes; /* Concatenated list of labels */ -- cgit From 1cee71713f75dbee653ea86bd4e7c87efe677cf6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 31 May 2011 16:14:04 -0700 Subject: Change sys_getcd() to take no arguments and always return malloc'ed memory (or NULL). Part of the efforts to remove PATH_MAX on modern systems. --- 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 23654e1ec6..83382594f9 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -391,7 +391,7 @@ void sys_rewinddir(SMB_STRUCT_DIR *dirp); int sys_closedir(SMB_STRUCT_DIR *dirp); int sys_mknod(const char *path, mode_t mode, SMB_DEV_T dev); int sys_waitpid(pid_t pid,int *status,int options); -char *sys_getwd(char *s); +char *sys_getwd(void); void set_effective_capability(enum smbd_capability capability); void drop_effective_capability(enum smbd_capability capability); long sys_random(void); -- cgit From c7d2f6d35a95678c91faf0b5ac7f83bc5d1abfde Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 31 May 2011 16:36:06 -0700 Subject: Remove the char * argument from the SMB_VFS_GETWD() call. Now always returns malloc'ed memory. Autobuild-User: Jeremy Allison Autobuild-Date: Wed Jun 1 04:06:12 CEST 2011 on sn-devel-104 --- source3/include/vfs.h | 5 +++-- source3/include/vfs_macros.h | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/include') diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 185bc7687c..145b52c5c2 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -134,6 +134,7 @@ to split out the two possible uses. JRA. */ /* Leave at 28 - not yet released. Add fdopendir. JRA. */ /* Leave at 28 - not yet released. Rename open function to open_fn. - gd */ +/* Leave at 28 - not yet released. Make getwd function always return malloced memory. JRA. */ #define SMB_VFS_INTERFACE_VERSION 28 /* @@ -250,7 +251,7 @@ struct vfs_fn_pointers { int (*fchown)(struct vfs_handle_struct *handle, struct files_struct *fsp, uid_t uid, gid_t gid); int (*lchown)(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); int (*chdir)(struct vfs_handle_struct *handle, const char *path); - char *(*getwd)(struct vfs_handle_struct *handle, char *buf); + char *(*getwd)(struct vfs_handle_struct *handle); int (*ntimes)(struct vfs_handle_struct *handle, const struct smb_filename *smb_fname, struct smb_file_time *ft); @@ -613,7 +614,7 @@ int smb_vfs_call_fchown(struct vfs_handle_struct *handle, int smb_vfs_call_lchown(struct vfs_handle_struct *handle, const char *path, uid_t uid, gid_t gid); int smb_vfs_call_chdir(struct vfs_handle_struct *handle, const char *path); -char *smb_vfs_call_getwd(struct vfs_handle_struct *handle, char *buf); +char *smb_vfs_call_getwd(struct vfs_handle_struct *handle); int smb_vfs_call_ntimes(struct vfs_handle_struct *handle, const struct smb_filename *smb_fname, struct smb_file_time *ft); diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 4b1d1d258b..c7686f1db5 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -239,10 +239,10 @@ #define SMB_VFS_NEXT_CHDIR(handle, path) \ smb_vfs_call_chdir((handle)->next, (path)) -#define SMB_VFS_GETWD(conn, buf) \ - smb_vfs_call_getwd((conn)->vfs_handles, (buf)) -#define SMB_VFS_NEXT_GETWD(handle, buf) \ - smb_vfs_call_getwd((handle)->next, (buf)) +#define SMB_VFS_GETWD(conn) \ + smb_vfs_call_getwd((conn)->vfs_handles) +#define SMB_VFS_NEXT_GETWD(handle) \ + smb_vfs_call_getwd((handle)->next) #define SMB_VFS_NTIMES(conn, path, ts) \ smb_vfs_call_ntimes((conn)->vfs_handles, (path), (ts)) -- cgit From ec9ff19e60907d6858c6a04f3fcd0e61d5c83100 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 11:10:47 +1000 Subject: s3-param Make lp_passwordserver() const. This means that it no longer takes % substituations, and so the documentation for this behaviour is removed from the smb.conf manpage. (This mode is only useful in security=server, which is already marked as deprecated in 3.6). Andrew Bartlett --- 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 83382594f9..82bea2e122 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1207,7 +1207,7 @@ char *lp_set_quota_command(void); char *lp_auto_services(void); char *lp_passwd_program(void); char *lp_passwd_chat(void); -char *lp_passwordserver(void); +const char *lp_passwordserver(void); char *lp_name_resolve_order(void); char *lp_realm(void); const char *lp_afs_username_map(void); -- cgit From f52b97a1292e4e84fccd4601d341de857cc5e586 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 11:13:30 +1000 Subject: s3-param Make charset parameters const This removes the dangerous ability for these parameters to change based on % substitutions. Andrew Bartlett --- source3/include/proto.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 82bea2e122..3f5417a471 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1176,9 +1176,9 @@ NTSTATUS change_trust_account_password( const char *domain, const char *remote_m /* The following definitions come from param/loadparm.c */ char *lp_smb_ports(void); -char *lp_dos_charset(void); -char *lp_unix_charset(void); -char *lp_display_charset(void); +const char *lp_dos_charset(void); +const char *lp_unix_charset(void); +const char *lp_display_charset(void); char *lp_logfile(void); char *lp_configfile(void); char *lp_smb_passwd_file(void); -- cgit From a74e7fbc6abb16e85eb6ac14193be0e0f664a6f0 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 11:18:09 +1000 Subject: s3-param Make lp_smb_ports() const It makes no sense to have a % substiution in the 'smb ports' parameter. Andrew Bartlett --- 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 3f5417a471..0d70c4fc78 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1175,7 +1175,7 @@ NTSTATUS change_trust_account_password( const char *domain, const char *remote_m /* The following definitions come from param/loadparm.c */ -char *lp_smb_ports(void); +const char *lp_smb_ports(void); const char *lp_dos_charset(void); const char *lp_unix_charset(void); const char *lp_display_charset(void); -- cgit From f331936db2990589047edd4aee61ac298262123d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 11:19:21 +1000 Subject: s3-param Make lp_smb_passwd_file() and lp_private_dir() const This disables % substitutions in the 'smb passwd file' and 'private dir' parameters. These are used all over the codebase, and need to be internally consistent for the life of the process, as they determine the location of secrets.tdb, as well as the passdb databases. Andrew Bartlett --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 0d70c4fc78..93ba2beaa7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1181,8 +1181,8 @@ const char *lp_unix_charset(void); const char *lp_display_charset(void); char *lp_logfile(void); char *lp_configfile(void); -char *lp_smb_passwd_file(void); -char *lp_private_dir(void); +const char *lp_smb_passwd_file(void); +const char *lp_private_dir(void); char *lp_serverstring(void); int lp_printcap_cache_time(void); char *lp_addport_cmd(void); -- cgit From 5f176378a802703778ae07c36e95fe186b6e57a8 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 11:45:44 +1000 Subject: s3-param Make lp_lockdir() const This disables % substitutions in the 'lock dir' parameter. This is used all over the codebase, and needs to be internally consistent for the life of the process, as they determine the location of our locking databases. Andrew Bartlett --- 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 93ba2beaa7..363d5e761a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1190,7 +1190,7 @@ char *lp_enumports_cmd(void); char *lp_addprinter_cmd(void); char *lp_deleteprinter_cmd(void); char *lp_os2_driver_map(void); -char *lp_lockdir(void); +const char *lp_lockdir(void); char *lp_statedir(void); char *lp_cachedir(void); char *lp_piddir(void); -- cgit From 9aef68f4c2791227186fa81f1ec19c40df435e18 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 11:48:38 +1000 Subject: s3-param Make lp_statedir() const This disables % substitutions in the 'state dir' parameter. This is used all over the codebase, and need to be internally consistent between all the Samba tasks. Andrew Bartlett --- 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 363d5e761a..2c34c58968 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1191,7 +1191,7 @@ char *lp_addprinter_cmd(void); char *lp_deleteprinter_cmd(void); char *lp_os2_driver_map(void); const char *lp_lockdir(void); -char *lp_statedir(void); +const char *lp_statedir(void); char *lp_cachedir(void); char *lp_piddir(void); char *lp_mangling_method(void); -- cgit From a0758bb5e5035a2547808a1fc89fe4fef51ed90c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 11:51:12 +1000 Subject: s3-param Make lp_cachedir() const This disables % substitutions in the 'cache dir' parameter. This is used all over the codebase, and need to be internally consistent between all the Samba tasks. Andrew Bartlett --- 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 2c34c58968..2fe6b2d5e3 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1192,7 +1192,7 @@ char *lp_deleteprinter_cmd(void); char *lp_os2_driver_map(void); const char *lp_lockdir(void); const char *lp_statedir(void); -char *lp_cachedir(void); +const char *lp_cachedir(void); char *lp_piddir(void); char *lp_mangling_method(void); int lp_mangle_prefix(void); -- cgit From 47ece3f897305970999fbcf012229105838c3687 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 11:52:07 +1000 Subject: s3-param Make lp_piddir() const This disables % substitutions in the 'pid dir' parameter. This is used all over the codebase, and need to be internally consistent between all the Samba tasks. Andrew Bartlett --- 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 2fe6b2d5e3..e7a172c93a 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1193,7 +1193,7 @@ char *lp_os2_driver_map(void); const char *lp_lockdir(void); const char *lp_statedir(void); const char *lp_cachedir(void); -char *lp_piddir(void); +const char *lp_piddir(void); char *lp_mangling_method(void); int lp_mangle_prefix(void); char *lp_utmpdir(void); -- cgit From 08a72f3a1571649eb52c7e06bab2789e0887c173 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 11:53:21 +1000 Subject: s3-param Make lp_utmpdir() and lp_wtmpdir const This disables % substitutions in the 'utmp dir' and 'wtmp dir' parameters. These are system paths, and need to be consistent between all the Samba tasks. Andrew Bartlett --- source3/include/proto.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index e7a172c93a..c51af0065c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1196,8 +1196,8 @@ const char *lp_cachedir(void); const char *lp_piddir(void); char *lp_mangling_method(void); int lp_mangle_prefix(void); -char *lp_utmpdir(void); -char *lp_wtmpdir(void); +const char *lp_utmpdir(void); +const char *lp_wtmpdir(void); bool lp_utmp(void); char *lp_rootdir(void); char *lp_defaultservice(void); -- cgit From 860b43737c0544cf651c2e93a30ca65f3f347219 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 11:54:52 +1000 Subject: s3-param Make lp_name_resolv_order() const This disables % substitutions in the 'name resolv order' parameter. This is used all over the codebase, and needs to be internally consistent between all the Samba tasks. Andrew Bartlett --- 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 c51af0065c..941b158b15 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1208,7 +1208,7 @@ char *lp_auto_services(void); char *lp_passwd_program(void); char *lp_passwd_chat(void); const char *lp_passwordserver(void); -char *lp_name_resolve_order(void); +const char *lp_name_resolve_order(void); char *lp_realm(void); const char *lp_afs_username_map(void); int lp_afs_token_lifetime(void); -- cgit From edc3041093b17ae6e18c5b7a64a94b5bfb3c3998 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 11:55:59 +1000 Subject: s3-param Make lp_realm() const This disables % substitutions in the 'realm' parameter. This is used all over the codebase, and needs to be internally consistent between all the Samba tasks. Andrew Bartlett --- 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 941b158b15..81ba17882c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1209,7 +1209,7 @@ char *lp_passwd_program(void); char *lp_passwd_chat(void); const char *lp_passwordserver(void); const char *lp_name_resolve_order(void); -char *lp_realm(void); +const char *lp_realm(void); const char *lp_afs_username_map(void); int lp_afs_token_lifetime(void); char *lp_log_nt_token_command(void); -- cgit From b9d61ef55a45bc58d7e0c6dae0969cf938974020 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 12:15:48 +1000 Subject: s3-param Make lp_dedicated_keytab_file() const This disables % substitutions in the 'dedicated keytab file' parameter. Andrew Bartlett --- 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 81ba17882c..0eae375bbc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1352,7 +1352,7 @@ bool lp_send_spnego_principal(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 ); -char * lp_dedicated_keytab_file(void); +const char * lp_dedicated_keytab_file(void); int lp_kerberos_method(void); bool lp_defer_sharing_violations(void); bool lp_enable_privileges(void); -- cgit From 5a8218b147ac62c065903591a15360a906da9bec Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 12:18:00 +1000 Subject: s3-param Make lp_ncalrpc_dir() const This disables % substitutions in the 'ncalrpc dir' parameter. This is used as a communication point between multiple parts of the codebase, and needs to be internally consistent between all the Samba tasks. Andrew Bartlett Autobuild-User: Andrew Bartlett Autobuild-Date: Wed Jun 1 05:30:53 CEST 2011 on sn-devel-104 --- 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 0eae375bbc..c6fd38dd81 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1660,7 +1660,7 @@ int lp_min_receive_file_size(void); char* lp_perfcount_module(void); void lp_set_passdb_backend(const char *backend); void widelinks_warning(int snum); -char *lp_ncalrpc_dir(void); +const char *lp_ncalrpc_dir(void); /* The following definitions come from param/loadparm_server_role.c */ -- cgit From 44fb1140bb92259f10852e24bde82a13f926ca15 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 30 May 2011 10:40:37 +0200 Subject: s3-rpc_server: Added syntax id to pipe_rpc_fns struct. --- source3/include/ntdomain.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index ed97182b25..fc30dd984a 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -86,7 +86,8 @@ typedef struct pipe_rpc_fns { const struct api_struct *cmds; int n_cmds; - uint32 context_id; + uint32_t context_id; + struct ndr_syntax_id syntax; } PIPE_RPC_FNS; -- cgit From f086057ce89a5a09e26b7b0f85e598951a866851 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 31 May 2011 13:37:11 +0200 Subject: s3-rpc_server: Remove syntax from pipes_struct. --- source3/include/ntdomain.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h index fc30dd984a..ff728736d4 100644 --- a/source3/include/ntdomain.h +++ b/source3/include/ntdomain.h @@ -116,7 +116,6 @@ struct pipes_struct { struct auth_serversupplied_info *session_info; struct messaging_context *msg_ctx; - struct ndr_syntax_id syntax; struct dcesrv_ep_entry_list *ep_entries; /* linked list of rpc dispatch tables associated -- cgit From 1dfc6fa558e7735341a7095aa46e5568a4f56cfe Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 1 Jun 2011 23:22:24 +1000 Subject: s4-param Add hook between Samba3 and Samba4 loadparm systems. In the top level build, this allows calls to code that requires a lpcfg_ style loadparm_context, while using the global parameters loaded from the source3 loadparm code. Andrew Bartlett --- 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 c6fd38dd81..f732a53655 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1210,6 +1210,7 @@ char *lp_passwd_chat(void); const char *lp_passwordserver(void); const char *lp_name_resolve_order(void); const char *lp_realm(void); +const char *lp_dnsdomain(void); const char *lp_afs_username_map(void); int lp_afs_token_lifetime(void); char *lp_log_nt_token_command(void); @@ -1662,6 +1663,10 @@ void lp_set_passdb_backend(const char *backend); void widelinks_warning(int snum); const char *lp_ncalrpc_dir(void); +/* The following definitions come from param/loadparm_ctx.c */ + +const struct loadparm_s3_context *loadparm_s3_context(void); + /* The following definitions come from param/loadparm_server_role.c */ int lp_server_role(void); -- cgit From 876b1b3d198e2306c36423bfb1449870c74181fd Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 6 Jun 2011 14:22:12 +1000 Subject: s3-lib Remove unused lib_path() --- 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 f732a53655..1cdc0c9081 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -570,7 +570,6 @@ void *smb_xmalloc_array(size_t size, unsigned int count); char *myhostname(void); char *lock_path(const char *name); char *pid_path(const char *name); -char *lib_path(const char *name); char *modules_path(const char *name); char *data_path(const char *name); char *state_path(const char *name); -- cgit From de46ad9084aff4384f33660acf91da3b81554a88 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 6 Jun 2011 14:37:06 +1000 Subject: lib/util use modules_path(), data_path() and shlib_ext() from source3 This brings these helpful utility functions in common, as they are not based on either loadparm system. (The 'modules dir' parameter from Samba4 will shortly be removed, so there is no loss in functionality) Andrew Bartlett --- source3/include/proto.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 1cdc0c9081..10a84f9050 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -570,11 +570,8 @@ void *smb_xmalloc_array(size_t size, unsigned int count); char *myhostname(void); char *lock_path(const char *name); char *pid_path(const char *name); -char *modules_path(const char *name); -char *data_path(const char *name); char *state_path(const char *name); char *cache_path(const char *name); -const char *shlib_ext(void); bool parent_dirname(TALLOC_CTX *mem_ctx, const char *dir, char **parent, const char **name); bool ms_has_wild(const char *s); -- cgit From 8459391e31079066745a65c5f3c07f3899afdc0c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:03:16 +1000 Subject: s3-talloc Remove unused TALLOC zeronull functions and macro definitions These have been under #if 0 for a long time now. Andrew Bartlett --- source3/include/proto.h | 5 ----- source3/include/smb_macros.h | 21 --------------------- 2 files changed, 26 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 10a84f9050..c04dc94e20 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -608,11 +608,6 @@ void split_domain_user(TALLOC_CTX *mem_ctx, const char *full_name, char **domain, char **user); -void *_talloc_zero_zeronull(const void *ctx, size_t size, const char *name); -void *_talloc_memdup_zeronull(const void *t, const void *p, size_t size, const char *name); -void *_talloc_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name); -void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned count, const char *name); -void *talloc_zeronull(const void *context, size_t size, const char *name); const char *strip_hostname(const char *s); bool tevent_req_poll_ntstatus(struct tevent_req *req, struct tevent_context *ev, diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index f7cfaaf325..ccf99daaea 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -218,25 +218,6 @@ copy an IP address from one buffer to another #define SMB_XMALLOC_P(type) (type *)smb_xmalloc_array(sizeof(type),1) #define SMB_XMALLOC_ARRAY(type,count) (type *)smb_xmalloc_array(sizeof(type),(count)) -/* The new talloc is paranoid malloc checker safe. */ - -#if 0 - -Disable these now we have checked all code paths and ensured -NULL returns on zero request. JRA. - -#define TALLOC(ctx, size) talloc_zeronull(ctx, size, __location__) -#define TALLOC_P(ctx, type) (type *)talloc_zeronull(ctx, sizeof(type), #type) -#define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array_zeronull(ctx, sizeof(type), count, #type) -#define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup_zeronull(ctx, ptr, size, __location__) -#define TALLOC_ZERO(ctx, size) _talloc_zero_zeronull(ctx, size, __location__) -#define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero_zeronull(ctx, sizeof(type), #type) -#define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array_zeronull(ctx, sizeof(type), count, #type) -#define TALLOC_SIZE(ctx, size) talloc_zeronull(ctx, size, __location__) -#define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero_zeronull(ctx, size, __location__) - -#else - #define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__) #define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type) #define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type) @@ -247,8 +228,6 @@ NULL returns on zero request. JRA. #define TALLOC_SIZE(ctx, size) talloc_named_const(ctx, size, __location__) #define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero(ctx, size, __location__) -#endif - #define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__) #define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)_talloc_realloc_array(ctx, ptr, sizeof(type), count, #type) #define talloc_destroy(ctx) talloc_free(ctx) -- cgit From 73b377432c5efb8451f09f6d25d8aa1b28c239c9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:10:15 +1000 Subject: s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc() Using the standard macro makes it easier to move code into common, as TALLOC_REALLOC_ARRAY isn't standard talloc. Andrew Bartlett --- source3/include/smb_macros.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index ccf99daaea..cb364a9aa3 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -229,7 +229,6 @@ copy an IP address from one buffer to another #define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero(ctx, size, __location__) #define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__) -#define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)_talloc_realloc_array(ctx, ptr, sizeof(type), count, #type) #define talloc_destroy(ctx) talloc_free(ctx) #ifndef TALLOC_FREE #define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0) @@ -292,7 +291,7 @@ copy an IP address from one buffer to another #define ADD_TO_ARRAY(mem_ctx, type, elem, array, num) \ do { \ *(array) = ((mem_ctx) != NULL) ? \ - TALLOC_REALLOC_ARRAY(mem_ctx, (*(array)), type, (*(num))+1) : \ + talloc_realloc(mem_ctx, (*(array)), type, (*(num))+1) : \ SMB_REALLOC_ARRAY((*(array)), type, (*(num))+1); \ SMB_ASSERT((*(array)) != NULL); \ (*(array))[*(num)] = (elem); \ -- cgit From 3d15137653a7d1b593a9af2eef12f6e5b9a04c4f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:30:12 +1000 Subject: s3-talloc Change TALLOC_ARRAY() to talloc_array() Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc. --- source3/include/smb_macros.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index cb364a9aa3..e21977f748 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -220,7 +220,6 @@ copy an IP address from one buffer to another #define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__) #define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type) -#define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type) #define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__) #define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__) #define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type) -- cgit From d5e6a47f064a3923b1e257ab84fa7ccd7c4f89f4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:38:41 +1000 Subject: s3-talloc Change TALLOC_P() to talloc() Using the standard macro makes it easier to move code into common, as TALLOC_P isn't standard talloc. --- source3/include/smb_macros.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index e21977f748..a51e9ec407 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -219,7 +219,6 @@ copy an IP address from one buffer to another #define SMB_XMALLOC_ARRAY(type,count) (type *)smb_xmalloc_array(sizeof(type),(count)) #define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__) -#define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type) #define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__) #define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__) #define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type) -- cgit From ad0a07c531fadd1639c5298951cfaf5cfe0cb10e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:44:43 +1000 Subject: s3-talloc Change TALLOC_ZERO_P() to talloc_zero() Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc. --- source3/include/smb_macros.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index a51e9ec407..73472dd61f 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -221,7 +221,6 @@ copy an IP address from one buffer to another #define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__) #define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__) #define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__) -#define TALLOC_ZERO_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type) #define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type) #define TALLOC_SIZE(ctx, size) talloc_named_const(ctx, size, __location__) #define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero(ctx, size, __location__) -- cgit From 5e26e94092b56ee47e7ec7837f7cd0feb3fb0119 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:58:39 +1000 Subject: s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array() Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_ARRAY isn't standard talloc. --- source3/include/smb_macros.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 73472dd61f..ce1bc6dafd 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -221,7 +221,6 @@ copy an IP address from one buffer to another #define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__) #define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__) #define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__) -#define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type) #define TALLOC_SIZE(ctx, size) talloc_named_const(ctx, size, __location__) #define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero(ctx, size, __location__) -- cgit From 8d4a8389bb2df77ff8923dda8368aa2915652c1a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 12:13:26 +1000 Subject: s3-talloc Change TALLOC_MEMDUP() to talloc_memdup() Using the standard macro makes it easier to move code into common, as TALLOC_MEMDUP isn't standard talloc. --- source3/include/smb_macros.h | 1 - 1 file changed, 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index ce1bc6dafd..37ea1b4292 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -219,7 +219,6 @@ copy an IP address from one buffer to another #define SMB_XMALLOC_ARRAY(type,count) (type *)smb_xmalloc_array(sizeof(type),(count)) #define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__) -#define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__) #define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__) #define TALLOC_SIZE(ctx, size) talloc_named_const(ctx, size, __location__) #define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero(ctx, size, __location__) -- cgit From 16b1c77644217796f70a3a0bf1d95c245f9ee2d9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 8 Jun 2011 14:05:55 +1000 Subject: lib/util Bring procid_str() into lib/util as server_id_string() This is needed for OpenChange, which prints Samba struct server_id values in debug messages. Andrew Bartlett --- source3/include/messages.h | 7 ------- source3/include/proto.h | 1 - 2 files changed, 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/messages.h b/source3/include/messages.h index a78599055d..41d5bb19fd 100644 --- a/source3/include/messages.h +++ b/source3/include/messages.h @@ -48,13 +48,6 @@ #define FLAG_MSG_DBWRAP 0x0020 -/* - * Virtual Node Numbers are identifying a node within a cluster. Ctdbd sets - * this, we retrieve our vnn from it. - */ - -#define NONCLUSTER_VNN (0xFFFFFFFF) - /* * ctdb gives us 64-bit server ids for messaging_send. This is done to avoid * pid clashes and to be able to register for special messages like "all diff --git a/source3/include/proto.h b/source3/include/proto.h index c04dc94e20..42c62d2f6f 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -594,7 +594,6 @@ bool cluster_id_equal(const struct server_id *id1, const struct server_id *id2); bool procid_is_me(const struct server_id *pid); struct server_id interpret_pid(const char *pid_string); -char *procid_str(TALLOC_CTX *mem_ctx, const struct server_id *pid); char *procid_str_static(const struct server_id *pid); bool procid_valid(const struct server_id *pid); bool procid_is_local(const struct server_id *pid); -- cgit From 3ccc7609476139bc6a906110a2623605f3802159 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 8 Jun 2011 15:42:22 +1000 Subject: s3-param Remove special case for lp_workgroup() There is no reason this can't be a normal constant string in the loadparm system, now that we have lp_set_cmdline() to handle overrides correctly. Andrew Bartlett --- 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 42c62d2f6f..2edd72e026 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -497,7 +497,6 @@ void gfree_netbios_names(void); bool set_global_myname(const char *myname); const char *global_myname(void); bool set_global_myworkgroup(const char *myworkgroup); -const char *lp_workgroup(void); const char *get_global_sam_name(void); /* The following definitions come from lib/util.c */ @@ -1199,6 +1198,7 @@ char *lp_passwd_program(void); char *lp_passwd_chat(void); const char *lp_passwordserver(void); const char *lp_name_resolve_order(void); +const char *lp_workgroup(void); const char *lp_realm(void); const char *lp_dnsdomain(void); const char *lp_afs_username_map(void); -- cgit From f348d148b463ca61cbc48d2aadeaa099f7150425 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 8 Jun 2011 16:27:06 +1000 Subject: s3-param Remove special case for global_scope() There is no reason this can't be a normal constant string in the loadparm system. (Past reasons were that we didn't have lp_set_cmdline()) Andrew Bartlett --- 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 2edd72e026..edcb025101 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -504,8 +504,6 @@ const char *get_global_sam_name(void); enum protocol_types get_Protocol(void); void set_Protocol(enum protocol_types p); bool all_zero(const uint8_t *ptr, size_t size); -bool set_global_scope(const char *scope); -const char *global_scope(void); void gfree_names(void); void gfree_all( void ); const char *my_netbios_names(int i); @@ -1198,6 +1196,7 @@ char *lp_passwd_program(void); char *lp_passwd_chat(void); const char *lp_passwordserver(void); const char *lp_name_resolve_order(void); +const char *lp_netbios_scope(void); const char *lp_workgroup(void); const char *lp_realm(void); const char *lp_dnsdomain(void); -- cgit From 0e95311c235929e07fdcfd7153b91ae795a979b9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 9 Jun 2011 15:27:53 +1000 Subject: s3-lib Add myhostname_upper() This varient always upper cases the hostname, which is needed for the netbios name. Andrew Bartlett --- 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 edcb025101..585d53f643 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -565,6 +565,7 @@ int set_maxfiles(int requested_max); int smb_mkstemp(char *name_template); void *smb_xmalloc_array(size_t size, unsigned int count); char *myhostname(void); +char *myhostname_upper(void); char *lock_path(const char *name); char *pid_path(const char *name); char *state_path(const char *name); -- cgit From 74eed8f3ed5c333728350df1d23a4318e9104909 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 9 Jun 2011 15:31:03 +1000 Subject: s3-param Remove special case for global_myname(), rename to lp_netbios_name() There is no reason this can't be a normal constant string in the loadparm system, now that we have lp_set_cmdline() to handle overrides correctly. Andrew Bartlett --- source3/include/proto.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 585d53f643..6820db99f2 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -493,10 +493,6 @@ char *get_user_home_dir(TALLOC_CTX *mem_ctx, const char *user); struct passwd *Get_Pwnam_alloc(TALLOC_CTX *mem_ctx, const char *user); /* The following definitions come from lib/util_names.c */ -void gfree_netbios_names(void); -bool set_global_myname(const char *myname); -const char *global_myname(void); -bool set_global_myworkgroup(const char *myworkgroup); const char *get_global_sam_name(void); /* The following definitions come from lib/util.c */ @@ -1198,6 +1194,7 @@ char *lp_passwd_chat(void); const char *lp_passwordserver(void); const char *lp_name_resolve_order(void); const char *lp_netbios_scope(void); +const char *lp_netbios_name(void); const char *lp_workgroup(void); const char *lp_realm(void); const char *lp_dnsdomain(void); -- cgit From de8eb77e91bb280da49f4f7586f8e511e808c1f0 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Fri, 3 Jun 2011 08:27:13 -0700 Subject: Export init_stat_ex_from_stat for use in VFS modules. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Günther Deschner Autobuild-User: Günther Deschner Autobuild-Date: Fri Jun 10 13:23:37 CEST 2011 on sn-devel-104 --- source3/include/proto.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 6820db99f2..1cde4be9a6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -429,6 +429,19 @@ int sys_aio_cancel(int fd, SMB_STRUCT_AIOCB *aiocb); int sys_aio_error(const SMB_STRUCT_AIOCB *aiocb); int sys_aio_fsync(int op, SMB_STRUCT_AIOCB *aiocb); int sys_aio_suspend(const SMB_STRUCT_AIOCB * const cblist[], int n, const struct timespec *timeout); + +#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T) && defined(HAVE_STAT64) +struct stat64; +void init_stat_ex_from_stat (struct stat_ex *dst, + const struct stat64 *src, + bool fake_dir_create_times); +#else +struct stat; +void init_stat_ex_from_stat (struct stat_ex *dst, + const struct stat *src, + bool fake_dir_create_times); +#endif + /* The following definitions come from lib/system_smbd.c */ bool getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user, -- cgit From 0d7581b22b76774a1ef58a7eeb71df9c5bd69943 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:03:43 +0200 Subject: source3/include/krb5_env.h: fix licence/copyright Guenther --- source3/include/krb5_env.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'source3/include') diff --git a/source3/include/krb5_env.h b/source3/include/krb5_env.h index aa96795392..0022da839c 100644 --- a/source3/include/krb5_env.h +++ b/source3/include/krb5_env.h @@ -1,2 +1,26 @@ +/* + Samba Unix/Linux SMB client library + + Copyright (C) 2010 Günther Deschner + + 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 _INCLUDE_KRB5_ENV_H_ +#define _INCLUDE_KRB5_ENV_H_ + /* Kerberos environment variable names */ #define KRB5_ENV_CCNAME "KRB5CCNAME" + +#endif /* _INCLUDE_KRB5_ENV_H_ */ -- cgit From ef84a5b2aafa7c90c2aaff82006a69dec485d2ab Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:03:55 +0200 Subject: source3/include/krb5_protos.h: fix licence/copyright Guenther --- source3/include/krb5_protos.h | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/krb5_protos.h b/source3/include/krb5_protos.h index c53588890c..37fc1c6cd5 100644 --- a/source3/include/krb5_protos.h +++ b/source3/include/krb5_protos.h @@ -1,3 +1,28 @@ +/* + Unix SMB/CIFS implementation. + simple kerberos5 routines for active directory + Copyright (C) Andrew Tridgell 2001 + Copyright (C) Luke Howard 2002-2003 + Copyright (C) Andrew Bartlett 2005 + Copyright (C) Guenther Deschner 2005-2009 + + 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 _INCLUDE_KRB5_PROTOS_H_ +#define _INCLUDE_KRB5_PROTOS_H_ + struct PAC_DATA; struct PAC_SIGNATURE_DATA; @@ -39,6 +64,8 @@ void krb5_free_unparsed_name(krb5_context ctx, char *val); #define initialize_krb5_error_table() #endif +/* The following definitions come from libsmb/clikrb5.c */ + /* Samba wrapper function for krb5 functionality. */ bool setup_kaddr( krb5_address *pkaddr, struct sockaddr_storage *paddr); int create_kerberos_key_from_string(krb5_context context, krb5_principal host_princ, krb5_data *password, krb5_keyblock *key, krb5_enctype enctype, bool no_salt); @@ -131,9 +158,9 @@ int cli_krb5_get_ticket(TALLOC_CTX *mem_ctx, time_t *tgs_expire, const char *impersonate_princ_s); -/* The following definitions come from libsmb/clikrb5.c */ - bool unwrap_edata_ntstatus(TALLOC_CTX *mem_ctx, DATA_BLOB *edata, DATA_BLOB *edata_out); bool unwrap_pac(TALLOC_CTX *mem_ctx, DATA_BLOB *auth_data, DATA_BLOB *unwrapped_pac_data); + +#endif /* _INCLUDE_KRB5_PROTOS_H_ */ -- cgit From d357b5ce2a1eeead19760ecfad8c7d2bbf9e7622 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:04:05 +0200 Subject: source3/include/mangle.h: fix licence/copyright Guenther --- source3/include/mangle.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source3/include') diff --git a/source3/include/mangle.h b/source3/include/mangle.h index c07b852453..7c4602b4eb 100644 --- a/source3/include/mangle.h +++ b/source3/include/mangle.h @@ -1,3 +1,22 @@ +/* + Unix SMB/CIFS implementation. + Name mangling interface + Copyright (C) Andrew Tridgell 2002 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef _MANGLE_H_ #define _MANGLE_H_ /* -- cgit From 769f8793cff7d336ab04442208039f87147388bd Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:04:16 +0200 Subject: source3/include/smb_krb5.h: fix licence/copyright Guenther --- source3/include/smb_krb5.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb_krb5.h b/source3/include/smb_krb5.h index 8109747b70..bc9996c541 100644 --- a/source3/include/smb_krb5.h +++ b/source3/include/smb_krb5.h @@ -1,3 +1,25 @@ +/* + Unix SMB/CIFS implementation. + simple kerberos5 routines for active directory + Copyright (C) Andrew Tridgell 2001 + Copyright (C) Luke Howard 2002-2003 + Copyright (C) Andrew Bartlett 2005 + Copyright (C) Guenther Deschner 2005-2009 + + 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 _HEADER_smb_krb5_h #define _HEADER_smb_krb5_h -- cgit From e14b60c7ee6a76c444f12b8987740602c7b5f1d3 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 10 Jun 2011 15:04:26 +0200 Subject: source3/include/smb_ldap.h: fix licence/copyright Guenther --- source3/include/smb_ldap.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3/include') diff --git a/source3/include/smb_ldap.h b/source3/include/smb_ldap.h index 389a734227..594f015862 100644 --- a/source3/include/smb_ldap.h +++ b/source3/include/smb_ldap.h @@ -1,3 +1,25 @@ +/* + Unix SMB/CIFS implementation. + Copyright (C) Andrew Tridgell 2001 + Copyright (C) Remus Koos 2001 + Copyright (C) Jim McDonough 2002 + Copyright (C) Guenther Deschner 2005 + Copyright (C) Gerald Carter 2006 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 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 _SMB_LDAP_H #define _SMB_LDAP_H -- cgit From f3ba1f4112b1216239e6c13a9d898e6bdbd86785 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 31 May 2011 21:03:22 -0700 Subject: Bump the smbd vfs interface version to 29. Samba 3.6.0 will ship with interface 28. --- source3/include/vfs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 145b52c5c2..5c7e4e52bc 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -135,7 +135,8 @@ /* Leave at 28 - not yet released. Add fdopendir. JRA. */ /* Leave at 28 - not yet released. Rename open function to open_fn. - gd */ /* Leave at 28 - not yet released. Make getwd function always return malloced memory. JRA. */ -#define SMB_VFS_INTERFACE_VERSION 28 +/* Bump to version 29 - Samba 3.6.0 will ship with interface version 28. */ +#define SMB_VFS_INTERFACE_VERSION 29 /* All intercepted VFS operations must be declared as static functions inside module source -- cgit From 3dd1ebd21ee99d130f6dd30326ddafe3f00a50d0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 9 Jun 2011 11:49:48 +0200 Subject: s3:libsmb/async_smb: add helpers to get and set the seqnum for signing This will be used for correct signing in [nt]trans[2][s] requests. metze --- source3/include/async_smb.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/include') diff --git a/source3/include/async_smb.h b/source3/include/async_smb.h index a8852b2eea..1685d4985d 100644 --- a/source3/include/async_smb.h +++ b/source3/include/async_smb.h @@ -51,6 +51,8 @@ void cli_smb_req_unset_pending(struct tevent_req *req); bool cli_smb_req_set_pending(struct tevent_req *req); uint16_t cli_smb_req_mid(struct tevent_req *req); void cli_smb_req_set_mid(struct tevent_req *req, uint16_t mid); +uint32_t cli_smb_req_seqnum(struct tevent_req *req); +void cli_smb_req_set_seqnum(struct tevent_req *req, uint32_t seqnum); struct tevent_req *cli_smb_send(TALLOC_CTX *mem_ctx, struct event_context *ev, struct cli_state *cli, uint8_t smb_command, uint8_t additional_flags, -- cgit From fdfb5e95fee67bb7bb3942270031d9260e0505b0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 9 Jun 2011 11:59:58 +0200 Subject: s3:libsmb: remove unused cli_state_seqnum infrastructure metze Autobuild-User: Jeremy Allison Autobuild-Date: Fri Jun 10 20:37:54 CEST 2011 on sn-devel-104 --- source3/include/client.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'source3/include') diff --git a/source3/include/client.h b/source3/include/client.h index 7d66bf912c..a853e90af6 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -46,13 +46,6 @@ struct print_job_info { time_t t; }; -struct cli_state_seqnum { - struct cli_state_seqnum *prev, *next; - uint16_t mid; - uint32_t seqnum; - bool persistent; -}; - struct cli_state { /** * A list of subsidiary connections for DFS. @@ -103,7 +96,6 @@ struct cli_state { size_t max_xmit; size_t max_mux; char *outbuf; - struct cli_state_seqnum *seqnum; char *inbuf; unsigned int bufsize; int initialised; -- cgit From ebf04d79abdf0a15248a266162c8ec8906ce3c5f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 3 Jun 2011 15:49:55 +0200 Subject: s3: Remove "struct ip_service" from resolve_wins --- 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 1cde4be9a6..4a19f74d4c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1052,7 +1052,8 @@ NTSTATUS name_resolve_bcast(const char *name, int *return_count); NTSTATUS resolve_wins(const char *name, int name_type, - struct ip_service **return_iplist, + TALLOC_CTX *mem_ctx, + struct sockaddr_storage **return_iplist, int *return_count); NTSTATUS internal_resolve_name(const char *name, int name_type, -- cgit From 396b646123c1aef81c644ae744e65c71b30067d0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 12 Jun 2011 14:07:22 +0200 Subject: s3: Add wins_server_tag_ips() For a given tag, return the list of all wins servers --- 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 4a19f74d4c..815104881d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -913,6 +913,8 @@ unsigned wins_srv_count(void); char **wins_srv_tags(void); void wins_srv_tags_free(char **list); struct in_addr wins_srv_ip_tag(const char *tag, struct in_addr src_ip); +bool wins_server_tag_ips(const char *tag, TALLOC_CTX *mem_ctx, + struct in_addr **pservers, int *pnum_servers); unsigned wins_srv_count_tag(const char *tag); /* The following definitions come from libsmb/clispnego.c */ -- cgit From 0dfcf3ef78bb16d79644ee08f58d519e74ff0f0a Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 2 Jun 2011 14:12:06 +0200 Subject: s3: Add resolve_wins_send/recv --- 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 815104881d..ad8ae994ff 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1052,6 +1052,13 @@ NTSTATUS name_resolve_bcast(const char *name, TALLOC_CTX *mem_ctx, struct sockaddr_storage **return_iplist, int *return_count); +struct tevent_req *resolve_wins_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + const char *name, + int name_type); +NTSTATUS resolve_wins_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, + struct sockaddr_storage **addrs, + int *num_addrs, uint8_t *flags); NTSTATUS resolve_wins(const char *name, int name_type, TALLOC_CTX *mem_ctx, -- cgit From 9923a8cf4373b757975c8fa27a4839a33833c032 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 13 Jun 2011 01:56:09 +0200 Subject: s3:proto.h: remove prototypes of error functions moved to common code. ntstatus_to_dos, werror_to_ntstatus, ntstatus_to_werror Autobuild-User: Michael Adam Autobuild-Date: Mon Jun 13 03:31:58 CEST 2011 on sn-devel-104 --- source3/include/proto.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index ad8ae994ff..f3643078c4 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -982,9 +982,6 @@ NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx, /* The following definitions come from libsmb/errormap.c */ NTSTATUS dos_to_ntstatus(uint8 eclass, uint32 ecode); -void ntstatus_to_dos(NTSTATUS ntstatus, uint8 *eclass, uint32 *ecode); -NTSTATUS werror_to_ntstatus(WERROR error); -WERROR ntstatus_to_werror(NTSTATUS error); NTSTATUS map_nt_error_from_gss(uint32 gss_maj, uint32 minor); /* The following definitions come from libsmb/namecache.c */ -- cgit From 264409750a569b632576e8cd6fddd72fc29e9660 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 17 Jun 2011 14:40:07 +1000 Subject: s3-util: remove the s3 nterr.c this is now in common code Pair-Programmed-With: Andrew Bartlett --- source3/include/proto.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f3643078c4..98445d89b5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1095,13 +1095,6 @@ bool get_dc_name(const char *domain, fstring srv_name, struct sockaddr_storage *ss_out); -/* The following definitions come from libsmb/nterr.c */ - -const char *nt_errstr(NTSTATUS nt_code); -const char *get_friendly_nt_error_msg(NTSTATUS nt_code); -NTSTATUS nt_status_string_to_code(const char *nt_status_str); -NTSTATUS nt_status_squash(NTSTATUS nt_status); - /* The following definitions come from libsmb/ntlmssp.c */ struct ntlmssp_state; NTSTATUS ntlmssp_set_username(struct ntlmssp_state *ntlmssp_state, const char *user) ; -- cgit From f811e894c42fc829d6fb82ba6f7316a9d852d85c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 19 Jun 2011 13:05:29 +0200 Subject: s3: Add name_resolve_bcast_send/recv --- 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 98445d89b5..aa99d1c543 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1044,6 +1044,13 @@ NTSTATUS name_query(const char *name, int name_type, TALLOC_CTX *mem_ctx, struct sockaddr_storage **addrs, int *num_addrs, uint8_t *flags); +struct tevent_req *name_resolve_bcast_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + const char *name, + int name_type); +NTSTATUS name_resolve_bcast_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, + struct sockaddr_storage **addrs, + int *num_addrs); NTSTATUS name_resolve_bcast(const char *name, int name_type, TALLOC_CTX *mem_ctx, -- cgit From 0e4c358e2710580d5aeb439d767c87aaf4c0f2f3 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 20 Jun 2011 18:40:25 +0930 Subject: tdb_compat.h: divert every tdb build and includes to tdb_compat We change all the headers and wscript files to use tdb_compat; this means we have one place to decide whether to use TDB1 or TDB2. Signed-off-by: Rusty Russell --- source3/include/ctdbd_conn.h | 2 +- source3/include/dbwrap.h | 2 +- source3/include/util_tdb.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index 36b6542da0..3d712674e0 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -20,7 +20,7 @@ #ifndef _CTDBD_CONN_H #define _CTDBD_CONN_H -#include +#include "tdb_compat.h" struct ctdbd_connection; struct messaging_context; diff --git a/source3/include/dbwrap.h b/source3/include/dbwrap.h index d657ee7f30..303a554938 100644 --- a/source3/include/dbwrap.h +++ b/source3/include/dbwrap.h @@ -20,7 +20,7 @@ #ifndef __DBWRAP_H__ #define __DBWRAP_H__ -#include +#include "tdb_compat.h" struct db_record { TDB_DATA key, value; diff --git a/source3/include/util_tdb.h b/source3/include/util_tdb.h index a6144ba44d..f127cea1ea 100644 --- a/source3/include/util_tdb.h +++ b/source3/include/util_tdb.h @@ -20,7 +20,7 @@ #ifndef __TDBUTIL_H__ #define __TDBUTIL_H__ -#include +#include "tdb_compat.h" #include /* for tdb_wrap_open() */ #include "../libcli/util/ntstatus.h" /* for map_nt_error_from_tdb() */ -- cgit From a4993f647cfc5b8e0cf4405cc1d8815770837310 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 20 Jun 2011 18:40:32 +0930 Subject: ldb: replace 'struct TDB_DATA' with 'TDB_DATA' The typedef is TDB2 compatible, the struct isn't. Signed-off-by: Rusty Russell --- source3/include/printing.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/printing.h b/source3/include/printing.h index bba7d53a16..1bbb72c7be 100644 --- a/source3/include/printing.h +++ b/source3/include/printing.h @@ -24,6 +24,7 @@ This file defines the low-level printing system interfaces used by the SAMBA printing subsystem. */ +#include "tdb_compat.h" /* Extra fields above "LPQ_PRINTING" are used to map extra NT status codes. */ @@ -158,9 +159,6 @@ extern struct printif iprint_printif; /* There can be this many printing tdb's open, plus any locked ones. */ #define MAX_PRINT_DBS_OPEN 1 -struct TDB_DATA; -struct tdb_context; - struct tdb_print_db { struct tdb_print_db *next, *prev; struct tdb_context *tdb; @@ -252,7 +250,7 @@ uint32_t print_parse_jobid(const char *fname); struct tdb_print_db *get_print_db_byname(const char *printername); void release_print_db( struct tdb_print_db *pdb); void close_all_print_db(void); -struct TDB_DATA get_printer_notify_pid_list(struct tdb_context *tdb, const char *printer_name, bool cleanlist); +TDB_DATA get_printer_notify_pid_list(struct tdb_context *tdb, const char *printer_name, bool cleanlist); void print_queue_receive(struct messaging_context *msg, void *private_data, -- cgit From f3d6b742b18589306e0f19cc52e06f108fc1268e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 20 Jun 2011 15:02:46 +1000 Subject: lib/util Make unused d_vfprintf() static --- source3/include/includes.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'source3/include') diff --git a/source3/include/includes.h b/source3/include/includes.h index e6b70c782c..08d5d96ab5 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -608,8 +608,6 @@ void sys_adminlog(int priority, const char *format_str, ...) PRINTF_ATTRIBUTE(2, /* PRINTFLIKE2 */ int fstr_sprintf(fstring s, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); -int d_vfprintf(FILE *f, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0); - int smb_xvasprintf(char **ptr, const char *format, va_list ap) PRINTF_ATTRIBUTE(2,0); int asprintf_strupper_m(char **strp, const char *fmt, ...) PRINTF_ATTRIBUTE(2,3); -- cgit From 8683490748a6ed2eaed11655c96e2838c4aa597b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 21 Jun 2011 10:23:17 +0200 Subject: s3: remove prototype of convert_string from proto.h --- source3/include/proto.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index aa99d1c543..570b1a1211 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -73,10 +73,6 @@ int bitmap_find(struct bitmap *bm, unsigned ofs); /* The following definitions come from lib/charcnv.c */ void gfree_charcnv(void); -bool convert_string(charset_t from, charset_t to, - void const *src, size_t srclen, - void *dest, size_t destlen, - size_t *converted_size); bool convert_string_error(charset_t from, charset_t to, void const *src, size_t srclen, void *dest, size_t destlen, -- cgit From 472759a1e407d564d0125ec8f47eee38d62d6e1f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 21 Jun 2011 10:23:51 +0200 Subject: s3: remove prototype of convert_string_error from proto.h Autobuild-User: Michael Adam Autobuild-Date: Thu Jun 23 12:34:31 CEST 2011 on sn-devel-104 --- source3/include/proto.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 570b1a1211..ef8be4f987 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -73,10 +73,6 @@ int bitmap_find(struct bitmap *bm, unsigned ofs); /* The following definitions come from lib/charcnv.c */ void gfree_charcnv(void); -bool convert_string_error(charset_t from, charset_t to, - void const *src, size_t srclen, - void *dest, size_t destlen, - size_t *converted_size); size_t ucs2_align(const void *base_ptr, const void *p, int flags); size_t push_ascii(void *dest, const char *src, size_t dest_len, int flags); size_t push_ascii_fstring(void *dest, const char *src); -- cgit From fb1346d748a969702d51d02dcecc38ae93714599 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 23 Jun 2011 12:24:21 +0200 Subject: s3: Fix some nonempty blank lines --- source3/include/ntioctl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/include') diff --git a/source3/include/ntioctl.h b/source3/include/ntioctl.h index 18707c5bbe..08196d4e53 100644 --- a/source3/include/ntioctl.h +++ b/source3/include/ntioctl.h @@ -2,17 +2,17 @@ Unix SMB/CIFS implementation. NT ioctl code constants Copyright (C) Andrew Tridgell 2002 - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ -- cgit From 6c3cef773a989f175c518b435feebab287a58cf0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 23 Jun 2011 12:24:40 +0200 Subject: s3: Add IO_REPARSE_TAG_SYMLINK define From http://msdn.microsoft.com/en-us/library/dd541667%28v=PROT.13%29.aspx Autobuild-User: Volker Lendecke Autobuild-Date: Thu Jun 23 13:46:37 CEST 2011 on sn-devel-104 --- source3/include/ntioctl.h | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/include') diff --git a/source3/include/ntioctl.h b/source3/include/ntioctl.h index 08196d4e53..131d596ded 100644 --- a/source3/include/ntioctl.h +++ b/source3/include/ntioctl.h @@ -69,6 +69,7 @@ #endif +#define IO_REPARSE_TAG_SYMLINK 0xA000000C #define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003 #define IO_REPARSE_TAG_HSM 0xC0000004 #define IO_REPARSE_TAG_SIS 0x80000007 -- cgit From 125a2ff262aa312df20eec68802fd5f8a47f492f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 22 Jun 2011 09:52:31 +1000 Subject: lib/util/charset: Remove 'display charset' As discussed in 'CH_DISPLAY and gettext' on the samba-technical list: http://lists.samba.org/archive/samba-technical/2011-June/078190.html Setting this to a value other than 'unix charset' does not make sense, as any system where the filesytem charset does not equal the terminal charset will already have problems with programs as simple as 'ls'. It also means that our output could not be pasted as our input in interactive programs or onto our command line, as we never did translate in the DISPLAY -> UNIX direction. The d_printf() calls are retained in case we need to revisit this, and to support display_set_stderr(). Andrew Bartlett --- 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 ef8be4f987..31c75189fc 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1174,7 +1174,6 @@ NTSTATUS change_trust_account_password( const char *domain, const char *remote_m const char *lp_smb_ports(void); const char *lp_dos_charset(void); const char *lp_unix_charset(void); -const char *lp_display_charset(void); char *lp_logfile(void); char *lp_configfile(void); const char *lp_smb_passwd_file(void); -- cgit From 734e1b6812b672fc7d838e943b14b8a176552734 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 21 Jun 2011 15:14:29 +1000 Subject: s3-param Remove 'announce version' parameter The only users I can find of this on the internet involve confused users, and our own documentation recommends never setting this. Don't confuse our users any longer. Andrew Bartlett --- source3/include/proto.h | 2 -- source3/include/smb.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index 31c75189fc..90dbafc96c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1636,8 +1636,6 @@ bool lp_preferred_master(void); void lp_remove_service(int snum); void lp_copy_service(int snum, const char *new_name); int lp_default_server_announce(void); -int lp_major_announce_version(void); -int lp_minor_announce_version(void); void lp_set_name_resolve_order(const char *new_order); const char *lp_printername(int snum); void lp_set_logfile(const char *name); diff --git a/source3/include/smb.h b/source3/include/smb.h index ec78317b9b..589dfd78c3 100644 --- a/source3/include/smb.h +++ b/source3/include/smb.h @@ -1236,8 +1236,8 @@ char *strdup(char *s); * This may change again in Samba-3.0 after further testing. JHT */ -#define DEFAULT_MAJOR_VERSION 0x04 -#define DEFAULT_MINOR_VERSION 0x09 +#define SAMBA_MAJOR_NBT_ANNOUNCE_VERSION 0x04 +#define SAMBA_MINOR_NBT_ANNOUNCE_VERSION 0x09 /* Browser Election Values */ #define BROWSER_ELECTION_VERSION 0x010f -- cgit