Skip to content
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

Excluding files/directories from directory listing does not work when using "-plaintextnames" switch #285

Closed
slackner opened this issue Dec 17, 2018 · 3 comments
Labels

Comments

@slackner
Copy link
Contributor

Steps to reproduce:

mkdir local remote
gocryptfs -init -plaintextnames -reverse local
touch local/abcd
gocryptfs -reverse -exclude abcd local remote

In this example, the file abcd should not appear in any directory listing - however, it still appears (but without being able to access it):

drwxr-xr-x 2 sebastian sebastian 4,0K Dez 17 14:48 .
drwxr-xr-x 7 sebastian sebastian 4,0K Dez 17 14:45 ..
-????????? ? ?         ?            ?            ? abcd
-r-------- 1 sebastian sebastian  366 Dez 17 14:45 gocryptfs.conf

The problem seems to be that exclude handling was never implemented in openDirPlaintextnames, which is used as shortcut when using plaintext names:

        [...]
	if rfs.args.PlaintextNames {
		return rfs.openDirPlaintextnames(cipherPath, entries)
	}
        [...]
@rfjakob rfjakob added the bug label Dec 27, 2018
@rfjakob
Copy link
Owner

rfjakob commented Jan 4, 2019

@rfjakob
Copy link
Owner

rfjakob commented Jan 4, 2019

And they are. The tests used ioutil.ReadDir, which tries to stat all files and filters out those it cannot.

rfjakob added a commit that referenced this issue Jan 4, 2019
VerifyExistence missed unstat()able files in the directory listing
because ioutil.ReadDir() filtered them out.

#285
@rfjakob rfjakob closed this as completed in 75a3e2c Jan 4, 2019
@rfjakob
Copy link
Owner

rfjakob commented Jan 4, 2019

Fixed the tests and fixed the bug, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants