mirror of
https://github.com/samba-team/samba.git
synced 2025-02-19 21:57:57 +03:00
Wed May 7 1997: Update for 1.9.17alpha1 release - 'browsefix release' designed to make browsing across subnets work. byteorder.h: Updated copyright to 1997. charcnv.c: Updated copyright to 1997. charset.c Updated copyright to 1997. charset.h Updated copyright to 1997. client.c Updated copyright to 1997. clientutil.c Updated copyright to 1997. dir.c Updated copyright to 1997. fault.c Updated copyright to 1997. includes.h Updated copyright to 1997. interface.c Updated copyright to 1997. ipc.c Updated copyright to 1997. kanji.c Updated copyright to 1997. kanji.h Updated copyright to 1997. loadparm.c Updated copyright to 1997. locking.c Updated copyright to 1997. mangle.c Updated copyright to 1997. message.c Updated copyright to 1997. nameannounce.c Made use of WINS subnet explicit. Added reset_announce_timer() so announcement can be made immediately when we become a master. Expanded code to do sync with dmb. namebrowse.c Removed redundent checks for AM_MASTER in sync code. Made use of WINS subnet explicit. namedbname.c Made use of WINS subnet explicit. namedbresp.c Made use of WINS subnet explicit. namedbserver.c Made use of WINS subnet explicit. namedbsubnet.c Explicitly add workgroup to WINS subnet when we become a dmb. Made use of WINS subnet explicit. namedbwork.c Made use of WINS subnet explicit. Removed redundent check_work_servertype() function. nameelect.c Explicitly add workgroup to WINS subnet when we become a master browser. Made use of WINS subnet explicit. namelogon.c Updated copyright to 1997. namepacket.c Updated copyright to 1997. namequery.c Updated copyright to 1997. nameresp.c Made use of WINS subnet explicit. Made nmbd fail if configured as master browser and one exists already. nameserv.c Made use of WINS subnet explicit. Remove redundent logon server and domain master code. nameserv.h Add emumerate subnet macros. nameservreply.c Made use of WINS subnet explicit. nameservresp.c Updated copyright to 1997. namework.c Made use of WINS subnet explicit. Updated code to add sync browser entries to add subnet parameter. nmbd.c Added sanity check for misconfigured nmbd. nmblib.c Updated copyright to 1997. nmblookup.c Updated copyright to 1997. nmbsync.c Removed redundent AM_ANY_MASTER check. params.c Updated copyright to 1997. password.c Updated copyright to 1997. pipes.c Updated copyright to 1997. predict.c Updated copyright to 1997. printing.c Updated copyright to 1997. proto.h Changed protos for new nmbd code. quotas.c Updated copyright to 1997. replace.c Updated copyright to 1997. reply.c Updated copyright to 1997. server.c Updated copyright to 1997. shmem.c Updated copyright to 1997. smb.h Updated copyright to 1997. smbencrypt.c Updated copyright to 1997. smbpasswd.c Updated copyright to 1997. smbrun.c Updated copyright to 1997. status.c Updated copyright to 1997. system.c Updated copyright to 1997. testparm.c Updated copyright to 1997. testprns.c Updated copyright to 1997. time.c Updated copyright to 1997. trans2.c Updated copyright to 1997. trans2.h Updated copyright to 1997. uid.c Updated copyright to 1997. username.c Updated copyright to 1997. util.c Updated copyright to 1997. version.h Changed to 1.9.17alpha1.
-
247 lines
8.4 KiB
C
247 lines
8.4 KiB
C
/*
|
|
Unix SMB/Netbios implementation.
|
|
Version 1.9.
|
|
SMB transaction2 handling
|
|
Copyright (C) Jeremy Allison 1994-1997
|
|
|
|
Extensively modified by Andrew Tridgell, 1995
|
|
|
|
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 _TRANS2_H_
|
|
#define _TRANS2_H_
|
|
|
|
/* Define the structures needed for the trans2 calls. */
|
|
|
|
/*******************************************************
|
|
For DosFindFirst/DosFindNext - level 1
|
|
|
|
MAXFILENAMELEN = 255;
|
|
FDATE == uint16
|
|
FTIME == uint16
|
|
ULONG == uint32
|
|
USHORT == uint16
|
|
|
|
typedef struct _FILEFINDBUF {
|
|
Byte offset Type name description
|
|
-------------+-------+-------------------+--------------
|
|
0 FDATE fdateCreation;
|
|
2 FTIME ftimeCreation;
|
|
4 FDATE fdateLastAccess;
|
|
6 FTIME ftimeLastAccess;
|
|
8 FDATE fdateLastWrite;
|
|
10 FTIME ftimeLastWrite;
|
|
12 ULONG cbFile file length in bytes
|
|
16 ULONG cbFileAlloc size of file allocation unit
|
|
20 USHORT attrFile
|
|
22 UCHAR cchName length of name to follow (not including zero)
|
|
23 UCHAR achName[MAXFILENAMELEN]; Null terminated name
|
|
} FILEFINDBUF;
|
|
*********************************************************/
|
|
|
|
#define l1_fdateCreation 0
|
|
#define l1_fdateLastAccess 4
|
|
#define l1_fdateLastWrite 8
|
|
#define l1_cbFile 12
|
|
#define l1_cbFileAlloc 16
|
|
#define l1_attrFile 20
|
|
#define l1_cchName 22
|
|
#define l1_achName 23
|
|
|
|
/**********************************************************
|
|
For DosFindFirst/DosFindNext - level 2
|
|
|
|
typedef struct _FILEFINDBUF2 {
|
|
Byte offset Type name description
|
|
-------------+-------+-------------------+--------------
|
|
0 FDATE fdateCreation;
|
|
2 FTIME ftimeCreation;
|
|
4 FDATE fdateLastAccess;
|
|
6 FTIME ftimeLastAccess;
|
|
8 FDATE fdateLastWrite;
|
|
10 FTIME ftimeLastWrite;
|
|
12 ULONG cbFile file length in bytes
|
|
16 ULONG cbFileAlloc size of file allocation unit
|
|
20 USHORT attrFile
|
|
22 ULONG cbList Extended attribute list (always 0)
|
|
26 UCHAR cchName length of name to follow (not including zero)
|
|
27 UCHAR achName[MAXFILENAMELEN]; Null terminated name
|
|
} FILEFINDBUF2;
|
|
*************************************************************/
|
|
|
|
#define l2_fdateCreation 0
|
|
#define l2_fdateLastAccess 4
|
|
#define l2_fdateLastWrite 8
|
|
#define l2_cbFile 12
|
|
#define l2_cbFileAlloc 16
|
|
#define l2_attrFile 20
|
|
#define l2_cbList 22
|
|
#define l2_cchName 26
|
|
#define l2_achName 27
|
|
|
|
|
|
/**********************************************************
|
|
For DosFindFirst/DosFindNext - level 260
|
|
|
|
typedef struct _FILEFINDBUF260 {
|
|
Byte offset Type name description
|
|
-------------+-------+-------------------+--------------
|
|
0 ULONG NextEntryOffset;
|
|
4 ULONG FileIndex;
|
|
8 LARGE_INTEGER CreationTime;
|
|
16 LARGE_INTEGER LastAccessTime;
|
|
24 LARGE_INTEGER LastWriteTime;
|
|
32 LARGE_INTEGER ChangeTime;
|
|
40 LARGE_INTEGER EndOfFile;
|
|
48 LARGE_INTEGER AllocationSize;
|
|
56 ULONG FileAttributes;
|
|
60 ULONG FileNameLength;
|
|
64 ULONG EaSize;
|
|
68 CHAR ShortNameLength;
|
|
70 UNICODE ShortName[12];
|
|
94 UNICODE FileName[];
|
|
*************************************************************/
|
|
|
|
#define l260_achName 94
|
|
|
|
|
|
/**********************************************************
|
|
For DosQueryPathInfo/DosQueryFileInfo/DosSetPathInfo/
|
|
DosSetFileInfo - level 1
|
|
|
|
typedef struct _FILESTATUS {
|
|
Byte offset Type name description
|
|
-------------+-------+-------------------+--------------
|
|
0 FDATE fdateCreation;
|
|
2 FTIME ftimeCreation;
|
|
4 FDATE fdateLastAccess;
|
|
6 FTIME ftimeLastAccess;
|
|
8 FDATE fdateLastWrite;
|
|
10 FTIME ftimeLastWrite;
|
|
12 ULONG cbFile file length in bytes
|
|
16 ULONG cbFileAlloc size of file allocation unit
|
|
20 USHORT attrFile
|
|
} FILESTATUS;
|
|
*************************************************************/
|
|
|
|
/* Use the l1_ defines from DosFindFirst */
|
|
|
|
/**********************************************************
|
|
For DosQueryPathInfo/DosQueryFileInfo/DosSetPathInfo/
|
|
DosSetFileInfo - level 2
|
|
|
|
typedef struct _FILESTATUS2 {
|
|
Byte offset Type name description
|
|
-------------+-------+-------------------+--------------
|
|
0 FDATE fdateCreation;
|
|
2 FTIME ftimeCreation;
|
|
4 FDATE fdateLastAccess;
|
|
6 FTIME ftimeLastAccess;
|
|
8 FDATE fdateLastWrite;
|
|
10 FTIME ftimeLastWrite;
|
|
12 ULONG cbFile file length in bytes
|
|
16 ULONG cbFileAlloc size of file allocation unit
|
|
20 USHORT attrFile
|
|
22 ULONG cbList Length of EA's (0)
|
|
} FILESTATUS2;
|
|
*************************************************************/
|
|
|
|
/* Use the l2_ #defines from DosFindFirst */
|
|
|
|
/**********************************************************
|
|
For DosQFSInfo/DosSetFSInfo - level 1
|
|
|
|
typedef struct _FSALLOCATE {
|
|
Byte offset Type name description
|
|
-------------+-------+-------------------+--------------
|
|
0 ULONG idFileSystem id of file system
|
|
4 ULONG cSectorUnit number of sectors per allocation unit
|
|
8 ULONG cUnit number of allocation units
|
|
12 ULONG cUnitAvail Available allocation units
|
|
16 USHORT cbSector bytes per sector
|
|
} FSALLOCATE;
|
|
*************************************************************/
|
|
|
|
#define l1_idFileSystem 0
|
|
#define l1_cSectorUnit 4
|
|
#define l1_cUnit 8
|
|
#define l1_cUnitAvail 12
|
|
#define l1_cbSector 16
|
|
|
|
/**********************************************************
|
|
For DosQFSInfo/DosSetFSInfo - level 2
|
|
|
|
typedef struct _FSINFO {
|
|
Byte offset Type name description
|
|
-------------+-------+-------------------+--------------
|
|
0 FDATE vol_fdateCreation
|
|
2 FTIME vol_ftimeCreation
|
|
4 UCHAR vol_cch length of volume name (excluding NULL)
|
|
5 UCHAR vol_szVolLabel[12] volume name
|
|
} FSINFO;
|
|
*************************************************************/
|
|
|
|
#define SMB_QUERY_FS_LABEL_INFO 0x101
|
|
#define SMB_QUERY_FS_VOLUME_INFO 0x102
|
|
#define SMB_QUERY_FS_SIZE_INFO 0x103
|
|
#define SMB_QUERY_FS_DEVICE_INFO 0x104
|
|
#define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105
|
|
|
|
|
|
#define l2_vol_fdateCreation 0
|
|
#define l2_vol_cch 4
|
|
#define l2_vol_szVolLabel 5
|
|
|
|
|
|
#define SMB_QUERY_FILE_BASIC_INFO 0x101
|
|
#define SMB_QUERY_FILE_STANDARD_INFO 0x102
|
|
#define SMB_QUERY_FILE_EA_INFO 0x103
|
|
#define SMB_QUERY_FILE_NAME_INFO 0x104
|
|
#define SMB_QUERY_FILE_ALLOCATION_INFO 0x105
|
|
#define SMB_QUERY_FILE_END_OF_FILEINFO 0x106
|
|
#define SMB_QUERY_FILE_ALL_INFO 0x107
|
|
#define SMB_QUERY_FILE_ALT_NAME_INFO 0x108
|
|
#define SMB_QUERY_FILE_STREAM_INFO 0x109
|
|
|
|
#define SMB_FIND_FILE_DIRECTORY_INFO 0x101
|
|
#define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102
|
|
#define SMB_FIND_FILE_NAMES_INFO 0x103
|
|
#define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104
|
|
|
|
#define SMB_SET_FILE_BASIC_INFO 0x101
|
|
#define SMB_SET_FILE_DISPOSITION_INFO 0x102
|
|
#define SMB_SET_FILE_ALLOCATION_INFO 0x103
|
|
#define SMB_SET_FILE_END_OF_FILE_INFO 0x104
|
|
|
|
#define DIRLEN_GUESS (45+MAX(l1_achName,l2_achName))
|
|
|
|
/* NT uses a FILE_ATTRIBUTE_NORMAL when no other attributes
|
|
are set. */
|
|
|
|
#define NT_FILE_ATTRIBUTE_NORMAL 0x80
|
|
|
|
/* Function prototypes */
|
|
|
|
|
|
int reply_findnclose(char *inbuf,char *outbuf,int length,int bufsize);
|
|
|
|
int reply_findclose(char *inbuf,char *outbuf,int length,int bufsize);
|
|
|
|
#endif
|
|
|
|
|
|
|