Stef Bon wrote:
> ---------
>
> #!/bin/bash
>
> key="$1"
> opts='-fstype=smbtest,auid=$UID'
>
> SMBCLIENT=/usr/bin/smbclient
>
> [ -x $SMBCLIENT ] || exit 1
>
> # echo $key
>
> $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 }
> END { if (!first) print "\n"; else exit 1 }
> '
> --------
>
> Note:
> a. I've made this script I little bit simpler by letting it not search
> the smbclient script.
> b. the fstype is not smb but smbtest. I've created a wrapper
> mount.smbtest which will filter the parameter
> auid out. This value can be used for permissions and authentification
> c. the extra opion auid (activating user) which will be assigned when
> the automounter does the mount, not when running this script. That's why
> there are single quotes around it.
>
I would like to add that the mount will use the userid of the activating
user, but that the smbclient does a guest
lookup. It is with this construction not possible to make use of this
"activating userid" in auto.smb. In general I find it very difficult to
figure out a construction which does support mounting for every ordinary
user which:
- give enough permissions so that user one cannot access other users
mountpoint (if more than one user is logged in)
- use the activating user in the mount program as the lookup program as well
Stef Bon
_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs