Updated to version 1.146

Please keep in mind that this is still a development version and might surprise you (not necessarily in a good way).

Do not let me discourage you to build and test this version, although there will be some risks involved such as data corruption or loss of data.
This commit is contained in:
obarthel
2018-06-03 11:36:04 +02:00
parent 32c75549a4
commit 31c8fb0d77
11 changed files with 1204 additions and 264 deletions
+4
View File
@@ -79,6 +79,8 @@ int smb_proc_setattr_core(struct smb_server *server, const char *path, int len,
int smb_proc_setattrE(struct smb_server *server, word fid, struct smb_dirent *new_entry, int * error_ptr);
int smb_proc_dskattr (struct smb_server *server, struct smb_dskattr *attr, int * error_ptr);
int smb_proc_connect(struct smb_server *server, int * error_ptr);
int smb_proc_read_raw (struct smb_server *server, struct smb_dirent *finfo, const QUAD * const offset_quad, long count, char *data, int * error_ptr);
int smb_proc_write_raw (struct smb_server *server, struct smb_dirent *finfo, const QUAD * const offset_quad, long count, const char *data, int * error_ptr);
/* sock.c */
int smb_discard_netbios_frames(struct smb_server *server, int sock_fd, int * error_ptr);
@@ -87,5 +89,7 @@ void smb_release(struct smb_server *server);
int smb_connect(struct smb_server *server, int * error_ptr);
int smb_request(struct smb_server *server, int command, void * input_payload,const void * output_payload,int payload_size, int * error_ptr);
int smb_trans2_request(struct smb_server *server, int command, int *data_len, int *param_len, char **data, char **param, int * error_ptr);
int smb_request_read_raw (struct smb_server *server, unsigned char *target, int max_len, int * error_ptr);
int smb_request_write_raw (struct smb_server *server, unsigned const char *source, int length, int * error_ptr);
#endif /* _SMB_FS_H_SMB_H */
+9
View File
@@ -59,6 +59,15 @@ struct smb_server
/* olsen (2012-12-10): raw SMB over TCP instead of NBT transport? */
int raw_smb;
/* olsen (2016-06-03): Prefer SMB_COM_WRITE_RAW to SMB_COM_WRITE_ANDX? */
int prefer_write_raw;
/* olsen (2016-04-20): Use write-behind with SMB_COM_WRITE_RAW? */
int write_behind;
/* olsen (2016-06-03): Prefer SMB_COM_READ_RAW to SMB_COM_READ_ANDX? */
int prefer_read_raw;
/* olsen (2018-05-09): Timeout for send/receive operations in seconds. */
int timeout;
+36 -44
View File
@@ -5,14 +5,6 @@
#ifndef _SMBNO_H_
#define _SMBNO_H_
/* 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)
/* error classes */
#define SUCCESS 0 /* The request was successful. */
#define ERRDOS 0x01 /* Error is from the core DOS operating system set. */
@@ -62,37 +54,37 @@
/* Error codes for the ERRSRV class */
#define ERRerror 1 /* Non specific error code */
#define ERRbadpw 2 /* Bad password */
#define ERRbadtype 3 /* reserved */
#define ERRaccess 4 /* No permissions to do the requested operation */
#define ERRinvnid 5 /* tid invalid */
#define ERRinvnetname 6 /* Invalid servername */
#define ERRinvdevice 7 /* Invalid device */
#define ERRqfull 49 /* Print queue full */
#define ERRqtoobig 50 /* Queued item too big */
#define ERRqeof 51
#define ERRinvpfid 52 /* Invalid print file in smb_fid */
#define ERRsmbcmd 64 /* Unrecognised command */
#define ERRsrverror 65 /* smb server internal error */
#define ERRbadBID 66
#define ERRfilespecs 67 /* fid and pathname invalid combination */
#define ERRbadlink 68 /* reserved */
#define ERRbadpermits 69 /* Access specified for a file is not valid */
#define ERRbadpid 70 /* reserved */
#define ERRsetattrmode 71 /* attribute mode invalid */
#define ERRpaused 81 /* Message server paused */
#define ERRmsgoff 82 /* Not receiving messages */
#define ERRnoroom 83 /* No room for message */
#define ERRrmuns 87 /* too many remote usernames */
#define ERRtimeout 88 /* operation timed out */
#define ERRnoresource 89 /* No resources currently available for request. */
#define ERRtoomanyuids 90 /* too many userids */
#define ERRbaduid 91 /* bad userid */
#define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */
#define ERRuseSTD 251 /* temporarily unable to use raw mode, use std.mode */
#define ERRcontMPX 252 /* resume MPX mode */
#define ERRbadPW 254
#define ERRerror 1 /* Non specific error code */
#define ERRbadpw 2 /* Bad password */
#define ERRbadtype 3 /* reserved */
#define ERRaccess 4 /* No permissions to do the requested operation */
#define ERRinvnid 5 /* tid invalid */
#define ERRinvnetname 6 /* Invalid servername */
#define ERRinvdevice 7 /* Invalid device */
#define ERRqfull 49 /* Print queue full */
#define ERRqtoobig 50 /* Queued item too big */
#define ERRqeof 51
#define ERRinvpfid 52 /* Invalid print file in smb_fid */
#define ERRsmbcmd 64 /* Unrecognised command */
#define ERRsrverror 65 /* smb server internal error */
#define ERRbadBID 66
#define ERRfilespecs 67 /* fid and pathname invalid combination */
#define ERRbadlink 68 /* reserved */
#define ERRbadpermits 69 /* Access specified for a file is not valid */
#define ERRbadpid 70 /* reserved */
#define ERRsetattrmode 71 /* attribute mode invalid */
#define ERRpaused 81 /* Message server paused */
#define ERRmsgoff 82 /* Not receiving messages */
#define ERRnoroom 83 /* No room for message */
#define ERRrmuns 87 /* too many remote usernames */
#define ERRtimeout 88 /* operation timed out */
#define ERRnoresource 89 /* No resources currently available for request. */
#define ERRtoomanyuids 90 /* too many userids */
#define ERRbaduid 91 /* bad userid */
#define ERRuseMPX 250 /* temporarily unable to use raw mode, use MPX mode */
#define ERRuseSTD 251 /* temporarily unable to use raw mode, use std.mode */
#define ERRcontMPX 252 /* resume MPX mode */
#define ERRbadPW 254
#define ERRnotifyEnumDir 1024
#define ERRaccountExpired 2239
#define ERRbadClient 2240
@@ -420,13 +412,13 @@
#define SMB_OPEN_WRITE_THROUGH_ENABLED 0x4000
/* SMB header flags (which go into the "flags" field). */
#define SMB_FLG_SERVER_TO_REDIR 0x80
#define SMB_FLG_SERVER_TO_REDIR 0x80
#define SMB_FLG_REQUEST_BATCH_OPLOCK 0x40
#define SMB_FLG_REQUEST_OPLOCK 0x20
#define SMB_FLG_CANONICAL_PATHNAMES 0x10
#define SMB_FLG_CASELESS_PATHNAMES 0x08
#define SMB_FLG_REQUEST_OPLOCK 0x20
#define SMB_FLG_CANONICAL_PATHNAMES 0x10
#define SMB_FLG_CASELESS_PATHNAMES 0x08
#define SMB_FLG_CLIENT_BUF_AVAIL 0x02
#define SMB_FLG_SUPPORT_LOCKREAD 0x0
#define SMB_FLG_SUPPORT_LOCKREAD 0x01
/* More SMB header flags (which go into the "flags2" field). */
#define SMB_FLG2_UNICODE_STRINGS 0x8000