summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-02-11 11:07:14 +0000
committerJeremy Allison <jra@samba.org>1998-02-11 11:07:14 +0000
commit99e11e171e40703271ad2a7934708cee66b0bb82 (patch)
treeed892bbc53c3155d43e583ced1a59d47623fa1af /source3/smbd/trans2.c
parent5546e28e69b1a43dbb48e024e233d8ebf7fa667a (diff)
downloadsamba-99e11e171e40703271ad2a7934708cee66b0bb82.tar.gz
samba-99e11e171e40703271ad2a7934708cee66b0bb82.tar.bz2
samba-99e11e171e40703271ad2a7934708cee66b0bb82.zip
Makefile: Added AIX 3.2.5.
loadparm.c: Added "win95 bug compatibility" parameter. local.h: Replaced MAX_OPEN_FILES back to 100 from 10 (oops). reply.c: Fixed ulogoff check against uid - changed to vuid. server.c: Changed file struct save of uid - changed to vuid. smb.h: Changed id in struct current_user to vuid. Changed file struct uid to vuid. time.c: Added "win95 bug compatibility" atime -> mtime return. trans2.c: Added "win95 bug compatibility" fixes. uid.c: Changed id in struct current_user to vuid - added checks to set/reset it. util.c: Added code to expand environment variables. version.h : still at 1.9.18 (head branch doesn't matter too much at present). Jeremy. (This used to be commit adc903bcf59ad1664babd7f1d43675d3a75bfbc9)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 825dd0a25e..2b5d5785fa 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -32,6 +32,7 @@ extern BOOL case_sensitive;
extern int Client;
extern int oplock_sock;
extern int smb_read_error;
+extern fstring local_machine;
/****************************************************************************
Send the required number of replies back.
@@ -940,7 +941,8 @@ static int call_trans2qfsinfo(char *inbuf, char *outbuf, int length, int bufsize
int data_len;
struct stat st;
char *vname = volume_label(SNUM(cnum));
-
+ int snum = SNUM(cnum);
+
DEBUG(3,("call_trans2qfsinfo: cnum = %d, level = %d\n", cnum, info_level));
if(sys_stat(".",&st)!=0) {
@@ -971,7 +973,11 @@ static int call_trans2qfsinfo(char *inbuf, char *outbuf, int length, int bufsize
/* Return volume name */
int volname_len = MIN(strlen(vname),11);
data_len = l2_vol_szVolLabel + volname_len + 1;
- put_dos_date2(pdata,l2_vol_fdateCreation,st.st_ctime);
+ /*
+ * Add volume serial number - hash of a combination of
+ * the called hostname and the service name.
+ */
+ SIVAL(pdata,0,str_checksum(lp_servicename(snum)) ^ str_checksum(local_machine) );
SCVAL(pdata,l2_vol_cch,volname_len);
StrnCpy(pdata+l2_vol_szVolLabel,vname,volname_len);
DEBUG(5,("call_trans2qfsinfo : time = %x, namelen = %d, name = %s\n",st.st_ctime, volname_len,
@@ -992,6 +998,11 @@ static int call_trans2qfsinfo(char *inbuf, char *outbuf, int length, int bufsize
break;
case SMB_QUERY_FS_VOLUME_INFO:
data_len = 18 + 2*strlen(vname);
+ /*
+ * Add volume serial number - hash of a combination of
+ * the called hostname and the service name.
+ */
+ SIVAL(pdata,8,str_checksum(lp_servicename(snum)) ^ str_checksum(local_machine) );
SIVAL(pdata,12,2*strlen(vname));
PutUniCode(pdata+18,vname);
DEBUG(5,("call_trans2qfsinfo : SMB_QUERY_FS_VOLUME_INFO namelen = %d, vol = %s\n", strlen(vname),
@@ -1128,9 +1139,18 @@ static int call_trans2qfilepathinfo(char *inbuf, char *outbuf, int length,
case SMB_INFO_STANDARD:
case SMB_INFO_QUERY_EA_SIZE:
data_size = (info_level==1?22:26);
- put_dos_date2(pdata,l1_fdateCreation,get_create_time(&sbuf));
- put_dos_date2(pdata,l1_fdateLastAccess,get_access_time(&sbuf));
- put_dos_date2(pdata,l1_fdateLastWrite,sbuf.st_mtime); /* write time */
+ if( lp_win95_bug_compatibility())
+ {
+ put_dos_date(pdata,l1_fdateCreation,get_create_time(&sbuf));
+ put_dos_date(pdata,l1_fdateLastAccess,get_access_time(&sbuf));
+ put_dos_date(pdata,l1_fdateLastWrite,sbuf.st_mtime); /* write time */
+ }
+ else
+ {
+ put_dos_date2(pdata,l1_fdateCreation,get_create_time(&sbuf));
+ put_dos_date2(pdata,l1_fdateLastAccess,get_access_time(&sbuf));
+ put_dos_date2(pdata,l1_fdateLastWrite,sbuf.st_mtime); /* write time */
+ }
SIVAL(pdata,l1_cbFile,size);
SIVAL(pdata,l1_cbFileAlloc,ROUNDUP(size,1024));
SSVAL(pdata,l1_attrFile,mode);