Updated to version 1.140

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-05-27 15:38:19 +02:00
parent ea486c36c9
commit 8e4d177607
10 changed files with 509 additions and 340 deletions
+8 -4
View File
@@ -67,15 +67,19 @@ struct smb_dirent
dword attr; /* Attribute fields, DOS value */
time_t atime, mtime,
wtime, ctime; /* Times, as seen by the server, normalized */
/* to UTC. The ugly conversion happens in */
/* proc.c */
wtime, ctime; /* Times, as seen by the server, normalized
* to UTC. The ugly conversion happens in
* proc.c
*/
dword size_low; /* File size (least significant 32 bits). */
dword size_high; /* File size (most significant 32 bits). */
char * complete_path; /* Complete path, MS-DOS notation, with '\' */
size_t complete_path_size; /* Number of bytes allocated for name */
size_t complete_path_size; /* Number of bytes allocated for name; this is
* used only by the directory reader and
* the cache.
*/
int len; /* Name length. */
+3 -3
View File
@@ -57,19 +57,19 @@ int smb_proc_read(struct smb_server *server, struct smb_dirent *finfo, off_t off
int smb_proc_write (struct smb_server *server, struct smb_dirent *finfo, off_t offset, long count, const char *data, int * error_ptr);
int smb_proc_writex (struct smb_server *server, struct smb_dirent *finfo, const QUAD * const offset, long count, const char *data, int * error_ptr);
int smb_proc_readx (struct smb_server *server, struct smb_dirent *finfo, const QUAD * const offset, long count, char *data, int * error_ptr);
int smb_proc_lockingX (struct smb_server *server, struct smb_dirent *finfo, struct smb_lkrng *locks, int num_entries, int mode, long timeout, int * error_ptr);
int smb_proc_lockingX (struct smb_server *server, struct smb_dirent *finfo, const struct smb_lkrng *locks, int num_entries, int mode, long timeout, int * error_ptr);
int smb_proc_create(struct smb_server *server, const char *path, int len, struct smb_dirent *entry, int * error_ptr);
int smb_proc_mv(struct smb_server *server, const char *opath, const int olen, const char *npath, const int nlen, int * error_ptr);
int smb_proc_mkdir(struct smb_server *server, const char *path, const int len, int * error_ptr);
int smb_proc_rmdir(struct smb_server *server, const char *path, const int len, int * error_ptr);
int smb_proc_unlink(struct smb_server *server, const char *path, const int len, int * error_ptr);
int smb_proc_trunc(struct smb_server *server, word fid, dword length, int * error_ptr);
int smb_proc_readdir(struct smb_server *server, char *path, int fpos, int cache_size, struct smb_dirent *entry, int * error_ptr);
int smb_proc_readdir(struct smb_server *server, const char *path, int fpos, int cache_size, struct smb_dirent *entry, int * error_ptr);
int smb_proc_getattr_core(struct smb_server *server, const char *path, int len, struct smb_dirent *entry, int * error_ptr);
int smb_proc_getattrE(struct smb_server *server, struct smb_dirent *entry, int * error_ptr);
int smb_query_path_information(struct smb_server *server, const char *path, int len, int fid, struct smb_dirent *entry, int * error_ptr);
int smb_set_file_information(struct smb_server *server, struct smb_dirent *entry, const QUAD * const size, int * error_ptr);
int smb_proc_setattr_core(struct smb_server *server, const char *path, int len, struct smb_dirent *new_finfo, int * error_ptr);
int smb_proc_setattr_core(struct smb_server *server, const char *path, int len, const struct smb_dirent *new_finfo, int * error_ptr);
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);
+31
View File
@@ -292,6 +292,20 @@
#define TRANSACT2_FINDNOTIFYNEXT 12
#define TRANSACT2_MKDIR 13 /* TRANS2_CREATE_DIRECTORY */
/* Basic SMB file attributes, such as used by TRANSACT2_FINDFIRST
* or SMB_COM_OPEN.
*/
#define SMB_FILE_ATTRIBUTE_NORMAL 0x0000
#define SMB_FILE_ATTRIBUTE_READONLY 0x0001
#define SMB_FILE_ATTRIBUTE_HIDDEN 0x0002
#define SMB_FILE_ATTRIBUTE_SYSTEM 0x0004
#define SMB_FILE_ATTRIBUTE_VOLUME 0x0008
#define SMB_FILE_ATTRIBUTE_DIRECTORY 0x0010
#define SMB_FILE_ATTRIBUTE_ARCHIVE 0x0020
#define SMB_SEARCH_ATTRIBUTE_READONLY 0x0100
#define SMB_SEARCH_ATTRIBUTE_HIDDEN 0x0200
#define SMB_SEARCH_ATTRIBUTE_SYSTEM 0x0400
/* Extended file attributes */
#define ATTR_READONLY 0x00000001
#define ATTR_HIDDEN 0x00000002
@@ -384,4 +398,21 @@
#define SMB_SET_FILE_BASIC_INFO 0x0101 /* NT LAN Manager */
#define SMB_SET_FILE_END_OF_FILE_INFO 0x0104 /* NT LAN Manager */
/* These are used with SMBopen */
#define SMB_OPEN_ACCESS_READ_ONLY 0x0000
#define SMB_OPEN_ACCESS_WRITE_ONLY 0x0001
#define SMB_OPEN_ACCESS_READ_WRITE 0x0002
#define SMB_OPEN_ACCESS_EXECUTE 0x0003
#define SMB_OPEN_SHARE_COMPATIBILITY_MODE 0x0000
#define SMB_OPEN_SHARE_DENY_EVERYTHING 0x0010
#define SMB_OPEN_SHARE_DENY_WRITE 0x0020
#define SMB_OPEN_SHARE_DENY_READ_EXECUTE 0x0030
#define SMB_OPEN_SHARE_DENY_NOTHING 0x0040
#define SMB_OPEN_LOCALITY_UNKNOWN 0x0000
#define SMB_OPEN_LOCALITY_SEQUENTIAL 0x0100
#define SMB_OPEN_LOCALITY_RANDOM 0x0200
#define SMB_OPEN_LOCALITY_MIXED 0x0300
#define SMB_OPEN_CACHE_DISABLED 0x1000
#define SMB_OPEN_WRITE_THROUGH_ENABLED 0x4000
#endif /* _SMBNO_H_ */