summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-09-23 01:25:33 +0000
committerAndrew Tridgell <tridge@samba.org>1998-09-23 01:25:33 +0000
commit3b7cee95ac741ee24b8edd36095cc30e3377a23c (patch)
treeb30be8eab5caf0ec26d5a459e5bed3eb94201a51 /source3/smbd/trans2.c
parent242d068297b79af46c00a94d0e737c79e908a498 (diff)
downloadsamba-3b7cee95ac741ee24b8edd36095cc30e3377a23c.tar.gz
samba-3b7cee95ac741ee24b8edd36095cc30e3377a23c.tar.bz2
samba-3b7cee95ac741ee24b8edd36095cc30e3377a23c.zip
look at the CAP_NT_SMBS bit in the client capabilities to determine if
we should serve up volume labels as ascii or unicode. NT wants ascii, W95 wants unicode. It's a crazy protocol! (This used to be commit 24b8a757ae2899d54dd2b2f091a3c0de6de84dbb)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 5c8c64a63c..fe44965674 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1069,7 +1069,8 @@ static int call_trans2qfsinfo(connection_struct *conn,
char *vname = volume_label(SNUM(conn));
int snum = SNUM(conn);
char *fstype = lp_fstype(SNUM(conn));
-
+ extern uint32 global_client_caps;
+
DEBUG(3,("call_trans2qfsinfo: level = %d\n", info_level));
if(dos_stat(".",&st)!=0) {
@@ -1131,24 +1132,28 @@ static int call_trans2qfsinfo(connection_struct *conn,
break;
case SMB_QUERY_FS_VOLUME_INFO:
- /* 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 + 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)*2);
- PutUniCode(pdata+18,vname);
- DEBUG(5,("call_trans2qfsinfo : SMB_QUERY_FS_VOLUME_INFO namelen = %d, vol = %s\n", strlen(vname),
- vname));
+ SIVAL(pdata,8,str_checksum(lp_servicename(snum)) ^
+ (str_checksum(local_machine)<<16));
+
+ /* NT4 always serves this up as unicode but expects it to be
+ * delivered as ascii! (tridge && JRA)
+ */
+ if (global_client_caps & CAP_NT_SMBS) {
+ data_len = 18 + strlen(vname);
+ SIVAL(pdata,12,strlen(vname));
+ pstrcpy(pdata+18,vname);
+ } else {
+ data_len = 18 + 2*strlen(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;
case SMB_QUERY_FS_SIZE_INFO:
{