diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-09-20 15:48:10 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-09-20 15:48:10 +0000 |
commit | 5e634ef68c2abfda88153a402b189eb71e5aea0e (patch) | |
tree | 7e268311cbd4d5c608cb352787b48032d7c7adec | |
parent | 93dfc79888120a0e39a8ea82df2d04c87e45d03a (diff) | |
download | samba-5e634ef68c2abfda88153a402b189eb71e5aea0e.tar.gz samba-5e634ef68c2abfda88153a402b189eb71e5aea0e.tar.bz2 samba-5e634ef68c2abfda88153a402b189eb71e5aea0e.zip |
3 changes:
1) use lp_fstype() instead of FSTYPE_STRING
2) added SMB_SEARCH_BITS to the TconX reply options (in vwv3). I noted
that NT sets this (undocumented) bit and setting it helped get
autorun from exported cdroms working.
3) fixed volume labels in QFSINFO level 258.
I made these changes while getting the Encyclopadia Brittanica CD to
run from a Samba drive. (I bought it for Sue yesterday). The first
and second changes allowed Samba to export CDs with autorun info and
the client will autorun it when mounted. There are all sorts of nasty
implications in that that perhaps we can go into on
samba-technical. Think about creating some autorun info in /tmp/ then
waiting for people to mount it as scratch space ...
The last change was because EB wanted the right volume label. The code
we had used a non unicode volume label but tests with W95->NT4 showed
that it has to be unicode. There was a note in the code from Jeremy
saying that he thought it should _not_ be unicode. Jeremy, can you
explain why? It certainly didn't work as non-unicode (the client
displays a garbage volume label) and when I fixed it to use unicode it
all worked from Win95.
and in case anyone is interested EB98 now works fine from a Samba
drive :)
(This used to be commit 66268ae5881f43fbdc1ccd751122ab2285c375ad)
-rw-r--r-- | source3/smbd/reply.c | 6 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 21 |
2 files changed, 16 insertions, 11 deletions
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index ad1894358a..254fb32a51 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -319,7 +319,7 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt set_message(outbuf,2,strlen(devicename)+1,True); pstrcpy(smb_buf(outbuf),devicename); } else { - char *fsname = FSTYPE_STRING; + char *fsname = lp_fstype(SNUM(conn)); set_message(outbuf,3,3,True); @@ -329,7 +329,9 @@ int reply_tcon_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt set_message(outbuf,3,PTR_DIFF(p,smb_buf(outbuf)),False); - SSVAL(outbuf, smb_vwv2, 0x0); /* optional support */ + /* what does setting this bit do? It is set by NT4 and + may affect the ability to autorun mounted cdroms */ + SSVAL(outbuf, smb_vwv2, SMB_SUPPORT_SEARCH_BITS); } DEBUG(3,("tconX service=%s user=%s\n", diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index fe2869db93..5c8c64a63c 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1068,6 +1068,7 @@ static int call_trans2qfsinfo(connection_struct *conn, SMB_STRUCT_STAT st; char *vname = volume_label(SNUM(conn)); int snum = SNUM(conn); + char *fstype = lp_fstype(SNUM(conn)); DEBUG(3,("call_trans2qfsinfo: level = %d\n", info_level)); @@ -1113,14 +1114,14 @@ static int call_trans2qfsinfo(connection_struct *conn, break; } case SMB_QUERY_FS_ATTRIBUTE_INFO: - data_len = 12 + 2*strlen(FSTYPE_STRING); + data_len = 12 + 2*strlen(fstype); SIVAL(pdata,0,FILE_CASE_PRESERVED_NAMES); /* FS ATTRIBUTES */ #if 0 /* Old code. JRA. */ SIVAL(pdata,0,0x4006); /* FS ATTRIBUTES == long filenames supported? */ #endif /* Old code. */ SIVAL(pdata,4,128); /* Max filename component length */ - SIVAL(pdata,8,2*strlen(FSTYPE_STRING)); - PutUniCode(pdata+12,FSTYPE_STRING); + SIVAL(pdata,8,2*strlen(fstype)); + PutUniCode(pdata+12,fstype); SSVAL(outbuf,smb_flg2,SVAL(outbuf,smb_flg2)|FLAGS2_UNICODE_STRINGS); break; case SMB_QUERY_FS_LABEL_INFO: @@ -1130,20 +1131,22 @@ static int call_trans2qfsinfo(connection_struct *conn, break; case SMB_QUERY_FS_VOLUME_INFO: - /* - * NB: The earlier CIFS spec that says this always - * uses UNICODE is incorrect ! JRA. + /* NT4 always serves this up as unicode. JRA had noted this was + * not the case in an earlier comment. What is going on? I + * tested with Win95 -> NT and a sniff definately showed + * unicode. The volume label now shows up correctly under Win95 + * with unicode here (tridge, Sep98) */ - data_len = 18 + strlen(vname); + 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)<<16) ); - SIVAL(pdata,12,strlen(vname)); - pstrcpy(pdata+18,vname); + SIVAL(pdata,12,strlen(vname)*2); + PutUniCode(pdata+18,vname); DEBUG(5,("call_trans2qfsinfo : SMB_QUERY_FS_VOLUME_INFO namelen = %d, vol = %s\n", strlen(vname), vname)); break; |