Skip to content

Commit 201bb4a

Browse files
committed
1 parent 6577c9e commit 201bb4a

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

samba-timemachine/TimeMachine.quota.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>GlobalQuota</key>
5+
<key>GlobalQuota</key>
66
<integer>REPLACE_TM_SIZE</integer>
7-
</dict>
7+
</dict>
88
</plist>

samba-timemachine/entrypoint

+5-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ configureQuota()
4141
echo "Setting quote to ${QUOTA}MB"
4242
QUOTA=$((QUOTA * 1048576))
4343
sed "s%REPLACE_TM_SIZE%${QUOTA}%" /etc/TimeMachine.quota.tmpl > "${BACKUPDIR}"/.com.apple.TimeMachine.quota.plist
44+
chown root:root "${BACKUPDIR}"/.com.apple.TimeMachine.quota.plist
45+
chmod 444 "${BACKUPDIR}"/.com.apple.TimeMachine.quota.plist
4446
}
47+
4548
backupConfig()
4649
{
4750
echo "Marking ${BACKUPDIR} as supported by timemmachine"
@@ -50,7 +53,7 @@ backupConfig()
5053
echo "Changing ownership of ${BACKUPDIR} to ${PUID}:${PGID}, this may take a few minutes"
5154
chown -R "${PUID}":"${PGID}" "${BACKUPDIR}"
5255

53-
echo "Restricting permssions on ${BACKUPDIR}, this may take a few minutes"
56+
echo "Restricting permissions on ${BACKUPDIR}, this may take a few minutes"
5457
chmod -R u+rwX,g=,o= "${BACKUPDIR}"
5558
}
5659

@@ -67,8 +70,8 @@ if [[ -z ${1} ]] || [[ ${1:0:1} == '-' ]] ; then
6770
checkBackupDir
6871
setPassword
6972
createUser
70-
configureQuota
7173
backupConfig
74+
configureQuota
7275
startSMB "$@"
7376
else
7477
exec "$@"

samba-timemachine/spec/samba-timemachine/samba-timemachine_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ def compose
5353
describe file('/backups/.com.apple.TimeMachine.quota.plist') do
5454
it { should exist }
5555
it { should be_file }
56-
it { should be_mode 600 }
57-
it { should be_owned_by 'timemachine' }
58-
it { should be_grouped_into 'timemachine' }
56+
it { should be_mode 444 }
57+
it { should be_owned_by 'root' }
58+
it { should be_grouped_into 'root' }
5959
its(:content) { is_expected.to match('524288000000') }
6060
end
6161

0 commit comments

Comments
 (0)