fix typo.
[vuplus_openvuplus] / meta-openvuplus / recipes-base / autofs / autofs-4.1.4 / 080_auto_smb_probe_credentials.patch
1 #!/bin/sh /usr/share/dpatch/dpatch-run
2 ## 080_auto_smb_probe_credentials.dpatch
3 ##
4 ## DP: No description.
5
6 @DPATCH@
7
8 diff -Naur .B/samples/auto.smb .A/samples/auto.smb
9 --- .B/samples/auto.smb 2007-01-07 21:36:36.000000000 +0000
10 +++ .A/samples/auto.smb 2007-01-07 21:36:37.000000000 +0000
11 @@ -5,7 +5,9 @@
12  # This file must be executable to work! chmod 755!
13  
14  key="$1"
15 -opts="-fstype=cifs"
16 +mountopts="-fstype=cifs"
17 +smbopts=""
18 +credfile="/etc/auto.smb.$key"
19  
20  for P in /bin /sbin /usr/bin /usr/sbin
21  do
22 @@ -18,7 +20,14 @@
23  
24  [ -x $SMBCLIENT ] || exit 1
25  
26 -$SMBCLIENT -gNL $key 2>/dev/null| awk -v key="$key" -v opts="$opts" -F'|' -- '
27 +if [ -e $credfile ]; then
28 +       mountopts="$mountopts,credentials=$credfile"
29 +       smbopts="-A $credfile"
30 +else
31 +       smbopts="-N"
32 +fi
33
34 +$SMBCLIENT $smbopts -gL $key 2>/dev/null| awk -v key="$key" -v opts="$mountopts" -F'|' -- '
35         BEGIN   { ORS=""; first=1 }
36         /Disk/  { if (first) { print opts; first=0 }; sub(/ /, "\\ ", $2); print " \\\n\t /" $2, "://" key "/" $2 }
37         END     { if (!first) print "\n"; else exit 1 }