Bug in libsmbclient?

Derrell.Lipman at UnwiredUniverse.com Derrell.Lipman at UnwiredUniverse.com
Fri Oct 8 14:14:26 GMT 2004

Kovalyev Sergey <randoman at xfo.org.ru> writes:

> I need a bit another thing :)
> I getting filename like "%CD..." from smbc_readdir, so, I want to
> smbc_stat this name, so, if libsmbclient translates these names, I
> need to get a function which will translate '%' to an appropriate
> sequence ;)


The library does support urldecoding of paths passed to it.  Any crash caused
by a url-encoded string passed to the library is unacceptable.

I will soon be posting patches to libsmbclient which support urlencoding of
the returns from smbc_readdir() such that they may be appended to the path
provided to smbc_readdir() and then directly provided to smbc_open(),
smbc_opendir(), smbc_stat(), etc..  The option will be available to the caller
to have this urlencoding done or not.  Not doing it is the default, to provide
backward compatibility.  (You don't want it to be urlencoded if you're going
to display it to the user; you do want it urlencoded if you're going to pass
it back to an smbc_* function.)  Also available in this patch is a public
interface to the urlencode and urldecode functions.

I hope to have the patch available in a week or two.  If you would like a
"pre-release" (still being tested), let me know.  I'd actually like to know if
my patch solves your crashing problem.

Note that this patch provides a number of other features and fixes as well,
mostly pertaining to the extended attribute functions.  There will be only one
patch with all of my additions and fixes; separating them by category is not
really feasible.


More information about the samba-technical mailing list