summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-06-19 00:11:12 +0000
committerJeremy Allison <jra@samba.org>2001-06-19 00:11:12 +0000
commit5f633c0e5e17c3b0c30b819f147e5d6672e86649 (patch)
treeb569e765bb264c4025c985565241e477c27dd042 /source3/smbd
parentc0be2fc029463428c604abdd8f90f49b3925ea90 (diff)
downloadsamba-5f633c0e5e17c3b0c30b819f147e5d6672e86649.tar.gz
samba-5f633c0e5e17c3b0c30b819f147e5d6672e86649.tar.bz2
samba-5f633c0e5e17c3b0c30b819f147e5d6672e86649.zip
Set support for info levels...
Jeremy. (This used to be commit e033f758914f6631545af17041b4e49c1ff885d9)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/trans2.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 29c68bd0e0..f88ddb41aa 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1448,7 +1448,14 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
return(ERROR(ERRDOS,ERRbadfunc)); /* os/2 needs this */
case SMB_QUERY_FILE_BASIC_INFO:
- data_size = 36; /* w95 returns 40 bytes not 36 - why ?. */
+ case 1004:
+
+ if (info_level == SMB_QUERY_FILE_BASIC_INFO)
+ data_size = 36; /* w95 returns 40 bytes not 36 - why ?. */
+ else {
+ data_size = 40;
+ SIVAL(pdata,36,0);
+ }
put_long_date(pdata,get_create_time(&sbuf,lp_fake_dir_create_times(SNUM(conn))));
put_long_date(pdata+8,sbuf.st_atime);
put_long_date(pdata+16,sbuf.st_mtime); /* write time */
@@ -1560,16 +1567,6 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
* Lying rat-bastards. JRA.
*/
- case 1004:
- put_long_date(pdata,get_create_time(&sbuf,lp_fake_dir_create_times(SNUM(conn))));
- put_long_date(pdata+8,sbuf.st_atime);
- put_long_date(pdata+16,sbuf.st_mtime); /* write time */
- put_long_date(pdata+24,sbuf.st_mtime); /* change time */
- SIVAL(pdata,32,mode);
- SIVAL(pdata,36,0); /* ??? */
- data_size = 40;
- break;
-
case 1005:
SIVAL(pdata,0,mode);
SIVAL(pdata,4,0); /* ??? */
@@ -1881,6 +1878,7 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
break;
case SMB_SET_FILE_BASIC_INFO:
+ case 1004:
{
/* Patch to do this correctly from Paul Eggert <eggert@twinsun.com>. */
time_t write_time;
@@ -1902,14 +1900,6 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
? changed_time
: write_time);
-#if 0 /* Needs more testing... */
- /* Test from Luke to prevent Win95 from
- setting incorrect values here.
- */
- if (tvs.actime < tvs.modtime)
- return(ERROR(ERRDOS,ERRnoaccess));
-#endif /* Needs more testing... */
-
/* attributes */
mode = IVAL(pdata,32);
break;
@@ -1920,6 +1910,8 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
* to mean truncate the file. JRA.
*/
+ case 1019:
+ case 1020:
case SMB_SET_FILE_ALLOCATION_INFO:
{
SMB_OFF_T newsize = IVAL(pdata,0);
@@ -2053,7 +2045,9 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
DEBUG(6,("mode: %x\n" , mode));
if(!((info_level == SMB_SET_FILE_END_OF_FILE_INFO) ||
- (info_level == SMB_SET_FILE_ALLOCATION_INFO))) {
+ (info_level == SMB_SET_FILE_ALLOCATION_INFO) ||
+ (info_level == 1019) ||
+ (info_level == 1020))) {
/*
* Only do this test if we are not explicitly
* changing the size of a file.