summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-fs/fscrypt/files')
-rw-r--r--sys-fs/fscrypt/files/0001-Makefile-Optionally-avoid-installation-of-Ubuntu-spe.patch39
-rw-r--r--sys-fs/fscrypt/files/0001-Remove-TestLoadSourceDevice.patch44
-rw-r--r--sys-fs/fscrypt/files/fscrypt.pam-config3
3 files changed, 86 insertions, 0 deletions
diff --git a/sys-fs/fscrypt/files/0001-Makefile-Optionally-avoid-installation-of-Ubuntu-spe.patch b/sys-fs/fscrypt/files/0001-Makefile-Optionally-avoid-installation-of-Ubuntu-spe.patch
new file mode 100644
index 000000000000..f1732df62aeb
--- /dev/null
+++ b/sys-fs/fscrypt/files/0001-Makefile-Optionally-avoid-installation-of-Ubuntu-spe.patch
@@ -0,0 +1,39 @@
+From 3e08e9d634ae6fe259ba35139ef0a7bb4b7e60d8 Mon Sep 17 00:00:00 2001
+From: Florian Schmaus <flo@geekplace.eu>
+Date: Sat, 17 Apr 2021 18:19:59 +0200
+Subject: [PATCH] Makefile: Optionally avoid installation of Ubuntu-specific
+ PAM config
+
+This allows non Ubuntu distributions to opt out from the installation
+of Ubuntu-specific PAM files.
+---
+ Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 6e79421356de..307eeedc5153 100644
+--- a/Makefile
++++ b/Makefile
+@@ -28,6 +28,7 @@ PAM_NAME := pam_$(NAME)
+ # BINDIR: Where to install the fscrypt binary. Default: $(PREFIX)/bin
+ # PAM_MODULE_DIR: Where to install pam_fscrypt.so. Default: $(PREFIX)/lib/security
+ # PAM_CONFIG_DIR: Where to install Ubuntu PAM config. Default: $(PREFIX)/share/pam-configs
++# If the empty string, then the Ubuntu PAM config will not be installed.
+ #
+ # MOUNT: The filesystem where our tests are run. Default: /mnt/fscrypt_mount
+ # Ex: make test-setup MOUNT=/foo/bar
+@@ -178,9 +179,11 @@ install-pam: $(PAM_MODULE)
+ install -d $(DESTDIR)$(PAM_MODULE_DIR)
+ install $(PAM_MODULE) $(DESTDIR)$(PAM_MODULE_DIR)
+
++ifdef $(PAM_CONFIG_DIR)
+ m4 --define=PAM_INSTALL_PATH=$(PAM_INSTALL_PATH) < $(PAM_NAME)/config > $(PAM_CONFIG)
+ install -d $(DESTDIR)$(PAM_CONFIG_DIR)
+ install $(PAM_CONFIG) $(DESTDIR)$(PAM_CONFIG_DIR)/$(NAME)
++endif
+
+ COMPLETION_INSTALL_DIR := $(PREFIX)/share/bash-completion/completions
+
+--
+2.30.2
+
diff --git a/sys-fs/fscrypt/files/0001-Remove-TestLoadSourceDevice.patch b/sys-fs/fscrypt/files/0001-Remove-TestLoadSourceDevice.patch
new file mode 100644
index 000000000000..c019a080eab5
--- /dev/null
+++ b/sys-fs/fscrypt/files/0001-Remove-TestLoadSourceDevice.patch
@@ -0,0 +1,44 @@
+From 462a36e7b039d5c7e33d95237f6c697fa59775da Mon Sep 17 00:00:00 2001
+From: Florian Schmaus <flo@geekplace.eu>
+Date: Sat, 17 Apr 2021 18:15:05 +0200
+Subject: [PATCH] Remove TestLoadSourceDevice
+
+This test requires /dev/loop0, which may not always be available.
+---
+ filesystem/mountpoint_test.go | 20 --------------------
+ 1 file changed, 20 deletions(-)
+
+diff --git a/filesystem/mountpoint_test.go b/filesystem/mountpoint_test.go
+index 633ff947aaf7..9981db181a13 100644
+--- a/filesystem/mountpoint_test.go
++++ b/filesystem/mountpoint_test.go
+@@ -92,26 +92,6 @@ func TestLoadMountInfoBasic(t *testing.T) {
+ }
+ }
+
+-// Test that Mount.Device is set to the mountpoint's source device if
+-// applicable, otherwise it is set to the empty string.
+-func TestLoadSourceDevice(t *testing.T) {
+- var mountinfo = `
+-15 0 7:0 / / rw shared:1 - foo /dev/loop0 rw,data=ordered
+-31 15 0:27 / /tmp rw,nosuid,nodev shared:17 - tmpfs tmpfs rw
+-`
+- beginLoadMountInfoTest()
+- defer endLoadMountInfoTest()
+- loadMountInfoFromString(mountinfo)
+- mnt := mountForDevice("7:0")
+- if mnt.Device != "/dev/loop0" {
+- t.Error("mnt.Device wasn't set to source device")
+- }
+- mnt = mountForDevice("0:27")
+- if mnt.Device != "" {
+- t.Error("mnt.Device wasn't set to empty string for an invalid device")
+- }
+-}
+-
+ // Test that non-directory mounts are ignored.
+ func TestNondirectoryMountsIgnored(t *testing.T) {
+ beginLoadMountInfoTest()
+--
+2.30.2
+
diff --git a/sys-fs/fscrypt/files/fscrypt.pam-config b/sys-fs/fscrypt/files/fscrypt.pam-config
new file mode 100644
index 000000000000..cfcd60286401
--- /dev/null
+++ b/sys-fs/fscrypt/files/fscrypt.pam-config
@@ -0,0 +1,3 @@
+# Allow fscrypt to check your login passphrase when you create a login protector
+# See https://github.com/google/fscrypt/issues/130#issuecomment-533955949
+auth required pam_unix.so