summaryrefslogtreecommitdiffstats
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_client_proto.h231
-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/sids.h39
-rw-r--r--source3/include/smb.h102
-rw-r--r--source3/include/smb_macros.h5
-rw-r--r--source3/include/trans2.h12
33 files changed, 304 insertions, 1149 deletions
diff --git a/source3/include/ads.h b/source3/include/ads.h
index b3e18f18b8d..8658e72f6ac 100644
--- a/source3/include/ads.h
+++ b/source3/include/ads.h
@@ -7,7 +7,6 @@
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 66b317d6433..5c8bc8edfe6 100644
--- a/source3/include/auth.h
+++ b/source3/include/auth.h
@@ -141,12 +141,11 @@ typedef struct auth_methods
} auth_methods;
-typedef NTSTATUS (*auth_init_function)(struct auth_context *, const char *, struct auth_methods **);
-
-struct auth_init_function_entry {
+struct auth_init_function {
char *name;
/* Function to create a member of the authmethods list */
-
- auth_init_function init;
+ BOOL (*init)(struct auth_context *auth_context, struct auth_methods **auth_method);
};
+
+
#endif /* _SMBAUTH_H_ */
diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h
index c262dd2d337..1abf1854f36 100644
--- a/source3/include/byteorder.h
+++ b/source3/include/byteorder.h
@@ -107,7 +107,8 @@ 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) (CVAL(buf,pos))
+#define PVAL(buf,pos) ((const unsigned)CVAL(buf,pos))
+#define PVAL_NC(buf,pos) ((unsigned)CVAL(buf,pos)) /* Non const version of PVAL */
#define SCVAL(buf,pos,val) (CVAL_NC(buf,pos) = (val))
@@ -117,12 +118,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) ((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)))
+#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)))
#else /* CAREFUL_ALIGNMENT */
@@ -144,10 +145,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)=((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))
+#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))
#endif /* CAREFUL_ALIGNMENT */
diff --git a/source3/include/client.h b/source3/include/client.h
index 711ae1fd196..0974cd06664 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -57,15 +57,6 @@ 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;
@@ -78,6 +69,7 @@ struct cli_state {
int rap_error;
int privileges;
+ fstring eff_name;
fstring desthost;
fstring user_name;
fstring domain;
@@ -117,8 +109,6 @@ struct cli_state {
TALLOC_CTX *mem_ctx;
- smb_sign_info sign_info;
-
/*
* Only used in NT domain calls.
*/
@@ -155,8 +145,4 @@ 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 ac28c0856cf..8dc7dd6cf88 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. */
+/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */
/* Define if on AIX 3.
System headers sometimes define this.
@@ -124,6 +124,8 @@
#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
@@ -135,7 +137,6 @@
#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
@@ -189,10 +190,7 @@
#undef USE_SETRESUID
#undef USE_SETREUID
#undef USE_SETUIDX
-#undef HAVE_DLOPEN
-#undef HAVE_DLCLOSE
-#undef HAVE_DLSYM
-#undef HAVE_DLERROR
+#undef HAVE_LIBDL
#undef SYSCONF_SC_NGROUPS_MAX
#undef HAVE_UT_UT_NAME
#undef HAVE_UT_UT_USER
@@ -813,9 +811,6 @@
/* 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
@@ -882,9 +877,6 @@
/* 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 08858274337..235fbf70c4e 100644
--- a/source3/include/debug.h
+++ b/source3/include/debug.h
@@ -38,10 +38,8 @@
*/
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
@@ -66,7 +64,7 @@ extern pstring debugf;
* 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
@@ -79,27 +77,26 @@ extern int DEBUGLEVEL;
* 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 */
-#endif
+#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];
-extern int *DEBUGLEVEL_CLASS;
-extern BOOL *DEBUGLEVEL_CLASS_ISSET;
+struct debuglevel_message {
+ int debuglevel_class[DBGC_LAST];
+ BOOL debuglevel_class_isset[DBGC_LAST];
+};
/* Debugging macros
*
@@ -154,7 +151,7 @@ extern BOOL *DEBUGLEVEL_CLASS_ISSET;
#define DEBUGLVL( level ) \
( ((level) <= MAX_DEBUG_LEVEL) && \
((DEBUGLEVEL_CLASS[ DBGC_CLASS ] >= (level))|| \
- (!DEBUGLEVEL_CLASS_ISSET[ DBGC_CLASS ] && \
+ (!DEBUGLEVEL_CLASS[ 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 135d799596c..45898f63758 100644
--- a/source3/include/doserr.h
+++ b/source3/include/doserr.h
@@ -165,9 +165,7 @@
#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 f8b3bbb791d..eaa3a0568d3 100644
--- a/source3/include/dynconfig.h
+++ b/source3/include/dynconfig.h
@@ -31,7 +31,6 @@ 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 435810a1bab..5da1c1d9972 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -434,12 +434,8 @@
/*
* Define additional missing types
*/
-#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;
+#ifndef HAVE_SIG_ATOMIC_T_TYPE
+typedef int sig_atomic_t;
#endif
#ifndef HAVE_SOCKLEN_T_TYPE
@@ -700,7 +696,6 @@ 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"
@@ -753,6 +748,10 @@ 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.
@@ -943,14 +942,6 @@ 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
@@ -1002,9 +993,9 @@ int vasprintf(char **ptr, const char *format, va_list ap);
#define DEFAULT_SOCKET_OPTIONS ""
#endif
-/* Load header file for dynamic linking stuff */
+/* Load header file for libdl stuff */
-#ifdef HAVE_DLFCN_H
+#ifdef HAVE_LIBDL
#include <dlfcn.h>
#endif
@@ -1164,13 +1155,5 @@ 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 f2695639969..e343b876d33 100644
--- a/source3/include/libsmbclient.h
+++ b/source3/include/libsmbclient.h
@@ -1,11 +1,9 @@
/*=====================================================================
- Unix SMB/Netbios implementation.
+ Unix SMB/CIFS 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
@@ -95,28 +93,30 @@ struct smbc_dirent
SMBC_DIR=7,
SMBC_FILE=8,
SMBC_LINK=9,*/
- unsigned int smbc_type;
+ uint smbc_type;
/** Length of this smbc_dirent in bytes
*/
- unsigned int dirlen;
+ uint dirlen;
/** The length of the comment string in bytes (includes null
* terminator)
*/
- unsigned int commentlen;
+ uint commentlen;
/** Points to the null terminated comment string
*/
char *comment;
/** The length of the name string in bytes (includes null
* terminator)
*/
- unsigned int namelen;
+ uint 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
*/
- unsigned short id;
+ uint16 id;
/** represents print job priority (lower numbers mean higher priority)
*/
- unsigned short priority;
+ uint16 priority;
/** Size of the print job
*/
@@ -149,7 +149,8 @@ struct print_job_info
*/
time_t t;
};
-#endif /* ifndef _CLIENT_H */
+#endif
+
/**@ingroup structure
* Authentication callback function type.
@@ -195,227 +196,6 @@ 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.
@@ -434,9 +214,9 @@ SMBCCTX * smbc_init_context(SMBCCTX * context);
* - ENOENT The smb.conf file would not load
*
*/
-
int smbc_init(smbc_get_auth_data_fn fn, int debug);
+
/**@ingroup file
* Open a file on an SMB server.
*
@@ -488,9 +268,9 @@ 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);
+
/**@ingroup file
* Create a file on an SMB server.
*
@@ -522,9 +302,9 @@ int smbc_open(const char *furl, int flags, mode_t mode);
* @see smbc_open()
*
*/
-
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 24f3fa77246..1ecd63738ec 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 769278d828b..d3218519f88 100644
--- a/source3/include/mangle.h
+++ b/source3/include/mangle.h
@@ -1,14 +1,11 @@
-#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 allow_wildcards);
+ BOOL (*is_8_3)(const char *fname, BOOL check_case);
void (*reset)(void);
BOOL (*check_cache)(char *s);
- void (*name_map)(char *OutName, BOOL need83, BOOL cache83);
+ BOOL (*name_map)(char *OutName, BOOL need83, BOOL cache83);
};
-#endif /* _MANGLE_H_ */
diff --git a/source3/include/md5.h b/source3/include/md5.h
index 6665171e7c5..dc2f2dd207f 100644
--- a/source3/include/md5.h
+++ b/source3/include/md5.h
@@ -15,6 +15,7 @@ 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 79a08a75462..9868b5de099 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -47,10 +47,9 @@
#define MSG_FORCE_ELECTION 1001
#define MSG_WINS_NEW_ENTRY 1002
-/* printing messages */
-/* #define MSG_PRINTER_NOTIFY 2001*/ /* Obsolete */
-#define MSG_PRINTER_DRVUPGRADE 2002
-#define MSG_PRINTER_NOTIFY2 2003
+/* rpc messages */
+#define MSG_PRINTER_NOTIFY 2001
+#define MSG_PRINTER_UPDATE 2002
/* smbd messages */
#define MSG_SMB_CONF_UPDATED 3001
diff --git a/source3/include/msdfs.h b/source3/include/msdfs.h
index 32aa7ecef25..ab56ae4af44 100644
--- a/source3/include/msdfs.h
+++ b/source3/include/msdfs.h
@@ -1,6 +1,5 @@
/*
- Unix SMB/Netbios implementation.
- Version 3.0
+ Unix SMB/CIFS implementation.
MSDfs services for Samba
Copyright (C) Shirish Kalele 2000
@@ -17,7 +16,6 @@
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
@@ -54,32 +52,26 @@ struct junction_map
struct dfs_path
{
- pstring hostname;
- pstring servicename;
- pstring reqpath;
+ pstring hostname;
+ pstring servicename;
+ pstring volumename;
+ pstring restofthepath;
};
-#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_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_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()) { \
- 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)); \
-} }
+#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); \
+}
#endif /* _MSDFS_H */
diff --git a/source3/include/nameserv.h b/source3/include/nameserv.h
index fefa243c3fd..53a5a3b5d8a 100644
--- a/source3/include/nameserv.h
+++ b/source3/include/nameserv.h
@@ -458,14 +458,6 @@ 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 57181c66591..90ac45412d9 100644
--- a/source3/include/nt_printing.h
+++ b/source3/include/nt_printing.h
@@ -1,6 +1,5 @@
/*
- Unix SMB/Netbios implementation.
- Version 1.9.
+ Unix SMB/CIFS implementation.
SMB parameters and setup
Copyright (C) Andrew Tridgell 1992-2000,
Copyright (C) Jean Francois Micouleau 1998-2000.
@@ -332,23 +331,4 @@ 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 ffb9c96b725..57eb4f43311 100644
--- a/source3/include/ntdomain.h
+++ b/source3/include/ntdomain.h
@@ -374,5 +374,6 @@ 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 dcc26d98848..a869e197380 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 a79c8a0289f..f17b043fb27 100644
--- a/source3/include/passdb.h
+++ b/source3/include/passdb.h
@@ -27,24 +27,9 @@
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_methods;
- struct pdb_methods *pwent_methods;
+ struct pdb_methods *pdb_selected;
/* These functions are wrappers for the functions listed above.
They may do extra things like re-reading a SAM_ACCOUNT on update */
@@ -57,7 +42,7 @@ typedef struct pdb_context
BOOL (*pdb_getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username);
- BOOL (*pdb_getsampwsid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, DOM_SID *sid);
+ BOOL (*pdb_getsampwrid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, uint32 rid);
BOOL (*pdb_add_sam_account)(struct pdb_context *, SAM_ACCOUNT *sampass);
@@ -74,27 +59,22 @@ 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_methods *, BOOL update);
+ BOOL (*setsampwent)(struct pdb_context *, BOOL update);
- void (*endsampwent)(struct pdb_methods *);
+ void (*endsampwent)(struct pdb_context *);
- BOOL (*getsampwent)(struct pdb_methods *, SAM_ACCOUNT *user);
+ BOOL (*getsampwent)(struct pdb_context *, SAM_ACCOUNT *user);
- BOOL (*getsampwnam)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, const char *username);
+ BOOL (*getsampwnam)(struct pdb_context *, SAM_ACCOUNT *sam_acct, const char *username);
- BOOL (*getsampwsid)(struct pdb_methods *, SAM_ACCOUNT *sam_acct, DOM_SID *Sid);
+ BOOL (*getsampwrid)(struct pdb_context *, SAM_ACCOUNT *sam_acct, uint32 rid);
- BOOL (*add_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass);
+ BOOL (*add_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass);
- BOOL (*update_sam_account)(struct pdb_methods *, SAM_ACCOUNT *sampass);
+ BOOL (*update_sam_account)(struct pdb_context *, const SAM_ACCOUNT *sampass);
- BOOL (*delete_sam_account)(struct pdb_methods *, SAM_ACCOUNT *username);
+ BOOL (*delete_sam_account)(struct pdb_context *, const SAM_ACCOUNT *username);
void *private_data; /* Private data of some kind */
@@ -108,8 +88,10 @@ typedef NTSTATUS (*pdb_init_function)(struct pdb_context *,
struct pdb_init_function_entry {
char *name;
- /* Function to create a member of the pdb_methods list */
- pdb_init_function init;
+ /* Function to create a member of the authmethods list */
+ NTSTATUS (*init)(struct pdb_context *pdb_context,
+ struct pdb_methods **pdb_method,
+ const char *location);
};
#endif /* _PASSDB_H */
diff --git a/source3/include/printing.h b/source3/include/printing.h
index ecf603b8fcc..b99f2aeffb9 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 5
+#define PRINT_DATABASE_VERSION 4
#endif /* PRINTING_H_ */
diff --git a/source3/include/rpc_client_proto.h b/source3/include/rpc_client_proto.h
deleted file mode 100644
index 0ecb1956913..00000000000
--- a/source3/include/rpc_client_proto.h
+++ /dev/null
@@ -1,231 +0,0 @@
-#ifndef _RPC_CLIENT_PROTO_H_
-#define _RPC_CLIENT_PROTO_H_
-/* This file is automatically generated with "make proto". DO NOT EDIT */
-
-
-/*The following definitions come from lib/util_list.c */
-
-BOOL copy_policy_hnd (POLICY_HND *dest, const POLICY_HND *src);
-BOOL compare_rpc_hnd_node(const RPC_HND_NODE *x,
- const RPC_HND_NODE *y);
-BOOL RpcHndList_set_connection(const POLICY_HND *hnd,
- struct cli_connection *con);
-BOOL RpcHndList_del_connection(const POLICY_HND *hnd);
-struct cli_connection* RpcHndList_get_connection(const POLICY_HND *hnd);
-
-/*The following definitions come from rpc_client/cli_connect.c */
-
-void init_connections(void);
-void free_connections(void);
-void cli_connection_free(struct cli_connection *con);
-void cli_connection_unlink(struct cli_connection *con);
-BOOL cli_connection_init(const char *srv_name, char *pipe_name,
- struct cli_connection **con);
-BOOL cli_connection_init_auth(const char *srv_name, char *pipe_name,
- struct cli_connection **con,
- cli_auth_fns * auth, void *auth_creds);
-struct _cli_auth_fns *cli_conn_get_authfns(struct cli_connection *con);
-void *cli_conn_get_auth_creds(struct cli_connection *con);
-BOOL rpc_hnd_pipe_req(const POLICY_HND * hnd, uint8 op_num,
- prs_struct * data, prs_struct * rdata);
-BOOL rpc_con_pipe_req(struct cli_connection *con, uint8 op_num,
- prs_struct * data, prs_struct * rdata);
-BOOL rpc_con_ok(struct cli_connection *con);
-
-/*The following definitions come from rpc_client/cli_login.c */
-
-BOOL cli_nt_setup_creds(struct cli_state *cli, unsigned char mach_pwd[16]);
-BOOL cli_nt_srv_pwset(struct cli_state *cli, unsigned char *new_hashof_mach_pwd);
-BOOL cli_nt_login_interactive(struct cli_state *cli, char *domain, char *username,
- uint32 smb_userid_low, char *password,
- NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3);
-BOOL cli_nt_login_network(struct cli_state *cli, char *domain, char *username,
- uint32 smb_userid_low, char lm_chal[8],
- char *lm_chal_resp, char *nt_chal_resp,
- NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3);
-BOOL cli_nt_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr);
-
-/*The following definitions come from rpc_client/cli_lsarpc.c */
-
-BOOL do_lsa_open_policy(struct cli_state *cli,
- char *system_name, POLICY_HND *hnd,
- BOOL sec_qos);
-BOOL do_lsa_query_info_pol(struct cli_state *cli,
- POLICY_HND *hnd, uint16 info_class,
- fstring domain_name, DOM_SID *domain_sid);
-BOOL do_lsa_close(struct cli_state *cli, POLICY_HND *hnd);
-BOOL cli_lsa_get_domain_sid(struct cli_state *cli, char *server);
-uint32 lsa_open_policy(const char *system_name, POLICY_HND *hnd,
- BOOL sec_qos, uint32 des_access);
-uint32 lsa_lookup_sids(POLICY_HND *hnd, int num_sids, DOM_SID *sids,
- char ***names, uint32 **types, int *num_names);
-uint32 lsa_lookup_names(POLICY_HND *hnd, int num_names, char **names,
- DOM_SID **sids, uint32 **types, int *num_sids);
-
-/*The following definitions come from rpc_client/cli_netlogon.c */
-
-BOOL cli_net_logon_ctrl2(struct cli_state *cli, uint32 status_level);
-BOOL cli_net_auth2(struct cli_state *cli, uint16 sec_chan,
- uint32 neg_flags, DOM_CHAL *srv_chal);
-BOOL cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal, DOM_CHAL *srv_chal);
-BOOL cli_net_srv_pwset(struct cli_state *cli, uint8 hashed_mach_pwd[16]);
-BOOL cli_net_sam_logon(struct cli_state *cli, NET_ID_INFO_CTR *ctr, NET_USER_INFO_3 *user_info3);
-BOOL cli_net_sam_logoff(struct cli_state *cli, NET_ID_INFO_CTR *ctr);
-BOOL change_trust_account_password( char *domain, char *remote_machine_list);
-
-/*The following definitions come from rpc_client/cli_pipe.c */
-
-BOOL rpc_api_pipe_req(struct cli_state *cli, uint8 op_num,
- prs_struct *data, prs_struct *rdata);
-BOOL rpc_pipe_bind(struct cli_state *cli, char *pipe_name, char *my_name);
-void cli_nt_set_ntlmssp_flgs(struct cli_state *cli, uint32 ntlmssp_flgs);
-BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name);
-void cli_nt_session_close(struct cli_state *cli);
-
-/*The following definitions come from rpc_client/cli_reg.c */
-
-BOOL do_reg_connect(struct cli_state *cli, char *full_keyname, char *key_name,
- POLICY_HND *reg_hnd);
-BOOL do_reg_open_hklm(struct cli_state *cli, uint16 unknown_0, uint32 level,
- POLICY_HND *hnd);
-BOOL do_reg_open_hku(struct cli_state *cli, uint16 unknown_0, uint32 level,
- POLICY_HND *hnd);
-BOOL do_reg_flush_key(struct cli_state *cli, POLICY_HND *hnd);
-BOOL do_reg_query_key(struct cli_state *cli, POLICY_HND *hnd,
- char *class, uint32 *class_len,
- uint32 *num_subkeys, uint32 *max_subkeylen,
- uint32 *max_subkeysize, uint32 *num_values,
- uint32 *max_valnamelen, uint32 *max_valbufsize,
- uint32 *sec_desc, NTTIME *mod_time);
-BOOL do_reg_unknown_1a(struct cli_state *cli, POLICY_HND *hnd, uint32 *unk);
-BOOL do_reg_query_info(struct cli_state *cli, POLICY_HND *hnd,
- char *key_value, uint32* key_type);
-BOOL do_reg_set_key_sec(struct cli_state *cli, POLICY_HND *hnd, SEC_DESC_BUF *sec_desc_buf);
-BOOL do_reg_get_key_sec(struct cli_state *cli, POLICY_HND *hnd, uint32 *sec_buf_size, SEC_DESC_BUF **ppsec_desc_buf);
-BOOL do_reg_delete_val(struct cli_state *cli, POLICY_HND *hnd, char *val_name);
-BOOL do_reg_delete_key(struct cli_state *cli, POLICY_HND *hnd, char *key_name);
-BOOL do_reg_create_key(struct cli_state *cli, POLICY_HND *hnd,
- char *key_name, char *key_class,
- SEC_ACCESS *sam_access,
- POLICY_HND *key);
-BOOL do_reg_enum_key(struct cli_state *cli, POLICY_HND *hnd,
- int key_index, char *key_name,
- uint32 *unk_1, uint32 *unk_2,
- time_t *mod_time);
-BOOL do_reg_create_val(struct cli_state *cli, POLICY_HND *hnd,
- char *val_name, uint32 type, BUFFER3 *data);
-BOOL do_reg_enum_val(struct cli_state *cli, POLICY_HND *hnd,
- int val_index, int max_valnamelen, int max_valbufsize,
- fstring val_name,
- uint32 *val_type, BUFFER2 *value);
-BOOL do_reg_open_entry(struct cli_state *cli, POLICY_HND *hnd,
- char *key_name, uint32 unk_0,
- POLICY_HND *key_hnd);
-BOOL do_reg_close(struct cli_state *cli, POLICY_HND *hnd);
-
-/*The following definitions come from rpc_client/cli_samr.c */
-
-BOOL get_samr_query_usergroups(struct cli_state *cli,
- POLICY_HND *pol_open_domain, uint32 user_rid,
- uint32 *num_groups, DOM_GID *gid);
-BOOL get_samr_query_userinfo(struct cli_state *cli,
- POLICY_HND *pol_open_domain,
- uint32 info_level,
- uint32 user_rid, SAM_USER_INFO_21 *usr);
-BOOL do_samr_chgpasswd_user(struct cli_state *cli,
- char *srv_name, char *user_name,
- char nt_newpass[516], uchar nt_oldhash[16],
- char lm_newpass[516], uchar lm_oldhash[16]);
-BOOL do_samr_unknown_38(struct cli_state *cli, char *srv_name);
-BOOL do_samr_query_dom_info(struct cli_state *cli,
- POLICY_HND *domain_pol, uint16 switch_value);
-BOOL do_samr_enum_dom_users(struct cli_state *cli,
- POLICY_HND *pol, uint16 num_entries, uint16 unk_0,
- uint16 acb_mask, uint16 unk_1, uint32 size,
- struct acct_info **sam,
- int *num_sam_users);
-BOOL do_samr_connect(struct cli_state *cli,
- char *srv_name, uint32 unknown_0,
- POLICY_HND *connect_pol);
-BOOL do_samr_open_user(struct cli_state *cli,
- POLICY_HND *pol, uint32 unk_0, uint32 rid,
- POLICY_HND *user_pol);
-BOOL do_samr_open_domain(struct cli_state *cli,
- POLICY_HND *connect_pol, uint32 rid, DOM_SID *sid,
- POLICY_HND *domain_pol);
-BOOL do_samr_query_unknown_12(struct cli_state *cli,
- POLICY_HND *pol, uint32 rid, uint32 num_gids, uint32 *gids,
- uint32 *num_aliases,
- fstring als_names [MAX_LOOKUP_SIDS],
- uint32 num_als_users[MAX_LOOKUP_SIDS]);
-BOOL do_samr_query_usergroups(struct cli_state *cli,
- POLICY_HND *pol, uint32 *num_groups, DOM_GID *gid);
-BOOL do_samr_query_userinfo(struct cli_state *cli,
- POLICY_HND *pol, uint16 switch_value, void* usr);
-BOOL do_samr_close(struct cli_state *cli, POLICY_HND *hnd);
-
-/*The following definitions come from rpc_client/cli_spoolss_notify.c */
-
-BOOL spoolss_disconnect_from_client( struct cli_state *cli);
-BOOL spoolss_connect_to_client( struct cli_state *cli, char *remote_machine);
-BOOL cli_spoolss_reply_open_printer(struct cli_state *cli, char *printer, uint32 localprinter, uint32 type, uint32 *status, POLICY_HND *handle);
-BOOL cli_spoolss_reply_rrpcn(struct cli_state *cli, POLICY_HND *handle,
- uint32 change_low, uint32 change_high, uint32 *status);
-BOOL cli_spoolss_reply_close_printer(struct cli_state *cli, POLICY_HND *handle, uint32 *status);
-
-/*The following definitions come from rpc_client/cli_srvsvc.c */
-
-BOOL do_srv_net_srv_conn_enum(struct cli_state *cli,
- char *server_name, char *qual_name,
- uint32 switch_value, SRV_CONN_INFO_CTR *ctr,
- uint32 preferred_len,
- ENUM_HND *hnd);
-BOOL do_srv_net_srv_sess_enum(struct cli_state *cli,
- char *server_name, char *qual_name,
- uint32 switch_value, SRV_SESS_INFO_CTR *ctr,
- uint32 preferred_len,
- ENUM_HND *hnd);
-BOOL do_srv_net_srv_share_enum(struct cli_state *cli,
- char *server_name,
- uint32 switch_value, SRV_R_NET_SHARE_ENUM *r_o,
- uint32 preferred_len, ENUM_HND *hnd);
-BOOL do_srv_net_srv_file_enum(struct cli_state *cli,
- char *server_name, char *qual_name,
- uint32 switch_value, SRV_FILE_INFO_CTR *ctr,
- uint32 preferred_len,
- ENUM_HND *hnd);
-BOOL do_srv_net_srv_get_info(struct cli_state *cli,
- char *server_name, uint32 switch_value, SRV_INFO_CTR *ctr);
-
-/*The following definitions come from rpc_client/cli_use.c */
-
-void init_cli_use(void);
-void free_cli_use(void);
-struct cli_state *cli_net_use_add(const char *srv_name,
- const struct ntuser_creds *usr_creds,
- BOOL reuse, BOOL *is_new);
-BOOL cli_net_use_del(const char *srv_name,
- const struct ntuser_creds *usr_creds,
- BOOL force_close, BOOL *connection_closed);
-void cli_net_use_enum(uint32 *num_cons, struct use_info ***use);
-void cli_use_wait_keyboard(void);
-
-/*The following definitions come from rpc_client/cli_wkssvc.c */
-
-BOOL do_wks_query_info(struct cli_state *cli,
- char *server_name, uint32 switch_value,
- WKS_INFO_100 *wks100);
-
-/*The following definitions come from rpc_client/ncacn_np_use.c */
-
-BOOL ncacn_np_use_del(const char *srv_name, const char *pipe_name,
- const vuser_key * key,
- BOOL force_close, BOOL *connection_closed);
-struct ncacn_np *ncacn_np_initialise(struct ncacn_np *msrpc,
- const vuser_key * key);
-struct ncacn_np *ncacn_np_use_add(const char *pipe_name,
- const vuser_key * key,
- const char *srv_name,
- const struct ntuser_creds *ntc,
- BOOL reuse, BOOL *is_new_connection);
-#endif /* _PROTO_H_ */
diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h
index 61316de89ca..01d974d41dd 100644
--- a/source3/include/rpc_dce.h
+++ b/source3/include/rpc_dce.h
@@ -59,26 +59,19 @@ enum NTLM_MESSAGE_TYPE
#define NTLMSSP_NEGOTIATE_UNICODE 0x00000001
#define NTLMSSP_NEGOTIATE_OEM 0x00000002
#define NTLMSSP_REQUEST_TARGET 0x00000004
-#define NTLMSSP_NEGOTIATE_SIGN 0x00000010 /* Message integrity */
-#define NTLMSSP_NEGOTIATE_SEAL 0x00000020 /* Message confidentiality */
-#define NTLMSSP_NEGOTIATE_DATAGRAM_STYLE 0x00000040
+#define NTLMSSP_NEGOTIATE_SIGN 0x00000010
+#define NTLMSSP_NEGOTIATE_SEAL 0x00000020
#define NTLMSSP_NEGOTIATE_LM_KEY 0x00000080
-#define NTLMSSP_NEGOTIATE_NETWARE 0x00000100
#define NTLMSSP_NEGOTIATE_NTLM 0x00000200
-#define NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED 0x00001000
-#define NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED 0x00002000
-#define NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL 0x00004000
+#define NTLMSSP_NEGOTIATE_00001000 0x00001000
+#define NTLMSSP_NEGOTIATE_00002000 0x00002000
#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_CHAL_TARGET_INFO 0x00800000
-#define NTLMSSP_NEGOTIATE_128 0x20000000 /* 128-bit encryption */
+#define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000
+#define NTLMSSP_NEGOTIATE_128 0x20000000
#define NTLMSSP_NEGOTIATE_KEY_EXCH 0x40000000
-#define NTLMSSP_NEGOTIATE_080000000 0x80000000
-#define SMBD_NTLMSSP_NEG_FLAGS 0x000082b1 /* ALWAYS_SIGN|NEG_NTLM|NEG_LM|NEG_SEAL|NEG_SIGN|NEG_UNICODE */
+#define SMBD_NTLMSSP_NEG_FLAGS 0x000082b1
/* NTLMSSP signature version */
#define NTLMSSP_SIGN_VERSION 0x01
diff --git a/source3/include/rpc_lsa.h b/source3/include/rpc_lsa.h
index 8e42ac7d2cb..ccdce6f2636 100644
--- a/source3/include/rpc_lsa.h
+++ b/source3/include/rpc_lsa.h
@@ -25,6 +25,19 @@
#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
@@ -265,8 +278,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 3f3db0f2ba0..a5aa6061207 100644
--- a/source3/include/rpc_reg.h
+++ b/source3/include/rpc_reg.h
@@ -24,39 +24,34 @@
#define _RPC_REG_H
-/* winreg pipe defines
- NOT IMPLEMENTED !!
+/* winreg pipe defines */
#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_UNKNOWN_1A 0x1a
-
+#define REG_UNK_1A 0x1a
#define HKEY_CLASSES_ROOT 0x80000000
#define HKEY_CURRENT_USER 0x80000001
@@ -126,17 +121,17 @@ REG_R_OPEN_HKLM;
typedef struct q_reg_open_hku_info
{
uint32 ptr;
- uint16 unknown_0;
- uint16 unknown_1;
- uint32 access_mask;
+ uint16 unknown_0; /* 0xE084 - 16 bit unknown */
+ uint16 unknown_1; /* random. changes */
+ uint32 level; /* 0x0000 0002 - 32 bit unknown */
} 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;
@@ -360,7 +355,7 @@ typedef struct r_reg_query_key_info
uint32 num_subkeys;
uint32 max_subkeylen;
- uint32 reserved; /* 0x0000 0000 - according to MSDN (max_subkeysize?) */
+ uint32 max_subkeysize; /* 0x0000 0000 */
uint32 num_values;
uint32 max_valnamelen;
uint32 max_valbufsize;
@@ -372,20 +367,20 @@ typedef struct r_reg_query_key_info
} REG_R_QUERY_KEY;
-/* REG_Q_UNKNOWN_1A */
+/* REG_Q_UNK_1A */
typedef struct q_reg_unk_1a_info
{
POLICY_HND pol; /* policy handle */
-} REG_Q_UNKNOWN_1A;
+} REG_Q_UNK_1A;
-/* REG_R_UNKNOWN_1A */
+/* REG_R_UNK_1A */
typedef struct r_reg_unk_1a_info
{
uint32 unknown; /* 0x0500 0000 */
NTSTATUS status; /* return status */
-} REG_R_UNKNOWN_1A;
+} REG_R_UNK_1A;
/* REG_Q_CLOSE */
@@ -503,7 +498,7 @@ typedef struct q_reg_open_entry_info
UNISTR2 uni_name; /* unicode registry string name */
uint32 unknown_0; /* 32 bit unknown - 0x0000 0000 */
- uint32 access_desired;
+ uint32 unknown_1; /* 32 bit unknown - 0x0200 0000 */
} REG_Q_OPEN_ENTRY;
diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h
index 78d5c244a6f..191a3695fbf 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_SET_SEC_OBJECT 0x02
+#define SAMR_UNKNOWN_2 0x02 /* set sec object? */
#define SAMR_QUERY_SEC_OBJECT 0x03
#define SAMR_UNKNOWN_4 0x04 /* profile info? */
@@ -145,175 +145,6 @@ 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;
@@ -620,26 +451,6 @@ 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.
@@ -1882,16 +1693,9 @@ typedef struct q_samr_get_dom_pwinfo
/* SAMR_R_GET_DOM_PWINFO */
typedef struct r_samr_get_dom_pwinfo
{
- /*
- * 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;
+ uint16 unk_0;
+ uint16 unk_1;
+ uint16 unk_2;
NTSTATUS status;
} SAMR_R_GET_DOM_PWINFO;
diff --git a/source3/include/rpc_spoolss.h b/source3/include/rpc_spoolss.h
index 7ec9a509bf3..0cbbad19f97 100755
--- a/source3/include/rpc_spoolss.h
+++ b/source3/include/rpc_spoolss.h
@@ -1,11 +1,9 @@
/*
- Unix SMB/Netbios implementation.
- Version 1.9.
+ Unix SMB/CIFS implementation.
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
@@ -25,6 +23,9 @@
#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
@@ -50,6 +51,9 @@
#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 */
@@ -105,10 +109,6 @@
#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,7 +117,6 @@
#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
@@ -158,18 +157,17 @@
/* JOB status codes. */
-#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
+#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
/* ACE masks for the various print permissions */
@@ -196,12 +194,9 @@
#define JOB_WRITE STANDARD_RIGHTS_WRITE_ACCESS|JOB_ACCESS_ADMINISTER
#define JOB_EXECUTE STANDARD_RIGHTS_EXECUTE_ACCESS|JOB_ACCESS_ADMINISTER
-/* 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 ONE_VALUE 1
+#define TWO_VALUE 2
+#define POINTER 3
#define PRINTER_NOTIFY_TYPE 0x00
#define JOB_NOTIFY_TYPE 0x01
@@ -400,23 +395,6 @@ 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
@@ -700,23 +678,6 @@ 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
{
@@ -1238,8 +1199,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;
@@ -1685,22 +1646,6 @@ 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
{
@@ -2089,21 +2034,6 @@ 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;
@@ -2120,19 +2050,6 @@ 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 1753c19783b..5ebb41036e8 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_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 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 MAX_SERVER_DISK_ENTRIES 15
@@ -165,9 +165,6 @@ 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;
@@ -541,9 +538,6 @@ 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 */
@@ -561,7 +555,6 @@ 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;
@@ -591,11 +584,20 @@ 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
{
- FILE_INFO_3 info_3; /* file entry details */
- FILE_INFO_3_STR info_3_str; /* file entry strings */
+ 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 */
} SRV_FILE_INFO_3;
@@ -603,15 +605,12 @@ typedef struct srv_file_info_3
typedef struct srv_file_info_3_info
{
uint32 switch_value; /* switch value */
- uint32 ptr_file_info; /* pointer to file info union */
-
- uint32 num_entries;
- uint32 ptr_entries;
- uint32 num_entries2;
+ uint32 ptr_file_ctr; /* pointer to file info union */
union
- {
- SRV_FILE_INFO_3 *info3;
- } file;
+ {
+ SRV_FILE_INFO_3 info3; /* file info with 0 entries */
+
+ } file;
} SRV_FILE_INFO_CTR;
@@ -625,12 +624,9 @@ 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;
@@ -643,7 +639,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;
@@ -652,21 +648,6 @@ 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
{
@@ -850,5 +831,4 @@ 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 8a5a573bcc0..69ab4f6c8dc 100644
--- a/source3/include/secrets.h
+++ b/source3/include/secrets.h
@@ -35,8 +35,6 @@
#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"
@@ -50,26 +48,12 @@ struct machine_acct_pass {
time_t mod_time;
};
-/*
- * storage structure for trusted domain
- */
+/* structure for storing trusted domain password */
struct trusted_dom_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 */
+ int pass_len;
+ fstring pass;
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/sids.h b/source3/include/sids.h
new file mode 100644
index 00000000000..860d96b193f
--- /dev/null
+++ b/source3/include/sids.h
@@ -0,0 +1,39 @@
+/*
+ Unix SMB/CIFS implementation.
+ SMB parameters and setup
+ Copyright (C) Andrew Tridgell 1992-2000
+ Copyright (C) Luke Kenneth Casson Leighton 1996-2000
+ Copyright (C) Elrond 2000
+
+ 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.
+*/
+
+#ifndef _SIDS_H
+#define _SIDS_H
+
+extern DOM_SID global_sam_sid;
+extern fstring global_sam_name;
+
+extern DOM_SID global_member_sid;
+
+extern DOM_SID global_sid_S_1_5_32; /* local well-known domain */
+extern DOM_SID global_sid_S_1_1; /* Global Domain */
+extern DOM_SID global_sid_NULL;
+
+extern const DOM_SID *global_sid_everyone;
+extern const DOM_SID *global_sid_system; /* SYSTEM */
+extern const DOM_SID *global_sid_builtin;
+
+#endif /* _SIDS_H */
diff --git a/source3/include/smb.h b/source3/include/smb.h
index a67101ff099..8963528e9ae 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -248,20 +248,6 @@ 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
*
@@ -595,7 +581,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) \
@@ -609,8 +595,6 @@ typedef struct sam_passwd
void (*free_fn)(struct sam_passwd **);
- struct pdb_methods *methods;
-
struct user_data {
/* initiailization flags */
uint32 init_flag;
@@ -626,7 +610,6 @@ 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 */
@@ -638,12 +621,11 @@ typedef struct sam_passwd
uid_t uid; /* this is a unix uid_t */
gid_t gid; /* this is a unix gid_t */
- DOM_SID user_sid; /* Primary User SID */
- DOM_SID group_sid; /* Primary Group SID */
+ uint32 user_rid; /* Primary User ID */
+ uint32 group_rid; /* Primary Group ID */
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 */
@@ -655,7 +637,6 @@ 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. */
@@ -688,7 +669,6 @@ 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 {
@@ -801,8 +781,7 @@ struct bitmap {
#define smb_err 11
#define smb_flg 13
#define smb_flg2 14
-#define smb_pidhigh 16
-#define smb_ss_field 18
+#define smb_reb 13
#define smb_tid 28
#define smb_pid 30
#define smb_uid 32
@@ -1077,11 +1056,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) /* 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 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 SYSTEM_SECURITY_ACCESS (1L<<24) /* 0x01000000 */
#define MAXIMUM_ALLOWED_ACCESS (1L<<25) /* 0x02000000 */
@@ -1296,25 +1275,18 @@ 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_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. */
+#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. */
/* Capabilities. see ftp.microsoft.com/developr/drg/cifs/cifs/cifs4.txt */
@@ -1332,7 +1304,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
@@ -1372,6 +1344,11 @@ 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)
@@ -1380,6 +1357,30 @@ enum case_handling {CASE_LOWER,CASE_UPPER};
#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.
*/
@@ -1580,8 +1581,6 @@ typedef struct user_struct
userdom_struct user;
char *homedir;
- char *unix_homedir;
- char *logon_script;
BOOL guest;
@@ -1595,9 +1594,6 @@ 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 a2351c705ea..c19be784a18 100644
--- a/source3/include/smb_macros.h
+++ b/source3/include/smb_macros.h
@@ -169,12 +169,9 @@
#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) (((char *)(buf)) + smb_size + CVAL(buf,smb_wct)*2)
+#define smb_buf(buf) (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 fb265fdb1a8..3a6fe6e9ee1 100644
--- a/source3/include/trans2.h
+++ b/source3/include/trans2.h
@@ -230,10 +230,6 @@ 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....
*/
@@ -340,12 +336,6 @@ 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
@@ -426,7 +416,7 @@ Offset Size Name
64-bits worth of capability fun :-).
*/
-#define SMB_QUERY_CIFS_UNIX_INFO 0x200
+#define SMB_CIFS_UNIX_QUERY_INFO 0x200
/* Returns the following.