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
This commit is contained in:
Donncha O'Cearbhaill 2013-07-21 14:08:17 +01:00
parent 89b29b1839
commit 3ed318e47d
1 changed files with 1 additions and 1 deletions

2
gpgit
View File

@ -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();