From 3ed318e47d90fcba06f33b7f3dd7f08f14a897ca Mon Sep 17 00:00:00 2001 From: Donncha O'Cearbhaill Date: Sun, 21 Jul 2013 14:08:17 +0100 Subject: [PATCH] Use explict form of specifing $REAL_USER_ID and $EFFECTIVE_USER_ID Dovecot can be setup to run as a virtual user, for example 'vmail'. Sieve scripts are then run with the UID of root but the EUID of the vmail user. GnuPG will not run if the EUID does not match the UID as a measure to prevent the system letting it keep root privs. http://lists.gnupg.org/pipermail/gnupg-users/2006-August/029109.html --- gpgit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpgit b/gpgit index 8e63293..de7fac5 100755 --- a/gpgit +++ b/gpgit @@ -59,7 +59,7 @@ use MIME::Parser; $ENV{HOME} = (getpwuid($>))[7]; ## Set the UID to match the EUID to prevent errors from GnuPG. - $< = $>; + $REAL_USER_ID = $EFFECTIVE_USER_ID; ## Object for GPG encryption my $gpg = new Mail::GnuPG();