Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 727038 - app-crypt/fscrypt - Go tool for managing Linux filesystem encryption
Summary: app-crypt/fscrypt - Go tool for managing Linux filesystem encryption
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Default Assignee for New Packages
URL: https://github.com/google/fscrypt
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-04 05:07 UTC by David Heidelberg (okias)
Modified: 2021-06-21 19:11 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Heidelberg (okias) 2020-06-04 05:07:43 UTC
Since systemd offers as one option to use fscrypt and also e4crypt is pretty basic, would be great to have this package.

Reproducible: Always
Comment 1 Shiba 2020-07-26 15:36:07 UTC
I made a very quick attempt in my wip overlay: https://gitlab.com/Shibotto/shibotto-overlay/-/tree/master/sys-fs/fscrypt
I thought it fitted better in sys-fs/ since it's a tool for a filesystem feature, but that's just my idea.

The LICENSE field is most likely incomplete (can't get dev-util/golicense to work) and I haven't tested pam_fscrypt.so.

For Gentoo developers: the test suite also seem to work, however at least TestLoadSourceDevice requires /dev/loop* (kernel loop module, if not built-in) to pass.
Comment 2 Peter Levine 2020-10-09 03:40:03 UTC
(In reply to Shiba from comment #1)
> I made a very quick attempt in my wip overlay:
> https://gitlab.com/Shibotto/shibotto-overlay/-/tree/master/sys-fs/fscrypt
> I thought it fitted better in sys-fs/ since it's a tool for a filesystem
> feature, but that's just my idea.
> 
> The LICENSE field is most likely incomplete (can't get dev-util/golicense to
> work) and I haven't tested pam_fscrypt.so.
> 
> For Gentoo developers: the test suite also seem to work, however at least
> TestLoadSourceDevice requires /dev/loop* (kernel loop module, if not
> built-in) to pass.

The Gentoo installation directory for PAM modules appears to be /lib/security, not /usr/lib/security.  Consider changing the emake command to:

emake DESTDIR="${D}" PREFIX="/usr" install-bin
emake DESTDIR="${D}" PREFIX= install-pam

Also, I ran into https://github.com/google/fscrypt/issues/130.  Arch installs https://aur.archlinux.org/cgit/aur.git/plain/pam_config?h=fscrypt-git as /etc/pam.d/fscrypt and that works to fix it for me.
Comment 3 Peter Levine 2020-10-09 18:36:21 UTC
(In reply to Peter Levine from comment #2)
> (In reply to Shiba from comment #1)
> > I made a very quick attempt in my wip overlay:
> > https://gitlab.com/Shibotto/shibotto-overlay/-/tree/master/sys-fs/fscrypt
> > I thought it fitted better in sys-fs/ since it's a tool for a filesystem
> > feature, but that's just my idea.
> > 
> > The LICENSE field is most likely incomplete (can't get dev-util/golicense to
> > work) and I haven't tested pam_fscrypt.so.
> > 
> > For Gentoo developers: the test suite also seem to work, however at least
> > TestLoadSourceDevice requires /dev/loop* (kernel loop module, if not
> > built-in) to pass.
> 
> The Gentoo installation directory for PAM modules appears to be
> /lib/security, not /usr/lib/security.  Consider changing the emake command
> to:
> 
> emake DESTDIR="${D}" PREFIX="/usr" install-bin
> emake DESTDIR="${D}" PREFIX= install-pam


Actually, it is looking for pam_fscrypt.so in /lib64/security.  It suffices just to add "multilib" to "inherit" and change the emake command to:

emake DESTDIR="${D}" PREFIX="/usr" PAM_MODULE_DIR="/$(get_libdir)/security" install
Comment 4 Shiba 2020-10-11 16:39:00 UTC
(In reply to Peter Levine from comment #2)
> The Gentoo installation directory for PAM modules appears to be
> /lib/security, not /usr/lib/security.
>
> Also, I ran into https://github.com/google/fscrypt/issues/130.  Arch
> installs
> https://aur.archlinux.org/cgit/aur.git/plain/pam_config?h=fscrypt-git as
> /etc/pam.d/fscrypt and that works to fix it for me.

Thanks for spotting this. I'm not using the PAM module nor a login protector, so when I saw it compiled I called it a day :^)
Both problems should be fixed in -r1
Comment 5 Paul Gover 2021-02-08 12:51:57 UTC
Some feedback, if anyone's interested.

I copied the ebuild and tried building fscrypt.  Failed, as I didn't have dev-lang/go installed.  That should be a build-time dependency.  It's not a runtime dependency though.

I created a stand-alone encrypted subdirectory of /mnt, much as in the fscrypt documentation, that worked OK.

As I wanted to use my pam-login to decrypt my home folder on login, I thought I needed to do all the pam.d changes in the Arch documentation at
  https://wiki.archlinux.org/index.php/Fscrypt#PAM_module
as well as the pam.d/fscrypt file.  (Arch seems to have cloned the Gentoo pam.d setup.)

It all works OK.  Further, I changed my login password using "passwd" in a KDE kterminal window, and after a reboot I could sign in with the new password and everything was correctly decrypted.  The reboot was because of problem with KDE.  Logging out from KDE leaves loads of files open, so fscrypt can't lock them.  This is IMHO a nasty KDE bug.
I'll put some more usability comments on my forum thread
  https://forums.gentoo.org/viewtopic-t-1129287-highlight-.html

Hope that's of use.
Comment 6 Shiba 2021-02-10 21:47:53 UTC
(In reply to Paul Gover from comment #5)
> I copied the ebuild and tried building fscrypt.  Failed, as I didn't have
> dev-lang/go installed.  That should be a build-time dependency.  It's not a
> runtime dependency though.

The inherited go-module ecalss should take care of that (BDEPEND=">=dev-lang/go-1.12"), does it not?
Comment 7 Paul Gover 2021-02-11 12:17:26 UTC
My apologies, go seems to be required.  I must have done something else wrong!
Comment 8 Larry the Git Cow gentoo-dev 2021-04-17 20:00:27 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=a3bd18b395df6a8e18ee4725b282b965c820cb44

commit a3bd18b395df6a8e18ee4725b282b965c820cb44
Author:     Florian Schmaus <flo@geekplace.eu>
AuthorDate: 2021-04-17 17:58:05 +0000
Commit:     Florian Schmaus <flo@geekplace.eu>
CommitDate: 2021-04-17 17:58:05 +0000

    sys-fs/fscrypt: initial import
    
    Bug: https://bugs.gentoo.org/727038
    Signed-off-by: Florian Schmaus <flo@geekplace.eu>

 sys-fs/fscrypt/Manifest                            | 45 +++++++++++
 ...tionally-avoid-installation-of-Ubuntu-spe.patch | 37 +++++++++
 .../files/0001-Remove-TestLoadSourceDevice.patch   | 44 +++++++++++
 sys-fs/fscrypt/files/fscrypt.pam-config            |  3 +
 sys-fs/fscrypt/fscrypt-0.3.0.ebuild                | 92 ++++++++++++++++++++++
 sys-fs/fscrypt/metadata.xml                        |  8 ++
 6 files changed, 229 insertions(+)
Comment 9 Larry the Git Cow gentoo-dev 2021-06-21 19:11:52 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad48503f5edbfb90110590e4dace5d3f6e2d159c

commit ad48503f5edbfb90110590e4dace5d3f6e2d159c
Author:     Florian Schmaus <flow@gentoo.org>
AuthorDate: 2021-06-21 19:07:49 +0000
Commit:     Florian Schmaus <flow@gentoo.org>
CommitDate: 2021-06-21 19:11:42 +0000

    sys-fs/fscrypt: initial import
    
    Closes: https://bugs.gentoo.org/727038
    Signed-off-by: Florian Schmaus <flow@gentoo.org>

 sys-fs/fscrypt/Manifest                            | 45 ++++++++++
 ...tionally-avoid-installation-of-Ubuntu-spe.patch | 39 +++++++++
 .../files/0001-Remove-TestLoadSourceDevice.patch   | 44 ++++++++++
 sys-fs/fscrypt/files/fscrypt.pam-config            |  3 +
 sys-fs/fscrypt/fscrypt-0.3.0-r1.ebuild             | 98 ++++++++++++++++++++++
 sys-fs/fscrypt/metadata.xml                        | 15 ++++
 6 files changed, 244 insertions(+)