From 0429ffb00a3f48ad1a6cb987d483609fe76c1a97 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Tue, 20 Mar 2018 16:58:11 -0400 Subject: [PATCH] added disabling of archive bit mapping samba will try to stuff the archive bit from dos into the unix execute bit, in a poorly chosen default option for the archive mapping feature. this turns that feature off again. --- scripts/site_avenger/revamp_cakelampvm.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/scripts/site_avenger/revamp_cakelampvm.sh b/scripts/site_avenger/revamp_cakelampvm.sh index fba7bb60..96daae90 100644 --- a/scripts/site_avenger/revamp_cakelampvm.sh +++ b/scripts/site_avenger/revamp_cakelampvm.sh @@ -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 -- 2.34.1