summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/ads.h1
-rw-r--r--source3/include/auth.h9
-rw-r--r--source3/include/byteorder.h23
-rw-r--r--source3/include/client.h16
-rw-r--r--source3/include/config.h.in16
-rw-r--r--source3/include/debug.h43
-rw-r--r--source3/include/doserr.h2
-rw-r--r--source3/include/dynconfig.h1
-rw-r--r--source3/include/includes.h33
-rw-r--r--source3/include/libsmbclient.h248
-rw-r--r--source3/include/local.h2
-rw-r--r--source3/include/mangle.h7
-rw-r--r--source3/include/md5.h1
-rw-r--r--source3/include/messages.h7
-rw-r--r--source3/include/msdfs.h44
-rw-r--r--source3/include/nameserv.h8
-rw-r--r--source3/include/nt_printing.h22
-rw-r--r--source3/include/ntdomain.h1
-rw-r--r--source3/include/nterr.h2
-rw-r--r--source3/include/passdb.h46
-rw-r--r--source3/include/printing.h2
-rw-r--r--source3/include/rpc_dce.h21
-rw-r--r--source3/include/rpc_lsa.h17
-rw-r--r--source3/include/rpc_reg.h45
-rw-r--r--source3/include/rpc_samr.h204
-rwxr-xr-xsource3/include/rpc_spoolss.h129
-rw-r--r--source3/include/rpc_srvsvc.h90
-rw-r--r--source3/include/secrets.h24
-rw-r--r--source3/include/smb.h102
-rw-r--r--source3/include/smb_macros.h5
-rw-r--r--source3/include/trans2.h12
31 files changed, 918 insertions, 265 deletions
diff --git a/source3/include/ads.h b/source3/include/ads.h
index 8658e72f6a..b3e18f18b8 100644
--- a/source3/include/ads.h
+++ b/source3/include/ads.h
@@ -7,6 +7,7 @@
typedef struct {
void *ld;
char *realm;
+ char *workgroup;
char *ldap_server;
char *ldap_server_name;
char *kdc_server;
diff --git a/source3/include/auth.h b/source3/include/auth.h
index 5c8bc8edfe..66b317d643 100644
--- a/source3/include/auth.h
+++ b/source3/include/auth.h
@@ -141,11 +141,12 @@ typedef struct auth_methods
} auth_methods;
-struct auth_init_function {
+typedef NTSTATUS (*auth_init_function)(struct auth_context *, const char *, struct auth_methods **);
+
+struct auth_init_function_entry {
char *name;
/* Function to create a member of the authmethods list */
- BOOL (*init)(struct auth_context *auth_context, struct auth_methods **auth_method);
-};
-
+ auth_init_function init;
+};
#endif /* _SMBAUTH_H_ */
diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h
index 1abf1854f3..c262dd2d33 100644
--- a/source3/include/byteorder.h
+++ b/source3/include/byteorder.h
@@ -107,8 +107,7 @@ it also defines lots of intermediate macros, just ignore those :-)
#define CVAL(buf,pos) (((const unsigned char *)(buf))[pos])
#define CVAL_NC(buf,pos) (((unsigned char *)(buf))[pos]) /* Non-const version of CVAL */
-#define PVAL(buf,pos) ((const unsigned)CVAL(buf,pos))
-#define PVAL_NC(buf,pos) ((unsigned)CVAL(buf,pos)) /* Non const version of PVAL */
+#define PVAL(buf,pos) (CVAL(buf,pos))
#define SCVAL(buf,pos,val) (CVAL_NC(buf,pos) = (val))
@@ -118,12 +117,12 @@ it also defines lots of intermediate macros, just ignore those :-)
#define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16)
#define SSVALX(buf,pos,val) (CVAL_NC(buf,pos)=(unsigned char)((val)&0xFF),CVAL_NC(buf,pos+1)=(unsigned char)((val)>>8))
#define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16))
-#define SVALS(buf,pos) ((const int16)SVAL(buf,pos))
-#define IVALS(buf,pos) ((const int32)IVAL(buf,pos))
-#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((const uint16)(val)))
-#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((const uint32)(val)))
-#define SSVALS(buf,pos,val) SSVALX((buf),(pos),((const int16)(val)))
-#define SIVALS(buf,pos,val) SIVALX((buf),(pos),((const int32)(val)))
+#define SVALS(buf,pos) ((int16)SVAL(buf,pos))
+#define IVALS(buf,pos) ((int32)IVAL(buf,pos))
+#define SSVAL(buf,pos,val) SSVALX((buf),(pos),((uint16)(val)))
+#define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32)(val)))
+#define SSVALS(buf,pos,val) SSVALX((buf),(pos),((int16)(val)))
+#define SIVALS(buf,pos,val) SIVALX((buf),(pos),((int32)(val)))
#else /* CAREFUL_ALIGNMENT */
@@ -145,10 +144,10 @@ it also defines lots of intermediate macros, just ignore those :-)
#define IVALS_NC(buf,pos) (*(int32 *)((char *)(buf) + (pos))) /* Non const version of above. */
/* store single value in an SMB buffer */
-#define SSVAL(buf,pos,val) SVAL_NC(buf,pos)=((const uint16)(val))
-#define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((const uint32)(val))
-#define SSVALS(buf,pos,val) SVALS_NC(buf,pos)=((const int16)(val))
-#define SIVALS(buf,pos,val) IVALS_NC(buf,pos)=((const int32)(val))
+#define SSVAL(buf,pos,val) SVAL_NC(buf,pos)=((uint16)(val))
+#define SIVAL(buf,pos,val) IVAL_NC(buf,pos)=((uint32)(val))
+#define SSVALS(buf,pos,val) SVALS_NC(buf,pos)=((int16)(val))
+#define SIVALS(buf,pos,val) IVALS_NC(buf,pos)=((int32)(val))
#endif /* CAREFUL_ALIGNMENT */
diff --git a/source3/include/client.h b/source3/include/client.h
index 0974cd0666..711ae1fd19 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -57,6 +57,15 @@ struct print_job_info
time_t t;
};
+typedef struct smb_sign_info {
+ BOOL use_smb_signing;
+ BOOL negotiated_smb_signing;
+ size_t mac_key_len;
+ uint8 mac_key[44];
+ uint32 send_seq_num;
+ uint32 reply_seq_num;
+} smb_sign_info;
+
struct cli_state {
int port;
int fd;
@@ -69,7 +78,6 @@ struct cli_state {
int rap_error;
int privileges;
- fstring eff_name;
fstring desthost;
fstring user_name;
fstring domain;
@@ -109,6 +117,8 @@ struct cli_state {
TALLOC_CTX *mem_ctx;
+ smb_sign_info sign_info;
+
/*
* Only used in NT domain calls.
*/
@@ -145,4 +155,8 @@ struct cli_state {
fstring pipe_name;
};
+#define CLI_FULL_CONNECTION_DONT_SPNEGO 0x0001
+#define CLI_FULL_CONNECTION_USE_KERBEROS 0x0002
+#define CLI_FULL_CONNECTION_ANNONYMOUS_FALLBACK 0x0004
+
#endif /* _CLIENT_H */
diff --git a/source3/include/config.h.in b/source3/include/config.h.in
index 8dc7dd6cf8..ac28c0856c 100644
--- a/source3/include/config.h.in
+++ b/source3/include/config.h.in
@@ -1,4 +1,4 @@
-/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */
+/* include/config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if on AIX 3.
System headers sometimes define this.
@@ -124,8 +124,6 @@
#undef HAVE_SET_AUTH_PARAMETERS
#undef WITH_SYSLOG
#undef WITH_PROFILE
-#undef WITH_SSL
-#undef SSL_DIR
#undef WITH_PAM
#undef WITH_NISPLUS_HOME
#undef WITH_AUTOMOUNT
@@ -137,6 +135,7 @@
#undef REPLACE_INET_NTOA
#undef HAVE_FILE_MACRO
#undef HAVE_FUNCTION_MACRO
+#undef HAVE_VA_COPY
#undef HAVE_SETRESUID_DECL
#undef HAVE_SETRESUID
#undef WITH_NETATALK
@@ -190,7 +189,10 @@
#undef USE_SETRESUID
#undef USE_SETREUID
#undef USE_SETUIDX
-#undef HAVE_LIBDL
+#undef HAVE_DLOPEN
+#undef HAVE_DLCLOSE
+#undef HAVE_DLSYM
+#undef HAVE_DLERROR
#undef SYSCONF_SC_NGROUPS_MAX
#undef HAVE_UT_UT_NAME
#undef HAVE_UT_UT_USER
@@ -811,6 +813,9 @@
/* Define if you have the strndup function. */
#undef HAVE_STRNDUP
+/* Define if you have the strnlen function. */
+#undef HAVE_STRNLEN
+
/* Define if you have the strpbrk function. */
#undef HAVE_STRPBRK
@@ -877,6 +882,9 @@
/* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H
+/* Define if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
/* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
diff --git a/source3/include/debug.h b/source3/include/debug.h
index 235fbf70c4..0885827433 100644
--- a/source3/include/debug.h
+++ b/source3/include/debug.h
@@ -38,8 +38,10 @@
*/
int Debug1( char *, ... ) PRINTF_ATTRIBUTE(1,2);
BOOL dbgtext( char *, ... ) PRINTF_ATTRIBUTE(1,2);
+BOOL dbghdr( int level, char *file, char *func, int line );
extern XFILE *dbf;
+extern pstring debugf;
/* If we have these macros, we can add additional info to the header. */
#ifdef HAVE_FILE_MACRO
@@ -64,7 +66,7 @@ extern XFILE *dbf;
* because some references would expand incorrectly.
*/
#define DEBUGLEVEL *debug_level
-
+extern int DEBUGLEVEL;
/*
* Define all new debug classes here. A class is represented by an entry in
@@ -77,26 +79,27 @@ extern XFILE *dbf;
* at the start of the file (after #include "includes.h") will default to
* using index zero, so it will behaive just like it always has.
*/
+#define DBGC_ALL 0 /* index equivalent to DEBUGLEVEL */
+
+#define DBGC_TDB 1
+#define DBGC_PRINTDRIVERS 2
+#define DBGC_LANMAN 3
+#define DBGC_SMB 4
+#define DBGC_RPC_PARSE 5
+#define DBGC_RPC_SRV 6
+#define DBGC_RPC_CLI 7
+#define DBGC_PASSDB 8
+#define DBGC_AUTH 9
+#define DBGC_WINBIND 10
+
+
+/* So you can define DBGC_CLASS before including debug.h */
+#ifndef DBGC_CLASS
#define DBGC_CLASS 0 /* override as shown above */
-#define DBGC_ALL 0 /* index equivalent to DEBUGLEVEL */
-
-#define DBGC_TDB 1
-#define DBGC_PRINTDRIVERS 2
-#define DBGC_LANMAN 3
-#define DBGC_SMB 4
-#define DBGC_RPC 5
-#define DBGC_RPC_HDR 6
-#define DBGC_BDC 7
-
-#define DBGC_LAST 8 /* MUST be last class value + 1 */
-
-extern int DEBUGLEVEL_CLASS[DBGC_LAST];
-extern BOOL DEBUGLEVEL_CLASS_ISSET[DBGC_LAST];
+#endif
-struct debuglevel_message {
- int debuglevel_class[DBGC_LAST];
- BOOL debuglevel_class_isset[DBGC_LAST];
-};
+extern int *DEBUGLEVEL_CLASS;
+extern BOOL *DEBUGLEVEL_CLASS_ISSET;
/* Debugging macros
*
@@ -151,7 +154,7 @@ struct debuglevel_message {
#define DEBUGLVL( level ) \
( ((level) <= MAX_DEBUG_LEVEL) && \
((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
- (!DEBUGLEVEL_CLASS[ DBGC_CLASS ] && \
+ (!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \
DEBUGLEVEL_CLASS[ DBGC_ALL ] >= (level)) ) \
&& dbghdr( level, FILE_MACRO, FUNCTION_MACRO, (__LINE__) ) )
diff --git a/source3/include/doserr.h b/source3/include/doserr.h
index 45898f6375..135d799596 100644
--- a/source3/include/doserr.h
+++ b/source3/include/doserr.h
@@ -165,7 +165,9 @@
#define WERR_NO_MORE_ITEMS W_ERROR(259)
#define WERR_MORE_DATA W_ERROR(234)
#define WERR_INVALID_OWNER W_ERROR(1307)
+#define WERR_CAN_NOT_COMPLETE W_ERROR(1003)
#define WERR_INVALID_SECURITY_DESCRIPTOR W_ERROR(1338)
+#define WERR_SERVER_UNAVAILABLE W_ERROR(1722)
#define WERR_UNKNOWN_PRINTER_DRIVER W_ERROR(1797)
#define WERR_INVALID_PRINTER_NAME W_ERROR(1801)
#define WERR_PRINTER_ALREADY_EXISTS W_ERROR(1802)
diff --git a/source3/include/dynconfig.h b/source3/include/dynconfig.h
index eaa3a0568d..f8b3bbb791 100644
--- a/source3/include/dynconfig.h
+++ b/source3/include/dynconfig.h
@@ -31,6 +31,7 @@ extern pstring dyn_CONFIGFILE;
extern pstring dyn_LOGFILEBASE, dyn_LMHOSTSFILE;
extern pstring dyn_LIBDIR;
extern const pstring dyn_LOCKDIR;
+extern const pstring dyn_PIDDIR;
extern const pstring dyn_DRIVERFILE;
extern const pstring dyn_SMB_PASSWD_FILE;
extern const pstring dyn_PRIVATE_DIR;
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 5da1c1d997..435810a1ba 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -434,8 +434,12 @@
/*
* Define additional missing types
*/
-#ifndef HAVE_SIG_ATOMIC_T_TYPE
-typedef int sig_atomic_t;
+#if defined(HAVE_SIG_ATOMIC_T_TYPE) && defined(AIX)
+typedef sig_atomic_t SIG_ATOMIC_T;
+#elif defined(HAVE_SIG_ATOMIC_T_TYPE) && !defined(AIX)
+typedef sig_atomic_t VOLATILE SIG_ATOMIC_T;
+#else
+typedef int VOLATILE SIG_ATOMIC_T;
#endif
#ifndef HAVE_SOCKLEN_T_TYPE
@@ -696,6 +700,7 @@ extern int errno;
#include "dlinklist.h"
#include "../tdb/tdb.h"
#include "../tdb/spinlock.h"
+#include "../tdb/tdbutil.h"
#include "talloc.h"
#include "ads.h"
#include "interfaces.h"
@@ -748,10 +753,6 @@ extern int errno;
#include "mangle.h"
-#ifndef MAXCODEPAGELINES
-#define MAXCODEPAGELINES 256
-#endif
-
/*
* Type for wide character dirent structure.
* Only d_name is defined by POSIX.
@@ -942,6 +943,14 @@ size_t strlcat(char *d, const char *s, size_t bufsize);
int ftruncate(int f,long l);
#endif
+#ifndef HAVE_STRNDUP
+char *strndup(const char *s, size_t n);
+#endif
+
+#ifndef HAVE_STRNLEN
+size_t strnlen(const char *s, size_t n);
+#endif
+
#ifndef HAVE_STRTOUL
unsigned long strtoul(const char *nptr, char **endptr, int base);
#endif
@@ -993,9 +1002,9 @@ int vasprintf(char **ptr, const char *format, va_list ap);
#define DEFAULT_SOCKET_OPTIONS ""
#endif
-/* Load header file for libdl stuff */
+/* Load header file for dynamic linking stuff */
-#ifdef HAVE_LIBDL
+#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif
@@ -1155,5 +1164,13 @@ int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
#define slprintf snprintf
#define vslprintf vsnprintf
+
+/* we need to use __va_copy() on some platforms */
+#ifdef HAVE_VA_COPY
+#define VA_COPY(dest, src) __va_copy(dest, src)
+#else
+#define VA_COPY(dest, src) (dest) = (src)
+#endif
+
#endif /* _INCLUDES_H */
diff --git a/source3/include/libsmbclient.h b/source3/include/libsmbclient.h
index e343b876d3..f269563996 100644
--- a/source3/include/libsmbclient.h
+++ b/source3/include/libsmbclient.h
@@ -1,9 +1,11 @@
/*=====================================================================
- Unix SMB/CIFS implementation.
+ Unix SMB/Netbios implementation.
SMB client library API definitions
Copyright (C) Andrew Tridgell 1998
Copyright (C) Richard Sharpe 2000
Copyright (C) John Terpsra 2000
+ Copyright (C) Tom Jansen (Ninja ISD) 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
@@ -93,30 +95,28 @@ struct smbc_dirent
SMBC_DIR=7,
SMBC_FILE=8,
SMBC_LINK=9,*/
- uint smbc_type;
+ unsigned int smbc_type;
/** Length of this smbc_dirent in bytes
*/
- uint dirlen;
+ unsigned int dirlen;
/** The length of the comment string in bytes (includes null
* terminator)
*/
- uint commentlen;
+ unsigned int commentlen;
/** Points to the null terminated comment string
*/
char *comment;
/** The length of the name string in bytes (includes null
* terminator)
*/
- uint namelen;
+ unsigned int namelen;
/** Points to the null terminated name string
*/
char name[1];
};
-
#ifndef _CLIENT_H
-typedef unsigned short uint16;
/**@ingroup structure
* Structure that represents a print job.
@@ -126,11 +126,11 @@ struct print_job_info
{
/** numeric ID of the print job
*/
- uint16 id;
+ unsigned short id;
/** represents print job priority (lower numbers mean higher priority)
*/
- uint16 priority;
+ unsigned short priority;
/** Size of the print job
*/
@@ -149,8 +149,7 @@ struct print_job_info
*/
time_t t;
};
-#endif
-
+#endif /* ifndef _CLIENT_H */
/**@ingroup structure
* Authentication callback function type.
@@ -196,6 +195,227 @@ typedef void (*smbc_get_auth_data_fn)(const char *srv,
*/
typedef void (*smbc_get_print_job_info)(struct print_job_info *i);
+typedef struct _SMBCSRV {
+ struct cli_state cli;
+ dev_t dev;
+ BOOL no_pathinfo2;
+ int server_fd;
+
+ struct _SMBCSRV *next, *prev;
+
+} SMBCSRV;
+
+/*
+ * Keep directory entries in a list
+ */
+struct smbc_dir_list {
+ struct smbc_dir_list *next;
+ struct smbc_dirent *dirent;
+};
+
+/*
+ * Structure for open file management
+ */
+typedef struct _SMBCFILE {
+ int cli_fd;
+ char *fname;
+ off_t offset;
+ SMBCSRV *srv;
+ BOOL file;
+ struct smbc_dir_list *dir_list, *dir_end, *dir_next;
+ int dir_type, dir_error;
+
+ struct _SMBCFILE *next, *prev;
+} SMBCFILE;
+
+/**@ingroup structure
+ * Structure that contains a client context information
+ */
+typedef struct _SMBCCTX {
+ /** debug level
+ */
+ int debug;
+
+ /** netbios name used for making connections
+ */
+ char * netbios_name;
+
+ /** workgroup name used for making connections
+ */
+ char * workgroup;
+
+ /** username used for making connections
+ */
+ char * user;
+
+ /** timeout used for waiting on connections / response data (in milliseconds)
+ */
+ int timeout;
+
+ /** callable functions for files:
+ * For usage and return values see the smbc_* functions
+ */
+ SMBCFILE * (*open) (struct _SMBCCTX *c, const char *fname, int flags, mode_t mode);
+ SMBCFILE * (*creat) (struct _SMBCCTX *c, const char *path, mode_t mode);
+ ssize_t (*read) (struct _SMBCCTX *c, SMBCFILE *file, void *buf, size_t count);
+ ssize_t (*write) (struct _SMBCCTX *c, SMBCFILE *file, void *buf, size_t count);
+ int (*unlink) (struct _SMBCCTX *c, const char *fname);
+ int (*rename) (struct _SMBCCTX *ocontext, const char *oname,
+ struct _SMBCCTX *ncontext, const char *nname);
+ off_t (*lseek) (struct _SMBCCTX *c, SMBCFILE * file, off_t offset, int whence);
+ int (*stat) (struct _SMBCCTX *c, const char *fname, struct stat *st);
+ int (*fstat) (struct _SMBCCTX *c, SMBCFILE *file, struct stat *st);
+ int (*close) (struct _SMBCCTX *c, SMBCFILE *file);
+
+ /** callable functions for dirs
+ */
+ SMBCFILE * (*opendir) (struct _SMBCCTX *c, const char *fname);
+ int (*closedir)(struct _SMBCCTX *c, SMBCFILE *dir);
+ struct smbc_dirent * (*readdir)(struct _SMBCCTX *c, SMBCFILE *dir);
+ int (*getdents)(struct _SMBCCTX *c, SMBCFILE *dir,
+ struct smbc_dirent *dirp, int count);
+ int (*mkdir) (struct _SMBCCTX *c, const char *fname, mode_t mode);
+ int (*rmdir) (struct _SMBCCTX *c, const char *fname);
+ off_t (*telldir) (struct _SMBCCTX *c, SMBCFILE *dir);
+ int (*lseekdir)(struct _SMBCCTX *c, SMBCFILE *dir, off_t offset);
+ int (*fstatdir)(struct _SMBCCTX *c, SMBCFILE *dir, struct stat *st);
+
+ /** callable functions for printing
+ */
+ int (*print_file)(struct _SMBCCTX *c_file, const char *fname,
+ struct _SMBCCTX *c_print, const char *printq);
+ SMBCFILE * (*open_print_job)(struct _SMBCCTX *c, const char *fname);
+ int (*list_print_jobs)(struct _SMBCCTX *c, const char *fname, void (*fn)(struct print_job_info *));
+ int (*unlink_print_job)(struct _SMBCCTX *c, const char *fname, int id);
+
+
+ /** Callbacks
+ * These callbacks _always_ have to be intialized because they will not be checked
+ * at dereference for increased speed.
+ */
+ struct _smbc_callbacks {
+ /** authentication function callback: called upon auth requests
+ */
+ smbc_get_auth_data_fn auth_fn;
+
+ /** check if a server is still good
+ */
+ int (*check_server_fn)(struct _SMBCCTX * c, SMBCSRV *srv);
+
+ /** remove a server if unused
+ */
+ int (*remove_unused_server_fn)(struct _SMBCCTX * c, SMBCSRV *srv);
+
+ /** Cache subsystem
+ * For an example cache system see samba/source/libsmb/libsmb_cache.c
+ * Cache subsystem functions follow.
+ */
+
+ /** server cache addition
+ */
+ int (*add_cached_srv_fn) (struct _SMBCCTX * c, SMBCSRV *srv,
+ char * server, char * share,
+ char * workgroup, char * username);
+ /** server cache lookup
+ */
+ SMBCSRV * (*get_cached_srv_fn) (struct _SMBCCTX * c, char * server,
+ char * share, char * workgroup, char * username);
+ /** server cache removal
+ */
+ int (*remove_cached_srv_fn)(struct _SMBCCTX * c, SMBCSRV *srv);
+
+ /** server cache purging, try to remove all cached servers (disconnect)
+ */
+ int (*purge_cached_fn) (struct _SMBCCTX * c);
+
+ } callbacks;
+
+
+ /** Space to store private data of the server cache.
+ */
+ void * server_cache;
+
+ /** INTERNAL functions
+ * do _NOT_ touch these from your program !
+ */
+
+ /** INTERNAL: is this handle initialized ?
+ */
+ int _initialized;
+
+ /** INTERNAL: dirent pointer location
+ */
+ char _dirent[512];
+
+ /** INTERNAL: server connection list
+ */
+ SMBCSRV * _servers;
+
+ /** INTERNAL: open file/dir list
+ */
+ SMBCFILE * _files;
+
+} SMBCCTX;
+
+
+/**@ingroup misc
+ * Create a new SBMCCTX (a context).
+ *
+ * Must be called before the context is passed to smbc_context_init()
+ *
+ * @return The given SMBCCTX pointer on success, NULL on error with errno set:
+ * - ENOMEM Out of memory
+ *
+ * @see smbc_free_context(), smbc_init_context()
+ *
+ * @note Do not forget to smbc_init_context() the returned SMBCCTX pointer !
+ */
+SMBCCTX * smbc_new_context(void);
+
+/**@ingroup misc
+ * Delete a SBMCCTX (a context) acquired from smbc_new_context().
+ *
+ * The context will be deleted if possible.
+ *
+ * @param context A pointer to a SMBCCTX obtained from smbc_new_context()
+ *
+ * @param shutdown_ctx If 1, all connections and files will be closed even if they are busy.
+ *
+ *
+ * @return Returns 0 on succes. Returns 1 on failure with errno set:
+ * - EBUSY Server connections are still used, Files are open or cache
+ * could not be purged
+ * - EBADF context == NULL
+ *
+ * @see smbc_new_context()
+ *
+ * @note It is advised to clean up all the contexts with shutdown_ctx set to 1
+ * just before exit()'ing. When shutdown_ctx is 0, this function can be
+ * use in periodical cleanup functions for example.
+ */
+int smbc_free_context(SMBCCTX * context, int shutdown_ctx);
+
+
+/**@ingroup misc
+ * Initialize a SBMCCTX (a context).
+ *
+ * Must be called before using any SMBCCTX API function
+ *
+ * @param context A pointer to a SMBCCTX obtained from smbc_new_context()
+ *
+ * @return A pointer to the given SMBCCTX on success, NULL on error with errno set:
+ * - EBADF NULL context given
+ * - ENOMEM Out of memory
+ * - ENOENT The smb.conf file would not load
+ *
+ * @see smbc_new_context()
+ *
+ * @note my_context = smbc_init_context(smbc_new_context()) is perfectly safe,
+ * but it might leak memory on smbc_context_init() failure. Avoid this.
+ * You'll have to call smbc_free_context() yourself on failure.
+ */
+
+SMBCCTX * smbc_init_context(SMBCCTX * context);
/**@ingroup misc
* Initialize the samba client library.
@@ -214,8 +434,8 @@ typedef void (*smbc_get_print_job_info)(struct print_job_info *i);
* - ENOENT The smb.conf file would not load
*
*/
-int smbc_init(smbc_get_auth_data_fn fn, int debug);
+int smbc_init(smbc_get_auth_data_fn fn, int debug);
/**@ingroup file
* Open a file on an SMB server.
@@ -268,8 +488,8 @@ int smbc_init(smbc_get_auth_data_fn fn, int debug);
* try again with an empty username and password. This
* often gets mapped to the guest account on some machines.
*/
-int smbc_open(const char *furl, int flags, mode_t mode);
+int smbc_open(const char *furl, int flags, mode_t mode);
/**@ingroup file
* Create a file on an SMB server.
@@ -302,8 +522,8 @@ int smbc_open(const char *furl, int flags, mode_t mode);
* @see smbc_open()
*
*/
-int smbc_creat(const char *furl, mode_t mode);
+int smbc_creat(const char *furl, mode_t mode);
/**@ingroup file
* Read from a file using an opened file handle.
diff --git a/source3/include/local.h b/source3/include/local.h
index 1ecd63738e..24f3fa7724 100644
--- a/source3/include/local.h
+++ b/source3/include/local.h
@@ -77,7 +77,7 @@
#define MAX_PASS_LEN 200
/* separators for lists */
-#define LIST_SEP " \t,;:\n\r"
+#define LIST_SEP " \t,;\n\r"
/* wchar separators for lists */
#define LIST_SEP_W wchar_list_sep
diff --git a/source3/include/mangle.h b/source3/include/mangle.h
index d3218519f8..769278d828 100644
--- a/source3/include/mangle.h
+++ b/source3/include/mangle.h
@@ -1,11 +1,14 @@
+#ifndef _MANGLE_H_
+#define _MANGLE_H_
/*
header for 8.3 name mangling interface
*/
struct mangle_fns {
BOOL (*is_mangled)(const char *s);
- BOOL (*is_8_3)(const char *fname, BOOL check_case);
+ BOOL (*is_8_3)(const char *fname, BOOL check_case, BOOL allow_wildcards);
void (*reset)(void);
BOOL (*check_cache)(char *s);
- BOOL (*name_map)(char *OutName, BOOL need83, BOOL cache83);
+ void (*name_map)(char *OutName, BOOL need83, BOOL cache83);
};
+#endif /* _MANGLE_H_ */
diff --git a/source3/include/md5.h b/source3/include/md5.h
index dc2f2dd207..6665171e7c 100644
--- a/source3/include/md5.h
+++ b/source3/include/md5.h
@@ -15,7 +15,6 @@ void MD5Init(struct MD5Context *context);
void MD5Update(struct MD5Context *context, unsigned char const *buf,
unsigned len);
void MD5Final(unsigned char digest[16], struct MD5Context *context);
-void MD5Transform(uint32 buf[4], uint32 const in[16]);
/*
* This is needed to make RSAREF happy on some MS-DOS compilers.
diff --git a/source3/include/messages.h b/source3/include/messages.h
index 9868b5de09..79a08a7546 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -47,9 +47,10 @@
#define MSG_FORCE_ELECTION 1001
#define MSG_WINS_NEW_ENTRY 1002
-/* rpc messages */
-#define MSG_PRINTER_NOTIFY 2001
-#define MSG_PRINTER_UPDATE 2002
+/* printing messages */
+/* #define MSG_PRINTER_NOTIFY 2001*/ /* Obsolete */
+#define MSG_PRINTER_DRVUPGRADE 2002
+#define MSG_PRINTER_NOTIFY2 2003
/* smbd messages */
#define MSG_SMB_CONF_UPDATED 3001
diff --git a/source3/include/msdfs.h b/source3/include/msdfs.h
index ab56ae4af4..32aa7ecef2 100644
--- a/source3/include/msdfs.h
+++ b/source3/include/msdfs.h
@@ -1,5 +1,6 @@
/*
- Unix SMB/CIFS implementation.
+ Unix SMB/Netbios implementation.
+ Version 3.0
MSDfs services for Samba
Copyright (C) Shirish Kalele 2000
@@ -16,6 +17,7 @@
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.
+
*/
#ifndef _MSDFS_H
@@ -52,26 +54,32 @@ struct junction_map
struct dfs_path
{
- pstring hostname;
- pstring servicename;
- pstring volumename;
- pstring restofthepath;
+ pstring hostname;
+ pstring servicename;
+ pstring reqpath;
};
-#define RESOLVE_DFSPATH(name, conn, inbuf, outbuf) \
-{ if(((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES)) && \
- dfs_redirect(name,conn)) \
- return ERROR_NT(NT_STATUS_PATH_NOT_COVERED); }
+#define RESOLVE_DFSPATH(name, conn, inbuf, outbuf) \
+{ if ((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES) && \
+ lp_host_msdfs() && lp_msdfs_root(SNUM(conn)) && \
+ dfs_redirect(name,conn,False)) \
+ return ERROR_BOTH(NT_STATUS_PATH_NOT_COVERED, \
+ ERRSRV, ERRbadpath);; }
+
+#define RESOLVE_FINDFIRST_DFSPATH(name, conn, inbuf, outbuf) \
+{ if ( (SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES) || \
+ ((get_remote_arch() == RA_WIN95) && lp_msdfs_root(SNUM(conn))) ) \
+ if (lp_host_msdfs() && dfs_redirect(name,conn,True)) \
+ return ERROR_BOTH(NT_STATUS_PATH_NOT_COVERED, \
+ ERRSRV, ERRbadpath);; }
-#define RESOLVE_FINDFIRST_DFSPATH(name, conn, inbuf, outbuf) \
-{ if((SVAL(inbuf,smb_flg2) & FLAGS2_DFS_PATHNAMES) || \
- get_remote_arch()==RA_WIN95) \
- if(dfs_findfirst_redirect(directory,conn)) \
- return ERROR_NT(NT_STATUS_PATH_NOT_COVERED); }
-#define init_dfsroot(conn, inbuf, outbuf) \
-{ if(lp_msdfs_root(SNUM(conn)) && lp_host_msdfs()) \
- SSVAL(outbuf, smb_vwv2, SMB_SHARE_IN_DFS | SMB_SUPPORT_SEARCH_BITS); \
-}
+#define init_dfsroot(conn, inbuf, outbuf) \
+{ if (lp_msdfs_root(SNUM(conn)) && lp_host_msdfs()) { \
+ DEBUG(2,("Serving %s as a Dfs root\n", \
+ lp_servicename(SNUM(conn)) )); \
+ SSVAL(outbuf, smb_vwv2, SMB_SHARE_IN_DFS \
+ | SVAL(outbuf, smb_vwv2)); \
+} }
#endif /* _MSDFS_H */
diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h
index 53a5a3b5d8..fefa243c3f 100644
--- a/source3/include/nameserv.h
+++ b/source3/include/nameserv.h
@@ -458,6 +458,14 @@ struct res_rec {
char rdata[MAX_DGRAM_SIZE];
};
+/* Define these so we can pass info back to caller of name_query */
+#define NM_FLAGS_RS 0x80 /* Response. Cheat */
+#define NM_FLAGS_AA 0x40 /* Authoritative */
+#define NM_FLAGS_TC 0x20 /* Truncated */
+#define NM_FLAGS_RD 0x10 /* Recursion Desired */
+#define NM_FLAGS_RA 0x08 /* Recursion Available */
+#define NM_FLAGS_B 0x01 /* Broadcast */
+
/* An nmb packet. */
struct nmb_packet
{
diff --git a/source3/include/nt_printing.h b/source3/include/nt_printing.h
index 90ac45412d..57181c6659 100644
--- a/source3/include/nt_printing.h
+++ b/source3/include/nt_printing.h
@@ -1,5 +1,6 @@
/*
- Unix SMB/CIFS implementation.
+ Unix SMB/Netbios implementation.
+ Version 1.9.
SMB parameters and setup
Copyright (C) Andrew Tridgell 1992-2000,
Copyright (C) Jean Francois Micouleau 1998-2000.
@@ -331,4 +332,23 @@ typedef struct _form
#define VS_VERSION_INFO_SIZE (sizeof(VS_SIGNATURE)+4+VS_MINOR_OFFSET+4) /* not true size! */
#define VS_NE_BUF_SIZE 4096 /* Must be > 2*VS_VERSION_INFO_SIZE */
+/* Notify spoolss clients that something has changed. The
+ notification data is either stored in two uint32 values or a
+ variable length array. */
+
+#define SPOOLSS_NOTIFY_MSG_UNIX_JOBID 0x0001 /* Job id is unix */
+
+struct spoolss_notify_msg {
+ fstring printer; /* Name of printer notified */
+ uint32 type; /* Printer or job notify */
+ uint32 field; /* Notify field changed */
+ uint32 id; /* Job id */
+ uint32 len; /* Length of data, 0 for two uint32 value */
+ uint32 flags;
+ union {
+ uint32 value[2];
+ char *data;
+ } notify;
+};
+
#endif /* NT_PRINTING_H_ */
diff --git a/source3/include/ntdomain.h b/source3/include/ntdomain.h
index 57eb4f4331..ffb9c96b72 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -374,6 +374,5 @@ struct acct_info
#include "rpc_wkssvc.h"
#include "rpc_spoolss.h"
#include "rpc_dfs.h"
-#include "sids.h"
#endif /* _NT_DOMAIN_H */
diff --git a/source3/include/nterr.h b/source3/include/nterr.h
index a869e19738..dcc26d9884 100644
--- a/source3/include/nterr.h
+++ b/source3/include/nterr.h
@@ -29,7 +29,7 @@
#define STATUS_BUFFER_OVERFLOW NT_STATUS(0x80000005)
#define NT_STATUS_NO_MORE_ENTRIES NT_STATUS(0x8000001a)
-#define STATUS_MORE_ENTRIES NT_STATUS(0x0105)
+#define STATUS_MORE_ENTRIES NT_STATUS(0x0105)
#define STATUS_SOME_UNMAPPED NT_STATUS(0x0107)
#define ERROR_INVALID_PARAMETER NT_STATUS(0x0057)
#define ERROR_INSUFFICIENT_BUFFER NT_STATUS(0x007a)
diff --git a/source3/include/passdb.h b/source3/include/passdb.h
index f17b043fb2..a79c8a0289 100644
--- a/source3/include/passdb.h
+++ b/source3/include/passdb.h
@@ -27,9 +27,24 @@
Functions to be implemented by the new (v2) passdb API
****************************************************************/
+/*
+ * This next constant specifies the version number of the PASSDB interface
+ * this SAMBA will load. Increment this if *ANY* changes are made to the interface.
+ */
+
+#define PASSDB_INTERFACE_VERSION 2
+
+/* use this inside a passdb module */
+#define PDB_MODULE_VERSIONING_MAGIC \
+int pdb_version(void)\
+{\
+ return PASSDB_INTERFACE_VERSION;\
+}
+
typedef struct pdb_context
{
- struct pdb_methods *pdb_selected;
+ struct pdb_methods *pdb_methods;
+ struct pdb_methods *pwent_methods;
/* These functions are wrappers for the functions listed above.
They may do extra things like re-reading a SAM_ACCOUNT on update */
@@ -42,7 +57,7 @@ typedef struct pdb_context
BOOL (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username);
- BOOL (*pdb_getsampwrid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, uint32 rid);
+ BOOL (*pdb_getsampwsid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, DOM_SID *sid);
BOOL (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass);
@@ -59,22 +74,27 @@ typedef struct pdb_context
typedef struct pdb_methods
{
const char *name; /* What name got this module */
+ struct pdb_context *parent;
+
+ /* Use macros from dlinklist.h on these two */
+ struct pdb_methods *next;
+ struct pdb_methods *prev;
- BOOL (*setsampwent)(struct pdb_context *, BOOL update);
+ BOOL (*setsampwent)(struct pdb_methods *, BOOL update);
- void (*endsampwent)(struct pdb_context *);
+ void (*endsampwent)(struct pdb_methods *);
- BOOL (*getsampwent)(struct pdb_context *, SAM_ACCOUNT *user);
+ BOOL (*getsampwent)(struct pdb_methods *, SAM_ACCOUNT *user);
- BOOL (*getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username);
+ BOOL (*getsampwnam)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const char *username);
- BOOL (*getsampwrid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, uint32 rid);
+ BOOL (*getsampwsid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, DOM_SID *Sid);
- BOOL (*add_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass);
+ BOOL (*add_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass);
- BOOL (*update_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass);
+ BOOL (*update_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass);
- BOOL (*delete_sam_account)(struct pdb_context *, const SAM_ACCOUNT *username);
+ BOOL (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username);
void *private_data; /* Private data of some kind */
@@ -88,10 +108,8 @@ typedef NTSTATUS (*pdb_init_function)(struct pdb_context *,
struct pdb_init_function_entry {
char *name;
- /* Function to create a member of the authmethods list */
- NTSTATUS (*init)(struct pdb_context *pdb_context,
- struct pdb_methods **pdb_method,
- const char *location);
+ /* Function to create a member of the pdb_methods list */
+ pdb_init_function init;
};
#endif /* _PASSDB_H */
diff --git a/source3/include/printing.h b/source3/include/printing.h
index b99f2aeffb..ecf603b8fc 100644
--- a/source3/include/printing.h
+++ b/source3/include/printing.h
@@ -71,6 +71,6 @@ extern struct printif cups_printif;
#define MAX_CACHE_VALID_TIME 3600
#define PRINT_SPOOL_PREFIX "smbprn."
-#define PRINT_DATABASE_VERSION 4
+#define PRINT_DATABASE_VERSION 5
#endif /* PRINTING_H_ */
diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h
index 01d974d41d..61316de89c 100644
--- a/source3/include/rpc_dce.h
+++ b/source3/include/rpc_dce.h
@@ -59,19 +59,26 @@ enum NTLM_MESSAGE_TYPE
#define NTLMSSP_NEGOTIATE_UNICODE 0x00000001
#define NTLMSSP_NEGOTIATE_OEM 0x00000002
#define NTLMSSP_REQUEST_TARGET 0x00000004
-#define NTLMSSP_NEGOTIATE_SIGN 0x00000010
-#define NTLMSSP_NEGOTIATE_SEAL 0x00000020
+#define NTLMSSP_NEGOTIATE_SIGN 0x00000010 /* Message integrity */
+#define NTLMSSP_NEGOTIATE_SEAL 0x00000020 /* Message confidentiality */
+#define NTLMSSP_NEGOTIATE_DATAGRAM_STYLE 0x00000040
#define NTLMSSP_NEGOTIATE_LM_KEY 0x00000080
+#define NTLMSSP_NEGOTIATE_NETWARE 0x00000100
#define NTLMSSP_NEGOTIATE_NTLM 0x00000200
-#define NTLMSSP_NEGOTIATE_00001000 0x00001000
-#define NTLMSSP_NEGOTIATE_00002000 0x00002000
+#define NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED 0x00001000
+#define NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED 0x00002000
+#define NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL 0x00004000
#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN 0x00008000
+#define NTLMSSP_CHAL_INIT_RESPONSE 0x00010000
+#define NTLMSSP_CHAL_ACCEPT_RESPONSE 0x00020000
+#define NTLMSSP_CHAL_NON_NT_SESSION_KEY 0x00040000
#define NTLMSSP_NEGOTIATE_NTLM2 0x00080000
-#define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000
-#define NTLMSSP_NEGOTIATE_128 0x20000000
+#define NTLMSSP_CHAL_TARGET_INFO 0x00800000
+#define NTLMSSP_NEGOTIATE_128 0x20000000 /* 128-bit encryption */
#define NTLMSSP_NEGOTIATE_KEY_EXCH 0x40000000
+#define NTLMSSP_NEGOTIATE_080000000 0x80000000
-#define SMBD_NTLMSSP_NEG_FLAGS 0x000082b1
+#define SMBD_NTLMSSP_NEG_FLAGS 0x000082b1 /* ALWAYS_SIGN|NEG_NTLM|NEG_LM|NEG_SEAL|NEG_SIGN|NEG_UNICODE */
/* NTLMSSP signature version */
#define NTLMSSP_SIGN_VERSION 0x01
diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h
index ccdce6f263..8e42ac7d2c 100644
--- a/source3/include/rpc_lsa.h
+++ b/source3/include/rpc_lsa.h
@@ -25,19 +25,6 @@
#include "rpc_misc.h"
-enum SID_NAME_USE
-{
- SID_NAME_USE_NONE = 0,/* NOTUSED */
- SID_NAME_USER = 1, /* user */
- SID_NAME_DOM_GRP = 2, /* domain group */
- SID_NAME_DOMAIN = 3, /* domain: don't know what this is */
- SID_NAME_ALIAS = 4, /* local group */
- SID_NAME_WKN_GRP = 5, /* well-known group */
- SID_NAME_DELETED = 6, /* deleted account: needed for c2 rating */
- SID_NAME_INVALID = 7, /* invalid account */
- SID_NAME_UNKNOWN = 8 /* oops. */
-};
-
/* Opcodes available on PIPE_LSARPC */
#define LSA_CLOSE 0x00
@@ -278,8 +265,8 @@ typedef struct lsa_r_query_info
typedef struct lsa_enum_trust_dom_info
{
POLICY_HND pol; /* policy handle */
- uint32 enum_context; /* enumeration context handle */
- uint32 preferred_len; /* preferred maximum length */
+ uint32 enum_context; /* enumeration context handle */
+ uint32 preferred_len; /* preferred maximum length */
} LSA_Q_ENUM_TRUST_DOM;
diff --git a/source3/include/rpc_reg.h b/source3/include/rpc_reg.h
index a5aa606120..3f3db0f2ba 100644
--- a/source3/include/rpc_reg.h
+++ b/source3/include/rpc_reg.h
@@ -24,34 +24,39 @@
#define _RPC_REG_H
-/* winreg pipe defines */
+/* winreg pipe defines
+ NOT IMPLEMENTED !!
#define REG_OPEN_HKCR 0x00
#define _REG_UNK_01 0x01
-#define REG_OPEN_HKLM 0x02
#define _REG_UNK_03 0x03
-#define REG_OPEN_HKU 0x04
-#define REG_CLOSE 0x05
#define REG_CREATE_KEY 0x06
#define REG_DELETE_KEY 0x07
#define REG_DELETE_VALUE 0x08
-#define REG_ENUM_KEY 0x09
#define REG_ENUM_VALUE 0x0a
#define REG_FLUSH_KEY 0x0b
#define REG_GET_KEY_SEC 0x0c
#define _REG_UNK_0D 0x0d
#define _REG_UNK_0E 0x0e
-#define REG_OPEN_ENTRY 0x0f
-#define REG_QUERY_KEY 0x10
-#define REG_INFO 0x11
#define _REG_UNK_12 0x12
#define _REG_UNK_13 0x13
#define _REG_UNK_14 0x14
#define REG_SET_KEY_SEC 0x15
#define REG_CREATE_VALUE 0x16
#define _REG_UNK_17 0x17
+*/
+
+/* Implemented */
+#define REG_OPEN_HKLM 0x02
+#define REG_OPEN_HKU 0x04
+#define REG_CLOSE 0x05
+#define REG_ENUM_KEY 0x09
+#define REG_OPEN_ENTRY 0x0f
+#define REG_QUERY_KEY 0x10
+#define REG_INFO 0x11
#define REG_SHUTDOWN 0x18
#define REG_ABORT_SHUTDOWN 0x19
-#define REG_UNK_1A 0x1a
+#define REG_UNKNOWN_1A 0x1a
+
#define HKEY_CLASSES_ROOT 0x80000000
#define HKEY_CURRENT_USER 0x80000001
@@ -121,17 +126,17 @@ REG_R_OPEN_HKLM;
typedef struct q_reg_open_hku_info
{
uint32 ptr;
- uint16 unknown_0; /* 0xE084 - 16 bit unknown */
- uint16 unknown_1; /* random. changes */
- uint32 level; /* 0x0000 0002 - 32 bit unknown */
+ uint16 unknown_0;
+ uint16 unknown_1;
+ uint32 access_mask;
} REG_Q_OPEN_HKU;
/* REG_R_OPEN_HKU */
typedef struct r_reg_open_hku_info
{
- POLICY_HND pol; /* policy handle */
- NTSTATUS status; /* return status */
+ POLICY_HND pol; /* policy handle */
+ NTSTATUS status; /* return status */
} REG_R_OPEN_HKU;
@@ -355,7 +360,7 @@ typedef struct r_reg_query_key_info
uint32 num_subkeys;
uint32 max_subkeylen;
- uint32 max_subkeysize; /* 0x0000 0000 */
+ uint32 reserved; /* 0x0000 0000 - according to MSDN (max_subkeysize?) */
uint32 num_values;
uint32 max_valnamelen;
uint32 max_valbufsize;
@@ -367,20 +372,20 @@ typedef struct r_reg_query_key_info
} REG_R_QUERY_KEY;
-/* REG_Q_UNK_1A */
+/* REG_Q_UNKNOWN_1A */
typedef struct q_reg_unk_1a_info
{
POLICY_HND pol; /* policy handle */
-} REG_Q_UNK_1A;
+} REG_Q_UNKNOWN_1A;
-/* REG_R_UNK_1A */
+/* REG_R_UNKNOWN_1A */
typedef struct r_reg_unk_1a_info
{
uint32 unknown; /* 0x0500 0000 */
NTSTATUS status; /* return status */
-} REG_R_UNK_1A;
+} REG_R_UNKNOWN_1A;
/* REG_Q_CLOSE */
@@ -498,7 +503,7 @@ typedef struct q_reg_open_entry_info
UNISTR2 uni_name; /* unicode registry string name */
uint32 unknown_0; /* 32 bit unknown - 0x0000 0000 */
- uint32 unknown_1; /* 32 bit unknown - 0x0200 0000 */
+ uint32 access_desired;
} REG_Q_OPEN_ENTRY;
diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h
index 191a3695fb..78d5c244a6 100644
--- a/source3/include/rpc_samr.h
+++ b/source3/include/rpc_samr.h
@@ -79,7 +79,7 @@ SamrTestPrivateFunctionsUser
#define SAMR_CONNECT_ANON 0x00
#define SAMR_CLOSE_HND 0x01
-#define SAMR_UNKNOWN_2 0x02 /* set sec object? */
+#define SAMR_SET_SEC_OBJECT 0x02
#define SAMR_QUERY_SEC_OBJECT 0x03
#define SAMR_UNKNOWN_4 0x04 /* profile info? */
@@ -145,6 +145,175 @@ SamrTestPrivateFunctionsUser
#define SAMR_CONNECT 0x39
#define SAMR_SET_USERINFO 0x3A
+/* Access bits to the SAM-object */
+
+#define SAMR_ACCESS_UNKNOWN_1 0x00000001
+#define SAMR_ACCESS_SHUTDOWN_SERVER 0x00000002
+#define SAMR_ACCESS_UNKNOWN_4 0x00000004
+#define SAMR_ACCESS_UNKNOWN_8 0x00000008
+#define SAMR_ACCESS_ENUM_DOMAINS 0x00000010
+#define SAMR_ACCESS_OPEN_DOMAIN 0x00000020
+
+#define SAMR_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS | \
+ SAMR_ACCESS_OPEN_DOMAIN | \
+ SAMR_ACCESS_ENUM_DOMAINS | \
+ SAMR_ACCESS_UNKNOWN_8 | \
+ SAMR_ACCESS_UNKNOWN_4 | \
+ SAMR_ACCESS_SHUTDOWN_SERVER | \
+ SAMR_ACCESS_UNKNOWN_1 )
+
+#define SAMR_READ ( STANDARD_RIGHTS_READ_ACCESS | \
+ SAMR_ACCESS_ENUM_DOMAINS )
+
+#define SAMR_WRITE ( STANDARD_RIGHTS_WRITE_ACCESS | \
+ SAMR_ACCESS_UNKNOWN_8 | \
+ SAMR_ACCESS_UNKNOWN_4 | \
+ SAMR_ACCESS_SHUTDOWN_SERVER )
+
+#define SAMR_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS | \
+ SAMR_ACCESS_OPEN_DOMAIN | \
+ SAMR_ACCESS_UNKNOWN_1 )
+
+/* Access bits to Domain-objects */
+
+#define DOMAIN_ACCESS_LOOKUP_INFO_1 0x000000001
+#define DOMAIN_ACCESS_SET_INFO_1 0x000000002
+#define DOMAIN_ACCESS_LOOKUP_INFO_2 0x000000004
+#define DOMAIN_ACCESS_SET_INFO_2 0x000000008
+#define DOMAIN_ACCESS_CREATE_USER 0x000000010
+#define DOMAIN_ACCESS_CREATE_GROUP 0x000000020
+#define DOMAIN_ACCESS_CREATE_ALIAS 0x000000040
+#define DOMAIN_ACCESS_UNKNOWN_80 0x000000080
+#define DOMAIN_ACCESS_ENUM_ACCOUNTS 0x000000100
+#define DOMAIN_ACCESS_OPEN_ACCOUNT 0x000000200
+#define DOMAIN_ACCESS_SET_INFO_3 0x000000400
+
+#define DOMAIN_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS | \
+ DOMAIN_ACCESS_SET_INFO_3 | \
+ DOMAIN_ACCESS_OPEN_ACCOUNT | \
+ DOMAIN_ACCESS_ENUM_ACCOUNTS | \
+ DOMAIN_ACCESS_UNKNOWN_80 | \
+ DOMAIN_ACCESS_CREATE_ALIAS | \
+ DOMAIN_ACCESS_CREATE_GROUP | \
+ DOMAIN_ACCESS_CREATE_USER | \
+ DOMAIN_ACCESS_SET_INFO_2 | \
+ DOMAIN_ACCESS_LOOKUP_INFO_2 | \
+ DOMAIN_ACCESS_SET_INFO_1 | \
+ DOMAIN_ACCESS_LOOKUP_INFO_1 )
+
+#define DOMAIN_READ ( STANDARD_RIGHTS_READ_ACCESS | \
+ DOMAIN_ACCESS_UNKNOWN_80 | \
+ DOMAIN_ACCESS_LOOKUP_INFO_2 )
+
+#define DOMAIN_WRITE ( STANDARD_RIGHTS_WRITE_ACCESS | \
+ DOMAIN_ACCESS_SET_INFO_3 | \
+ DOMAIN_ACCESS_CREATE_ALIAS | \
+ DOMAIN_ACCESS_CREATE_GROUP | \
+ DOMAIN_ACCESS_CREATE_USER | \
+ DOMAIN_ACCESS_SET_INFO_2 | \
+ DOMAIN_ACCESS_SET_INFO_1 )
+
+#define DOMAIN_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS | \
+ DOMAIN_ACCESS_OPEN_ACCOUNT | \
+ DOMAIN_ACCESS_ENUM_ACCOUNTS | \
+ DOMAIN_ACCESS_LOOKUP_INFO_1 )
+
+/* Access bits to User-objects */
+
+#define USER_ACCESS_GET_NAME_ETC 0x000000001
+#define USER_ACCESS_GET_LOCALE 0x000000002
+#define USER_ACCESS_SET_LOC_COM 0x000000004
+#define USER_ACCESS_GET_LOGONINFO 0x000000008
+#define USER_ACCESS_UNKNOWN_10 0x000000010
+#define USER_ACCESS_SET_ATTRIBUTES 0x000000020
+#define USER_ACCESS_CHANGE_PASSWORD 0x000000040
+#define USER_ACCESS_SET_PASSWORD 0x000000080
+#define USER_ACCESS_GET_GROUPS 0x000000100
+#define USER_ACCESS_UNKNOWN_200 0x000000200
+#define USER_ACCESS_UNKNOWN_400 0x000000400
+
+#define USER_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS | \
+ USER_ACCESS_UNKNOWN_400 | \
+ USER_ACCESS_UNKNOWN_200 | \
+ USER_ACCESS_GET_GROUPS | \
+ USER_ACCESS_SET_PASSWORD | \
+ USER_ACCESS_CHANGE_PASSWORD | \
+ USER_ACCESS_SET_ATTRIBUTES | \
+ USER_ACCESS_UNKNOWN_10 | \
+ USER_ACCESS_GET_LOGONINFO | \
+ USER_ACCESS_SET_LOC_COM | \
+ USER_ACCESS_GET_LOCALE | \
+ USER_ACCESS_GET_NAME_ETC )
+
+#define USER_READ ( STANDARD_RIGHTS_READ_ACCESS | \
+ USER_ACCESS_UNKNOWN_200 | \
+ USER_ACCESS_GET_GROUPS | \
+ USER_ACCESS_UNKNOWN_10 | \
+ USER_ACCESS_GET_LOGONINFO | \
+ USER_ACCESS_GET_LOCALE )
+
+#define USER_WRITE ( STANDARD_RIGHTS_WRITE_ACCESS | \
+ USER_ACCESS_CHANGE_PASSWORD | \
+ USER_ACCESS_SET_LOC_COM )
+
+#define USER_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS | \
+ USER_ACCESS_CHANGE_PASSWORD | \
+ USER_ACCESS_GET_NAME_ETC )
+
+/* Access bits to Group-objects */
+
+#define GROUP_ACCESS_LOOKUP_INFO 0x00000001
+#define GROUP_ACCESS_SET_INFO 0x00000002
+#define GROUP_ACCESS_ADD_MEMBER 0x00000004
+#define GROUP_ACCESS_REMOVE_MEMBER 0x00000008
+#define GROUP_ACCESS_GET_MEMBERS 0x00000010
+
+#define GROUP_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS | \
+ GROUP_ACCESS_GET_MEMBERS | \
+ GROUP_ACCESS_REMOVE_MEMBER | \
+ GROUP_ACCESS_ADD_MEMBER | \
+ GROUP_ACCESS_SET_INFO | \
+ GROUP_ACCESS_LOOKUP_INFO )
+
+#define GROUP_READ ( STANDARD_RIGHTS_READ_ACCESS | \
+ GROUP_ACCESS_GET_MEMBERS )
+
+#define GROUP_WRITE ( STANDARD_RIGHTS_WRITE_ACCESS | \
+ GROUP_ACCESS_REMOVE_MEMBER | \
+ GROUP_ACCESS_ADD_MEMBER | \
+ GROUP_ACCESS_SET_INFO )
+
+#define GROUP_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS | \
+ GROUP_ACCESS_LOOKUP_INFO )
+
+/* Access bits to Alias-objects */
+
+#define ALIAS_ACCESS_ADD_MEMBER 0x00000001
+#define ALIAS_ACCESS_REMOVE_MEMBER 0x00000002
+#define ALIAS_ACCESS_GET_MEMBERS 0x00000004
+#define ALIAS_ACCESS_LOOKUP_INFO 0x00000008
+#define ALIAS_ACCESS_SET_INFO 0x00000010
+
+#define ALIAS_ALL_ACCESS ( STANDARD_RIGHTS_REQUIRED_ACCESS | \
+ ALIAS_ACCESS_GET_MEMBERS | \
+ ALIAS_ACCESS_REMOVE_MEMBER | \
+ ALIAS_ACCESS_ADD_MEMBER | \
+ ALIAS_ACCESS_SET_INFO | \
+ ALIAS_ACCESS_LOOKUP_INFO )
+
+#define ALIAS_READ ( STANDARD_RIGHTS_READ_ACCESS | \
+ ALIAS_ACCESS_GET_MEMBERS )
+
+#define ALIAS_WRITE ( STANDARD_RIGHTS_WRITE_ACCESS | \
+ ALIAS_ACCESS_REMOVE_MEMBER | \
+ ALIAS_ACCESS_ADD_MEMBER | \
+ ALIAS_ACCESS_SET_INFO )
+
+#define ALIAS_EXECUTE ( STANDARD_RIGHTS_EXECUTE_ACCESS | \
+ ALIAS_ACCESS_LOOKUP_INFO )
+
+
+
typedef struct _DISP_USER_INFO {
SAM_ACCOUNT *sam;
@@ -451,6 +620,26 @@ typedef struct r_samr_usrdom_pwinfo_info
} SAMR_R_GET_USRDOM_PWINFO;
+/****************************************************************************
+SAMR_Q_SET_SEC_OBJ - info level 4.
+*****************************************************************************/
+
+/* SAMR_Q_SET_SEC_OBJ - */
+typedef struct q_samr_set_sec_obj_info
+{
+ POLICY_HND pol; /* policy handle */
+ uint32 sec_info; /* xxxx_SECURITY_INFORMATION 0x0000 0004 */
+ SEC_DESC_BUF *buf;
+
+} SAMR_Q_SET_SEC_OBJ;
+
+/* SAMR_R_SET_SEC_OBJ - */
+typedef struct r_samr_set_sec_obj_info
+{
+ NTSTATUS status; /* return status */
+
+} SAMR_R_SET_SEC_OBJ;
+
/****************************************************************************
SAMR_Q_QUERY_SEC_OBJ - info level 4. returns SIDs.
@@ -1693,9 +1882,16 @@ typedef struct q_samr_get_dom_pwinfo
/* SAMR_R_GET_DOM_PWINFO */
typedef struct r_samr_get_dom_pwinfo
{
- uint16 unk_0;
- uint16 unk_1;
- uint16 unk_2;
+ /*
+ * Previously this was 3 uint16's. However, after some tests
+ * it appears that the data len for the signing needs to be 16.
+ * Not sure how 3 unit16's ever worked since the length always
+ * turned out to 12. 3 uint32's + NT_STATUS == 16 bytes. Tested
+ * using NT and 2k. --jerry
+ */
+ uint32 unk_0;
+ uint32 unk_1;
+ uint32 unk_2;
NTSTATUS status;
} SAMR_R_GET_DOM_PWINFO;
diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h
index 0cbbad19f9..7ec9a509bf 100755
--- a/source3/include/rpc_spoolss.h
+++ b/source3/include/rpc_spoolss.h
@@ -1,9 +1,11 @@
/*
- Unix SMB/CIFS implementation.
+ Unix SMB/Netbios implementation.
+ Version 1.9.
SMB parameters and setup
Copyright (C) Andrew Tridgell 1992-2000,
Copyright (C) Luke Kenneth Casson Leighton 1996-2000,
Copyright (C) Jean Francois Micouleau 1998-2000.
+ Copyright (C) Gerald Carter 2001-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
@@ -23,9 +25,6 @@
#ifndef _RPC_SPOOLSS_H /* _RPC_SPOOLSS_H */
#define _RPC_SPOOLSS_H
-#define INTEGER 1
-#define STRING 2
-
/* spoolss pipe: this are the calls which are not implemented ...
#define SPOOLSS_GETPRINTERDRIVER 0x0b
#define SPOOLSS_READPRINTER 0x16
@@ -51,9 +50,6 @@
#define SPOOLSS_REMOTEFINDFIRSTPRINTERCHANGENOTIFICATION0x3e
#define SPOOLSS_SPOOLERINIT 0x3f
#define SPOOLSS_RESETPRINTEREX 0x40
-#define SPOOLSS_DELETEPRINTERDATAEX 0x51
-#define SPOOLSS_DELETEPRINTERDRIVEREX 0x54
-#define SPOOLSS_ADDPRINTERDRIVEREX 0x59
*/
/* those are implemented */
@@ -109,6 +105,10 @@
#define SPOOLSS_GETPRINTERDATAEX 0x4e
#define SPOOLSS_ENUMPRINTERDATAEX 0x4f
#define SPOOLSS_ENUMPRINTERKEY 0x50
+#define SPOOLSS_DELETEPRINTERDATAEX 0x51
+#define SPOOLSS_DELETEPRINTERKEY 0x52
+#define SPOOLSS_DELETEPRINTERDRIVEREX 0x54
+#define SPOOLSS_ADDPRINTERDRIVEREX 0x59
#define PRINTER_CONTROL_UNPAUSE 0x00000000
@@ -117,6 +117,7 @@
#define PRINTER_CONTROL_PURGE 0x00000003
#define PRINTER_CONTROL_SET_STATUS 0x00000004
+#define PRINTER_STATUS_OK 0x00000000
#define PRINTER_STATUS_PAUSED 0x00000001
#define PRINTER_STATUS_ERROR 0x00000002
#define PRINTER_STATUS_PENDING_DELETION 0x00000004
@@ -157,17 +158,18 @@
/* JOB status codes. */
-#define JOB_STATUS_PAUSED 0x001
-#define JOB_STATUS_ERROR 0x002
-#define JOB_STATUS_DELETING 0x004
-#define JOB_STATUS_SPOOLING 0x008
-#define JOB_STATUS_PRINTING 0x010
-#define JOB_STATUS_OFFLINE 0x020
-#define JOB_STATUS_PAPEROUT 0x040
-#define JOB_STATUS_PRINTED 0x080
-#define JOB_STATUS_DELETED 0x100
-#define JOB_STATUS_BLOCKED 0x200
-#define JOB_STATUS_USER_INTERVENTION 0x400
+#define JOB_STATUS_QUEUED 0x0000
+#define JOB_STATUS_PAUSED 0x0001
+#define JOB_STATUS_ERROR 0x0002
+#define JOB_STATUS_DELETING 0x0004
+#define JOB_STATUS_SPOOLING 0x0008
+#define JOB_STATUS_PRINTING 0x0010
+#define JOB_STATUS_OFFLINE 0x0020
+#define JOB_STATUS_PAPEROUT 0x0040
+#define JOB_STATUS_PRINTED 0x0080
+#define JOB_STATUS_DELETED 0x0100
+#define JOB_STATUS_BLOCKED 0x0200
+#define JOB_STATUS_USER_INTERVENTION 0x0400
/* ACE masks for the various print permissions */
@@ -194,9 +196,12 @@
#define JOB_WRITE STANDARD_RIGHTS_WRITE_ACCESS|JOB_ACCESS_ADMINISTER
#define JOB_EXECUTE STANDARD_RIGHTS_EXECUTE_ACCESS|JOB_ACCESS_ADMINISTER
-#define ONE_VALUE 1
-#define TWO_VALUE 2
-#define POINTER 3
+/* Notify field types */
+
+#define NOTIFY_ONE_VALUE 1 /* Notify data is stored in value1 */
+#define NOTIFY_TWO_VALUE 2 /* Notify data is stored in value2 */
+#define NOTIFY_POINTER 3 /* Data is a pointer to a buffer */
+#define NOTIFY_STRING 4 /* Data is a pointer to a buffer w/length */
#define PRINTER_NOTIFY_TYPE 0x00
#define JOB_NOTIFY_TYPE 0x01
@@ -395,6 +400,23 @@ PRINTER_MESSAGE_INFO;
#define PRINTER_ENUM_ICON7 0x00400000
#define PRINTER_ENUM_ICON8 0x00800000
+/* FLAGS for SPOOLSS_DELETEPRINTERDRIVEREX */
+
+#define DPD_DELETE_UNUSED_FILES 0x00000001
+#define DPD_DELETE_SPECIFIC_VERSION 0x00000002
+#define DPD_DELETE_ALL_FILES 0x00000004
+
+#define DRIVER_ANY_VERSION 0xffffffff
+#define DRIVER_MAX_VERSION 4
+
+/* FLAGS for SPOOLSS_ADDPRINTERDRIVEREX */
+
+#define APD_STRICT_UPGRADE 0x00000001
+#define APD_STRICT_DOWNGRADE 0x00000002
+#define APD_COPY_ALL_FILES 0x00000004
+#define APD_COPY_NEW_FILES 0x00000008
+
+
/* this struct is undocumented */
/* thanks to the ddk ... */
typedef struct spool_user_1
@@ -678,6 +700,23 @@ typedef struct spool_r_deleteprinterdriver
}
SPOOL_R_DELETEPRINTERDRIVER;
+typedef struct spool_q_deleteprinterdriverex
+{
+ uint32 server_ptr;
+ UNISTR2 server;
+ UNISTR2 arch;
+ UNISTR2 driver;
+ uint32 delete_flags;
+ uint32 version;
+}
+SPOOL_Q_DELETEPRINTERDRIVEREX;
+
+typedef struct spool_r_deleteprinterdriverex
+{
+ WERROR status;
+}
+SPOOL_R_DELETEPRINTERDRIVEREX;
+
typedef struct spool_doc_info_1
{
@@ -1199,8 +1238,8 @@ typedef struct job_info_ctr_info
{
union
{
- JOB_INFO_1 *job_info_1;
- JOB_INFO_2 *job_info_2;
+ JOB_INFO_1 **job_info_1;
+ JOB_INFO_2 **job_info_2;
void *info;
} job;
@@ -1646,6 +1685,22 @@ typedef struct spool_r_addprinterdriver
}
SPOOL_R_ADDPRINTERDRIVER;
+typedef struct spool_q_addprinterdriverex
+{
+ uint32 server_name_ptr;
+ UNISTR2 server_name;
+ uint32 level;
+ SPOOL_PRINTER_DRIVER_INFO_LEVEL info;
+ uint32 copy_flags;
+}
+SPOOL_Q_ADDPRINTERDRIVEREX;
+
+typedef struct spool_r_addprinterdriverex
+{
+ WERROR status;
+}
+SPOOL_R_ADDPRINTERDRIVEREX;
+
typedef struct driver_directory_1
{
@@ -2034,6 +2089,21 @@ typedef struct spool_r_setprinterdataex
SPOOL_R_SETPRINTERDATAEX;
+typedef struct spool_q_deleteprinterdataex
+{
+ POLICY_HND handle;
+ UNISTR2 keyname;
+ UNISTR2 valuename;
+}
+SPOOL_Q_DELETEPRINTERDATAEX;
+
+typedef struct spool_r_deleteprinterdataex
+{
+ WERROR status;
+}
+SPOOL_R_DELETEPRINTERDATAEX;
+
+
typedef struct spool_q_enumprinterkey
{
POLICY_HND handle;
@@ -2050,6 +2120,19 @@ typedef struct spool_r_enumprinterkey
}
SPOOL_R_ENUMPRINTERKEY;
+typedef struct spool_q_deleteprinterkey
+{
+ POLICY_HND handle;
+ UNISTR2 keyname;
+}
+SPOOL_Q_DELETEPRINTERKEY;
+
+typedef struct spool_r_deleteprinterkey
+{
+ WERROR status;
+}
+SPOOL_R_DELETEPRINTERKEY;
+
typedef struct printer_enum_values
{
UNISTR valuename;
diff --git a/source3/include/rpc_srvsvc.h b/source3/include/rpc_srvsvc.h
index 5ebb41036e..1753c19783 100644
--- a/source3/include/rpc_srvsvc.h
+++ b/source3/include/rpc_srvsvc.h
@@ -23,24 +23,24 @@
#ifndef _RPC_SRVSVC_H /* _RPC_SRVSVC_H */
#define _RPC_SRVSVC_H
-
/* srvsvc pipe */
-#define SRV_NETCONNENUM 0x08
-#define SRV_NETFILEENUM 0x09
-#define SRV_NETSESSENUM 0x0c
-#define SRV_NET_SHARE_ADD 0x0e
-#define SRV_NETSHAREENUM_ALL 0x0f
-#define SRV_NET_SHARE_GET_INFO 0x10
-#define SRV_NET_SHARE_SET_INFO 0x11
-#define SRV_NET_SHARE_DEL 0x12
-#define SRV_NET_SRV_GET_INFO 0x15
-#define SRV_NET_SRV_SET_INFO 0x16
-#define SRV_NET_DISK_ENUM 0x17
-#define SRV_NET_REMOTE_TOD 0x1c
-#define SRV_NET_NAME_VALIDATE 0x21
-#define SRV_NETSHAREENUM 0x24
-#define SRV_NETFILEQUERYSECDESC 0x27
-#define SRV_NETFILESETSECDESC 0x28
+#define SRV_NET_CONN_ENUM 0x08
+#define SRV_NET_FILE_ENUM 0x09
+#define SRV_NET_FILE_CLOSE 0x0b
+#define SRV_NET_SESS_ENUM 0x0c
+#define SRV_NET_SHARE_ADD 0x0e
+#define SRV_NET_SHARE_ENUM_ALL 0x0f
+#define SRV_NET_SHARE_GET_INFO 0x10
+#define SRV_NET_SHARE_SET_INFO 0x11
+#define SRV_NET_SHARE_DEL 0x12
+#define SRV_NET_SRV_GET_INFO 0x15
+#define SRV_NET_SRV_SET_INFO 0x16
+#define SRV_NET_DISK_ENUM 0x17
+#define SRV_NET_REMOTE_TOD 0x1c
+#define SRV_NET_NAME_VALIDATE 0x21
+#define SRV_NET_SHARE_ENUM 0x24
+#define SRV_NET_FILE_QUERY_SECDESC 0x27
+#define SRV_NET_FILE_SET_SECDESC 0x28
#define MAX_SERVER_DISK_ENTRIES 15
@@ -165,6 +165,9 @@ typedef struct q_net_sess_enum_info
uint32 ptr_qual_name; /* pointer (to qualifier name) */
UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
+ uint32 ptr_user_name; /* pointer (to user name */
+ UNISTR2 uni_user_name; /* user name */
+
uint32 sess_level; /* session level */
SRV_SESS_INFO_CTR *ctr;
@@ -538,6 +541,9 @@ typedef struct q_net_share_add
SRV_SHARE_INFO info;
+ uint32 ptr_err_index; /* pointer to error index */
+ uint32 err_index; /* index in info to field in error */
+
} SRV_Q_NET_SHARE_ADD;
/* SRV_R_NET_SHARE_ADD */
@@ -555,6 +561,7 @@ typedef struct q_net_share_del
uint32 ptr_srv_name;
UNISTR2 uni_srv_name;
UNISTR2 uni_share_name;
+ uint32 reserved;
} SRV_Q_NET_SHARE_DEL;
@@ -584,20 +591,11 @@ typedef struct str_file_info3_info
} FILE_INFO_3_STR;
-/* oops - this is going to take up a *massive* amount of stack. */
-/* the UNISTR2s already have 1024 uint16 chars in them... */
-#define MAX_FILE_ENTRIES 32
-
/* SRV_FILE_INFO_3 */
typedef struct srv_file_info_3
{
- uint32 num_entries_read; /* EntriesRead */
- uint32 ptr_file_info; /* Buffer */
-
- uint32 num_entries_read2; /* EntriesRead */
-
- FILE_INFO_3 info_3 [MAX_FILE_ENTRIES]; /* file entry details */
- FILE_INFO_3_STR info_3_str[MAX_FILE_ENTRIES]; /* file entry strings */
+ FILE_INFO_3 info_3; /* file entry details */
+ FILE_INFO_3_STR info_3_str; /* file entry strings */
} SRV_FILE_INFO_3;
@@ -605,12 +603,15 @@ typedef struct srv_file_info_3
typedef struct srv_file_info_3_info
{
uint32 switch_value; /* switch value */
- uint32 ptr_file_ctr; /* pointer to file info union */
- union
- {
- SRV_FILE_INFO_3 info3; /* file info with 0 entries */
+ uint32 ptr_file_info; /* pointer to file info union */
- } file;
+ uint32 num_entries;
+ uint32 ptr_entries;
+ uint32 num_entries2;
+ union
+ {
+ SRV_FILE_INFO_3 *info3;
+ } file;
} SRV_FILE_INFO_CTR;
@@ -624,9 +625,12 @@ typedef struct q_net_file_enum_info
uint32 ptr_qual_name; /* pointer (to qualifier name) */
UNISTR2 uni_qual_name; /* qualifier name "\\qualifier" */
+ uint32 ptr_user_name; /* pointer (to user name) */
+ UNISTR2 uni_user_name; /* user name */
+
uint32 file_level; /* file level */
- SRV_FILE_INFO_CTR *ctr;
+ SRV_FILE_INFO_CTR ctr;
uint32 preferred_len; /* preferred maximum length (0xffff ffff) */
ENUM_HND enum_hnd;
@@ -639,7 +643,7 @@ typedef struct r_net_file_enum_info
{
uint32 file_level; /* file level */
- SRV_FILE_INFO_CTR *ctr;
+ SRV_FILE_INFO_CTR ctr;
uint32 total_entries; /* total number of files */
ENUM_HND enum_hnd;
@@ -648,6 +652,21 @@ typedef struct r_net_file_enum_info
} SRV_R_NET_FILE_ENUM;
+/* SRV_Q_NET_FILE_CLOSE */
+typedef struct q_net_file_close
+{
+ uint32 ptr_srv_name; /* pointer to server name */
+ UNISTR2 uni_srv_name; /* server name */
+
+ uint32 file_id;
+} SRV_Q_NET_FILE_CLOSE;
+
+/* SRV_R_NET_FILE_CLOSE */
+typedef struct r_net_file_close
+{
+ WERROR status; /* return status */
+} SRV_R_NET_FILE_CLOSE;
+
/* SRV_INFO_100 */
typedef struct srv_info_100_info
{
@@ -831,4 +850,5 @@ typedef struct r_net_file_set_secdesc
{
WERROR status;
} SRV_R_NET_FILE_SET_SECDESC;
+
#endif /* _RPC_SRVSVC_H */
diff --git a/source3/include/secrets.h b/source3/include/secrets.h
index 69ab4f6c8d..8a5a573bcc 100644
--- a/source3/include/secrets.h
+++ b/source3/include/secrets.h
@@ -35,6 +35,8 @@
#define SECRETS_DOMAIN_SID "SECRETS/SID"
#define SECRETS_SAM_SID "SAM/SID"
+#define SECRETS_LDAP_BIND_PW "SECRETS/LDAP_BIND_PW"
+
/* Authenticated user info is stored in secrets.tdb under these keys */
#define SECRETS_AUTH_USER "SECRETS/AUTH_USER"
@@ -48,12 +50,26 @@ struct machine_acct_pass {
time_t mod_time;
};
-/* structure for storing trusted domain password */
+/*
+ * storage structure for trusted domain
+ */
struct trusted_dom_pass {
- int pass_len;
- fstring pass;
+ size_t uni_name_len;
+ smb_ucs2_t uni_name[32]; /* unicode domain name */
+ size_t pass_len;
+ fstring pass; /* trust relationship's password */
time_t mod_time;
- DOM_SID domain_sid; /* remote domain's sid */
+ DOM_SID domain_sid; /* remote domain's sid */
};
+/*
+ * trusted domain entry/entries returned by secrets_get_trusted_domains
+ * (used in _lsa_enum_trust_dom call)
+ */
+typedef struct trustdom {
+ smb_ucs2_t *name;
+ DOM_SID sid;
+} TRUSTDOM;
+
+
#endif /* _SECRETS_H */
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 8963528e9a..a67101ff09 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -248,6 +248,20 @@ typedef uint32 WERROR;
#define MAXSUBAUTHS 15 /* max sub authorities in a SID */
#endif
+/* SID Types */
+enum SID_NAME_USE
+{
+ SID_NAME_USE_NONE = 0,/* NOTUSED */
+ SID_NAME_USER = 1, /* user */
+ SID_NAME_DOM_GRP = 2, /* domain group */
+ SID_NAME_DOMAIN = 3, /* domain: don't know what this is */
+ SID_NAME_ALIAS = 4, /* local group */
+ SID_NAME_WKN_GRP = 5, /* well-known group */
+ SID_NAME_DELETED = 6, /* deleted account: needed for c2 rating */
+ SID_NAME_INVALID = 7, /* invalid account */
+ SID_NAME_UNKNOWN = 8 /* oops. */
+};
+
/**
* @brief Security Identifier
*
@@ -581,7 +595,7 @@ typedef struct {
#define FLAG_SAM_KICKOFFTIME 0x00000100
#define FLAG_SAM_CANCHANGETIME 0x00000200
#define FLAG_SAM_MUSTCHANGETIME 0x00000400
-
+#define FLAG_SAM_PLAINTEXT_PW 0x00000800
#define IS_SAM_UNIX_USER(x) \
((pdb_get_init_flag(x) & FLAG_SAM_UID) \
@@ -595,6 +609,8 @@ typedef struct sam_passwd
void (*free_fn)(struct sam_passwd **);
+ struct pdb_methods *methods;
+
struct user_data {
/* initiailization flags */
uint32 init_flag;
@@ -610,6 +626,7 @@ typedef struct sam_passwd
char * domain; /* Windows Domain name */
char * nt_username; /* Windows username string */
char * full_name; /* user's full name string */
+ char * unix_home_dir; /* UNIX home directory string */
char * home_dir; /* home directory string */
char * dir_drive; /* home directory drive string */
char * logon_script; /* logon script string */
@@ -621,11 +638,12 @@ typedef struct sam_passwd
uid_t uid; /* this is a unix uid_t */
gid_t gid; /* this is a unix gid_t */
- uint32 user_rid; /* Primary User ID */
- uint32 group_rid; /* Primary Group ID */
+ DOM_SID user_sid; /* Primary User SID */
+ DOM_SID group_sid; /* Primary Group SID */
DATA_BLOB lm_pw; /* .data is Null if no password */
DATA_BLOB nt_pw; /* .data is Null if no password */
+ DATA_BLOB plaintext_pw; /* .data is Null if not available */
uint16 acct_ctrl; /* account info (ACB_xxxx bit-mask) */
uint32 unknown_3; /* 0x00ff ffff */
@@ -637,6 +655,7 @@ typedef struct sam_passwd
uint32 unknown_5; /* 0x0002 0000 */
uint32 unknown_6; /* 0x0000 04ec */
} private;
+
/* Lets see if the remaining code can get the hint that you
are meant to use the pdb_...() functions. */
@@ -669,6 +688,7 @@ typedef struct sam_passwd
#define LOCAL_SET_PASSWORD 0x40
#define LOCAL_SET_LDAP_ADMIN_PW 0x80
#define LOCAL_INTERDOM_ACCOUNT 0x100
+#define LOCAL_AM_ROOT 0x200 /* Act as root */
/* key and data in the connections database - used in smbstatus and smbd */
struct connections_key {
@@ -781,7 +801,8 @@ struct bitmap {
#define smb_err 11
#define smb_flg 13
#define smb_flg2 14
-#define smb_reb 13
+#define smb_pidhigh 16
+#define smb_ss_field 18
#define smb_tid 28
#define smb_pid 30
#define smb_uid 32
@@ -1056,11 +1077,11 @@ struct bitmap {
#define SYNCHRONIZE_ACCESS (1L<<20) /* 0x00100000 */
/* Combinations of standard masks. */
-#define STANDARD_RIGHTS_ALL_ACCESS (DELETE_ACCESS|READ_CONTROL_ACCESS|WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS|SYNCHRONIZE_ACCESS)
-#define STANDARD_RIGHTS_EXECUTE_ACCESS (READ_CONTROL_ACCESS)
-#define STANDARD_RIGHTS_READ_ACCESS (READ_CONTROL_ACCESS)
-#define STANDARD_RIGHTS_REQUIRED_ACCESS (DELETE_ACCESS|READ_CONTROL_ACCESS|WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS)
-#define STANDARD_RIGHTS_WRITE_ACCESS (READ_CONTROL_ACCESS)
+#define STANDARD_RIGHTS_ALL_ACCESS (DELETE_ACCESS|READ_CONTROL_ACCESS|WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS|SYNCHRONIZE_ACCESS) /* 0x001f0000 */
+#define STANDARD_RIGHTS_EXECUTE_ACCESS (READ_CONTROL_ACCESS) /* 0x00020000 */
+#define STANDARD_RIGHTS_READ_ACCESS (READ_CONTROL_ACCESS) /* 0x00200000 */
+#define STANDARD_RIGHTS_REQUIRED_ACCESS (DELETE_ACCESS|READ_CONTROL_ACCESS|WRITE_DAC_ACCESS|WRITE_OWNER_ACCESS) /* 0x000f0000 */
+#define STANDARD_RIGHTS_WRITE_ACCESS (READ_CONTROL_ACCESS) /* 0x00020000 */
#define SYSTEM_SECURITY_ACCESS (1L<<24) /* 0x01000000 */
#define MAXIMUM_ALLOWED_ACCESS (1L<<25) /* 0x02000000 */
@@ -1275,18 +1296,25 @@ char *strdup(char *s);
#define BROWSER_ELECTION_VERSION 0x010f
#define BROWSER_CONSTANT 0xaa55
+/* Sercurity mode bits. */
+#define NEGOTIATE_SECURITY_USER_LEVEL 0x01
+#define NEGOTIATE_SECURITY_CHALLENGE_RESPONSE 0x02
+#define NEGOTIATE_SECURITY_SIGNATURES_ENABLED 0x04
+#define NEGOTIATE_SECURITY_SIGNATURES_REQUIRED 0x08
+
/* NT Flags2 bits - cifs6.txt section 3.1.2 */
-#define FLAGS2_LONG_PATH_COMPONENTS 0x0001
-#define FLAGS2_EXTENDED_ATTRIBUTES 0x0002
-#define FLAGS2_IS_LONG_NAME 0x0040
-#define FLAGS2_EXTENDED_SECURITY 0x0800
-#define FLAGS2_DFS_PATHNAMES 0x1000
-#define FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000
-#define FLAGS2_32_BIT_ERROR_CODES 0x4000
-#define FLAGS2_UNICODE_STRINGS 0x8000
-
-#define FLAGS2_WIN2K_SIGNATURE 0xC852 /* Hack alert ! For now... JRA. */
+#define FLAGS2_LONG_PATH_COMPONENTS 0x0001
+#define FLAGS2_EXTENDED_ATTRIBUTES 0x0002
+#define FLAGS2_SMB_SECURITY_SIGNATURES 0x0004
+#define FLAGS2_IS_LONG_NAME 0x0040
+#define FLAGS2_EXTENDED_SECURITY 0x0800
+#define FLAGS2_DFS_PATHNAMES 0x1000
+#define FLAGS2_READ_PERMIT_NO_EXECUTE 0x2000
+#define FLAGS2_32_BIT_ERROR_CODES 0x4000
+#define FLAGS2_UNICODE_STRINGS 0x8000
+
+#define FLAGS2_WIN2K_SIGNATURE 0xC852 /* Hack alert ! For now... JRA. */
/* Capabilities. see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */
@@ -1304,7 +1332,7 @@ char *strdup(char *s);
#define CAP_W2K_SMBS 0x2000
#define CAP_LARGE_READX 0x4000
#define CAP_LARGE_WRITEX 0x8000
-#define CAP_UNIX 0x800000 /* Capabilities for UNIX extensions. Created by HP. */
+#define CAP_UNIX 0x800000 /* Capabilities for UNIX extensions. Created by HP. */
#define CAP_EXTENDED_SECURITY 0x80000000
/* protocol types. It assumes that higher protocols include lower protocols
@@ -1344,11 +1372,6 @@ enum remote_arch_types {RA_UNKNOWN, RA_WFWG, RA_OS2, RA_WIN95, RA_WINNT, RA_WIN2
/* case handling */
enum case_handling {CASE_LOWER,CASE_UPPER};
-#ifdef WITH_SSL
-/* SSL version options */
-enum ssl_version_enum {SMB_SSL_V2,SMB_SSL_V3,SMB_SSL_V23,SMB_SSL_TLS1};
-#endif /* WITH_SSL */
-
/*
* Global value meaing that the smb_uid field should be
* ingored (in share level security and protocol level == CORE)
@@ -1357,30 +1380,6 @@ enum ssl_version_enum {SMB_SSL_V2,SMB_SSL_V3,SMB_SSL_V23,SMB_SSL_TLS1};
#define UID_FIELD_INVALID 0
#define VUID_OFFSET 100 /* Amount to bias returned vuid numbers */
-/* Defines needed for multi-codepage support. */
-#define MSDOS_LATIN_1_CODEPAGE 850
-#define KANJI_CODEPAGE 932
-#define HANGUL_CODEPAGE 949
-#define BIG5_CODEPAGE 950
-#define SIMPLIFIED_CHINESE_CODEPAGE 936
-
-#ifdef KANJI
-/*
- * Default client code page - Japanese
- */
-#define DEFAULT_CLIENT_CODE_PAGE KANJI_CODEPAGE
-#else /* KANJI */
-/*
- * Default client code page - 850 - Western European
- */
-#define DEFAULT_CLIENT_CODE_PAGE MSDOS_LATIN_1_CODEPAGE
-#endif /* KANJI */
-
-/* Global val set if multibyte codepage. */
-extern int global_is_multibyte_codepage;
-
-#define get_character_len(x) (global_is_multibyte_codepage ? skip_multibyte_char((x)) : 0)
-
/*
* Size of buffer to use when moving files across filesystems.
*/
@@ -1581,6 +1580,8 @@ typedef struct user_struct
userdom_struct user;
char *homedir;
+ char *unix_homedir;
+ char *logon_script;
BOOL guest;
@@ -1594,6 +1595,9 @@ typedef struct user_struct
uint8 session_key[16];
int session_id; /* used by utmp and pam session code */
+
+ int homes_snum;
+
} user_struct;
diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h
index c19be784a1..a2351c705e 100644
--- a/source3/include/smb_macros.h
+++ b/source3/include/smb_macros.h
@@ -169,9 +169,12 @@
#define SMB_ROUNDUP_ALLOCATION(s) ((s) ? (SMB_ROUNDUP((SMB_OFF_T)((s)+1), ((SMB_OFF_T)SMB_ROUNDUP_ALLOCATION_SIZE))) : 0 )
/* Extra macros added by Ying Chen at IBM - speed increase by inlining. */
-#define smb_buf(buf) (buf + smb_size + CVAL(buf,smb_wct)*2)
+#define smb_buf(buf) (((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'. */
+#define smb_bufrem(buf, p) (smb_buflen(buf)-PTR_DIFF(p, smb_buf(buf)))
+
/* Note that chain_size must be available as an extern int to this macro. */
#define smb_offset(p,buf) (PTR_DIFF(p,buf+4) + chain_size)
diff --git a/source3/include/trans2.h b/source3/include/trans2.h
index 3a6fe6e9ee..fb265fdb1a 100644
--- a/source3/include/trans2.h
+++ b/source3/include/trans2.h
@@ -230,6 +230,10 @@ Byte offset Type name description
#define SMB_SET_FILE_ALLOCATION_INFO 0x103
#define SMB_SET_FILE_END_OF_FILE_INFO 0x104
+/* Query FS info. */
+#define SMB_INFO_ALLOCATION 1
+#define SMB_INFO_VOLUME 2
+
/*
* Thursby MAC extensions....
*/
@@ -336,6 +340,12 @@ Byte offset Type name description
#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
@@ -416,7 +426,7 @@ Offset Size Name
64-bits worth of capability fun :-).
*/
-#define SMB_CIFS_UNIX_QUERY_INFO 0x200
+#define SMB_QUERY_CIFS_UNIX_INFO 0x200
/* Returns the following.