#ifndef _SMB_H
#define _SMB_H
+#if defined(LARGE_SMB_OFF_T)
+#define BUFFER_SIZE (128*1024)
+#else /* no large readwrite possible */
#define BUFFER_SIZE (0xFFFF)
+#endif
+
#define SAFETY_MARGIN 1024
#define LARGE_WRITEX_HDR_SIZE 65
#define DIR_STRUCT_SIZE 43
/* these define the attribute byte as seen by DOS */
-#define aRONLY (1L<<0)
-#define aHIDDEN (1L<<1)
-#define aSYSTEM (1L<<2)
-#define aVOLID (1L<<3)
-#define aDIR (1L<<4)
-#define aARCH (1L<<5)
+#define aRONLY (1L<<0) /* 0x01 */
+#define aHIDDEN (1L<<1) /* 0x02 */
+#define aSYSTEM (1L<<2) /* 0x04 */
+#define aVOLID (1L<<3) /* 0x08 */
+#define aDIR (1L<<4) /* 0x10 */
+#define aARCH (1L<<5) /* 0x20 */
/* deny modes */
#define DENY_DOS 0
#define GET_DELETE_ON_CLOSE_FLAG(x) (((x) & DELETE_ON_CLOSE_FLAG) ? True : False)
#define SET_DELETE_ON_CLOSE_FLAG(x) ((x) ? DELETE_ON_CLOSE_FLAG : 0)
-/* was delete access requested in NT open ? */
-#define DELETE_ACCESS_REQUESTED (1<<17)
-#define GET_DELETE_ACCESS_REQUESTED(x) (((x) & DELETE_ACCESS_REQUESTED) ? True : False)
-#define SET_DELETE_ACCESS_REQUESTED(x) ((x) ? DELETE_ACCESS_REQUESTED : 0)
-
/* open disposition values */
#define FILE_EXISTS_FAIL 0
#define FILE_EXISTS_OPEN 1
#include "doserr.h"
-#include "pstring.h"
-
/*
* SMB UCS2 (16-bit unicode) internal type.
*/
#define MAXSUBAUTHS 15 /* max sub authorities in a SID */
#endif
-#ifndef _DOM_SID
/**
* @brief Security Identifier
*
uint32 sub_auths[MAXSUBAUTHS];
} DOM_SID;
-#define _DOM_SID
-#endif
/*
* The complete list of SIDS belonging to this user.
#define PRIMARY_USER_SID_INDEX 0
#define PRIMARY_GROUP_SID_INDEX 1
-#ifndef _NT_USER_TOKEN
typedef struct _nt_user_token {
size_t num_sids;
DOM_SID *user_sids;
} NT_USER_TOKEN;
-#define _NT_USER_TOKEN
-#endif
/*** query a local group, get a list of these: shows who is in that group ***/
write_cache *wcp;
struct timeval open_time;
int share_mode;
+ uint32 desired_access;
time_t pending_modtime;
int oplock_type;
int sent_oplock_break;
BOOL modified;
BOOL is_directory;
BOOL directory_delete_on_close;
- BOOL stat_open;
char *fsp_name;
} files_struct;
/* Include VFS stuff */
+#include "smb_acls.h"
#include "vfs.h"
typedef struct connection_struct
struct vfs_ops vfs_ops; /* Filesystem operations */
/* Handle on dlopen() call */
void *dl_handle;
+ void *vfs_private;
char *user; /* name of user who *opened* this connection */
uid_t uid; /* uid of user who *opened* this connection */
{
int job;
int size;
+ int page_count;
int status;
int priority;
time_t time;
- fstring user;
- fstring file;
+ fstring fs_user;
+ fstring fs_file;
} print_queue_struct;
enum {LPSTAT_OK, LPSTAT_STOPPED, LPSTAT_ERROR};
uint16 op_port;
uint16 op_type;
int share_mode;
+ uint32 desired_access;
struct timeval time;
SMB_DEV_T dev;
SMB_INO_T inode;
#define FLAG_SAM_GID 0x00000002
#define FLAG_SAM_SMBHOME 0x00000004
#define FLAG_SAM_PROFILE 0x00000008
-#define FLAG_SAM_LOGONSCRIPT 0x00000010
-#define FLAG_SAM_DRIVE 0x00000020
+#define FLAG_SAM_DRIVE 0x00000010
+#define FLAG_SAM_LOGONSCRIPT 0x00000020
+#define FLAG_SAM_LOGONTIME 0x00000040
+#define FLAG_SAM_LOGOFFTIME 0x00000080
+#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) \
void (*free_fn)(struct sam_passwd **);
+ struct pdb_methods *methods;
+
struct user_data {
/* initiailization flags */
uint32 init_flag;
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 */
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 */
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. */
#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 */
#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
/* 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)
#define COPYBUF_SIZE (8*1024)
/*
- * Integers used to override error codes.
+ * Values used to override error codes.
*/
extern int unix_ERR_class;
extern int unix_ERR_code;
userdom_struct user;
char *homedir;
+ char *unix_homedir;
+ char *logon_script;
BOOL guest;
#define SAFE_NETBIOS_CHARS ". -_"
#include "nsswitch/winbindd_nss.h"
-#include "smb_acls.h"
/* generic iconv conversion structure */
typedef struct {