mirror of
https://github.com/YunoHost-Apps/dokuwiki_ynh.git
synced 2024-09-03 18:26:20 +02:00
[fix] Call xargs with sudo for chmod instead of the reverse
It allows to prevent the number of arguments and environment variables passed to chmod - which often fails with the error: "Argument list too long". See: http://unix.stackexchange.com/a/72822
This commit is contained in:
parent
e43a26b954
commit
41d5a04184
2 changed files with 4 additions and 4 deletions
|
@ -49,8 +49,8 @@ sudo cp ../conf/dokuwiki.php $final_path/conf
|
||||||
sudo cp ../conf/acl.auth.php $final_path/conf
|
sudo cp ../conf/acl.auth.php $final_path/conf
|
||||||
|
|
||||||
# Files owned by root, www-data can just read
|
# Files owned by root, www-data can just read
|
||||||
sudo find $final_path -type f | xargs sudo chmod 0644
|
sudo find $final_path -type f -print0 | sudo xargs -0 chmod 0644
|
||||||
sudo find $final_path -type d | xargs sudo chmod 0755
|
sudo find $final_path -type d -print0 | sudo xargs -0 chmod 0755
|
||||||
sudo chown -R root: $final_path
|
sudo chown -R root: $final_path
|
||||||
|
|
||||||
# except for conf, data, some data subfolders, and lib/plugin, where www-data must have write permissions
|
# except for conf, data, some data subfolders, and lib/plugin, where www-data must have write permissions
|
||||||
|
|
|
@ -53,8 +53,8 @@ sudo touch $final_path/doku.php
|
||||||
grep -Ev '^($|#)' ../sources/data/deleted.files | xargs -I {} sudo rm -vrf $final_path/{}
|
grep -Ev '^($|#)' ../sources/data/deleted.files | xargs -I {} sudo rm -vrf $final_path/{}
|
||||||
|
|
||||||
# Files owned by root, www-data can just read
|
# Files owned by root, www-data can just read
|
||||||
sudo find $final_path -type f | xargs sudo chmod 0644
|
sudo find $final_path -type f -print0 | sudo xargs -0 chmod 0644
|
||||||
sudo find $final_path -type d | xargs sudo chmod 755
|
sudo find $final_path -type d -print0 | sudo xargs -0 chmod 0755
|
||||||
sudo chown -R root: $final_path
|
sudo chown -R root: $final_path
|
||||||
|
|
||||||
# except for conf, data, some data subfolders, and lib/plugin, where www-data must have write permissions
|
# except for conf, data, some data subfolders, and lib/plugin, where www-data must have write permissions
|
||||||
|
|
Loading…
Add table
Reference in a new issue