Gentoo Archives: gentoo-user

From: Alexander Skwar <listen@×××××××××××××××.name>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: [slightly OT] Automounting Windows shares with autofs
Date: Fri, 01 Jun 2007 10:54:03
Message-Id: 2242554.u5kuDpTCCU@kn.gn.rtr.message-center.info
In Reply to: Re: [gentoo-user] [slightly OT] Automounting Windows shares with autofs by Dirk Heinrichs
1 Dirk Heinrichs <dirk.heinrichs.ext@×××.com> wrote:
2
3 > Am Freitag, 1. Juni 2007 schrieb ext Dirk Heinrichs:
4
5 >> Hmm, I guess the output of your script is wrong.
6
7 Guess so as well :)
8
9 >> Put this line into the
10 >> awk part instead:
11 >>
12 >> { if (first) { print opts; first=0 }; print " \\\n\t/"$1"\t://"host"/"$1
13 >> }
14
15 Thx. This works. The difference is, that you're printing "/DEPT", while
16 I was printing just "DEPT" - IOW: you added a / before the Sharename.
17 Strange that this is required, though, because in a static map, the
18 / isn't required.
19
20 Oh, well. As long as it works ;)
21
22 > However, xxx$ shares don't work for me, which they do when entered in a
23 > static auto.windows.
24
25 Yep. If you have a close look at the syslog, you'll find:
26
27 D       ://winfs001/D
28
29 So, for some reason, it's loosing the $. Maybe add quotes? Or escape?
30 Let's see...
31
32 Yep. Escaping seems to be in order.
33
34 See http://askwar.pastebin.ca/527548 for the new version of the script.
35
36 --- post.527240 2007-06-01 04:42:37.284685294 -0600
37 +++ post.527548 2007-06-01 04:42:37.284685294 -0600
38 @@ -6,8 +6,11 @@
39
40 /usr/bin/smbclient -A "$cred_file" -L "$host" 2>/dev/null | \
41 grep Disk | \
42 + sed s/\\$/\\\\$/g | \
43 awk -v host="$host" -v opts="$opts" -- '
44 BEGIN { ORS=""; first=1 }
45 - { if (first) { print opts; first=0 }; print " \\\n\t", $1, "\t ://" host "/" $1 }
46 + { if (first) { print opts; first=0 }; print " \\\n\t /"$1" \t ://"host"/"$1 }
47 END { print "\n"; }
48 '
49 +
50 +
51
52 http://askwar.pastebin.ca/diff.php?id1=527240&id2=527548
53
54 This fails with a much better error message for me ;)
55
56 Jun 1 12:39:23 winnb000488 automount[17344]: mount(generic): failed to mount //winfs001/D$ (type smbfs) on /smb/winfs001/D$
57 Jun 1 12:39:23 winnb000488 automount[17344]: >> 17411: tree connect failed: ERRDOS - ERRnoaccess (Access denied.)
58 Jun 1 12:39:23 winnb000488 automount[17344]: >> SMB connection failed
59
60 Yep. I'm not allowed access to D$. This can very well be.
61
62 Cheers and thanks for the help!
63 Alexander Skwar
64
65 --
66 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Re: [slightly OT] Automounting Windows shares with autofs Dirk Heinrichs <dirk.heinrichs.ext@×××.com>