Bug 6022 - smbc_urlencode symbol missing in library
smbc_urlencode symbol missing in library
Product: Samba 3.2
Classification: Unclassified
Component: libsmbclient
x86 Mac OS X
: P3 major
: ---
Assigned To: Derrell Lipman
Samba QA Contact
Depends on:
  Show dependency treegraph
Reported: 2009-01-08 14:22 UTC by Jeremy Huddleston
Modified: 2009-01-16 19:31 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Huddleston 2009-01-08 14:22:56 UTC
$ cat test.c
#include <libsmbclient.h>

int main() {
        char *c; char *s; int l;
        return smbc_urlencode(c, s, l);

$ gcc test.c -Wall -I/opt/local/include -L/opt/local/lib/samba3
Undefined symbols:
  "_smbc_urlencode", referenced from:
      _main in ccdxnKVA.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

$ gcc test.c -Wall -I/opt/local/include -E | grep -C3 smbc_urlencode
smbc_urldecode(char *dest, char * src, size_t max_dest_len);
# 2542 "/opt/local/include/libsmbclient.h" 3
smbc_urlencode(char * dest, char * src, int max_dest_len);
# 2558 "/opt/local/include/libsmbclient.h" 3
const char *

int main() {
 char *c; char *s; int l;
 return smbc_urlencode(c, s, l);
Comment 1 Jeremy Huddleston 2009-01-08 14:26:29 UTC
This seems to have been a fallout of:

Comment 2 Derrell Lipman 2009-01-08 14:36:14 UTC
Thanks.  The bug is actually that there's still an external declaration for that symbol in libsmbclient.h.  It's not exported because since the revamp, it hasn't been a public function and has a different name now, internally.

I can solve this bug in either of two ways: remove the declaration from libsmbclient.h, or make the function public.  My preference is the former, as libsmbclient isn't intended as a utility library.  I'm willing to be convinced that there's ample use for the function that I should just export it, however.

Comment 3 Jeremy Huddleston 2009-01-08 19:35:28 UTC
I discovered this while compiling XBMC which uses smbc_urlencode() (line 267 at http://xbmc.org/trac/browser/branches/linuxport/XBMC/xbmc/FileSystem/FileSmb.cpp )

As a workaround, I just patched our samba to provide those symbols:



I think it would be less headache if you provided these symbols but marked them as deprecated, so people will see the warning during compilation
Comment 4 Derrell Lipman 2009-01-16 19:31:17 UTC
Exported in all branches