All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Jurgens <autofs@edcint.co.nz>
To: Ian Kent <raven@themaw.net>
Cc: "autofs@linux.kernel.org" <autofs@linux.kernel.org>
Subject: Re: Not correctly mount SMB shares ending in $
Date: Sat, 13 Sep 2008 12:03:29 +1000	[thread overview]
Message-ID: <48CB1F71.50407@edcint.co.nz> (raw)
In-Reply-To: <1221142584.28271.15.camel@raven.themaw.net>


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

Ok, so I updated the script to the RPM version and added the 
authentication parts:

#!/bin/bash

# This file must be executable to work! chmod 755!
key="$1" # key comes is as something like a hostname eg matthew
opts="-fstype=cifs,username=$SMB_USER,password=$SMB_PASSWORD"

smbauthfile=/tmp/smbauth.tmp
cat << EOT > $smbauthfile
username=$SMB_USER
password=$SMB_PASSWORD
EOT

for P in /bin /sbin /usr/bin /usr/sbin
do
        if [ -x $P/smbclient ]
        then
                SMBCLIENT=$P/smbclient
                break
        fi
done

[ -x $SMBCLIENT ] || exit 1

$SMBCLIENT -A $smbauthfile -gL $key 2>/dev/null| awk -v key="$key" -v 
opts="$opts" -F'|' -- '
        BEGIN   { ORS=""; first=1 }
        /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 }
        '



Now its output is slightly different but the result is still the same
-fstype=cifs,username=USER,password=PASSWORD \
         "/C" "://xp0/C" \
         "/ADMIN$" "://xp0/ADMIN\$" \
         "/C$" "://xp0/C\$"

vs the older output

-fstype=cifs,username=USER,password=PASSWORD \
         /C "://xp0/C" \
         /ADMIN\$ "://xp0/ADMIN\$" \
         /C\$ "://xp0/C\$"

mount:
//xp0/C/$ on /smb/xp0/C$ type cifs (rw,mand)


>
> That doesn't look quite right.
> It might be an out of date script, how about posting the script as well
>   
>

[-- Attachment #1.2: Type: text/html, Size: 3626 bytes --]

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

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

  reply	other threads:[~2008-09-13  2:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09  4:01 Not correctly mount SMB shares ending in $ Matthew Jurgens
2008-09-10  3:49 ` Ian Kent
2008-09-11  8:34   ` Matthew Jurgens
2008-09-11 14:16     ` Ian Kent
2008-09-13  2:03       ` Matthew Jurgens [this message]
2008-09-13  3:09         ` Ian Kent
2008-09-13 12:30           ` Matthew Jurgens
2008-09-16  3:22             ` Ian Kent
2008-09-16 12:30             ` Ian Kent
2008-09-16  4:16         ` Ian Kent
2008-09-16 10:22           ` Jeff Layton
2008-09-16 12:21             ` Ian Kent
     [not found]         ` <1221539403.15861.108.camel@homebase.localnet>
2008-09-16  4:48           ` Ian Kent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48CB1F71.50407@edcint.co.nz \
    --to=autofs@edcint.co.nz \
    --cc=autofs@linux.kernel.org \
    --cc=raven@themaw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.