added disabling of archive bit mapping
[feisty_meow.git] / scripts / site_avenger / revamp_cakelampvm.sh
index fba7bb60bbb257e76ddecb6db13a1fad9a3b4186..96daae907e2dd4b753ed65f4bdca2d25ad735aa3 100644 (file)
@@ -243,12 +243,21 @@ sep
 pattern="[#;][[:blank:]]*read only = yes"
 replacement="read only = no"
 
-# we just always do the replacement now, after realizing the sentinel pattern
-# was actually already in the file...  too much subtlety can get one into trouble.
+# we just always do the replacement now rather than making it conditional,
+# after realizing the sentinel pattern was actually already in the file...
+# too much subtlety can get one into trouble.
 sed -i "0,/$pattern/{s/$pattern/$replacement/}" /etc/samba/smb.conf
 test_or_die "patching samba configuration to enable write acccess on user home dirs"
 echo successfully patched the samba configuration to enable writes on user home directories. 
 
+# add in a disabling of the archive bit mapping feature, which hoses up the execute bit
+# in an attempt to save the sad old DOS archive bit across the samba connection.
+grep -q "map archive" /etc/samba/smb.conf
+# if the phrase wasn't found, we need to add it.
+if [ $? -ne 0 ]; then
+  sed -i "/\[global\]/[global]\n\nmap archive = no" /etc/samba/smb.conf
+fi
+
 # sweet, looks like that worked...
 restart_samba