diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2006-02-23 15:52:24 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2006-02-23 15:52:24 +0000 |
commit | 8904d38decd3a3b8533872898e23d7f9402228d1 (patch) | |
tree | 10358e7ad64df5ff88adbf1ffbc1653879598785 | |
parent | e2f710ba9d2bddd11ff1a81aa1a2a37d6d8036a4 (diff) | |
download | samba-8904d38decd3a3b8533872898e23d7f9402228d1.tar.gz samba-8904d38decd3a3b8533872898e23d7f9402228d1.tar.xz samba-8904d38decd3a3b8533872898e23d7f9402228d1.zip |
r13658: More moving around of files:
- Collect the generic utility functions into a lib/util/ (a la GLib is
for the GNOME folks)
- Remove even more files from include/
-rw-r--r-- | source/dynconfig.c | 43 | ||||
-rw-r--r-- | source/dynconfig.h (renamed from source/include/dynconfig.h) | 0 | ||||
-rw-r--r-- | source/heimdal_build/config.mk | 1 | ||||
-rw-r--r-- | source/include/core.h | 6 | ||||
-rw-r--r-- | source/include/enums.h | 38 | ||||
-rw-r--r-- | source/include/includes.h | 24 | ||||
-rw-r--r-- | source/include/structs.h | 4 | ||||
-rw-r--r-- | source/lib/basic.mk | 42 | ||||
-rw-r--r-- | source/lib/gencache/gencache.c (renamed from source/lib/gencache.c) | 0 | ||||
-rw-r--r-- | source/lib/util/README | 296 | ||||
-rw-r--r-- | source/lib/util/byteorder.h (renamed from source/include/byteorder.h) | 0 | ||||
-rw-r--r-- | source/lib/util/capability.c (renamed from source/lib/capability.c) | 0 | ||||
-rw-r--r-- | source/lib/util/config.mk | 34 | ||||
-rw-r--r-- | source/lib/util/data_blob.c (renamed from source/lib/data_blob.c) | 0 | ||||
-rw-r--r-- | source/lib/util/debug.c (renamed from source/lib/debug.c) | 0 | ||||
-rw-r--r-- | source/lib/util/debug.h (renamed from source/lib/debug.h) | 0 | ||||
-rw-r--r-- | source/lib/util/dprintf.c (renamed from source/lib/dprintf.c) | 0 | ||||
-rw-r--r-- | source/lib/util/fault.c (renamed from source/lib/fault.c) | 0 | ||||
-rw-r--r-- | source/lib/util/fsusage.c (renamed from source/lib/fsusage.c) | 0 | ||||
-rw-r--r-- | source/lib/util/genrand.c (renamed from source/lib/genrand.c) | 0 | ||||
-rw-r--r-- | source/lib/util/idtree.c (renamed from source/lib/idtree.c) | 0 | ||||
-rw-r--r-- | source/lib/util/module.c (renamed from source/lib/module.c) | 0 | ||||
-rw-r--r-- | source/lib/util/ms_fnmatch.c (renamed from source/lib/ms_fnmatch.c) | 0 | ||||
-rw-r--r-- | source/lib/util/mutex.c (renamed from source/lib/mutex.c) | 0 | ||||
-rw-r--r-- | source/lib/util/mutex.h (renamed from source/lib/mutex.h) | 2 | ||||
-rw-r--r-- | source/lib/util/pidfile.c (renamed from source/lib/pidfile.c) | 0 | ||||
-rw-r--r-- | source/lib/util/safe_string.h (renamed from source/include/safe_string.h) | 0 | ||||
-rw-r--r-- | source/lib/util/select.c (renamed from source/lib/select.c) | 0 | ||||
-rw-r--r-- | source/lib/util/signal.c (renamed from source/lib/signal.c) | 0 | ||||
-rw-r--r-- | source/lib/util/substitute.c (renamed from source/lib/substitute.c) | 0 | ||||
-rw-r--r-- | source/lib/util/system.c (renamed from source/lib/system.c) | 0 | ||||
-rw-r--r-- | source/lib/util/time.c (renamed from source/lib/time.c) | 0 | ||||
-rw-r--r-- | source/lib/util/unix_privs.c (renamed from source/lib/unix_privs.c) | 0 | ||||
-rw-r--r-- | source/lib/util/util.c (renamed from source/lib/util.c) | 0 | ||||
-rw-r--r-- | source/lib/util/util.h (renamed from source/include/smb_macros.h) | 18 | ||||
-rw-r--r-- | source/lib/util/util_file.c (renamed from source/lib/util_file.c) | 0 | ||||
-rw-r--r-- | source/lib/util/util_getent.c (renamed from source/lib/util_getent.c) | 0 | ||||
-rw-r--r-- | source/lib/util/util_pw.c (renamed from source/lib/util_pw.c) | 0 | ||||
-rw-r--r-- | source/lib/util/util_sock.c (renamed from source/lib/util_sock.c) | 0 | ||||
-rw-r--r-- | source/lib/util/util_str.c (renamed from source/lib/util_str.c) | 0 | ||||
-rw-r--r-- | source/lib/util/util_strlist.c (renamed from source/lib/util_strlist.c) | 0 | ||||
-rw-r--r-- | source/lib/util/util_unistr.c (renamed from source/lib/util_unistr.c) | 0 | ||||
-rw-r--r-- | source/lib/util/xfile.c (renamed from source/lib/xfile.c) | 0 | ||||
-rw-r--r-- | source/lib/util/xfile.h (renamed from source/lib/xfile.h) | 0 | ||||
-rw-r--r-- | source/lib/version.c | 63 | ||||
-rw-r--r-- | source/libcli/clifile.c | 1 | ||||
-rw-r--r-- | source/libcli/raw/interfaces.h | 2 | ||||
-rw-r--r-- | source/libcli/raw/ioctl.h (renamed from source/include/ioctl.h) | 0 | ||||
-rw-r--r-- | source/libcli/raw/signing.h | 4 | ||||
-rw-r--r-- | source/libcli/raw/trans2.h (renamed from source/include/trans2.h) | 0 | ||||
-rw-r--r-- | source/librpc/rpc/dcerpc_smb2.c | 2 | ||||
-rw-r--r-- | source/main.mk | 2 | ||||
-rw-r--r-- | source/ntvfs/common/brlock.c | 7 | ||||
-rw-r--r-- | source/ntvfs/config.mk | 15 | ||||
-rw-r--r-- | source/ntvfs/posix/config.mk | 2 | ||||
-rw-r--r-- | source/ntvfs/posix/pvfs_ioctl.c | 2 | ||||
-rw-r--r-- | source/ntvfs/print/vfs_print.c | 2 | ||||
-rw-r--r-- | source/ntvfs/unixuid/config.mk | 2 | ||||
-rw-r--r-- | source/param/loadparm.c | 2 | ||||
-rw-r--r-- | source/rpc_server/lsa/dcesrv_lsa.c | 1 | ||||
-rw-r--r-- | source/rpc_server/unixinfo/dcesrv_unixinfo.c | 1 | ||||
-rwxr-xr-x | source/script/mkversion.sh | 4 | ||||
-rw-r--r-- | source/smb_server/smb_server.h | 2 | ||||
-rw-r--r-- | source/torture/raw/ioctl.c | 2 | ||||
-rw-r--r-- | source/torture/torture.c | 2 | ||||
-rw-r--r-- | source/winbind/wb_samba3_cmd.c | 2 |
66 files changed, 435 insertions, 193 deletions
diff --git a/source/dynconfig.c b/source/dynconfig.c index 742c96df2a2..c72b64bcac6 100644 --- a/source/dynconfig.c +++ b/source/dynconfig.c @@ -2,6 +2,7 @@ Unix SMB/CIFS implementation. Copyright (C) 2001 by Martin Pool <mbp@samba.org> Copyright (C) Jim McDonough (jmcd@us.ibm.com) 2003. + Copyright (C) Stefan Metzmacher 2003 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 @@ -18,6 +19,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "includes.h" +#include "version.h" + /** * @file dynconfig.c * @@ -90,3 +94,42 @@ const char *dyn_JSDIR = JSDIR; const char *dyn_WINBINDD_SOCKET_DIR = WINBINDD_SOCKET_DIR; +const char *samba_version_string(void) +{ + const char *official_string = SAMBA_VERSION_OFFICIAL_STRING; +#ifdef SAMBA_VERSION_RELEASE_NICKNAME + const char *release_nickname = SAMBA_VERSION_RELEASE_NICKNAME; +#else + const char *release_nickname = NULL; +#endif +#ifdef SAMBA_VERSION_VENDOR_SUFFIX + const char *vendor_suffix = SAMBA_VERSION_VENDOR_SUFFIX; +#else + const char *vendor_suffix = NULL; +#endif +#ifdef SAMBA_VERSION_VENDOR_PATCH + const char *vendor_patch = SAMBA_VERSION_VENDOR_PATCH; +#else + const char *vendor_patch = NULL; +#endif + static char *samba_version; + static BOOL init_samba_version; + + if (init_samba_version) { + return samba_version; + } + + samba_version = talloc_asprintf(talloc_autofree_context(), + "%s%s%s%s%s%s%s%s", + official_string, + (vendor_suffix?"-":""), + (vendor_suffix?vendor_suffix:""), + (vendor_patch?"-":""), + (vendor_patch?vendor_patch:""), + (release_nickname?" (":""), + (release_nickname?release_nickname:""), + (release_nickname?")":"")); + + init_samba_version = True; + return samba_version; +} diff --git a/source/include/dynconfig.h b/source/dynconfig.h index 5acf5b7338a..5acf5b7338a 100644 --- a/source/include/dynconfig.h +++ b/source/dynconfig.h diff --git a/source/heimdal_build/config.mk b/source/heimdal_build/config.mk index 0e652665268..a9d49f6082f 100644 --- a/source/heimdal_build/config.mk +++ b/source/heimdal_build/config.mk @@ -345,6 +345,7 @@ NOPROTO = YES # Start SUBSYSTEM HEIMDAL_GLUE [SUBSYSTEM::HEIMDAL_GLUE] OBJ_FILES = glue.o +REQUIRED_SUBSYSTEMS = LIBNETIF # End SUBSYSTEM HEIMDAL_GLUE ####################### diff --git a/source/include/core.h b/source/include/core.h index d0c92880de0..0ffbeea6a40 100644 --- a/source/include/core.h +++ b/source/include/core.h @@ -24,10 +24,6 @@ #ifndef _SAMBA_CORE_H #define _SAMBA_CORE_H -/* - * Define VOLATILE if needed. - */ - #define False (0) #define True (1) #define Auto (2) @@ -54,4 +50,4 @@ typedef uint64_t NTTIME; typedef NTSTATUS (*init_module_fn) (void); -#endif /* _SMB_H */ +#endif /* _SAMBA_CORE_H */ diff --git a/source/include/enums.h b/source/include/enums.h deleted file mode 100644 index 6003dfc7a00..00000000000 --- a/source/include/enums.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - Unix SMB/CIFS implementation. - - Copyright (C) Andrew Tridgell 2003 - - 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 2 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -/* - this header declares basic enumerated types -*/ - -/* protocol types. It assumes that higher protocols include lower protocols - as subsets */ -enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANMAN1,PROTOCOL_LANMAN2,PROTOCOL_NT1}; - -/* security levels */ -enum security_types {SEC_SHARE,SEC_USER}; - -/* passed to br lock code */ -enum brl_type {READ_LOCK, WRITE_LOCK, PENDING_READ_LOCK, PENDING_WRITE_LOCK}; - -enum smb_signing_state {SMB_SIGNING_OFF, SMB_SIGNING_SUPPORTED, - SMB_SIGNING_REQUIRED, SMB_SIGNING_AUTO}; - - diff --git a/source/include/includes.h b/source/include/includes.h index 444feab6fcf..8bede51721e 100644 --- a/source/include/includes.h +++ b/source/include/includes.h @@ -86,28 +86,31 @@ struct ipv4_addr { uint32_t addr; }; +/* protocol types. It assumes that higher protocols include lower protocols + as subsets. FIXME: Move to one of the smb-specific headers */ +enum protocol_types {PROTOCOL_NONE,PROTOCOL_CORE,PROTOCOL_COREPLUS,PROTOCOL_LANMAN1,PROTOCOL_LANMAN2,PROTOCOL_NT1}; + +/* passed to br lock code. FIXME: Move to one of the smb-specific headers */ +enum brl_type {READ_LOCK, WRITE_LOCK, PENDING_READ_LOCK, PENDING_WRITE_LOCK}; + #define _PRINTF_ATTRIBUTE(a1, a2) PRINTF_ATTRIBUTE(a1, a2) #include "lib/replace/replace.h" /* Lists, trees, caching, database... */ -#include "xfile.h" -#include "talloc/talloc.h" #include "nt_status.h" +#include "talloc/talloc.h" +#include "core.h" +#include "charset/charset.h" #include "structs.h" -#include "trans2.h" +#include "util/util.h" #include "libcli/util/nterr.h" -#include "charset/charset.h" -#include "core.h" -#include "debug.h" #include "libcli/util/doserr.h" -#include "enums.h" -#include "smb_macros.h" -#include "byteorder.h" #include "librpc/ndr/libndr.h" #include "librpc/gen_ndr/dcerpc.h" #include "librpc/ndr/ndr_orpc.h" #include "librpc/gen_ndr/orpc.h" #include "librpc/rpc/dcerpc.h" +#include "libcli/raw/trans2.h" #include "libcli/raw/interfaces.h" #include "auth/credentials/credentials.h" #include "libcli/nbt/libnbt.h" @@ -116,12 +119,11 @@ struct ipv4_addr { #define _PRINTF_ATTRIBUTE(a1, a2) /***** automatically generated prototypes *****/ -#include "basic.h" #include "include/proto.h" /* String routines */ -#include "safe_string.h" +#include "util/safe_string.h" #ifndef HAVE_PIPE #define SYNC_DNS 1 diff --git a/source/include/structs.h b/source/include/structs.h index 60ec1eae672..7bfe3262341 100644 --- a/source/include/structs.h +++ b/source/include/structs.h @@ -133,8 +133,6 @@ struct wb_sid_object; struct cldap_socket; struct cldapd_server; -struct mutex_ops; - struct websrv_context; struct wbsrv_call; @@ -161,6 +159,4 @@ struct nbtd_interface; struct smbcli_session; struct smbcli_state; -struct substitute_context; - struct model_ops; diff --git a/source/lib/basic.mk b/source/lib/basic.mk index d5bff95f012..51ca3378a24 100644 --- a/source/lib/basic.mk +++ b/source/lib/basic.mk @@ -16,6 +16,7 @@ include socket_wrapper/config.mk include appweb/config.mk include replace/config.mk include stream/config.mk +include util/config.mk ############################## # Start SUBSYSTEM LIBNETIF @@ -57,50 +58,13 @@ OBJ_FILES = \ ################################################ [SUBSYSTEM::GENCACHE] -PRIVATE_PROTO_HEADER = gencache.h +PRIVATE_PROTO_HEADER = gencache/gencache.h OBJ_FILES = \ - gencache.o \ - -############################## -# Start SUBSYSTEM LIBBASIC -[SUBSYSTEM::LIBBASIC] -PRIVATE_PROTO_HEADER = basic.h -OBJ_FILES = version.o \ - xfile.o \ - debug.o \ - fault.o \ - signal.o \ - system.o \ - time.o \ - genrand.o \ - dprintf.o \ - util_str.o \ - util_strlist.o \ - util_unistr.o \ - util_file.o \ - data_blob.o \ - util.o \ - util_sock.o \ - substitute.o \ - fsusage.o \ - ms_fnmatch.o \ - select.o \ - mutex.o \ - idtree.o \ - module.o -REQUIRED_SUBSYSTEMS = \ - CHARSET LIBREPLACE LIBNETIF LIBCRYPTO EXT_LIB_DL LIBTALLOC \ - SOCKET_WRAPPER CONFIG -# End SUBSYSTEM LIBBASIC -############################## + gencache/gencache.o \ [SUBSYSTEM::DB_WRAP] OBJ_FILES = db_wrap.o \ gendb.o REQUIRED_SUBSYSTEMS = LIBLDB LIBTDB -[SUBSYSTEM::PIDFILE] -OBJ_FILES = pidfile.o -[SUBSYSTEM::UNIX_PRIVS] -OBJ_FILES = unix_privs.o diff --git a/source/lib/gencache.c b/source/lib/gencache/gencache.c index de8c47ada59..de8c47ada59 100644 --- a/source/lib/gencache.c +++ b/source/lib/gencache/gencache.c diff --git a/source/lib/util/README b/source/lib/util/README new file mode 100644 index 00000000000..e52e04ed924 --- /dev/null +++ b/source/lib/util/README @@ -0,0 +1,296 @@ +This directory contains convenience functions that are used heavily +throughout Samba. None of these functions are SMB or Samba-specific. +It's a bit to Samba what GLib is to the GNOME folks. + +(This file should be migrated to doxygen sometime.. ) + +Also TODO: Remove dependency on loadparm + +XFILE wrapper functions +======================= +The XFILE implementation contains a clone of the standard UNIX stdio +functions + +Debug functions +=============== +DEBUG() + +Crash handlers +============== +void smb_panic(const char *why); + +Signal handling +======================== +void BlockSignals(BOOL block,int signum); +void (*CatchSignal(int signum,void (*handler)(int )))(int); +void CatchChild(void); +void CatchChildLeaveStatus(void); + +Wrappers +======== +struct hostent *sys_gethostbyname(const char *name); +const char *sys_inet_ntoa(struct ipv4_addr in); +struct ipv4_addr sys_inet_makeaddr(int net, int host); +void sys_select_signal(void); +int sys_select(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *tval); +int sys_select_intr(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *tval); + +Time datastructures +=================== +time_t get_time_t_max(void); +void GetTimeOfDay(struct timeval *tval); +time_t nt_time_to_unix(NTTIME nt); +void unix_to_nt_time(NTTIME *nt, time_t t); +BOOL null_time(time_t t); +BOOL null_nttime(NTTIME t); +void push_dos_date(uint8_t *buf, int offset, time_t unixdate, int zone_offset); +void push_dos_date2(uint8_t *buf,int offset,time_t unixdate, int zone_offset); +void push_dos_date3(uint8_t *buf,int offset,time_t unixdate, int zone_offset); +time_t pull_dos_date(const uint8_t *date_ptr, int zone_offset); +time_t pull_dos_date2(const uint8_t *date_ptr, int zone_offset); +time_t pull_dos_date3(const uint8_t *date_ptr, int zone_offset); +char *http_timestring(TALLOC_CTX *mem_ctx, time_t t); +char *timestring(TALLOC_CTX *mem_ctx, time_t t); +const char *nt_time_string(TALLOC_CTX *mem_ctx, NTTIME nt); +void push_nttime(uint8_t *base, uint16_t offset, NTTIME t); +NTTIME pull_nttime(uint8_t *base, uint16_t offset); +NTTIME nttime_from_string(const char *s); +int64_t usec_time_diff(struct timeval *tv1, struct timeval *tv2); +struct timeval timeval_zero(void); +BOOL timeval_is_zero(const struct timeval *tv); +struct timeval timeval_current(void); +struct timeval timeval_set(uint32_t secs, uint32_t usecs); +struct timeval timeval_add(const struct timeval *tv, + uint32_t secs, uint32_t usecs); +struct timeval timeval_sum(const struct timeval *tv1, + const struct timeval *tv2); +struct timeval timeval_current_ofs(uint32_t secs, uint32_t usecs); +int timeval_compare(const struct timeval *tv1, const struct timeval *tv2); +BOOL timeval_expired(const struct timeval *tv); +double timeval_elapsed2(const struct timeval *tv1, const struct timeval *tv2); +double timeval_elapsed(const struct timeval *tv); +struct timeval timeval_min(const struct timeval *tv1, + const struct timeval *tv2); +struct timeval timeval_max(const struct timeval *tv1, + const struct timeval *tv2); +struct timeval timeval_until(const struct timeval *tv1, + const struct timeval *tv2); +NTTIME timeval_to_nttime(const struct timeval *tv); +int get_time_zone(time_t t); + +Random number generation +======================== +void set_rand_reseed_callback(void (*fn)(int *)); +void set_need_random_reseed(void); +void generate_random_buffer(uint8_t *out, int len); +uint32_t generate_random(void); +BOOL check_password_quality(const char *s); +char *generate_random_str_list(TALLOC_CTX *mem_ctx, size_t len, const char *list); +char *generate_random_str(TALLOC_CTX *mem_ctx, size_t len); + +String manipulation +=================== +BOOL next_token(const char **ptr,char *buff, const char *sep, size_t bufsize); +int strcasecmp_m(const char *s1, const char *s2); +BOOL strequal(const char *s1, const char *s2); +BOOL strcsequal(const char *s1,const char *s2); +int strwicmp(const char *psz1, const char *psz2); +void string_replace(char *s, char oldc, char newc); +BOOL trim_string(char *s,const char *front,const char *back); +size_t count_chars(const char *s, char c); +char *safe_strcpy(char *dest,const char *src, size_t maxlength); +char *safe_strcat(char *dest, const char *src, size_t maxlength); +char *alpha_strcpy(char *dest, const char *src, const char *other_safe_chars, size_t maxlength); +char *StrnCpy(char *dest,const char *src,size_t n); +size_t strhex_to_str(char *p, size_t len, const char *strhex); +DATA_BLOB strhex_to_data_blob(const char *strhex) ; +void hex_encode(const unsigned char *buff_in, size_t len, char **out_hex_buffer); +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_sub(char *s,const char *pattern, const char *insert, size_t len); +void all_string_sub(char *s,const char *pattern,const char *insert, size_t len); +char *strchr_m(const char *s, char c); +char *strrchr_m(const char *s, char c); +BOOL strhaslower(const char *string); +BOOL strhasupper(const char *string); +char *strlower_talloc(TALLOC_CTX *ctx, const char *src); +char *strupper_talloc(TALLOC_CTX *ctx, const char *src); +void strlower_m(char *s); +void strupper_m(char *s); +size_t strlen_m(const char *s); +size_t strlen_m_term(const char *s); +void rfc1738_unescape(char *buf); +DATA_BLOB base64_decode_data_blob(TALLOC_CTX *mem_ctx, const char *s); +void base64_decode_inplace(char *s); +char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data); +size_t valgrind_strlen(const char *s); +const char *str_format_nbt_domain(TALLOC_CTX *mem_ctx, const char *s); +BOOL add_string_to_array(TALLOC_CTX *mem_ctx, + const char *str, const char ***strings, int *num); +int strcmp_safe(const char *s1, const char *s2); +size_t ascii_len_n(const char *src, size_t n); +char *attrib_string(TALLOC_CTX *mem_ctx, uint32_t attrib); +BOOL set_boolean(const char *boolean_string, BOOL *boolean); +BOOL conv_str_bool(const char * str, BOOL * val); +BOOL conv_str_size(const char * str, uint64_t * val); +BOOL conv_str_u64(const char * str, uint64_t * val); + +String list manipulation +======================== +const char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep); +const char **str_list_make_shell(TALLOC_CTX *mem_ctx, const char *string, const char *sep); +char *str_list_join(TALLOC_CTX *mem_ctx, const char **list, char seperator); +char *str_list_join_shell(TALLOC_CTX *mem_ctx, const char **list, char sep); +size_t str_list_length(const char **list); +const char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list); +BOOL str_list_equal(const char **list1, const char **list2); +const char **str_list_add(const char **list, const char *s); +void str_list_remove(const char **list, const char *s); +BOOL str_list_check(const char **list, const char *s); +BOOL str_list_check_ci(const char **list, const char *s); + +Unicode string manipulation +=========================== +codepoint_t toupper_w(codepoint_t val); +codepoint_t tolower_w(codepoint_t val); +size_t utf16_len(const void *buf); +size_t utf16_len_n(const void *src, size_t n); +size_t ucs2_align(const void *base_ptr, const void *p, int flags); +int codepoint_cmpi(codepoint_t c1, codepoint_t c2); + +File manipulation +================= +char *fgets_slash(char *s2,int maxlen,XFILE *f); +char *afdgets(int fd, TALLOC_CTX *mem_ctx, size_t hint); +char *fd_load(int fd, size_t *size, TALLOC_CTX *mem_ctx); +char *file_load(const char *fname, size_t *size, TALLOC_CTX *mem_ctx); +void *map_file(const char *fname, size_t size); +char **file_lines_load(const char *fname, int *numlines, TALLOC_CTX *mem_ctx); +char **fd_lines_load(int fd, int *numlines, TALLOC_CTX *mem_ctx); +void file_lines_slashcont(char **lines); +BOOL file_save(const char *fname, const void *packet, size_t length); +BOOL file_exists(const char *path); +int vfdprintf(int fd, const char *format, va_list ap) _PRINTF_ATTRIBUTE(2,0); +int fdprintf(int fd, const char *format, ...) _PRINTF_ATTRIBUTE(2,3); + +Data Blob +========= +DATA_BLOB data_blob_named(const void *p, size_t length, const char *name); +DATA_BLOB data_blob_talloc_named(TALLOC_CTX *mem_ctx, const void *p, size_t length, const char *name); +DATA_BLOB data_blob_talloc_reference(TALLOC_CTX *mem_ctx, DATA_BLOB *blob); +DATA_BLOB data_blob_talloc_zero(TALLOC_CTX *mem_ctx, size_t length); +void data_blob_free(DATA_BLOB *d); +void data_blob_clear(DATA_BLOB *d); +void data_blob_clear_free(DATA_BLOB *d); +BOOL data_blob_equal(const DATA_BLOB *d1, const DATA_BLOB *d2); +char *data_blob_hex_string(TALLOC_CTX *mem_ctx, DATA_BLOB *blob); +DATA_BLOB data_blob_string_const(const char *str); +DATA_BLOB data_blob_const(const void *p, size_t length); +NTSTATUS data_blob_realloc(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, size_t length); +NTSTATUS data_blob_append(TALLOC_CTX *mem_ctx, DATA_BLOB *blob, + const void *p, size_t length); + +Random Utility functions +======================== +const char *tmpdir(void); +BOOL file_exist(const char *fname); +time_t file_modtime(const char *fname); +BOOL directory_exist(const char *dname); +BOOL directory_create_or_exist(const char *dname, uid_t uid, + mode_t dir_perms); +int set_blocking(int fd, BOOL set); +void msleep(uint_t t); +void become_daemon(BOOL Fork); +void safe_free(void *p); +BOOL is_myname(const char *name); +char* get_myname(void); +BOOL is_ipaddress(const char *str); +uint32_t interpret_addr(const char *str); +struct ipv4_addr interpret_addr2(const char *str); +BOOL is_zero_ip(struct ipv4_addr ip); +BOOL same_net(struct ipv4_addr ip1,struct ipv4_addr ip2,struct ipv4_addr mask); +BOOL process_exists(pid_t pid); +BOOL fcntl_lock(int fd, int op, off_t offset, off_t count, int type); +void dump_data(int level, const uint8_t *buf,int len); +void *smb_xmalloc(size_t size); +void *smb_xmemdup(const void *p, size_t size); +char *smb_xstrdup(const char *s); +void *memdup(const void *p, size_t size); +char *lock_path(TALLOC_CTX* mem_ctx, const char *name); +char *lib_path(TALLOC_CTX* mem_ctx, const char *name); +char *private_path(TALLOC_CTX* mem_ctx, const char *name); +char *smbd_tmp_path(TALLOC_CTX *mem_ctx, const char *name); +init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *subsystem); +void dump_data_pw(const char *msg, const uint8_t * data, size_t len); +BOOL all_zero(const uint8_t *ptr, uint_t size); +void *realloc_array(void *ptr, size_t el_size, unsigned count); + +/* The following definitions come from lib/util/util_sock.c */ + +void set_socket_options(int fd, const char *options); + +Variable substitution +===================== +void sub_set_context(struct substitute_context *subptr); +void sub_set_remote_proto(const char *str); +void sub_set_remote_arch(const char *str); +void sub_set_user_name(const char *name); +void standard_sub_basic(char *str,size_t len); +char *talloc_sub_basic(TALLOC_CTX *mem_ctx, const char *smb_name, const char *str); +char *alloc_sub_basic(const char *smb_name, const char *str); +char *talloc_sub_specified(TALLOC_CTX *mem_ctx, + const char *input_string, + const char *username, + const char *domain, + uid_t uid, + gid_t gid); +char *alloc_sub_specified(const char *input_string, + const char *username, + const char *domain, + uid_t uid, + gid_t gid); +char *talloc_sub_advanced(TALLOC_CTX *mem_ctx, + int snum, + const char *user, + const char *connectpath, + gid_t gid, + const char *smb_name, + char *str); +char *alloc_sub_advanced(int snum, const char *user, + const char *connectpath, gid_t gid, + const char *smb_name, char *str); +void standard_sub_tcon(struct smbsrv_tcon *tcon, char *str, size_t len); +char *talloc_sub_tcon(TALLOC_CTX *mem_ctx, struct smbsrv_tcon *tcon, char *str); +char *alloc_sub_tcon(struct smbsrv_tcon *tcon, char *str); +void standard_sub_snum(int snum, char *str, size_t len); + +/* The following definitions come from lib/util/fsusage.c */ + +int sys_fsusage(const char *path, uint64_t *dfree, uint64_t *dsize); + +Microsoft-style filename matching +================================= +int ms_fnmatch(const char *pattern, const char *string, enum protocol_types protocol); +int gen_fnmatch(const char *pattern, const char *string); + +Mutexes +======= +BOOL register_mutex_handlers(const char *name, struct mutex_ops *ops); + +Idtree +====== +very efficient functions to manage mapping a id (such as a fnum) to +a pointer. This is used for fnum and search id allocation. + +struct idr_context *idr_init(TALLOC_CTX *mem_ctx); +int idr_get_new(struct idr_context *idp, void *ptr, int limit); +int idr_get_new_above(struct idr_context *idp, void *ptr, int starting_id, int limit); +int idr_get_new_random(struct idr_context *idp, void *ptr, int limit); +void *idr_find(struct idr_context *idp, int id); +int idr_remove(struct idr_context *idp, int id); + +Module loading +============== +init_module_fn *load_modules(TALLOC_CTX *mem_ctx, const char *path); +BOOL run_init_functions(NTSTATUS (**fns) (void)); diff --git a/source/include/byteorder.h b/source/lib/util/byteorder.h index 941dee9e88f..941dee9e88f 100644 --- a/source/include/byteorder.h +++ b/source/lib/util/byteorder.h diff --git a/source/lib/capability.c b/source/lib/util/capability.c index 0cebd333032..0cebd333032 100644 --- a/source/lib/capability.c +++ b/source/lib/util/capability.c diff --git a/source/lib/util/config.mk b/source/lib/util/config.mk new file mode 100644 index 00000000000..79e145775d7 --- /dev/null +++ b/source/lib/util/config.mk @@ -0,0 +1,34 @@ +[SUBSYSTEM::LIBBASIC] +PRIVATE_PROTO_HEADER = util_proto.h +PUBLIC_HEADERS = util.h +OBJ_FILES = xfile.o \ + debug.o \ + fault.o \ + signal.o \ + system.o \ + time.o \ + genrand.o \ + dprintf.o \ + util_str.o \ + util_strlist.o \ + util_unistr.o \ + util_file.o \ + data_blob.o \ + util.o \ + util_sock.o \ + substitute.o \ + fsusage.o \ + ms_fnmatch.o \ + select.o \ + mutex.o \ + idtree.o \ + module.o +REQUIRED_SUBSYSTEMS = \ + CHARSET LIBREPLACE LIBCRYPTO EXT_LIB_DL LIBTALLOC \ + SOCKET_WRAPPER CONFIG + +[SUBSYSTEM::PIDFILE] +OBJ_FILES = pidfile.o + +[SUBSYSTEM::UNIX_PRIVS] +OBJ_FILES = unix_privs.o diff --git a/source/lib/data_blob.c b/source/lib/util/data_blob.c index c6471fbf540..c6471fbf540 100644 --- a/source/lib/data_blob.c +++ b/source/lib/util/data_blob.c diff --git a/source/lib/debug.c b/source/lib/util/debug.c index 9df6e573b09..9df6e573b09 100644 --- a/source/lib/debug.c +++ b/source/lib/util/debug.c diff --git a/source/lib/debug.h b/source/lib/util/debug.h index 8ff937e7b93..8ff937e7b93 100644 --- a/source/lib/debug.h +++ b/source/lib/util/debug.h diff --git a/source/lib/dprintf.c b/source/lib/util/dprintf.c index 64227148fd9..64227148fd9 100644 --- a/source/lib/dprintf.c +++ b/source/lib/util/dprintf.c diff --git a/source/lib/fault.c b/source/lib/util/fault.c index 3670575dcc7..3670575dcc7 100644 --- a/source/lib/fault.c +++ b/source/lib/util/fault.c diff --git a/source/lib/fsusage.c b/source/lib/util/fsusage.c index f8176725447..f8176725447 100644 --- a/source/lib/fsusage.c +++ b/source/lib/util/fsusage.c diff --git a/source/lib/genrand.c b/source/lib/util/genrand.c index 1149314d0b4..1149314d0b4 100644 --- a/source/lib/genrand.c +++ b/source/lib/util/genrand.c diff --git a/source/lib/idtree.c b/source/lib/util/idtree.c index a67a80940a0..a67a80940a0 100644 --- a/source/lib/idtree.c +++ b/source/lib/util/idtree.c diff --git a/source/lib/module.c b/source/lib/util/module.c index 672d8df7cef..672d8df7cef 100644 --- a/source/lib/module.c +++ b/source/lib/util/module.c diff --git a/source/lib/ms_fnmatch.c b/source/lib/util/ms_fnmatch.c index 699341bede5..699341bede5 100644 --- a/source/lib/ms_fnmatch.c +++ b/source/lib/util/ms_fnmatch.c diff --git a/source/lib/mutex.c b/source/lib/util/mutex.c index 480ba92cc09..480ba92cc09 100644 --- a/source/lib/mutex.c +++ b/source/lib/util/mutex.c diff --git a/source/lib/mutex.h b/source/lib/util/mutex.h index bb26c84f5dc..018c134bcb8 100644 --- a/source/lib/mutex.h +++ b/source/lib/util/mutex.h @@ -21,6 +21,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +struct mutex_ops; + /* To add a new read/write lock, add it to enum rwlock_id */ enum rwlock_id { RWLOCK_SMBD, /* global smbd lock */ diff --git a/source/lib/pidfile.c b/source/lib/util/pidfile.c index 9a7c197f700..9a7c197f700 100644 --- a/source/lib/pidfile.c +++ b/source/lib/util/pidfile.c diff --git a/source/include/safe_string.h b/source/lib/util/safe_string.h index 43e094467cc..43e094467cc 100644 --- a/source/include/safe_string.h +++ b/source/lib/util/safe_string.h diff --git a/source/lib/select.c b/source/lib/util/select.c index a1b2e04065b..a1b2e04065b 100644 --- a/source/lib/select.c +++ b/source/lib/util/select.c diff --git a/source/lib/signal.c b/source/lib/util/signal.c index 6c0bb4007a1..6c0bb4007a1 100644 --- a/source/lib/signal.c +++ b/source/lib/util/signal.c diff --git a/source/lib/substitute.c b/source/lib/util/substitute.c index 34a2ad9f82b..34a2ad9f82b 100644 --- a/source/lib/substitute.c +++ b/source/lib/util/substitute.c diff --git a/source/lib/system.c b/source/lib/util/system.c index 655b4a1054f..655b4a1054f 100644 --- a/source/lib/system.c +++ b/source/lib/util/system.c diff --git a/source/lib/time.c b/source/lib/util/time.c index 7721a2c456c..7721a2c456c 100644 --- a/source/lib/time.c +++ b/source/lib/util/time.c diff --git a/source/lib/unix_privs.c b/source/lib/util/unix_privs.c index 3c0f3197767..3c0f3197767 100644 --- a/source/lib/unix_privs.c +++ b/source/lib/util/unix_privs.c diff --git a/source/lib/util.c b/source/lib/util/util.c index 17dde332e1a..17dde332e1a 100644 --- a/source/lib/util.c +++ b/source/lib/util/util.c diff --git a/source/include/smb_macros.h b/source/lib/util/util.h index 956b0709ca7..55d775e25c6 100644 --- a/source/include/smb_macros.h +++ b/source/lib/util/util.h @@ -1,11 +1,11 @@ /* Unix SMB/CIFS implementation. - Some convenient macros + Utility functions for Samba Copyright (C) Andrew Tridgell 1992-1999 Copyright (C) John H Terpstra 1996-1999 Copyright (C) Luke Kenneth Casson Leighton 1996-1999 Copyright (C) Paul Ashton 1998 - 1999 - + 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 2 of the License, or @@ -21,8 +21,16 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#ifndef _SMB_MACROS_H -#define _SMB_MACROS_H +#ifndef _SAMBA_UTIL_H_ +#define _SAMBA_UTIL_H_ + +struct substitute_context; + +#include "util/xfile.h" +#include "util/debug.h" +#include "util/mutex.h" +#include "util/byteorder.h" +#include "util/util_proto.h" /* zero a structure */ #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x)) @@ -70,4 +78,4 @@ #define malloc_array_p(type, count) (type *)realloc_array(NULL, sizeof(type), count) #define realloc_p(p, type, count) (type *)realloc_array(p, sizeof(type), count) -#endif /* _SMB_MACROS_H */ +#endif /* _SAMBA_UTIL_H_ */ diff --git a/source/lib/util_file.c b/source/lib/util/util_file.c index 246b03b4aa4..246b03b4aa4 100644 --- a/source/lib/util_file.c +++ b/source/lib/util/util_file.c diff --git a/source/lib/util_getent.c b/source/lib/util/util_getent.c index 9f58472fb8c..9f58472fb8c 100644 --- a/source/lib/util_getent.c +++ b/source/lib/util/util_getent.c diff --git a/source/lib/util_pw.c b/source/lib/util/util_pw.c index 19893e396f9..19893e396f9 100644 --- a/source/lib/util_pw.c +++ b/source/lib/util/util_pw.c diff --git a/source/lib/util_sock.c b/source/lib/util/util_sock.c index 8a65a27d020..8a65a27d020 100644 --- a/source/lib/util_sock.c +++ b/source/lib/util/util_sock.c diff --git a/source/lib/util_str.c b/source/lib/util/util_str.c index b46787e3ea2..b46787e3ea2 100644 --- a/source/lib/util_str.c +++ b/source/lib/util/util_str.c diff --git a/source/lib/util_strlist.c b/source/lib/util/util_strlist.c index ec6c58162f7..ec6c58162f7 100644 --- a/source/lib/util_strlist.c +++ b/source/lib/util/util_strlist.c diff --git a/source/lib/util_unistr.c b/source/lib/util/util_unistr.c index b35822877cc..b35822877cc 100644 --- a/source/lib/util_unistr.c +++ b/source/lib/util/util_unistr.c diff --git a/source/lib/xfile.c b/source/lib/util/xfile.c index 794e3f0f5e8..794e3f0f5e8 100644 --- a/source/lib/xfile.c +++ b/source/lib/util/xfile.c diff --git a/source/lib/xfile.h b/source/lib/util/xfile.h index 89fa9d1e118..89fa9d1e118 100644 --- a/source/lib/xfile.h +++ b/source/lib/util/xfile.h diff --git a/source/lib/version.c b/source/lib/version.c deleted file mode 100644 index b7aa81a0817..00000000000 --- a/source/lib/version.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Samba Version functions - - Copyright (C) Stefan Metzmacher 2003 - - 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 2 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, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include "includes.h" -#include "version.h" - -const char *samba_version_string(void) -{ - const char *official_string = SAMBA_VERSION_OFFICIAL_STRING; -#ifdef SAMBA_VERSION_RELEASE_NICKNAME - const char *release_nickname = SAMBA_VERSION_RELEASE_NICKNAME; -#else - const char *release_nickname = NULL; -#endif -#ifdef SAMBA_VERSION_VENDOR_SUFFIX - const char *vendor_suffix = SAMBA_VERSION_VENDOR_SUFFIX; -#else - const char *vendor_suffix = NULL; -#endif -#ifdef SAMBA_VERSION_VENDOR_PATCH - const char *vendor_patch = SAMBA_VERSION_VENDOR_PATCH; -#else - const char *vendor_patch = NULL; -#endif - static char *samba_version; - static BOOL init_samba_version; - - if (init_samba_version) { - return samba_version; - } - - samba_version = talloc_asprintf(talloc_autofree_context(), - "%s%s%s%s%s%s%s%s", - official_string, - (vendor_suffix?"-":""), - (vendor_suffix?vendor_suffix:""), - (vendor_patch?"-":""), - (vendor_patch?vendor_patch:""), - (release_nickname?" (":""), - (release_nickname?release_nickname:""), - (release_nickname?")":"")); - - init_samba_version = True; - return samba_version; -} diff --git a/source/libcli/clifile.c b/source/libcli/clifile.c index 0b9cac4c07c..e8cb5480075 100644 --- a/source/libcli/clifile.c +++ b/source/libcli/clifile.c @@ -23,6 +23,7 @@ #include "includes.h" #include "system/filesys.h" #include "libcli/raw/libcliraw.h" +#include "libcli/libcli.h" /**************************************************************************** Hard/Symlink a file (UNIX extensions). diff --git a/source/libcli/raw/interfaces.h b/source/libcli/raw/interfaces.h index 49fe085f2cf..034878a464a 100644 --- a/source/libcli/raw/interfaces.h +++ b/source/libcli/raw/interfaces.h @@ -19,8 +19,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ - - /* this structure is just a wrapper for a string, the only reason we bother with this is that it allows us to check the length provided on the wire in testsuite test code to ensure that we are diff --git a/source/include/ioctl.h b/source/libcli/raw/ioctl.h index cd658c121b5..cd658c121b5 100644 --- a/source/include/ioctl.h +++ b/source/libcli/raw/ioctl.h diff --git a/source/libcli/raw/signing.h b/source/libcli/raw/signing.h index dfc5a4bd7e1..cea8556c2c4 100644 --- a/source/libcli/raw/signing.h +++ b/source/libcli/raw/signing.h @@ -27,6 +27,10 @@ enum smb_signing_engine_state { SMB_SIGNING_ENGINE_ON }; +enum smb_signing_state { + SMB_SIGNING_OFF, SMB_SIGNING_SUPPORTED, + SMB_SIGNING_REQUIRED, SMB_SIGNING_AUTO}; + struct smb_signing_context { enum smb_signing_engine_state signing_state; DATA_BLOB mac_key; diff --git a/source/include/trans2.h b/source/libcli/raw/trans2.h index a3f6e28a2af..a3f6e28a2af 100644 --- a/source/include/trans2.h +++ b/source/libcli/raw/trans2.h diff --git a/source/librpc/rpc/dcerpc_smb2.c b/source/librpc/rpc/dcerpc_smb2.c index 90882bd95ea..d22ef6a9f24 100644 --- a/source/librpc/rpc/dcerpc_smb2.c +++ b/source/librpc/rpc/dcerpc_smb2.c @@ -25,7 +25,7 @@ #include "libcli/composite/composite.h" #include "libcli/smb2/smb2.h" #include "libcli/smb2/smb2_calls.h" -#include "ioctl.h" +#include "libcli/raw/ioctl.h" /* transport private information used by SMB2 pipe transport */ struct smb2_private { diff --git a/source/main.mk b/source/main.mk index 8f67e6ad9e0..98ee46cc7e5 100644 --- a/source/main.mk +++ b/source/main.mk @@ -246,7 +246,7 @@ include/includes.h: \ librpc/rpc/dcerpc.h \ auth/credentials/credentials_proto.h \ libcli/nbt/libnbt.h \ - lib/basic.h \ + lib/util/util_proto.h \ lib/charset/charset.h clean_pch: diff --git a/source/ntvfs/common/brlock.c b/source/ntvfs/common/brlock.c index 3fc3c09316a..6548a2c1993 100644 --- a/source/ntvfs/common/brlock.c +++ b/source/ntvfs/common/brlock.c @@ -31,6 +31,7 @@ #include "messaging/messaging.h" #include "db_wrap.h" #include "lib/messaging/irpc.h" +#include "libcli/libcli.h" /* in this module a "DATA_BLOB *file_key" is a blob that uniquely identifies @@ -237,7 +238,7 @@ NTSTATUS brl_lock(struct brl_context *brl, struct lock_struct lock, *locks=NULL; NTSTATUS status; - kbuf.dptr = (char *)file_key->data; + kbuf.dptr = (uint8_t *)file_key->data; kbuf.dsize = file_key->length; if (tdb_chainlock(brl->w->tdb, kbuf) != 0) { @@ -287,7 +288,7 @@ NTSTATUS brl_lock(struct brl_context *brl, status = NT_STATUS_NO_MEMORY; goto fail; } else { - dbuf.dptr = (char *)locks; + dbuf.dptr = (uint8_t *)locks; } locks[count] = lock; dbuf.dsize += sizeof(lock); @@ -382,7 +383,7 @@ NTSTATUS brl_unlock(struct brl_context *brl, struct lock_context context; NTSTATUS status; - kbuf.dptr = (char *)file_key->data; + kbuf.dptr = (uint8_t *)file_key->data; kbuf.dsize = file_key->length; if (tdb_chainlock(brl->w->tdb, kbuf) != 0) { diff --git a/source/ntvfs/config.mk b/source/ntvfs/config.mk index 74b62809f7e..8194fc1963b 100644 --- a/source/ntvfs/config.mk +++ b/source/ntvfs/config.mk @@ -59,16 +59,6 @@ OBJ_FILES = \ # End MODULE ntvfs_nbench ################################################ -################################################ -# Start SUBSYSTEM ntvfs_common -[SUBSYSTEM::ntvfs_common] -OBJ_FILES = \ - common/brlock.o \ - common/opendb.o \ - common/sidmap.o -# End SUBSYSTEM ntvfs_common -################################################ - ################################################ # Start SUBSYSTEM NTVFS @@ -83,7 +73,10 @@ OBJ_FILES = \ ntvfs_base.o \ ntvfs_generic.o \ ntvfs_interface.o \ - ntvfs_util.o + ntvfs_util.o \ + common/brlock.o \ + common/opendb.o \ + common/sidmap.o # # End SUBSYSTEM NTVFS ################################################ diff --git a/source/ntvfs/posix/config.mk b/source/ntvfs/posix/config.mk index a2a4685d8c7..85fcc10e060 100644 --- a/source/ntvfs/posix/config.mk +++ b/source/ntvfs/posix/config.mk @@ -31,6 +31,6 @@ OBJ_FILES = \ pvfs_acl.o \ xattr_system.o \ xattr_tdb.o -REQUIRED_SUBSYSTEMS = NDR_XATTR ntvfs_common EXT_LIB_XATTR EXT_LIB_BLKID +REQUIRED_SUBSYSTEMS = NDR_XATTR EXT_LIB_XATTR EXT_LIB_BLKID # End MODULE ntvfs_posix ################################################ diff --git a/source/ntvfs/posix/pvfs_ioctl.c b/source/ntvfs/posix/pvfs_ioctl.c index abf575aa3df..b35a98fa875 100644 --- a/source/ntvfs/posix/pvfs_ioctl.c +++ b/source/ntvfs/posix/pvfs_ioctl.c @@ -22,7 +22,7 @@ #include "includes.h" #include "vfs_posix.h" -#include "ioctl.h" +#include "libcli/raw/ioctl.h" /* old ioctl interface diff --git a/source/ntvfs/print/vfs_print.c b/source/ntvfs/print/vfs_print.c index e933f5502bb..b0c34b2abed 100644 --- a/source/ntvfs/print/vfs_print.c +++ b/source/ntvfs/print/vfs_print.c @@ -23,7 +23,7 @@ */ #include "includes.h" -#include "ioctl.h" +#include "libcli/raw/ioctl.h" #include "smb_server/smb_server.h" #include "ntvfs/ntvfs.h" diff --git a/source/ntvfs/unixuid/config.mk b/source/ntvfs/unixuid/config.mk index d99229729c5..bb811bca2bd 100644 --- a/source/ntvfs/unixuid/config.mk +++ b/source/ntvfs/unixuid/config.mk @@ -5,7 +5,5 @@ INIT_FUNCTION = ntvfs_unixuid_init SUBSYSTEM = NTVFS OBJ_FILES = \ vfs_unixuid.o -REQUIRED_SUBSYSTEMS = \ - ntvfs_common # End MODULE ntvfs_unixuid ################################################ diff --git a/source/param/loadparm.c b/source/param/loadparm.c index 96ba2bbc736..8fc061b53fd 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -61,6 +61,8 @@ #include "system/iconv.h" #include "librpc/gen_ndr/ndr_svcctl.h" #include "librpc/gen_ndr/ndr_samr.h" +#include "smb_server/smb_server.h" +#include "libcli/raw/signing.h" #include "dlinklist.h" #include "param/loadparm.h" diff --git a/source/rpc_server/lsa/dcesrv_lsa.c b/source/rpc_server/lsa/dcesrv_lsa.c index 914bb98eda0..b62e1abaefc 100644 --- a/source/rpc_server/lsa/dcesrv_lsa.c +++ b/source/rpc_server/lsa/dcesrv_lsa.c @@ -27,6 +27,7 @@ #include "auth/auth.h" #include "dsdb/samdb/samdb.h" #include "libcli/ldap/ldap.h" +#include "ntvfs/ntvfs.h" /* this type allows us to distinguish handle types diff --git a/source/rpc_server/unixinfo/dcesrv_unixinfo.c b/source/rpc_server/unixinfo/dcesrv_unixinfo.c index b85d3f144ed..1224daa76ab 100644 --- a/source/rpc_server/unixinfo/dcesrv_unixinfo.c +++ b/source/rpc_server/unixinfo/dcesrv_unixinfo.c @@ -25,6 +25,7 @@ #include "rpc_server/common/common.h" #include "librpc/gen_ndr/ndr_unixinfo.h" #include "lib/events/events.h" +#include "ntvfs/ntvfs.h" #include <sys/types.h> #include <pwd.h> diff --git a/source/script/mkversion.sh b/source/script/mkversion.sh index 7f42eded238..7995027998f 100755 --- a/source/script/mkversion.sh +++ b/source/script/mkversion.sh @@ -8,7 +8,7 @@ if test -z "$VERSION_FILE";then fi if test -z "$OUTPUT_FILE";then - OUTPUT_FILE="include/version.h" + OUTPUT_FILE="version.h" fi SOURCE_DIR=$3 @@ -114,7 +114,7 @@ echo "#define SAMBA_VERSION_OFFICIAL_STRING \"${SAMBA_VERSION_STRING}\"" >> $OUT echo "#define SAMBA_VERSION_STRING samba_version_string()" >> $OUTPUT_FILE -echo "$0: 'include/version.h' created for Samba(\"${SAMBA_VERSION_STRING}\")" +echo "$0: 'version.h' created for Samba(\"${SAMBA_VERSION_STRING}\")" if test -n "${SAMBA_VERSION_RELEASE_NICKNAME}";then echo "$0: with RELEASE_NICKNAME = ${SAMBA_VERSION_RELEASE_NICKNAME}" diff --git a/source/smb_server/smb_server.h b/source/smb_server/smb_server.h index 0c201b2b1d0..5ba17998684 100644 --- a/source/smb_server/smb_server.h +++ b/source/smb_server/smb_server.h @@ -206,6 +206,8 @@ struct substitute_context { /* Remote architectures we know about. */ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_WIN2K, RA_WINXP, RA_SAMBA}; +enum security_types {SEC_SHARE,SEC_USER} security; + /* smb server context structure. This should contain all the state * information associated with a SMB server connection */ diff --git a/source/torture/raw/ioctl.c b/source/torture/raw/ioctl.c index 0fb48c292b3..2c51e4d7b41 100644 --- a/source/torture/raw/ioctl.c +++ b/source/torture/raw/ioctl.c @@ -21,7 +21,7 @@ #include "includes.h" #include "torture/torture.h" -#include "ioctl.h" +#include "libcli/raw/ioctl.h" #include "libcli/raw/libcliraw.h" #include "libcli/libcli.h" diff --git a/source/torture/torture.c b/source/torture/torture.c index aad44e4a160..26137b18908 100644 --- a/source/torture/torture.c +++ b/source/torture/torture.c @@ -24,7 +24,7 @@ #include "system/time.h" #include "system/wait.h" #include "system/filesys.h" -#include "ioctl.h" +#include "libcli/raw/ioctl.h" #include "libcli/libcli.h" #include "librpc/rpc/dcerpc_table.h" diff --git a/source/winbind/wb_samba3_cmd.c b/source/winbind/wb_samba3_cmd.c index f930a6052d2..fd36dde16dc 100644 --- a/source/winbind/wb_samba3_cmd.c +++ b/source/winbind/wb_samba3_cmd.c @@ -26,7 +26,7 @@ #include "winbind/wb_server.h" #include "winbind/wb_async_helpers.h" #include "libcli/composite/composite.h" -#include "include/version.h" +#include "version.h" #include "librpc/gen_ndr/ndr_netlogon.h" /* |