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

disable new filename encryption (diriv) #9

Closed
diseq opened this issue Dec 9, 2015 · 5 comments
Closed

disable new filename encryption (diriv) #9

diseq opened this issue Dec 9, 2015 · 5 comments

Comments

@diseq
Copy link

diseq commented Dec 9, 2015

can you make it possible to disable the new (diriv) filename encryption for mounts (like it was before)

as far as i can tell it cannot be turned off any more. (like in mkdir)

func (fs *FS) Mkdir(relPath string, mode uint32, context *fuse.Context) (code fuse.Status) {
    if fs.isFiltered(relPath) {
        return fuse.EPERM
    }
    encPath, err := fs.getBackingPath(relPath)
    if err != nil {
        return fuse.ToStatus(err)
    }
    // The new directory may take the place of an older one that is still in the cache
    fs.CryptFS.DirIVCacheEnc.Clear()
    // Create directory
    fs.dirIVLock.Lock()
    defer fs.dirIVLock.Unlock()
    err = os.Mkdir(encPath, os.FileMode(mode))
    if err != nil {
        return fuse.ToStatus(err)
    }
    // Create gocryptfs.diriv inside
    err = cryptfs.WriteDirIV(encPath)
    if err != nil {
        // This should not happen
        cryptfs.Warn.Printf("Creating %s in dir %s failed: %v\n", cryptfs.DIRIV_FILENAME, encPath, err)
        err2 := syscall.Rmdir(encPath)
        if err2 != nil {
            cryptfs.Warn.Printf("Mkdir: Rollback failed: %v\n", err2)
        }
        return fuse.ToStatus(err)
    }
    return fuse.OK
}
@diseq diseq changed the title disable filename encryption (diriv) disable new filename encryption (diriv) Dec 9, 2015
@diseq
Copy link
Author

diseq commented Dec 9, 2015

seems to create always gocryptfs.diriv.
even with featureset diriv not set.

rfjakob added a commit that referenced this issue Dec 10, 2015
Plaintextnames support has bitrotted during the DirIV additions,
this needs test cases. Will be added in a future patch.

Fixes issue #9.
@rfjakob
Copy link
Owner

rfjakob commented Dec 10, 2015

Oh dear, I need to add testcases for -plaintextnames.

For now, does the latest change fix the issue for you?

@diseq
Copy link
Author

diseq commented Dec 10, 2015

thanks a lot. looks great!
i'll try that tomorrow.

hey. btw. greetings from vienna to vienna.

@rfjakob
Copy link
Owner

rfjakob commented Dec 10, 2015 via email

@rfjakob
Copy link
Owner

rfjakob commented Dec 11, 2015

Testcases added, this bug should be gone for good.

@rfjakob rfjakob closed this as completed Dec 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants