diff -Nru ecryptfs-utils-111/debian/changelog ecryptfs-utils-111/debian/changelog --- ecryptfs-utils-111/debian/changelog 2016-09-13 09:34:34.000000000 +0000 +++ ecryptfs-utils-111/debian/changelog 2017-09-25 17:31:22.000000000 +0000 @@ -1,3 +1,13 @@ +ecryptfs-utils (111-0ubuntu5) artful; urgency=medium + + [ Alberto Pianon ] + * debian/patches/swapfile-support.patch: Fix swapfile support. (LP: #1670336) + - src/utils/ecryptfs-setup-swap: revise script for a world with swapfiles. + - src/utils/ecryptfs-setup-swap: make sure we can restart ecryptfs with + systemd. + + -- Mathieu Trudel-Lapierre Mon, 25 Sep 2017 13:31:22 -0400 + ecryptfs-utils (111-0ubuntu4) yakkety; urgency=medium * Drop the hard-coded libnss3-1d dependency. diff -Nru ecryptfs-utils-111/debian/patches/series ecryptfs-utils-111/debian/patches/series --- ecryptfs-utils-111/debian/patches/series 2016-07-14 23:48:31.000000000 +0000 +++ ecryptfs-utils-111/debian/patches/series 2017-09-25 17:31:22.000000000 +0000 @@ -1 +1,2 @@ CVE-2016-6224.patch +swapfile-support.patch diff -Nru ecryptfs-utils-111/debian/patches/swapfile-support.patch ecryptfs-utils-111/debian/patches/swapfile-support.patch --- ecryptfs-utils-111/debian/patches/swapfile-support.patch 1970-01-01 00:00:00.000000000 +0000 +++ ecryptfs-utils-111/debian/patches/swapfile-support.patch 2017-09-25 17:31:22.000000000 +0000 @@ -0,0 +1,40 @@ +From: Alberto Pianon +Subject: Fix to make the script work with swapfiles and to use the right script to start encrypted swap +Bug-Ubuntu: https://launchpad.net/bugs/1670336 +Last-Update: 2017-09-25 + +--- ecryptfs-utils-111.orig/src/utils/ecryptfs-setup-swap ++++ ecryptfs-utils-111/src/utils/ecryptfs-setup-swap +@@ -150,7 +150,7 @@ for swap in $swaps; do + info `gettext "Setting up swap:"` "[$swap]" + uuid=$(blkid -o value -s UUID $swap) + # /etc/fstab might use a symlink like /dev/mapper/ubuntu--vg-swap_1 +- links=$(for d in $(udevadm info --query=symlink -n $swap); do echo /dev/$d; done) ++ [ -f $swap ] || links=$(for d in $(udevadm info --query=symlink -n $swap); do echo /dev/$d; done) + for target in "UUID=$uuid" $swap $links; do + if [ -n "$target" ] && grep -qs "^$target\s\+" /etc/fstab; then + sed -i "s:^$target\s\+:\#$target :" /etc/fstab +@@ -193,7 +193,11 @@ for swap in $swaps; do + # Add crypttab entry + # Use /dev/urandom, since this is not a long lived key (generated each boot), + # and so that we don't block booting while waiting for entropy +- echo "cryptswap$i UUID=$uuid /dev/urandom swap,offset=1024,cipher=aes-xts-plain64" >> /etc/crypttab ++ if [ -f $swap ]; then # swapfile ++ echo "cryptswap$i $swap /dev/urandom swap,offset=1024,cipher=aes-xts-plain64" >> /etc/crypttab ++ else # partition ++ echo "cryptswap$i UUID=$uuid /dev/urandom swap,offset=1024,cipher=aes-xts-plain64" >> /etc/crypttab ++ fi + + # Add fstab entry + echo "/dev/mapper/cryptswap$i none swap sw 0 0" >> /etc/fstab +@@ -203,8 +207,8 @@ if [ "$NO_RELOAD" != 1 ]; then + # Turn swap off + swapoff -a + +- # Restart cryptdisks +- /etc/init.d/cryptdisks restart ++ # Restart cryptsetup ++ systemctl restart cryptsetup.target + + # Turn the swap on + swapon -a