Multiple consecutive white spaces in a share gets truncated to one space.

HEMANTH THUMMALA hemanth.thummala at gmail.com
Thu Jul 18 05:47:04 MDT 2013


Hi All,

We faced a situation where in we tried to add a share(by appending to
smb.conf shares section) which is having multiple consecutive white spaces.

For ex: [share   with   spaces]

On configuration reload samba started exporting the share as [share with
spaces].

 I have figured out that after removing the following code samba started
considering extra spaces.

--- samba-3.6.12/lib/util/params.c.orig 2013-07-18 04:10:15.345361542 -0700
+++ samba-3.6.12/lib/util/params.c      2013-07-18 04:11:36.676739413 -0700
@@ -259,18 +259,9 @@ static bool Section( myFILE *InFile, boo
         break;

       default:                        /* All else are a valid name chars.
  */
-        if( isspace( c ) )              /* One space per whitespace
region. */
-          {
-          InFile->bufr[end] = ' ';
-          i = end + 1;
-          c = EatWhitespace( InFile );
-          }
-        else                            /* All others copy verbatim.
 */
-          {
           InFile->bufr[i++] = c;
           end = i;
           c = mygetc( InFile );
-          }
       }
     }


Looks like its intentional but not sure about the reason for doing so.
Whereas windows allows this case.

Thanks,
Hemanth.


More information about the samba-technical mailing list