summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJim McDonough <jmcd@samba.org>2004-09-27 17:07:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:49 -0500
commit2d5bf9ec40dbae68ced924604e180f6669b80670 (patch)
treed16d9a960228243decfabc469948e2a9f4243345 /source3
parentcc146adb2635daa4625ec00fc1c2e4ae757e72f9 (diff)
downloadsamba-2d5bf9ec40dbae68ced924604e180f6669b80670.tar.gz
samba-2d5bf9ec40dbae68ced924604e180f6669b80670.tar.bz2
samba-2d5bf9ec40dbae68ced924604e180f6669b80670.zip
r2697: Fix for bugzilla #1732, patch by Satoh Fumiyasu, fumiya@samba.gr.jp
Limit share names returned by RAP based on windows character width, not unix character width. (This used to be commit 5d57058d912a42d55879352e904f0bcaa6531075)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/lanman.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index dd9708356e..524c982998 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -1501,10 +1501,12 @@ static BOOL api_RNetShareEnum( connection_struct *conn,
if (!check_share_info(uLevel,str2)) return False;
data_len = fixed_len = string_len = 0;
- for (i=0;i<count;i++)
+ for (i=0;i<count;i++) {
+ fstring servicename_dos;
+ push_ascii_fstring(servicename_dos, lp_servicename(i));
if( lp_browseable( i )
&& lp_snum_ok( i )
- && (strlen( lp_servicename( i ) ) < 13) ) /* Maximum name length. */
+ && (strlen(servicename_dos) < 13) ) /* Maximum name length. */
{
total++;
data_len += fill_share_info(conn,i,uLevel,0,&f_len,0,&s_len,0);
@@ -1517,6 +1519,7 @@ static BOOL api_RNetShareEnum( connection_struct *conn,
else
missed = True;
}
+ }
*rdata_len = fixed_len + string_len;
*rdata = REALLOC(*rdata,*rdata_len);
memset(*rdata,0,*rdata_len);
@@ -1527,9 +1530,11 @@ static BOOL api_RNetShareEnum( connection_struct *conn,
s_len = string_len;
for( i = 0; i < count; i++ )
{
+ fstring servicename_dos;
+ push_ascii_fstring(servicename_dos, lp_servicename(i));
if( lp_browseable( i )
&& lp_snum_ok( i )
- && (strlen( lp_servicename( i ) ) < 13) )
+ && (strlen(servicename_dos) < 13) )
{
if( fill_share_info( conn,i,uLevel,&p,&f_len,&p2,&s_len,*rdata ) < 0 )
break;