Merge pull request #4853 from StevenHessing/noddos
[feed/packages.git] / mail / postfix / patches / 900_less_overlayfs_rewrites.patch
1 diff -Naur a/conf/post-install b/conf/post-install
2 --- a/conf/post-install 2015-12-28 00:00:45.000000000 +0000
3 +++ b/conf/post-install 2017-08-01 22:42:30.476896711 +0000
4 @@ -561,15 +561,16 @@
5 then
6 set_permission=1
7 fi
8 + test -n "$recursive" && nonrecursive="" || nonrecursive="-maxdepth 0"
9 test -n "$set_permission" && {
10 - chown $recursive $owner $path || exit 1
11 - test -z "$group" || chgrp $recursive $group $path || exit 1
12 + find $path $nonrecursive ! -user $owner -exec chown $owner "{}" ";" || exit 1
13 + test -z "$group" || find $path $nonrecursive ! -group $group -exec chgrp $group "{}" ";" || exit 1
14 # Don't "chmod -R"; queue file status is encoded in mode bits.
15 if [ "$type" = "d" -a -n "$recursive" ]
16 then
17 - find $path -type d -exec chmod $mode "{}" ";"
18 + find $path -type d -a ! -perm $mode -exec chmod $mode "{}" ";"
19 else
20 - chmod $mode $path
21 + find $path $nonrecursive ! -perm $mode -exec chmod $mode "{}" ";"
22 fi || exit 1
23 }
24 done