From b943efe5bc501d36933f5645642f74f25e8e77f8 Mon Sep 17 00:00:00 2001
From: Victor Mocelin <vm13@inf.ufpr.br>
Date: Sat, 18 Jun 2016 14:43:59 -0300
Subject: [PATCH] Updated makesigphrase.sh to link ecrypt

For hd users it must create the link to .ecryptfs and .Private
---
 .../local-accounts-ecrypt/opt/ecryptfs/makesigphrase.sh    | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/server/modules/local-accounts-ecrypt/opt/ecryptfs/makesigphrase.sh b/server/modules/local-accounts-ecrypt/opt/ecryptfs/makesigphrase.sh
index 82a54b9b..f9a670ee 100755
--- a/server/modules/local-accounts-ecrypt/opt/ecryptfs/makesigphrase.sh
+++ b/server/modules/local-accounts-ecrypt/opt/ecryptfs/makesigphrase.sh
@@ -2,6 +2,7 @@
 username=$1
 password=$2
 path=$3
+device=$4
 
 user_home="$path/$username"
 ecryptfs_path="$path/.ecryptfs"
@@ -37,4 +38,10 @@ chmod 600 "$user_ecrypt_path/.ecryptfs/wrapped-passphrase"
 chmod 644 "$user_ecrypt_path/.ecryptfs/auto-mount"
 chmod 644 "$user_ecrypt_path/.ecryptfs/auto-umount"
 
+if [ $device == "hd" ]; then
+    chown -R $username:$username $user_ecrypt_path
+    ln -s "$user_ecrypt_path/.ecryptfs/" "/home/$username/"
+    ln -s "$user_ecrypt_path/.Private/" "/home/$username/"
+    ln -s "/opt/ecryptfs/README.txt" "/home/$username/README.txt"
+fi
 keyctl clear @u
-- 
GitLab