Author: guillomovitch
Date: Mon Feb 19 12:51:04 2007
New Revision: 122733

Added:
   
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-consistent-dquote-handling.patch
   
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-correct-expire-check.patch
   
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-correct-offset-mount-busy-check.patch
   
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-do_mkdir-return-status.patch
   
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-match-export-fqdn.patch
   
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-nsswitch-ignore-winbind.patch
   
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-proximity-local-handling.patch
   
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-task-done-race-2.patch
   
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-trailing-whitespace.patch
Modified:
   packages/cooker/autofs/current/SPECS/autofs.spec

Log:
update to latest patch level

Added: 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-consistent-dquote-handling.patch
==============================================================================
--- (empty file)
+++ 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-consistent-dquote-handling.patch
    Mon Feb 19 12:51:04 2007
@@ -0,0 +1,333 @@
+diff --git a/CHANGELOG b/CHANGELOG
+index b77c2cd..5bbf9a1 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -5,6 +5,7 @@
+ - ignore "winbind" if it appears in "automount" nsswitch.conf.
+ - fix another expire regression introduced in the "mitigate manual umount" 
patch.
+ - correct check for busy offset mounts before offset umount.
++- make double quote handing consistent.
+ 
+ 4/1/2007 autofs-5.0.1 rc3
+ -------------------------
+diff --git a/lib/parse_subs.c b/lib/parse_subs.c
+index d4ddbe4..81db459 100644
+--- a/lib/parse_subs.c
++++ b/lib/parse_subs.c
+@@ -89,6 +89,18 @@ int chunklen(const char *whence, int expect_colon)
+                               quote = 1;
+                               continue;
+                       }
++              case '"':
++                      if (quote)
++                              break;
++                      while (*str) {
++                              str++;
++                              n++;
++                              if (*str == '"')
++                                      break;
++                              if (*str == ':')
++                                      expect_colon = 0;
++                      }
++                      break;
+               case ':':
+                       if (expect_colon)
+                               expect_colon = 0;
+@@ -185,11 +197,19 @@ int span_space(const char *str, unsigned int maxlen)
+       const char *p = str;
+       unsigned int len = 0;
+ 
+-      while (!isblank(*(p++)) && len++ < maxlen) {
+-              if (*p == '\\') {
++      while (*p && !isblank(*p) && len < maxlen) {
++              if (*p == '"') {
++                      while (*p++ && len++ < maxlen) {
++                              if (*p == '"')
++                                      break;
++                      }
++              } else if (*p == '\\') {
+                       p += 2;
+                       len += 2;
++                      continue;
+               }
++              p++;
++              len++;
+       }
+       return len;
+ }
+diff --git a/modules/lookup_file.c b/modules/lookup_file.c
+index 051e5b5..0f4d8f1 100644
+--- a/modules/lookup_file.c
++++ b/modules/lookup_file.c
+@@ -41,7 +41,7 @@ typedef enum {
+ } LOOKUP_STATE;
+ 
+ typedef enum { got_nothing, got_star, got_real, got_plus } FOUND_STATE;
+-typedef enum { esc_none, esc_char, esc_val } ESCAPES;
++typedef enum { esc_none, esc_char, esc_val, esc_all } ESCAPES;
+ 
+ 
+ struct lookup_context {
+@@ -143,6 +143,8 @@ static int read_one(FILE *f, char *key, unsigned int 
*k_len, char *mapent, unsig
+                               ungetc(nch, f);
+                               escape = esc_char;
+                       }
++                      if (ch == '"')
++                              escape = esc_all;
+                       break;
+ 
+               case esc_char:
+@@ -152,6 +154,11 @@ static int read_one(FILE *f, char *key, unsigned int 
*k_len, char *mapent, unsig
+               case esc_val:
+                       escape = esc_none;
+                       break;
++
++              case esc_all:
++                      if (ch == '"')
++                              escape = esc_none;
++                      break;
+               }
+ 
+               switch (state) {
+@@ -171,6 +178,10 @@ static int read_one(FILE *f, char *key, unsigned int 
*k_len, char *mapent, unsig
+                                       *(kptr++) = ch;
+                                       key_len++;
+                               }
++                      } else if (escape == esc_all) {
++                              state = st_compare;
++                              *(kptr++) = ch;
++                              key_len++;
+                       } else if (escape == esc_char);
+                       else
+                               state = st_badent;
+@@ -181,7 +192,11 @@ static int read_one(FILE *f, char *key, unsigned int 
*k_len, char *mapent, unsig
+                               state = st_begin;
+                               if (gotten == got_plus)
+                                       goto got_it;
+-                              if (escape != esc_val)
++                              else if (escape == esc_all) {
++                                      warn(LOGOPT_ANY, MODPREFIX
++                                          "unmatched \" in map key %s", key);
++                                      goto next;
++                              } else if (escape != esc_val)
+                                       goto got_it;
+                       } else if (isspace(ch) && !escape) {
+                               getting = got_real;
+@@ -199,6 +214,10 @@ static int read_one(FILE *f, char *key, unsigned int 
*k_len, char *mapent, unsig
+                                             "length is %d", key,
+                                             KEY_MAX_LEN);
+                               } else {
++                                      if (escape == esc_val) {
++                                              *(kptr++) = '\\';
++                                              key_len++;
++                                      }
+                                       *(kptr++) = ch;
+                                       key_len++;
+                               }
+@@ -237,9 +256,12 @@ static int read_one(FILE *f, char *key, unsigned int 
*k_len, char *mapent, unsig
+                                               break;
+                                       }
+                                       p = mapent;
+-                                      *(p++) = '\\';
++                                      if (escape == esc_val) {
++                                              *(p++) = '\\';
++                                              mapent_len++;
++                                      }
+                                       *(p++) = ch;
+-                                      mapent_len = 2;
++                                      mapent_len++;
+                               } else {
+                                       p = mapent;
+                                       *(p++) = ch;
+@@ -264,6 +286,12 @@ static int read_one(FILE *f, char *key, unsigned int 
*k_len, char *mapent, unsig
+                               }
+                               ungetc(nch, f);
+                               state = st_begin;
++                              if (escape == esc_all) {
++                                      warn(LOGOPT_ANY, MODPREFIX
++                                           "unmatched \" in %s for key %s",
++                                           mapent, key);
++                                      goto next;
++                              }
+                               if (gotten == got_real || gotten == getting)
+                                       goto got_it;
+                       } else if (mapent_len < MAPENT_MAX_LEN) {
+diff --git a/modules/parse_sun.c b/modules/parse_sun.c
+index 6b2a640..0a3cac9 100644
+--- a/modules/parse_sun.c
++++ b/modules/parse_sun.c
+@@ -193,6 +193,23 @@ int expandsunent(const char *src, char *dst, const char 
*key,
+                       }
+                       break;
+ 
++              case '"':
++                      len++;
++                      if (dst)
++                              *dst++ = ch;
++
++                      while (*src && *src != '"') {
++                              len++;
++                              if (dst)
++                                      *dst++ = *src;
++                              src++;
++                      }
++                      if (*src && dst) {
++                              len++;
++                              *dst++ = *src++;
++                      }
++                      break;
++
+               case ':':
+                       if (dst)
+                               *(dst++) = 
+@@ -573,7 +590,10 @@ static int check_is_multi(const char *mapent)
+                    MODPREFIX "unexpected NULL map entry pointer");
+               return 0;
+       }
+-      
++
++      if (*p == '"')
++              p++;
++
+       /* If first character is "/" it's a multi-mount */
+       if (*p == '/')
+               return 1;
+@@ -590,6 +610,8 @@ static int check_is_multi(const char *mapent)
+                * entry.
+                */
+               if (not_first_chunk) {
++                      if (*p == '"')
++                              p++;
+                       if (*p == '/' || *p == '-') {
+                               multi = 1;
+                               break;
+@@ -749,13 +771,6 @@ static int parse_mapent(const char *ent, char *g_options, 
char **options, char *
+ 
+       debug(logopt, MODPREFIX "gathered options: %s", myoptions);
+ 
+-      /* Location can't begin with a '/' */
+-      if (*p == '/') {
+-              warn(logopt, MODPREFIX "error location begins with \"/\"");
+-              free(myoptions);
+-              return 0;
+-      }
+-
+       l = chunklen(p, check_colon(p));
+       loc = dequote(p, l, logopt);
+       if (!loc) {
+@@ -764,6 +779,13 @@ static int parse_mapent(const char *ent, char *g_options, 
char **options, char *
+               return 0;
+       }
+ 
++      /* Location can't begin with a '/' */
++      if (*p == '/') {
++              warn(logopt, MODPREFIX "error location begins with \"/\"");
++              free(myoptions);
++              return 0;
++      }
++
+       if (!validate_location(loc)) {
+               warn(logopt, MODPREFIX "invalid location");
+               free(myoptions);
+@@ -776,22 +798,22 @@ static int parse_mapent(const char *ent, char 
*g_options, char **options, char *
+       p += l;
+       p = skipspace(p);
+ 
+-      while (*p && *p != '/') {
++      while (*p && ((*p == '"' && *(p + 1) != '/') || (*p != '"' && *p != 
'/'))) {
+               char *tmp, *ent;
+ 
+-              /* Location can't begin with a '/' */
+-              if (*p == '/') {
+-                      warn(logopt,
+-                            MODPREFIX "error location begins with \"/\"");
++              l = chunklen(p, check_colon(p));
++              ent = dequote(p, l, logopt);
++              if (!ent) {
++                      warn(logopt, MODPREFIX "null location or out of 
memory");
+                       free(myoptions);
+                       free(loc);
+                       return 0;
+               }
+ 
+-              l = chunklen(p, check_colon(p));
+-              ent = dequote(p, l, logopt);
+-              if (!ent) {
+-                      warn(logopt, MODPREFIX "null location or out of 
memory");
++              /* Location can't begin with a '/' */
++              if (*p == '/') {
++                      warn(logopt,
++                            MODPREFIX "error location begins with \"/\"");
+                       free(myoptions);
+                       free(loc);
+                       return 0;
+@@ -1077,7 +1099,7 @@ int parse_mount(struct autofs_point *ap, const char 
*name,
+                       char *path, *myoptions, *loc;
+                       int status;
+ 
+-                      if (*p != '/') {
++                      if ((*p == '"' && *(p + 1) != '/') || (*p != '"' && *p 
!= '/')) {
+                               l = 0;
+                               path = dequote("/", 1, ap->logopt);
+                               debug(ap->logopt,
+@@ -1139,7 +1161,7 @@ int parse_mount(struct autofs_point *ap, const char 
*name,
+                       free(loc);
+                       free(path);
+                       free(myoptions);
+-              } while (*p == '/');
++              } while (*p == '/' || (*p == '"' && *(p + 1) == '/'));
+ 
+               /*
+                * We've got the ordered list of multi-mount entries so go
+@@ -1203,14 +1225,6 @@ int parse_mount(struct autofs_point *ap, const char 
*name,
+               int loclen;
+               int l;
+ 
+-              /* Location can't begin with a '/' */
+-              if (*p == '/') {
+-                      free(options);
+-                      warn(ap->logopt,
+-                            MODPREFIX "error location begins with \"/\"");
+-                      return 1;
+-              }
+-
+               l = chunklen(p, check_colon(p));
+               loc = dequote(p, l, ap->logopt);
+               if (!loc) {
+@@ -1219,6 +1233,14 @@ int parse_mount(struct autofs_point *ap, const char 
*name,
+                       return 1;
+               }
+ 
++              /* Location can't begin with a '/' */
++              if (*p == '/') {
++                      free(options);
++                      warn(ap->logopt,
++                            MODPREFIX "error location begins with \"/\"");
++                      return 1;
++              }
++
+               if (!validate_location(loc)) {
+                       free(loc);
+                       free(options);
+diff --git a/samples/auto.smb b/samples/auto.smb
+index d0abcd7..56e6232 100755
+--- a/samples/auto.smb
++++ b/samples/auto.smb
+@@ -20,7 +20,16 @@ done
+ 
+ $SMBCLIENT -gNL $key 2>/dev/null| awk -v key="$key" -v opts="$opts" -F'|' -- '
+       BEGIN   { ORS=""; first=1 }
+-      /Disk/  { if (first) { print opts; first=0 }; sub(/ /, "\\ ", $2); 
print " \\\n\t /" $2, "://" key "/" $2 }
++      /Disk/  {
++                if (first)
++                      print opts; first=0
++                dir = $2
++                loc = $2
++                # Enclose mount dir and location in quotes
++                # Double quote "$" in location as it is special
++                gsub(/\$$/, "\\$", loc);
++                print " \\\n\t \"/" dir "\"", "\"://" key "/" loc "\""
++              }
+       END     { if (!first) print "\n"; else exit 1 }
+       '
+ 

Added: 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-correct-expire-check.patch
==============================================================================
--- (empty file)
+++ 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-correct-expire-check.patch
  Mon Feb 19 12:51:04 2007
@@ -0,0 +1,40 @@
+diff --git a/CHANGELOG b/CHANGELOG
+index 011da35..8ca790a 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -3,6 +3,7 @@
+ - fix typo in Fix typo in var when removing temp directory.
+ - remove redundant rpath link option.
+ - ignore "winbind" if it appears in "automount" nsswitch.conf.
++- fix another expire regression introduced in the "mitigate manual umount" 
patch.
+ 
+ 4/1/2007 autofs-5.0.1 rc3
+ -------------------------
+diff --git a/daemon/direct.c b/daemon/direct.c
+index 070e614..aa1a501 100644
+--- a/daemon/direct.c
++++ b/daemon/direct.c
+@@ -930,6 +930,7 @@ void *expire_proc_direct(void *arg)
+ 
+               if (!strcmp(next->fs_type, "autofs")) {
+                       struct stat st;
++                      struct statfs fs;
+                       int ioctlfd;
+ 
+                       cache_unlock(me->mc);
+@@ -950,7 +951,14 @@ void *expire_proc_direct(void *arg)
+                               continue;
+                       }
+ 
+-                      if (tree_is_mounted(mnts, next->path, MNTS_REAL)) {
++                      if (statfs(next->path, &fs) == -1) {
++                              pthread_setcancelstate(cur_state, NULL);
++                              warn(ap->logopt,
++                                  "fstatfs failed for %s", next->path);
++                              continue;
++                      }
++
++                      if (fs.f_type != AUTOFS_SUPER_MAGIC) {
+                               pthread_setcancelstate(cur_state, NULL);
+                               continue;
+                       }

Added: 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-correct-offset-mount-busy-check.patch
==============================================================================
--- (empty file)
+++ 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-correct-offset-mount-busy-check.patch
       Mon Feb 19 12:51:04 2007
@@ -0,0 +1,25 @@
+diff --git a/CHANGELOG b/CHANGELOG
+index 8ca790a..b77c2cd 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -4,6 +4,7 @@
+ - remove redundant rpath link option.
+ - ignore "winbind" if it appears in "automount" nsswitch.conf.
+ - fix another expire regression introduced in the "mitigate manual umount" 
patch.
++- correct check for busy offset mounts before offset umount.
+ 
+ 4/1/2007 autofs-5.0.1 rc3
+ -------------------------
+diff --git a/lib/parse_subs.c b/lib/parse_subs.c
+index c98989c..d4ddbe4 100644
+--- a/lib/parse_subs.c
++++ b/lib/parse_subs.c
+@@ -454,7 +454,7 @@ int umount_multi_triggers(struct autofs_point *ap, char 
*root, struct mapent *me
+                * nonstrict mount fail.
+                */
+               oe_base = oe->key + strlen(root);
+-              left = umount_multi_triggers(ap, root, oe, oe_base);
++              left += umount_multi_triggers(ap, root, oe, oe_base);
+ 
+               if (oe->ioctlfd != -1)
+                       left++;

Added: 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-do_mkdir-return-status.patch
==============================================================================
--- (empty file)
+++ 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-do_mkdir-return-status.patch
        Mon Feb 19 12:51:04 2007
@@ -0,0 +1,49 @@
+diff --git a/CHANGELOG b/CHANGELOG
+index bdedbf5..cdf8ed2 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -9,6 +9,7 @@
+ - fix handling of trailing white space in wildcard lookup.
+ - check fqdn of each interface when matching export access list.
+ - fix race when setting task done.
++- correct return status from do_mkdir.
+ 
+ 4/1/2007 autofs-5.0.1 rc3
+ -------------------------
+diff --git a/daemon/automount.c b/daemon/automount.c
+index ae61f02..368153a 100644
+--- a/daemon/automount.c
++++ b/daemon/automount.c
+@@ -81,27 +81,23 @@ static int do_mkdir(const char *parent, const char *path, 
mode_t mode)
+       /* If path exists we're done */
+       status = stat(path, &st);
+       if (status == 0) {
+-              if (!S_ISDIR(st.st_mode)) {
++              if (!S_ISDIR(st.st_mode))
+                       errno = ENOTDIR;
+-                      return 0;
+-              }
+-              return 1;
++              errno = EEXIST;
++              return 0;
+       }
+ 
+       /*
+        * If we're trying to create a directory within an autofs fs
+-       * of the path is contained in a localy mounted fs go ahead.
++       * or the path is contained in a localy mounted fs go ahead.
+        */
+       status = -1;
+       if (*parent)
+               status = statfs(parent, &fs);
+       if ((status != -1 && fs.f_type == AUTOFS_SUPER_MAGIC) ||
+           contained_in_local_fs(path)) {
+-              if (mkdir(path, mode) == -1) {
+-                      if (errno == EEXIST)
+-                              return 1;
++              if (mkdir(path, mode) == -1)
+                       return 0;
+-              }
+               return 1;
+       }
+ 

Added: 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-match-export-fqdn.patch
==============================================================================
--- (empty file)
+++ 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-match-export-fqdn.patch 
    Mon Feb 19 12:51:04 2007
@@ -0,0 +1,179 @@
+diff --git a/CHANGELOG b/CHANGELOG
+index b435501..48b959a 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -7,6 +7,7 @@
+ - correct check for busy offset mounts before offset umount.
+ - make double quote handing consistent.
+ - fix handling of trailing white space in wildcard lookup.
++- check fqdn of each interface when matching export access list.
+ 
+ 4/1/2007 autofs-5.0.1 rc3
+ -------------------------
+diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c
+index b4e9c91..1c5f009 100644
+--- a/lib/rpc_subs.c
++++ b/lib/rpc_subs.c
+@@ -42,7 +42,8 @@
+ #include "log.h"
+ #endif
+ 
+-#define MAX_ERR_BUF   512
++#define MAX_IFC_BUF   1024
++#define MAX_ERR_BUF   128
+ 
+ static char *ypdomain = NULL;
+ 
+@@ -755,7 +756,7 @@ void rpc_exports_free(exports list)
+ 
+ static int masked_match(const char *addr, const char *mask)
+ {
+-      char buf[MAX_ERR_BUF], *ptr;
++      char buf[MAX_IFC_BUF], *ptr;
+       struct sockaddr_in saddr;
+       struct sockaddr_in6 saddr6;
+       struct ifconf ifc;
+@@ -926,42 +927,118 @@ static int pattern_match(const char *s, const char 
*pattern)
+       /* NOTREACHED */
+ }
+ 
+-static int string_match(const char *myname, const char *pattern)
++static int name_match(const char *name, const char *pattern)
+ {
+-      struct addrinfo hints, *ni;
+       int ret;
+ 
+-      memset(&hints, 0, sizeof(hints));
+-      hints.ai_flags = AI_CANONNAME;
+-      hints.ai_family = 0;
+-      hints.ai_socktype = 0;
++      if (strchr(pattern, '*') || strchr(pattern, '?'))
++              ret = pattern_match(name, pattern);
++      else {
++              ret = !memcmp(name, pattern, strlen(pattern));
++              /* Name could still be a netgroup (Solaris) */
++              if (!ret && ypdomain)
++                      ret = innetgr(pattern, name, NULL, ypdomain);
++      }
++
++      return ret;
++}
++
++static int fqdn_match(const char *pattern)
++{
++      char buf[MAX_IFC_BUF], *ptr;
++      struct ifconf ifc;
++      struct ifreq *ifr;
++      int sock, cl_flags, ret, i;
++      char fqdn[NI_MAXHOST + 1];
++
++      sock = socket(AF_INET, SOCK_DGRAM, 0);
++      if (sock < 0) {
++              char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
++              error(LOGOPT_ANY, "socket creation failed: %s", estr);
++              return 0;
++      }
++
++      if ((cl_flags = fcntl(sock, F_GETFD, 0)) != -1) {
++              cl_flags |= FD_CLOEXEC;
++              fcntl(sock, F_SETFD, cl_flags);
++      }
+ 
+-      ret = getaddrinfo(myname, NULL, &hints, &ni);
+-      if (ret) {
+-              error(LOGOPT_ANY, "name lookup failed: %s", gai_strerror(ret));
++      ifc.ifc_len = sizeof(buf);
++      ifc.ifc_req = (struct ifreq *) buf;
++      ret = ioctl(sock, SIOCGIFCONF, &ifc);
++      if (ret == -1) {
++              close(sock);
++              char *estr = strerror_r(errno, buf, MAX_ERR_BUF);
++              error(LOGOPT_ANY, "ioctl: %s", estr);
+               return 0;
+       }
+ 
+-      if (strchr(pattern, '*') || strchr(pattern, '?')) {
+-              ret = pattern_match(myname, pattern);
+-              if (!ret)
+-                      ret = pattern_match(ni->ai_canonname, pattern);
+-      } else {
+-              /* Match simple nane or FQDN */
+-              ret = !memcmp(myname, pattern, strlen(pattern));
+-              if (!ret)
+-                      ret = !memcmp(ni->ai_canonname, pattern, 
strlen(pattern));
++      i = 0;
++      ptr = (char *) &ifc.ifc_buf[0];
+ 
+-              /* Name could still be a netgroup (Solaris) */
+-              if (!ret && ypdomain) {
+-                      ret = innetgr(pattern, myname, NULL, ypdomain);
+-                      if (!ret)
+-                              ret = innetgr(pattern,
+-                                       ni->ai_canonname, NULL, ypdomain);
++      while (ptr < buf + ifc.ifc_len) {
++              ifr = (struct ifreq *) ptr;
++
++              switch (ifr->ifr_addr.sa_family) {
++              case AF_INET:
++              {
++                      socklen_t slen = sizeof(struct sockaddr);
++
++                      ret = getnameinfo(&ifr->ifr_addr, slen, fqdn,
++                                        NI_MAXHOST, NULL, 0, NI_NAMEREQD);
++                      if (!ret) {
++                              ret = name_match(fqdn, pattern);
++                              if (ret) {
++                                      close(sock);
++                                      return 1;
++                              }
++                      }
++                      break;
++              }
++
++              /* glibc rpc only understands IPv4 atm */
++              case AF_INET6:
++                      break;
++
++              default:
++                      break;
+               }
+ 
++              i++;
++              ptr = (char *) &ifc.ifc_req[i];
+       }
+-      freeaddrinfo(ni);
++
++      close(sock);
++      return 0;
++}
++
++static int string_match(const char *myname, const char *pattern)
++{
++      struct addrinfo hints, *ni;
++      int ret;
++
++      /* Try simple name match first */
++      ret = name_match(myname, pattern);
++      if (ret)
++              goto done;
++
++      memset(&hints, 0, sizeof(hints));
++      hints.ai_flags = AI_CANONNAME;
++      hints.ai_family = 0;
++      hints.ai_socktype = 0;
++
++      /* See if our canonical name matches */
++      if (getaddrinfo(myname, NULL, &hints, &ni) == 0) {
++              ret = name_match(ni->ai_canonname, pattern);
++              freeaddrinfo(ni);
++      } else
++              warn(LOGOPT_ANY, "name lookup failed: %s", gai_strerror(ret));
++      if (ret)
++              goto done;
++
++      /* Lastly see if the name of an interfaces matches */
++      ret = fqdn_match(pattern);
++done:
+       return ret;
+ }
+ 

Added: 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-nsswitch-ignore-winbind.patch
==============================================================================
--- (empty file)
+++ 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-nsswitch-ignore-winbind.patch
       Mon Feb 19 12:51:04 2007
@@ -0,0 +1,82 @@
+diff --git a/CHANGELOG b/CHANGELOG
+index b043e7e..011da35 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -2,6 +2,7 @@
+ ---------------------
+ - fix typo in Fix typo in var when removing temp directory.
+ - remove redundant rpath link option.
++- ignore "winbind" if it appears in "automount" nsswitch.conf.
+ 
+ 4/1/2007 autofs-5.0.1 rc3
+ -------------------------
+diff --git a/lib/nss_parse.y b/lib/nss_parse.y
+index bc12c73..6be243e 100644
+--- a/lib/nss_parse.y
++++ b/lib/nss_parse.y
+@@ -51,6 +51,7 @@ extern int nss_lineno;
+ extern int nss_lex(void);
+ extern FILE *nss_in;
+ 
++static int nss_ignore(const char *s);
+ static int nss_error(const char *s);
+ 
+ %}
+@@ -82,18 +83,24 @@ sources: nss_source
+ 
+ nss_source: SOURCE
+ {
+-      src = add_source(nss_list, $1);
++      if (strcmp($1, "winbind"))
++              src = add_source(nss_list, $1);
++      else
++              nss_ignore($1);
+ } | SOURCE LBRACKET status_exp_list RBRACKET
+ {
+       enum nsswitch_status a;
+ 
+-      src = add_source(nss_list, $1);
+-      for (a = 0; a < NSS_STATUS_MAX; a++) {
+-              if (act[a].action != NSS_ACTION_UNKNOWN) {
+-                      src->action[a].action = act[a].action;
+-                      src->action[a].negated = act[a].negated;
++      if (strcmp($1, "winbind")) {
++              src = add_source(nss_list, $1);
++              for (a = 0; a < NSS_STATUS_MAX; a++) {
++                      if (act[a].action != NSS_ACTION_UNKNOWN) {
++                              src->action[a].action = act[a].action;
++                              src->action[a].negated = act[a].negated;
++                      }
+               }
+-      }
++      } else
++              nss_ignore($1);
+ } | SOURCE LBRACKET status_exp_list SOURCE { nss_error($4); YYABORT; }
+   | SOURCE LBRACKET status_exp_list OTHER { nss_error($4); YYABORT; }
+   | SOURCE LBRACKET status_exp_list NL { nss_error("no closing bracket"); 
YYABORT; }
+@@ -118,6 +125,12 @@ status_exp: STATUS EQUAL ACTION
+ 
+ %%
+ 
++static int nss_ignore(const char *s)
++{
++      msg("ignored invalid nsswitch config near [ %s ]", s);
++      return(0);
++}
++
+ static int nss_error(const char *s)
+ {
+       msg("syntax error in nsswitch config near [ %s ]\n", s);
+diff --git a/lib/nss_tok.l b/lib/nss_tok.l
+index dea8203..597fc76 100644
+--- a/lib/nss_tok.l
++++ b/lib/nss_tok.l
+@@ -68,7 +68,7 @@ WS           [[:blank:]]+
+ 
+ automount     ([Aa][Uu][Tt][Oo][Mm][Oo][Uu][Nn][Tt])
+ 
+-source                files|yp|nis|nisplus|ldap|hesiod
++source                files|yp|nis|nisplus|ldap|hesiod|winbind
+ 
+ success               ([Ss][Uu][Cc][Cc][Ee][Ss][Ss])
+ notfound      ([Nn][Oo][Tt][Ff][Oo][Uu][Nn][Dd])

Added: 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-proximity-local-handling.patch
==============================================================================
--- (empty file)
+++ 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-proximity-local-handling.patch
      Mon Feb 19 12:51:04 2007
@@ -0,0 +1,181 @@
+diff --git a/CHANGELOG b/CHANGELOG
+index cdf8ed2..bf37533 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -10,6 +10,7 @@
+ - check fqdn of each interface when matching export access list.
+ - fix race when setting task done.
+ - correct return status from do_mkdir.
++- fix localhost replicated mounts not working.
+ 
+ 4/1/2007 autofs-5.0.1 rc3
+ -------------------------
+diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c
+index e859284..4063e9a 100644
+--- a/modules/mount_nfs.c
++++ b/modules/mount_nfs.c
+@@ -60,6 +60,7 @@ int mount_mount(struct autofs_point *ap, const char *root, 
const char *name, int
+ {
+       char *fullpath, buf[MAX_ERR_BUF];
+       struct host *this, *hosts = NULL;
++      unsigned int save_ghost = ap->ghost;
+       unsigned int vers;
+       char *nfsoptions = NULL;
+       int len, rlen, status, err, existed = 1;
+@@ -183,19 +184,35 @@ int mount_mount(struct autofs_point *ap, const char 
*root, const char *name, int
+       if (!status)
+               existed = 0;
+ 
++      /*
++       * We need to stop the bind mount module from removing the
++       * mount point directory if a bind attempt fails so abuse
++       * the ap->ghost field for this.
++       */
++      ap->ghost = 1;
++
+       this = hosts;
+       while (this) {
+-              char *loc;
++              char *loc, *port_opt = NULL;
+ 
+               if (is_mounted(_PATH_MOUNTED, fullpath, MNTS_REAL)) {
+                       error(ap->logopt,
+                             MODPREFIX
+                             "warning: %s is already mounted", fullpath);
+-                      free_host_list(&hosts);
+                       break;
+               }
+ 
+-              if (this->proximity == PROXIMITY_LOCAL) {
++              /*
++               * If the "port" option is specified, then we don't want
++               * a bind mount. Use the "port" option if you want to
++               * avoid attempting a local bind mount, such as when
++               * tunneling NFS via localhost.
++               */
++              if (nfsoptions && *nfsoptions)
++                      port_opt = strstr(nfsoptions, "port=");
++
++              /* Port option specified, don't try to bind */
++              if (!port_opt && this->proximity == PROXIMITY_LOCAL) {
+                       /* Local host -- do a "bind" */
+                       const char *bind_options = ro ? "ro" : "";
+ 
+@@ -210,11 +227,15 @@ int mount_mount(struct autofs_point *ap, const char 
*root, const char *name, int
+                       /* Success - we're done */
+                       if (!err) {
+                               free_host_list(&hosts);
++                              ap->ghost = save_ghost;
+                               return 0;
+                       }
+ 
+-                      this = this->next;
+-                      continue;
++                      /* No hostname, can't be NFS */
++                      if (!this->name) {
++                              this = this->next;
++                              continue;
++                      }
+               }
+ 
+               /* Not a local host - do an NFS mount */
+@@ -244,6 +265,7 @@ int mount_mount(struct autofs_point *ap, const char *root, 
const char *name, int
+                       msg(MODPREFIX "mounted %s on %s", loc, fullpath);
+                       free(loc);
+                       free_host_list(&hosts);
++                      ap->ghost = save_ghost;
+                       return 0;
+               }
+ 
+@@ -252,6 +274,7 @@ int mount_mount(struct autofs_point *ap, const char *root, 
const char *name, int
+       }
+ 
+       free_host_list(&hosts);
++      ap->ghost = save_ghost;
+ 
+       /* If we get here we've failed to complete the mount */
+ 
+diff --git a/modules/replicated.c b/modules/replicated.c
+index 46ea36b..cb65d82 100644
+--- a/modules/replicated.c
++++ b/modules/replicated.c
+@@ -652,12 +652,28 @@ int prune_host_list(struct host **list, unsigned int 
vers, const char *options)
+       /* Use closest hosts to choose NFS version */
+ 
+       first = *list;
++
++      /* Get proximity of first entry after local entries */
+       this = first;
+-      proximity = this->proximity;
++      while (this && this->proximity == PROXIMITY_LOCAL)
++              this = this->next;
++
++      proximity = PROXIMITY_LOCAL;
++      if (this)
++              proximity = this->proximity;
+ 
+-      while (this && this->proximity == proximity) {
++      this = first;
++      while (this) {
+               struct host *next = this->next;
+ 
++              if (this->proximity == PROXIMITY_LOCAL) {
++                      this = next;
++                      continue;
++              }
++
++              if (this->proximity != proximity)
++                      break;
++
+               if (this->name) {
+                       status = get_vers_and_cost(this, vers, options);
+                       if (!status) {
+@@ -674,6 +690,7 @@ int prune_host_list(struct host **list, unsigned int vers, 
const char *options)
+ 
+       last = this;
+ 
++      /* If there are only local entries on the list, just return it. */
+       if (!first)
+               return 0;
+ 
+@@ -722,15 +739,12 @@ int prune_host_list(struct host **list, unsigned int 
vers, const char *options)
+       else if (max_count == v2_udp_count)
+               selected_version = NFS2_UDP_SUPPORTED;
+ 
+-      if (!selected_version)
+-              return 0;
+-
+-      /* Add hosts with selected version to new list */
+-
+-      this = first;
++      /* Add local and hosts with selected version to new list */
++      this = *list;
+       do {
+               struct host *next = this->next;
+-              if (this->version & selected_version) {
++              if (this->version & selected_version ||
++                  this->proximity == PROXIMITY_LOCAL) {
+                       this->version = selected_version;
+                       remove_host(list, this);
+                       add_host(&new, this);
+@@ -740,16 +754,17 @@ int prune_host_list(struct host **list, unsigned int 
vers, const char *options)
+ 
+       /*
+        * Now go through rest of list and check for chosen version
+-       * and add to new list if supported.
++       * and add to new list if selected version is supported.
+        */ 
+ 
+       first = last;
+       this = first;
+       while (this) {
+               struct host *next = this->next;
+-              if (!this->name)
++              if (!this->name) {
++                      remove_host(list, this);
+                       add_host(&new, this);
+-              else {
++              } else {
+                       status = get_supported_ver_and_cost(this, 
selected_version, options);
+                       if (status) {
+                               this->version = selected_version;

Added: 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-task-done-race-2.patch
==============================================================================
--- (empty file)
+++ 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-task-done-race-2.patch  
    Mon Feb 19 12:51:04 2007
@@ -0,0 +1,114 @@
+diff --git a/CHANGELOG b/CHANGELOG
+index 48b959a..bdedbf5 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -8,6 +8,7 @@
+ - make double quote handing consistent.
+ - fix handling of trailing white space in wildcard lookup.
+ - check fqdn of each interface when matching export access list.
++- fix race when setting task done.
+ 
+ 4/1/2007 autofs-5.0.1 rc3
+ -------------------------
+diff --git a/daemon/state.c b/daemon/state.c
+index d5eca8b..2fa78aa 100644
+--- a/daemon/state.c
++++ b/daemon/state.c
+@@ -190,10 +190,10 @@ void expire_cleanup(void *arg)
+       if (next != ST_INVAL)
+               nextstate(statefd, next);
+ 
+-      state_mutex_unlock(ap);
+-
+       st_set_done(ap);
+ 
++      state_mutex_unlock(ap);
++
+       return;
+ }
+ 
+@@ -326,11 +326,10 @@ static void do_readmap_cleanup(void *arg)
+       state_mutex_lock(ap);
+ 
+       nextstate(ap->state_pipe[1], ST_READY);
++      st_set_done(ap);
+ 
+       state_mutex_unlock(ap);
+ 
+-      st_set_done(ap);
+-
+       if (!ap->submount)
+               alarm_add(ap, ap->exp_runfreq);
+ 
+@@ -480,10 +479,6 @@ static unsigned int st_readmap(struct autofs_point *ap)
+       assert(ap->state == ST_READY);
+       assert(ap->readmap_thread == 0);
+ 
+-      /* Turn off timeouts for this mountpoint */
+-      if (!ap->submount)
+-              alarm_delete(ap);
+-
+       ap->state = ST_READMAP;
+ 
+       ra = malloc(sizeof(struct readmap_args));
+@@ -549,10 +544,6 @@ static unsigned int st_prepare_shutdown(struct 
autofs_point *ap)
+ 
+       debug(ap->logopt, "state %d path %s", ap->state, ap->path);
+ 
+-      /* Turn off timeouts for this mountpoint */
+-      if (!ap->submount)
+-              alarm_delete(ap);
+-
+       assert(ap->state == ST_READY || ap->state == ST_EXPIRE);
+       ap->state = ST_SHUTDOWN_PENDING;
+ 
+@@ -579,10 +570,6 @@ static unsigned int st_force_shutdown(struct autofs_point 
*ap)
+ 
+       debug(ap->logopt, "state %d path %s", ap->state, ap->path);
+ 
+-      /* Turn off timeouts for this mountpoint */
+-      if (!ap->submount)
+-              alarm_delete(ap);
+-
+       assert(ap->state == ST_READY || ap->state == ST_EXPIRE);
+       ap->state = ST_SHUTDOWN_FORCE;
+ 
+@@ -610,10 +597,6 @@ static unsigned int st_prune(struct autofs_point *ap)
+       assert(ap->state == ST_READY);
+       ap->state = ST_PRUNE;
+ 
+-      /* Turn off timeouts while we prune */
+-      if (!ap->submount)
+-              alarm_delete(ap);
+-
+       switch (expire_proc(ap, 1)) {
+       case EXP_ERROR:
+       case EXP_PARTIAL:
+@@ -635,10 +618,6 @@ static unsigned int st_expire(struct autofs_point *ap)
+       assert(ap->state == ST_READY);
+       ap->state = ST_EXPIRE;
+ 
+-      /* Turn off timeouts while we expire */
+-      if (!ap->submount)
+-              alarm_delete(ap);
+-
+       switch (expire_proc(ap, 0)) {
+       case EXP_ERROR:
+       case EXP_PARTIAL:
+@@ -723,7 +702,7 @@ int st_add_task(struct autofs_point *ap, enum states state)
+               empty = 0;
+ 
+               /* Don't add duplicate tasks */
+-              if (task->state == state ||
++              if ((task->state == state && !task->done) ||
+                  (ap_state == ST_SHUTDOWN_PENDING ||
+                   ap_state == ST_SHUTDOWN_FORCE))
+                       break;
+@@ -888,6 +867,7 @@ static void st_set_thid(struct autofs_point *ap, pthread_t 
thid)
+       return;
+ }
+ 
++/* Requires state mutex to be held */
+ static void st_set_done(struct autofs_point *ap)
+ {
+       struct list_head *p, *head;

Added: 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-trailing-whitespace.patch
==============================================================================
--- (empty file)
+++ 
packages/cooker/autofs/current/SOURCES/autofs-5.0.1-rc3-trailing-whitespace.patch
   Mon Feb 19 12:51:04 2007
@@ -0,0 +1,79 @@
+diff --git a/CHANGELOG b/CHANGELOG
+index 5bbf9a1..b435501 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -6,6 +6,7 @@
+ - fix another expire regression introduced in the "mitigate manual umount" 
patch.
+ - correct check for busy offset mounts before offset umount.
+ - make double quote handing consistent.
++- fix handling of trailing white space in wildcard lookup.
+ 
+ 4/1/2007 autofs-5.0.1 rc3
+ -------------------------
+diff --git a/lib/parse_subs.c b/lib/parse_subs.c
+index 81db459..bdb19cd 100644
+--- a/lib/parse_subs.c
++++ b/lib/parse_subs.c
+@@ -157,10 +157,22 @@ char *dequote(const char *str, int origlen, unsigned int 
logopt)
+       const char *scp;
+       int len = origlen;
+       int quote = 0, dquote = 0;
++      int i, j;
+ 
+       if (ret == NULL)
+               return NULL;
+ 
++      /* first thing to do is strip white space from the end */
++      i = len - 1;
++      while (isspace(str[i])) {
++              /* of course, we have to keep escaped white-space */
++              j = i - 1;
++              if (j > 0 && (str[j] == '\\' || str[j] == '"'))
++                      break;
++              i--;
++              len--;
++      }
++
+       for (scp = str; len > 0 && *scp; scp++, len--) {
+               if (!quote) {
+                       if (*scp == '"') {
+diff --git a/modules/parse_sun.c b/modules/parse_sun.c
+index 0a3cac9..7020902 100644
+--- a/modules/parse_sun.c
++++ b/modules/parse_sun.c
+@@ -135,9 +135,32 @@ int expandsunent(const char *src, char *dst, const char 
*key,
+               switch (ch) {
+               case '&':
+                       l = strlen(key);
+-                      if (dst) {
+-                              strcpy(dst, key);
+-                              dst += l;
++                      /*
++                       * In order to ensure that any spaces in the key
++                       * re preserved, we need to escape them here.
++                       */
++                      if (strchr(key, ' ')) {
++                              char *keyp = key;
++                              while (*keyp) {
++                                      if (isspace(*keyp)) {
++                                              if (dst) {
++                                                      *dst++ = '\\';
++                                                      *dst++ = *keyp++;
++                                              } else
++                                                      keyp++;
++                                              l++;
++                                      } else {
++                                              if (dst)
++                                                      *dst++ = *keyp++;
++                                              else
++                                                      keyp++;
++                                      }
++                              }
++                      } else {
++                              if (dst) {
++                                      strcpy(dst, key);
++                                      dst += l;
++                              }
+                       }
+                       len += l;
+                       break;

Modified: packages/cooker/autofs/current/SPECS/autofs.spec
==============================================================================
--- packages/cooker/autofs/current/SPECS/autofs.spec    (original)
+++ packages/cooker/autofs/current/SPECS/autofs.spec    Mon Feb 19 12:51:04 2007
@@ -1,7 +1,7 @@
 %define name    autofs
 %define version 5.0.1
 %define beta    rc3
-%define release %mkrel 0.%{beta}.1
+%define release %mkrel 0.%{beta}.2
 
 Name:           %{name}
 Version:        %{version}
@@ -20,6 +20,15 @@
 Patch200:       autofs-5.0.1-rc1-fix-hesiod-check.patch
 Patch201:       autofs-5.0.1-rc3-fix-typo-rmdir-temp.patch
 Patch202:       autofs-5.0.1-rc3-remove-rpath-link-option.patch
+Patch203:       autofs-5.0.1-rc3-nsswitch-ignore-winbind.patch
+Patch204:       autofs-5.0.1-rc3-correct-expire-check.patch
+Patch205:       autofs-5.0.1-rc3-correct-offset-mount-busy-check.patch
+Patch206:       autofs-5.0.1-rc3-consistent-dquote-handling.patch
+Patch207:       autofs-5.0.1-rc3-trailing-whitespace.patch
+Patch208:       autofs-5.0.1-rc3-match-export-fqdn.patch
+Patch209:       autofs-5.0.1-rc3-task-done-race-2.patch
+Patch210:       autofs-5.0.1-rc3-do_mkdir-return-status.patch
+Patch211:       autofs-5.0.1-rc3-proximity-local-handling.patch
 Requires:       nfs-utils-clients
 Requires:       kernel >= 2.6.17
 Requires(post): rpm-helper
@@ -45,6 +54,15 @@
 %patch200 -p 1
 %patch201 -p 1
 %patch202 -p 1
+%patch203 -p 1
+%patch204 -p 1
+%patch205 -p 1
+%patch206 -p 1
+%patch207 -p 1
+%patch208 -p 1
+%patch209 -p 1
+%patch210 -p 1
+%patch211 -p 1
 
 %build
 autoconf-2.5x

Reply via email to