diff options
author | alfred <alfred@FreeBSD.org> | 2002-06-19 06:39:25 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2002-06-19 06:39:25 +0000 |
commit | bfa1cb192ccc7451cb1191150e479dbe394f212f (patch) | |
tree | eb114f0da986c26c412286c513b7911b9eb0fb74 /sys/sys/ucred.h | |
parent | 1da636b9f46629c676e995f1e52ba9d553db90c6 (diff) | |
download | FreeBSD-src-bfa1cb192ccc7451cb1191150e479dbe394f212f.zip FreeBSD-src-bfa1cb192ccc7451cb1191150e479dbe394f212f.tar.gz |
Squish the "could sleep with process lock" messages caused by calling
uifind() with a proc lock held.
change_ruid() and change_euid() have been modified to take a uidinfo
structure which will be pre-allocated by callers, they will then
call uihold() on the uidinfo structure so that the caller's logic
is simplified.
This allows one to call uifind() before locking the proc struct and
thereby avoid a potential blocking allocation with the proc lock
held.
This may need revisiting, perhaps keeping a spare uidinfo allocated
per process to handle this situation or re-examining if the proc
lock needs to be held over the entire operation of changing real
or effective user id.
Submitted by: Don Lewis <dl-freebsd@catspoiler.org>
Diffstat (limited to 'sys/sys/ucred.h')
-rw-r--r-- | sys/sys/ucred.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h index bb2cd5b..26afb36 100644 --- a/sys/sys/ucred.h +++ b/sys/sys/ucred.h @@ -85,9 +85,9 @@ void cred_free_thread(struct thread *td); #endif void cred_update_thread(struct thread *td); void change_egid(struct ucred *newcred, gid_t egid); -void change_euid(struct ucred *newcred, uid_t euid); +void change_euid(struct ucred *newcred, struct uidinfo *euip); void change_rgid(struct ucred *newcred, gid_t rgid); -void change_ruid(struct ucred *newcred, uid_t ruid); +void change_ruid(struct ucred *newcred, struct uidinfo *ruip); void change_svgid(struct ucred *newcred, gid_t svgid); void change_svuid(struct ucred *newcred, uid_t svuid); void crcopy(struct ucred *dest, struct ucred *src); |