You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
912 B

  1. --- a/conf/post-install
  2. +++ b/conf/post-install
  3. @@ -566,15 +566,16 @@ test -n "$create" && {
  4. then
  5. set_permission=1
  6. fi
  7. + test -n "$recursive" && nonrecursive="" || nonrecursive="-maxdepth 0"
  8. test -n "$set_permission" && {
  9. - chown $recursive $owner $path || exit 1
  10. - test -z "$group" || chgrp $recursive $group $path || exit 1
  11. + find $path $nonrecursive ! -user $owner -exec chown $owner "{}" ";" || exit 1
  12. + test -z "$group" || find $path $nonrecursive ! -group $group -exec chgrp $group "{}" ";" || exit 1
  13. # Don't "chmod -R"; queue file status is encoded in mode bits.
  14. if [ "$type" = "d" -a -n "$recursive" ]
  15. then
  16. - find $path -type d -exec chmod $mode "{}" ";"
  17. + find $path -type d -a ! -perm $mode -exec chmod $mode "{}" ";"
  18. else
  19. - chmod $mode $path
  20. + find $path $nonrecursive ! -perm $mode -exec chmod $mode "{}" ";"
  21. fi || exit 1
  22. }
  23. done