-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds world readable attribute to files created by Pi-hole to circumve… #2730
Conversation
pi-hole#2724 Signed-off-by: pvogt09 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most files should be 644, so can you change the chmod
calls to set the permissions to 644?
Signed-off-by: pvogt09 <[email protected]>
Can instances where a file is copied and assigned permissions be replaced with |
…files after checkout and pull Signed-off-by: pvogt09 <[email protected]>
Line 2261 of the installer should set the permissions There's also an issue where some web interface folders don't give |
Signed-off-by: pvogt09 <[email protected]>
According to this answer, it would be possible with:
What happens if the $webroot variable is changed to something (e.g. depending on the outcome of #2692, if anything remains in |
The You should be able to do
And then the Once we replace the PHP web interface, there will be no files necessary for the web interface. It is embedded in the API's binary. |
Signed-off-by: pvogt09 <[email protected]>
Signed-off-by: pvogt09 <[email protected]>
Tested this again. The |
Signed-off-by: pvogt09 <[email protected]>
Is |
Signed-off-by: pvogt09 <[email protected]>
Here's a directory listing from a fresh install:
Here, the list file ( Line 330 in 54ae9d8
|
Signed-off-by: pvogt09 <[email protected]>
Signed-off-by: pvogt09 <[email protected]>
The |
The |
Signed-off-by: pvogt09 <[email protected]>
What is the correct place for user creation? I would assume def test_FTL_detect_armv6l_no_errors(Pihole):
'''
confirms only armv6l package is downloaded for FTL engine
'''
# mock uname to return armv6l platform
mock_command('uname', {'-m': ('armv6l', '0')}, Pihole)
# mock ldd to respond with aarch64 shared library
mock_command('ldd', {'/bin/ls': ('/lib/ld-linux-armhf.so.3', '0')}, Pihole)
detectPlatform = Pihole.run('''
source /opt/pihole/basic-install.sh
create_pihole_user
FTLdetect
''')
expected_stdout = info_box + ' FTL Checks...'
assert expected_stdout in detectPlatform.stdout
expected_stdout = tick_box + (' Detected ARM-hf architecture '
'(armv6 or lower)')
assert expected_stdout in detectPlatform.stdout
expected_stdout = tick_box + ' Downloading and Installing FTL'
assert expected_stdout in detectPlatform.stdout to pass, because the user still does not exist in this case for the test case. |
The user should be added right before the FTL install in |
…function Signed-off-by: pvogt09 <[email protected]>
Signed-off-by: pvogt09 <[email protected]>
Thanks for sticking with this PR! |
You're welcome. Can I close #2724 or is it still needed? |
I will mark it as fixed. |
* add test for file permissions of $webroot Signed-off-by: pvogt09 <[email protected]> * changes sudo to su for running command as user www-data Signed-off-by: pvogt09 <[email protected]> * installs PIHOLE_WEB_DEPS to create LIGHTTPD_USER Signed-off-by: pvogt09 <[email protected]> * changes stdout to rc Signed-off-by: pvogt09 <[email protected]> * use installPihole instead of installPiholeWeb in test Signed-off-by: pvogt09 <[email protected]> * try installation process with main Signed-off-by: pvogt09 <[email protected]> * mock systemctl Signed-off-by: pvogt09 <[email protected]> * removes stickler errors Signed-off-by: pvogt09 <[email protected]> * start lighttpd and make webpage test optional Signed-off-by: pvogt09 <[email protected]> * test all files and directories in $webroot Signed-off-by: pvogt09 <[email protected]> * fix stickler and codefactor warnings Signed-off-by: pvogt09 <[email protected]> * set permission for /var/cache if it did not exist before Signed-off-by: pvogt09 <[email protected]> * add test case for pihole files Signed-off-by: pvogt09 <[email protected]> * fix stickler errors Signed-off-by: pvogt09 <[email protected]> * revert "set permission for /var/cache if it did not exist before" and make lighttpd start work Signed-off-by: pvogt09 <[email protected]> * add --add-cap=NET_ADMIN to enable FTL start Signed-off-by: pvogt09 <[email protected]> * specify DNS server for cURL Signed-off-by: pvogt09 <[email protected]> * check files created by FTL Signed-off-by: pvogt09 <[email protected]> * reorder code and change nameserver in /etc/resolv.conf Signed-off-by: pvogt09 <[email protected]> * resolve with dig instead of relying on /etc/resolv.conf Signed-off-by: pvogt09 <[email protected]> * set IP to 127.0.0.1 in setupVars.conf for blockpage tests Signed-off-by: pvogt09 <[email protected]> * resolve domain with dig and remove debug output Signed-off-by: pvogt09 <[email protected]> * fix stickler errors Signed-off-by: pvogt09 <[email protected]> * no git pull in Github Action runs for pull requests Signed-off-by: pvogt09 <[email protected]> * --cap-add=ALL test Signed-off-by: pvogt09 <[email protected]> * fix stickler errors Signed-off-by: pvogt09 <[email protected]> * remove debug code Signed-off-by: pvogt09 <[email protected]> * update_repo patch for CentOS 7 in Github Actions Signed-off-by: pvogt09 <[email protected]> * removes TODOs and stickler warnings Signed-off-by: pvogt09 <[email protected]> * adds trailing slash to domain Signed-off-by: pvogt09 <[email protected]> * use only first result from dig Signed-off-by: pvogt09 <[email protected]> * domain name resolution does not work reliably in docker container Signed-off-by: pvogt09 <[email protected]> * repair executable permission Signed-off-by: pvogt09 <[email protected]> * Create mock_command_passthrough that allows intercepting of specific arguments - everything else is passed through to the proper command. Use this new command instead of making changes in basic-install.sh to make the tests pass. Signed-off-by: Adam Warner <[email protected]> Co-authored-by: Adam Warner <[email protected]>
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-ftl-v5-12-web-v5-9-and-core-v5-7-released/51795/1 |
…nt #2724
Signed-off-by: pvogt09 [email protected]
By submitting this pull request, I confirm the following:
git rebase
)Please make sure you Sign Off all commits. Pi-hole enforces the DCO.
What does this PR aim to accomplish?:
This PR should partially fix #2724 by setting most of the files that Pi-hole creates during install or update are made world readable explicitly instead of relying on the umask being set to something that results in world readable files/directories.
/etc/pihole/setupVars.conf
permissions have to be set in a different place, because there is notouch
orecho >
for this file./usr/local/share/man/man{5, 8}
correct for all distributions?How does this PR accomplish the above?:
chmod a+r ...
is added to make files world readable and files are copied with-p
option to keep file permissions (especially for backups).What documentation changes (if any) are needed to support this PR?:
None.