# Samba CIFS mounting problems while using nss_ldap [SOLVED]

## casso

Hi,

I seem to have the strangest error. When I mount a Samba share using CIFS and I use LDAP in my nsswitch.conf file, I get problems with pointers and no record of the mount. However, the filesystem does actually mount, so I would say that it is not being recorded in /etc/mtab or /proc/mounts.

When using file in nsswitch.conf, all mounting works just fine.

I upgraded samba, but that didn't help. I upgraded glibc and now it gives me a nice dump of data, rather than glibc detected free invalid pointer ...

I really do need these to function together without failing. I intend to use pam_mount to have roaming profiles for Linux (ie: each users home directory is stored on the server). I do not want to switch to NFS, so please don't suggest it.

If this really is a bug, let me know and I will post a bug report, but I thought I would ask here first.

Thanks,

Michael Cassaniti

----------

## jmbsvicetto

Hi.

I'll be interested in knowing if you can put it to work. That's something I'm interested in.

----------

## casso

I must elaborate. The problem has nothing at all to do with pam_mount at present. It is entirely due to LDAP being used to get POSIX user/group information. Whenever this information is being gained from LDAP, the mount itself is sucessful (the mount worked), but mount.cifs fails with problems about pointers. I really, really need to resolve this issue. If NSS only uses files, the mount is sucessful all the way.

If you use the serverino option when mounting the CIFS share (I did this manually), then you can get Linux Roaming Profiles. So yes, I can get the profiles to move between computers, but I can't get them at present to automatically mount when the user logs into either xdm/gdm/kdm or through the terminal. This is because pam_mount fails since the mount itself is failing.

Again, the problem has nothing at all to do with pam_mount at present. It is entirely due to LDAP being used to get POSIX user/group information when attempting a CIFS mount.

----------

## jmbsvicetto

Have you tried using SMBFS instead of CIFS? Does it work? Do you have any reason for needing CIFS?

----------

## casso

I haven't tried smbfs lately, I don't have it compiled into my kernel. I will try it for comparison purposes, but I do want to stick to CIFS.

CIFS allows me to have true POSIX file permissions. If I mount the share with smbfs, I will not be able to sucessfully work with POSIX file permissions. If I am truly wrong and the share will have properly emulated POSIX file permissions even after I unmount the share and remount it, then please let me know.

I am running KDE as my desktop, so KDE will need to access all the features of any other POSIX filesystem such as symlinks, hardlinks, correct inode numbers and proper file permissions.

The inodes are important. This is why it is necessary to use the serverino option when mounting the share by hand. If this option is not specified, KDE will fail loads of locks on files and simply be a nightmare.

Again the issue is not with pam_mount, it is with CIFS and using LDAP to store the user/group info. CIFS works just fine when the share is mounted with NSS configured to use files.

Thanks for the help so far. I appreciate all comments and suggestions (except NFS).

Michael Cassaniti

----------

## jmbsvicetto

Please open a bug in Bugzilla. Please include your error, any logs you might have and emerge --info.

----------

## casso

After a long time having this issue, I have found some possible solutions, but they are not consistent. I found that when mounting CIFS and having NSS_LDAP in use, that mounts would fail with invalid pointers, but would still be listed in /proc/mounts. I also found that on some clients using Name Service Cache Daemon would resolve the issue, and sometimes it wouldn't. I think this may be dependent on the use flags I have chosen. I can give any details about software versions and use flags needed. I just don't understand how something that works fine on one system can fail on another.

I also have issues using portage over CIFS. It is causing issues on one client with locking, but on another client using the same mount options and identical NSS_LDAP NSCD setups, it works just fine. At present this client requires a replica of the portage tree to install any packages.

----------

## casso

Hi,

I just noticed my old post while going through some email.

I am still using CIFS on my network, with NSS_LDAP to distribute user/group information. Using Name Service Cache Daemon has resolved my issues when it comes to authentication. I believe my LDAP servers are underpowered too.

Portage had a bug when using CIFS. The CIFS implementation returns an access denied (IO Error 13) when an exclusive lock is still open by another process and the current process attempts to gain an exclusive lock to the same file. According to the Open Group standards for lockf, portage should check for both an EAGAIN or EACCES exception, but was originally only checking for EAGAIN. This was what caused locking issues for me when multiple clients were accessing portage and locking the portage DB. I believe portage has since been fixed. This bug report should help explain what went wrong.

Don't ask me what managed to fix the free/invalid pointer problems I was getting. Thread is now resolved.

----------

