Fix the obscure at(1) permission problem.
authorSimon Schubert <corecode@dragonflybsd.org>
Mon, 8 Jan 2007 21:32:57 +0000 (21:32 +0000)
committerSimon Schubert <corecode@dragonflybsd.org>
Mon, 8 Jan 2007 21:32:57 +0000 (21:32 +0000)
commitbe170d6b2590bfd987bbaa89f641c6d57608b41e
tree6776c26859846c4aac31b7199488a5afb2accd8b
parent368a926909be5faeba16900a456ef35de7024c12
Fix the obscure at(1) permission problem.

change_[er]uid() both use cratom(), however their consumers happened to cache
the original cred in a variable.  If the cred happened to be shared before
(for example due to an open(2)), a conditional lateron would still reference
the old cred instead of the new one, which was instanciated in change_[er]uid.

Fix this by returning the new cred from change_[er]uid and using this in
subsequent conditionals.

DragonFly-bug: http://bugs.dragonflybsd.org/issue509
sys/kern/kern_prot.c
sys/sys/ucred.h