All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug#279561: smbfs multimount broken
@ 2004-11-03 19:16 Arthur Korn
  0 siblings, 0 replies; only message in thread
From: Arthur Korn @ 2004-11-03 19:16 UTC (permalink / raw)
  To: submit


[-- Attachment #1.1: Type: text/plain, Size: 3285 bytes --]

Package: autofs
Version: 4.1.3-4
Severity: minor
Tags: patch

You should file all bugs to the BTS, since else I have to ... or
I'll most probably forget about it.

Maybe it could be changed to detect double slashes "//"? This
would be compatible with the old behaviour (which is as SUN does
I suppose), but admittedly limited to SMBfs.

ciao, 2ri

----- Forwarded message from Elmar Pruesse <elmar@pruesse.net> -----

Date: Wed, 03 Nov 2004 16:51:08 +0100
To: arthur@debian.org
From: Elmar Pruesse <elmar@pruesse.net>
Subject: debian, autofs 4.1.3-4, smbfs multimount broken, patch

hi Arthur,

I hope you don't mind me mailing you directly instead of fileing a bug 
report, etc.

The the code in parse_sun.c that "tokenizes" multimount lines got broken 
when the possibilty to use server names containing whitespace was added. 
It assumes that whitespace followed by a "/" indicates a new mountpoint. 
Since smbfs mounts also start with a "/", this makes it impossible to 
use smbfs in multimounts. (Escaping doesn't work either, tried that).

I propose (patch attached) changing the syntax of multimount smbfs 
mountpoints to match those of ordinary smbfs mounts.

Ordninary smbfsmount:
/mysmbmount -fstype=smbfs ://smbserver/dir

Multimount in version three:
/multimount -fstype=smbfs /one //smbserver/one /two //smbserver/two

Proposed syntax:
/multimount -fstype=smbfs /one ://smbserver/one /two ://smbserver/two


It's the shortest patch I could come up with. The syntax change is 
minimal, resolves an inconsistency and the way it used to work is broken 
anyway.

In case anyone is interested I also attached a modified version of the 
auto.net example which uses smblclient instead of showmount and can be 
used to dynamically access public smb shares.

By the way: Is there any reason, apart from noone having written it, why 
 there is no support for ghosting from program maps?

regards,
Elmar

diff -rNu autofs-4.1.3.orig/modules/parse_sun.c autofs-4.1.3/modules/parse_sun.c
--- autofs-4.1.3.orig/modules/parse_sun.c	2004-10-03 17:43:57.000000000 +0200
+++ autofs-4.1.3/modules/parse_sun.c	2004-10-03 17:38:50.000000000 +0200
@@ -618,7 +618,7 @@
 {
 	struct parse_context *ctxt = (struct parse_context *) context;
 	char *pmapent, *options;
-	const char *p, *q;
+	const char *p, *q, *r;
 	int mapent_len, rv;
 	int optlen;
 
@@ -716,9 +716,12 @@
 			while (*q && *q != '/') {
 				l = chunklen(q, 1);
 				q += l;
+				r = q;
 				q = skipspace(q);
 			}
-			l = q - p;
+			if (*p == ':') 
+			  	p++;	/* Sun escape for entries starting with / */
+			l = r - p;
 
 			loc = dequote(p, l);
 			loclen = strlen(loc);

#!/bin/sh

key="$1"
opts="-fstype=smbfs"

for SMBCLIENT in /{,usr/}{,s}bin/smbclient; do [ -x $SMBCLIENT ] && break; done
[ -x $SMBCLIENT ] || exit 1

$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 }; print " \\\n\t /" $2, "://" key "/" $2 }
	END 	{ if (!first) print "\n"; else exit 1 }
	'


----- End forwarded message -----

-- 
Secure email, spread GPG, clearsign all mail. http://www.gnupg.org
.
I didn't know it was impossible when I did it.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-11-03 19:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-03 19:16 Bug#279561: smbfs multimount broken Arthur Korn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.