From 805749baab4e79fbdb9897f22b2c801d9dd9efc2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 10 Oct 1997 01:32:26 +0000 Subject: nmblookup.c: Added -A ability to do status on ip address. smb.h: Added defines we will need for NT SMB calls. trans2.c: Fixed SMB_QUERY_FILE_ALT_NAME_INFO return - this is only for short name returns (and only used when you negotiate NT SMB calls to boot !). Jeremy (jallison@whistle.com) (This used to be commit 53915bd160eda8c099482ddcef74d1d7606e752b) --- source3/smbd/trans2.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'source3/smbd/trans2.c') diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 092a069a6e..a56df9cb9c 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1181,12 +1181,32 @@ static int call_trans2qfilepathinfo(char *inbuf, char *outbuf, int length, data_size = 4; break; - case SMB_QUERY_FILE_NAME_INFO: + /* Get the 8.3 name - used if NT SMB was negotiated. */ case SMB_QUERY_FILE_ALT_NAME_INFO: + { + pstring short_name; + pstrcpy(short_name,fname); + /* Mangle if not already 8.3 */ + if(!is_8_3(short_name, True)) + { + if(!name_map_mangle(short_name,True,SNUM(cnum))) + *short_name = '\0'; + } + strncpy(pdata + 4,short_name,12); + (pdata + 4)[12] = 0; + strupper(pdata + 4); + l = strlen(pdata + 4); + data_size = 4 + l; + SIVAL(pdata,0,l); + } + break; + + case SMB_QUERY_FILE_NAME_INFO: data_size = 4 + l; SIVAL(pdata,0,l); pstrcpy(pdata+4,fname); break; + case SMB_QUERY_FILE_ALLOCATION_INFO: case SMB_QUERY_FILE_END_OF_FILEINFO: data_size = 8; -- cgit