Hi,

        Now that cooker has a samba-2.0.6, could you add the following patch to
autofs-3.1.3? It just removes the parsing of smbfs-options from mount_smbfs.c,
which is done by smbmount now....


        Regards,
                Hakan

--
Hakan Tandogan                                       [EMAIL PROTECTED]

ICONSULT Tandogan - Egerer GbR                   Tel.: +49-9131-9047-0
Memelstrasse 38 - D-91052 Erlangen               Fax.: +49-9131-9047-77
diff -wbur autofs-3.1.3/modules/mount_smbfs.c autofs-3.1.3.foo/modules/mount_smbfs.c
--- autofs-3.1.3/modules/mount_smbfs.c	Tue Nov  3 22:21:14 1998
+++ autofs-3.1.3.foo/modules/mount_smbfs.c	Thu Nov 25 20:26:21 1999
@@ -42,128 +42,38 @@
   int satisfies_pwd;		/* true if this means we don't need a -n */
 };
 
-static struct smb_mount_opt mount_opt_list[] = {
-  { "nocaps",    "-C", 0, 0 },
-  { "guest",     "-n", 0, 1 },
-  { "passwd",    "-P", 1, 1 },
-  { "srvname",   "-s", 1, 0 },
-  { "mysmbname", "-c", 1, 0 },
-  { "login",     "-U", 1, 0 },
-  { "uid",       "-u", 1, 0 },
-  { "gid",       "-g", 1, 0 },
-  { "filemod",   "-f", 1, 0 },
-  { "dirmod",    "-d", 1, 0 },
-  { "port",      "-p", 1, 0 },
-  { "maxxmit",   "-m", 1, 0 },
-  { NULL, NULL, 0, 0 }
-};
-
 int mount_init(void **context)
 {
   return 0;
 }
 
-static int smb_parse_options(char *optstr, const char **argv,
-			     char *qbuf, int *qbuflen)
-{
-  char *opt;
-  int ln;
-  int argc;
-  int has_pwd;
-  int qbufchr, qln;
-  struct smb_mount_opt *mount_opt;
-
-  has_pwd = 0;
-  qbufchr = 0;
-  argc = 0;
-
-  if ( optstr ) {
-    for ( opt = strtok(optstr, ",") ; opt ; opt = strtok(NULL, ",") ) {
-      for ( mount_opt = mount_opt_list ; mount_opt->optname ; mount_opt++ ) {
-	if ( mount_opt->hasarg ) {
-	  ln = strlen(mount_opt->optname);
-	  if ( !strncmp(opt, mount_opt->optname, ln) && opt[ln] == '=' ) {
-	    qln = strlen(opt)-ln;
-	    if ( argv ) {
-	      *(argv++) = mount_opt->optflag;
-	      memcpy(qbuf, opt+ln+1, qln);
-	      *(argv++) = qbuf;
-	      qbuf += qln;
-	    }
-	    qbufchr += qln;
-	    has_pwd = has_pwd || mount_opt->satisfies_pwd;
-	    argc += 2;
-	    break;
-	  }
-	} else {
-	  if ( !strcmp(opt, mount_opt->optname) ) {
-	    if ( argv )
-	      *(argv++) = mount_opt->optflag;
-	    has_pwd = has_pwd || mount_opt->satisfies_pwd;
-	    argc++;
-	    break;
-	  }
-	}
-      }
-      /* Ignore unknown options */
-    }
-  }
-
-  if ( !has_pwd ) {
-    syslog(LOG_DEBUG, MODPREFIX "no password option, adding -n");
-    if ( argv )
-      *(argv++) = "-n";
-    argc++;
-  }
-  
-  if ( argv )
-    *argv = NULL;
-
-  if ( qbuflen )
-    *qbuflen = qbufchr;
-
-  return argc;
-}
-
 int mount_mount(const char *root, const char *name, int name_len,
 		const char *what, const char *fstype, const char *options,
 		void *context)
 {
-  char *fullpath, *optcopy;
+  char *fullpath;
   int err;
-  char *qbuf;
-  int argc, optsize, qbuflen;
+  int argc, i;
   const char **argv;
 
   fullpath = alloca(strlen(root)+name_len+2);
-  if (options)
-    optcopy  = alloca(optsize = strlen(options)+1);
-  else {
-    optsize = 0;
-    optcopy = NULL;
-  }
-  if ( !fullpath || (!optcopy && optsize)) {
-    syslog(LOG_ERR, MODPREFIX "alloca: %m");
-    return 1;
-  }
   sprintf(fullpath, "%s/%s", root, name);
 
-  if (optsize)
-    memcpy(optcopy, options, optsize);
+  syslog(LOG_DEBUG, MODPREFIX "options: '%s'", options);
 
-  argc = smb_parse_options(optcopy, NULL, NULL, &qbuflen) + 4;
+  argc = 6;
   argv = alloca(sizeof(char *) * argc);
-  qbuf = alloca(qbuflen);
-  if ( !argv || (qbuflen && !qbuf) ) {
-    syslog(LOG_ERR, MODPREFIX "alloca: %m");
-    return 1;
-  }
   argv[0] = PATH_SMBMOUNT;
   argv[1] = what;
   argv[2] = fullpath;
-  if (optsize)
-    memcpy(optcopy, options, optsize);
-  smb_parse_options(optcopy, argv+3, qbuf, NULL);
+  argv[3] = "-o";
+  argv[4] = options;
+  argv[5] = NULL;
+
+  for (i = 0; i < argc; i++)
+  {
+      syslog(LOG_DEBUG, MODPREFIX "argv[%d]: '%s'", i, argv[i]);
+  }
 
   syslog(LOG_DEBUG, MODPREFIX "calling mkdir %s", fullpath);
   if ( mkdir(fullpath, 0555) && errno != EEXIST ) {

Reply via email to