google / fscrypt

Go tool for managing Linux filesystem encryption
Apache License 2.0
886 stars 99 forks source link

Provide better error message when given a locked regular file #396

Closed ebiggers closed 10 months ago

ebiggers commented 10 months ago

Since opening an encrypted regular file that is locked fails with ENOKEY, getting the encryption policy of such a file is not possible. As a result, 'fscrypt status' and 'fscrypt lock' fail on such files. Provide a better error message that tries to explain what is going on.

Resolves https://github.com/google/fscrypt/issues/393