Skip to contentSkip to conversation

Patch: Correctly escape $ in auto.smb

PATCH Jason Spashett 1 participant 1 message Jun 11, 2009 Kernel automounter

lore
Share & tools
lore
#0 lore raw

https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/385244

auto.smb does not escape the $ common in windows administrative shares. auto.smb has been changed to do this.

auto.smb 2009-06-11 15:21:47.000000000 +0100 renamed from auto.smb.orig 2009-06-11 14:18:39.000000000 +0100 +0 -0
@@ -29,7 +29,7 @@
 
 $SMBCLIENT $smbopts -gL $key 2>/dev/null| awk -v key="$key" -v 

opts="$mountopts" -F'|' -- '

     BEGIN    { ORS=""; first=1 }

- /Disk/ { if (first) { print opts; first=0 }; sub(/ /, "\\ ",
$2); print " \\\n\t /", $2, "://" key "/" $2 }
+ /Disk/ { if (first) { print opts; first=0 }; gsub(/[ $]/,
"\\\&", $2); print " \\\n\t /" $2, "://" key "/" $2 }

     END     { if (!first) print "\n"; else exit 1 }
     '