[Samba] libsmbclient bug ?

Bogdan Harjoc bzerodi at email.ro
Sun Nov 3 16:47:01 GMT 2002


Hello, 

I've tried using libsmbclient from the 2.2.6 samba package (on a slackware 8.1,
compiled --with-libsmbclient --with-sendfile-support --enable-debug (without 
debug also) ) and it segfaults when I call smbc_stat() (or smbc_fstat() ) on a
file. I'm sorry I'm not able to find out the problem with gdb, the output (with
the library compiled with debugging enabled) is:
--------------------
Starting program: /.tmp/tst 

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) 
--------------------

The source file that causes this is:
---- tst.c ------------
#include <stdio.h>
#include <libsmbclient.h>

void auth_fn(const char *server, const char *share, char *workgroup, 
             int wgmaxlen, char *username, int unmaxlen,
             char *password, int pwmaxlen)
{
        password[0] = 0;
}

int main()
{
        struct stat stat_buf;

        if (0 > smbc_init(auth_fn, 0)) {
                perror("smbc_init()");
                return 0;
        }

        if (0 > (smbc_stat("smb://b0di/Muzica/lista", &stat_buf))) {
                perror("smbc_stat()");
                return 0;
        }

        return 0;
}
--------------------------
If there's no smb://b0di/Muzica/lista file, the call works (ENOENT). I'm using
the gcc from the distribution (gcc-2.95.3)


thanks for reading, any pointer to fixing this (or what i'm missing here) 
would be appreciated

Bogdan Harjoc


______________________________________________________________________
Do you want a free e-mail for life ? Get it at http://www.email.ro/




More information about the samba mailing list