Package: libpam-mount
Version: 2.5-3
Severity: important
Tags: upstream patch

Hi,

After migrating to squeeze I've been having difficulties with
libpam-mount. One of them is that it fails to detect the already mounted
cifs setups, so the cifs entries get mounted on each authentication.

Tracking the problem I found that the newer the mount.cifs adds a trailing /
to the device part in /etc/mtab and /proc/mounts. So, what use to be
//samba/share now becomes //samba/share/. Which makes the check made by
libpam-mount to fail.

So, I made a quick fix in libpam-mount, that removes the trailing slash
whenever its processing the mtab and mounts lines.

Which is something like this:

--- libpam-mount-2.5/src/mtab.c 2010-09-14 13:29:21.000000000 -0300
+++ libpam-mount-2.5.remove_trailing_slash/src/mtab.c   2010-09-14 
12:58:23.000000000 -0300
@@ -222,6 +222,8 @@
                        ;
                for (p = q; !HX_isspace(*p) && *p != '\0'; ++p)
                        ;
+               /* newer mount.cifs adds a hanging '/' at the end, messing up 
with the check */
+               if ((i == 0) && (p > line+1) && (*(p-1) == '/')) *(p-1) = '\0';
                *p++ = '\0';
                field[i] = mt_unescape(q);
        }

Thanks,

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing-proposed-updates
  APT policy: (500, 'testing-proposed-updates'), (500, 'proposed-updates'), 
(500, 'testing'), (500, 'stable')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=es_AR.UTF-8, LC_CTYPE=es_AR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libpam-mount depends on:
ii  libc6                       2.11.2-2     Embedded GNU C Library: Shared lib
ii  libcryptsetup1              2:1.1.3-3    libcryptsetup shared library
ii  libhx25                     3.5-2        A library providing queue, tree, I
ii  libpam-runtime              1.1.1-4      Runtime support for the PAM librar
ii  libpam0g                    1.1.1-4      Pluggable Authentication Modules l
ii  libssl0.9.8                 0.9.8o-2     SSL shared libraries
ii  libxml2                     2.7.7.dfsg-4 GNOME XML library
ii  mount                       2.17.2-3.1   Tools for mounting and manipulatin

libpam-mount recommends no packages.

Versions of packages libpam-mount suggests:
pn  davfs2                     <none>        (no description available)
ii  fuse-utils                 2.8.1-1.2     Filesystem in USErspace (utilities
ii  lsof                       4.81.dfsg.1-1 List open files
pn  ncpfs                      <none>        (no description available)
ii  openssl                    0.9.8o-2      Secure Socket Layer (SSL) binary a
ii  psmisc                     22.11-1       utilities that use the proc file s
ii  smbfs                      2:4.5-2       Common Internet File System utilit
ii  sshfs                      2.2-1         filesystem client based on SSH Fil
pn  tc-utils                   <none>        (no description available)
pn  xfsprogs                   <none>        (no description available)

-- Configuration Files:
/etc/pam.d/common-pammount changed [not included]
/etc/security/pam_mount.conf.xml changed [not included]

-- debconf information excluded
--- libpam-mount-2.5/src/mtab.c	2010-09-14 13:29:21.000000000 -0300
+++ libpam-mount-2.5.remove_trailing_slash/src/mtab.c	2010-09-14 12:58:23.000000000 -0300
@@ -222,6 +222,8 @@
 			;
 		for (p = q; !HX_isspace(*p) && *p != '\0'; ++p)
 			;
+		/* newer mount.cifs adds a hanging '/' at the end, messing up with the check */
+		if ((i == 0) && (p > line+1) && (*(p-1) == '/')) *(p-1) = '\0';
 		*p++ = '\0';
 		field[i] = mt_unescape(q);
 	}

Reply via email to