If running as root, only switch the effective uid and gid back if we have
actually switched them before.
This commit is contained in:
parent
a1641450ed
commit
3ee105d766
|
@ -15,6 +15,8 @@ Version 0.7.1 - UNRELEASED
|
||||||
* New option --copy: archive mail, but don't delete it from the mailbox.
|
* New option --copy: archive mail, but don't delete it from the mailbox.
|
||||||
This is mainly useful for testing purposes, and complements --delete.
|
This is mainly useful for testing purposes, and complements --delete.
|
||||||
Closes: #981865, #988803, #1764851, Debian bug #434798
|
Closes: #981865, #988803, #1764851, Debian bug #434798
|
||||||
|
* If running as root, only switch the effective uid and gid back if we have
|
||||||
|
actually switched them before. Closes: #1762907
|
||||||
|
|
||||||
Version 0.7.0 - 2 November 2006
|
Version 0.7.0 - 2 November 2006
|
||||||
* Fixed long options --filter-append and --pwfile to accept their arguments.
|
* Fixed long options --filter-append and --pwfile to accept their arguments.
|
||||||
|
|
|
@ -1173,7 +1173,7 @@ def archive(mailbox_name):
|
||||||
clean_up()
|
clean_up()
|
||||||
|
|
||||||
# if we are running as root, revert the seteuid()/setegid() above
|
# if we are running as root, revert the seteuid()/setegid() above
|
||||||
if (os.getuid() == 0):
|
if former_gid != None:
|
||||||
vprint("changing effective groupid and userid back to root")
|
vprint("changing effective groupid and userid back to root")
|
||||||
os.setegid(former_gid)
|
os.setegid(former_gid)
|
||||||
os.seteuid(0)
|
os.seteuid(0)
|
||||||
|
|
Loading…
Reference in New Issue