Skip to content

Commit

Permalink
lib-storage: Fixed accessing user as root when user has no uid.
Browse files Browse the repository at this point in the history
This shouldn't normally be done, but might as well fix it. Fixes:

Fatal: mail-storage-service: seteuid(4294967295) failed: Invalid argument
  • Loading branch information
sirainen committed Sep 9, 2016
1 parent d3cc15f commit 8c81109
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib-storage/mail-storage-service.c
Expand Up @@ -610,7 +610,7 @@ service_drop_privileges(struct mail_storage_service_user *user,
}

if (keep_setuid_root) {
if (current_euid != rset.uid) {
if (current_euid != rset.uid && rset.uid != (uid_t)-1) {
if (current_euid != 0) {
/* we're changing the UID,
switch back to root first */
Expand Down

0 comments on commit 8c81109

Please sign in to comment.