Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146499035
D53457.id165466.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
985 B
Referenced Files
None
Subscribers
None
D53457.id165466.diff
View Options
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -696,7 +696,7 @@
gid_t *groups = NULL;
gid_t smallgroups[CRED_SMALLGROUPS_NB];
int error;
- bool cred_set;
+ bool cred_set = false;
/* Bail out on unrecognized flags. */
if (flags & ~SETCREDF_MASK)
@@ -839,17 +839,32 @@
if (cred_set) {
setsugid(p);
to_free_cred = old_cred;
+#ifdef RACCT
+ racct_proc_ucred_changed(p, old_cred, new_cred);
+#endif
+#ifdef RCTL
+ crhold(new_cred);
+#endif
MPASS(error == 0);
} else
error = EAGAIN;
unlock_finish:
PROC_UNLOCK(p);
+
/*
* Part 3: After releasing the process lock, we perform cleanups and
* finishing operations.
*/
+#ifdef RCTL
+ if (cred_set) {
+ rctl_proc_ucred_changed(p, new_cred);
+ /* Paired with the crhold() just above. */
+ crfree(new_cred);
+ }
+#endif
+
#ifdef MAC
if (mac_set_proc_data != NULL)
mac_set_proc_finish(td, proc_label_set, mac_set_proc_data);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 4, 4:19 AM (18 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29226827
Default Alt Text
D53457.id165466.diff (985 B)
Attached To
Mode
D53457: setcred(): Fix RACCT resource accounting on credentials change
Attached
Detach File
Event Timeline
Log In to Comment