If a Tor users wishes to use a system Tor with a user service they may encounter problems with not being able to utilize the hidden service due to directory permissions.
An option "HiddenServiceDirGroupReadable" similar to "ControlPortFileGroupReadable" and "CookieAuthFileGroupReadable" would resolve this issue.
Trac: Username: anon
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
Some notes: check_private_dir() knows only of user privacy, not group and is used extensively to verify the permissions on hidden service directories and files.
A naive approach of changing the permissions after created/updated gets clobbered during other start-up process, and thus is not even a workable quick hack. See rend_config_services().
Things still wrong with that patch: overriding perms after call to check_private_dir(), the CPD_GROUP_READ vs. CPD_GROUP_OK not elegantness, and the way check perms only checks for need to make more restrictive, rather than set to specific desired value if not just testing.
Will provide a better patch before asking for review... once brain re-charged... nom nom brains.
This patch is now doing what it should, and the tests confirm.
It would be nice to replace other existing magic stat constants (0700, etc.) with the new defines (STAT_RWXO, etc.) however that refactoring will go in another patch...
Background: meejah and ioerror, others have issues with system Tor on Debian and Debian based distributions like Tails. The nature of this problem is that Hidden Service directories on the filesystem and hostname files themselves (but NOT private key files!)
The specific use case was to provide dissidents like Snowden a more privacy enhanced video streaming mechanism than Skype or other "trusted" third parties.
The hidden service directories and hostnames files are not group-read-able like the other options "ControlPortFileGroupReadable" and "CookieAuthFileGroupReadable" which can be used to launch and serve media, file archives, and other services via hidden service as the desktop or other user with Tor group membership.
The user only private key file behavior requires a unit test be implemented as of when this comment was written. In other words this patch is not yet ready to be merged until further tests are added.
Will the tests pass on windows? (Will they compile on windows?)
Are symbolic constants really necessary here for the STAT_* stuff? (In theory, we already have standard symbolic constants as S_IRUSR, S_IRUSR, S_IXUSR.... but, does having them really make the code cleaner? Is STAT_RWXU|STAT_RGRP|STAT_XGRP really easier to read than 0750 ?)
Our coding style is to write '} else {' on one line.
The style changes at the start of rendservice.c don't have anything to do with the rest of the patch.
The comment opening /** is only for doxygen comments.
Should HiddenServiceGroupReadable be HiddenServiceDirGroupReadable ?
check_private_dir() ensures that the directory has bits 0700 if CPD_CHECK_MODE_ONLY is not set. Shouldn't it also ensure that the directory has bits 0050 if CPD_CHECK_MODE_ONLY is not set, and CPD_GROUP_READ is set?
Does it make sense for HiddenServiceGroupReadable to be a per-hidden-service option?
The specific use case was to provide dissidents like Snowden a more privacy enhanced video streaming mechanism than Skype or other "trusted" third parties.
Another specific use case: so that would-be dissidents like Snowden can anonymously leak documents to anonymously hosted file storage infrastructure that has geographically distributed data redundancy and verified end to end crypto.
In other words: native Tor integration with Tahoe-LAFS:
Will the tests pass on windows? (Will they compile on windows?)
Does it make sense for HiddenServiceGroupReadable to be a per-hidden-service option?
I will look into making HiddenServiceDirGroupReadable a per-hidden-service option...
unless someone speaks up and explains why this should not be done.
I would like someone to help with the windows compatibility; I don't do windows.
If I understand things correctly HiddenServiceDirGroupReadable would have to change to CONFIG_TYPE_LINELIST or CONFIG_TYPE_LINELIST_S so that it can be listed more than once... that is what I got from looking at confparse.c... however I think that is only for torrc config files. For the control port interface i don't yet know...
Is the above patch + windows compatibility good enough?
I (believe I) have made the option per-hidden-service and fixed a couple minor typos. The unit-tests appear to run, and even have some plausible coverage. I didn't write a unit-test for the config-parsing logic.
On windows: there's no need to support windows with this: our other group-permission stuff doesn't do windows either. So it's okay to make test_checkdir_perms() only happen on non-Windows.
Other notes: It looks like CPD_GROUP_OK no longer does what it used to? Previously, CPD_CHECK_MODE_ONLY|CPD_GROUP_OK would complain if the permissions didn't match 0027. Now it complains if they're not in 0077. There's a similar issue with CPD_GROUP_OK without CPD_CHECK_MODE_ONLY.
The indentation in rend_config_services doesn't match the rest of Tor.
There are some misc whitespace-rules violations: 'make check-spaces' will tell you where.
Identified a couple of issues on irc, most prominent one being an error where we're always trying to change permissions on the directory if CPD_CHECK_MODE_ONLY is not set.
Last request, I hope: could the unit tests please be made to test the changes from 72030408 and b59fd2ef ? If they didn't catch this error in the first place, it would be great to make sure that they can catch it now.
David asked me to review branch ticket-11291-extra-utests. It looks good to me.
I would maybe document a bit more the mask stuff in check_private_dir() because it was not obvious to me what the mask is for and why it was not needed before: