Package: autofs
Version: 4.1.4-11
Severity: important
Tags: patch

Automounting NFS directories with submounts will fail on kernels
2.6.18+ when the NFS-share is exported read-only. Autofs tries to
mkdir the submount-directory and expects EEXISTS in case of an
already existing directory, but the kernel now returns EROFS.
The attached patch fixes this problems for autofs and should be
included pre-Etch.

Regards,
  Michael


--- autofs-4.1.4/daemon/automount.c.old 2006-10-17 12:59:27.284566000 +0200
+++ autofs-4.1.4/daemon/automount.c     2006-10-17 12:58:55.978259000 +0200
@@ -93,12 +93,13 @@
                        *bp = '\0';
                        if (mkdir(buf, mode) == -1) {
                                /* If it already exists, make sure it's a 
directory */
-                               if (errno == EEXIST) {
+                               if (errno == EEXIST || errno == EROFS) {
                                        struct stat st;
 
                                        if (stat(buf, &st) == 0 && 
!S_ISDIR(st.st_mode))
                                                errno = ENOTDIR;
                                        else {
+                                               errno = EEXIST;
                                                /* last component, return -1 */
                                                if (*cp != '\0')
                                                        continue;


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (50, 'unstable')
Architecture: i386 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17.6-simigern-64bit
Locale: LANG=C, [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages autofs depends on:
ii  libc6                        2.3.6.ds1-4 GNU C Library: Shared libraries
ii  ucf                          2.0015      Update Configuration File: preserv

Versions of packages autofs recommends:
ii  nfs-common                    1:1.0.10-1 NFS support files common to client

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to