[Samba] Strange automount problem with samba & LDAP

Yusuf TAMBAG yusuf at ceng.metu.edu.tr
Thu Dec 8 10:23:09 GMT 2005


Following code segment pasted from vfstest works when I connect 
anonymously (or root) does the automount, but when I connect as a user 
it does not work.
It wold be nice if someone could explain the difference between 
anonymous login or root login and normal login, where they don't share 
the same code. It seems to me that automount can not get right 
information when loging as a user to samba (may be a extra null 
character appended). any help will be appreciated.

-regards.
        vfs.conn = conn_new();
        string_set(&vfs.conn->user,"vfstest");
        for (i=0; i < 1024; i++)
                vfs.files[i] = NULL;
        smbd_vfs_init(vfs.conn);
        test=SMB_VFS_STAT(vfs.conn, "/home/stf4/yusuf", &mystatus);
        if (test == -1) {
                DEBUG(0,("make_connection_snum: stat unsuccessfull!\n"));
        }
        else {
                DEBUG(0,("make_connection_snum: stat successfull.\n"));
                if (S_ISDIR(st.st_mode))
                        DEBUG(0,("make_connection_snum: Directory!!\n"));
                else
                        DEBUG(0,("make_connection_snum: Not 
Directory!!\n"));
        }
        free(vfs.conn);


Yusuf TAMBAG wrote:
> Hi all,
>
> I've installed samba-3.0.21rc2 on a solaris 10 machine (latest patches 
> applied) by compiling from source:
> #uname -a
> SunOS newton 5.10 Generic_118844-20 i86pc i386 i86pc
> User's home is mounted using automount without any problem. But when I 
> try to mount using samba, it can not access the users home directory 
> when it 's share is not mounted and gives following error:
> [2005/12/05 15:49:30, 0] smbd/service.c:(690)
>  '/home/stf4/yusuf' does not exist or permission denied when 
> connecting to [yusuf] Error was No such file or directory
> I also get following message in "/var/adm/messages" when I try to 
> mount a user's samba share.
>
> Dec  5 15:49:30 newton automountd[18951]: [ID 293258 daemon.warning] 
> libsldap: Status: 7  Mesg: Session error no available conn.
> Dec  5 15:49:30 newton last message repeated 11 times
>
> Also following code segment I added to smbd/service.c does not work 
> and prints failure for both cases:
>        code=stat(conn->connectpath,mystatus);
>        if(code)
>                DEBUG(0,("stat to (%s) failed!\n",conn->connectpath));
>        else
>                DEBUG(0,("stat to (%s) suceeded.\n",conn->connectpath));
>        code=S_ISDIR(mystatus->st_mode);
>        if(!code)
>                DEBUG(0,("S_ISDIR to (%s) failed!\n",conn->connectpath));
>        else
>                DEBUG(0,("S_ISDIR to (%s) 
> suceeded.\n",conn->connectpath));
>
> The same code runs without any problem alone (mounts the user's share 
> if not mounted and returns success) and users can login and see their 
> home directories without any problem.
>
> Is samba using something else to access the filesystem other than the 
> system calls ? How can I make it to access using system calls or how 
> can I resolv the problem ?
>
> -regards.



More information about the samba mailing list