Bug 6022 - smbc_urlencode symbol missing in library
Summary: smbc_urlencode symbol missing in library
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.2
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: 3.2.7
Hardware: x86 Mac OS X
: P3 major
Target Milestone: ---
Assignee: Derrell Lipman
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-08 14:22 UTC by Jeremy Huddleston
Modified: 2009-01-16 19:31 UTC (History)
0 users

See Also:


Attachments

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
-lsmbclient
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
int
smbc_urlencode(char * dest, char * src, int max_dest_len);
# 2558 "/opt/local/include/libsmbclient.h" 3
const char *
smbc_version(void);
--

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:

http://gitweb.samba.org/?p=samba.git;a=commit;h=59292c0da8880afd7bac82f6a5bba009f3827ea0
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.

Derrell
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:

http://trac.macports.org/browser/trunk/dports/net/samba3/files/urlencode.compat.patch

http://trac.macports.org/browser/trunk/dports/net/samba3/files/urlencode.compat.patch?format=txt

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