Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145322251
D53757.id167027.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D53757.id167027.diff
View Options
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -4249,10 +4249,14 @@
error = copyin(uap->wcred, &wcred32, sizeof(wcred32));
if (error != 0)
return (error);
- /* These fields have exactly the same sizes and positions. */
- memcpy(&wcred, &wcred32, __rangeof(struct setcred32,
- setcred32_copy_start, setcred32_copy_end));
- /* Remaining fields are pointers and need PTRIN*(). */
+ memset(&wcred, 0, sizeof(wcred));
+ CP(wcred32, wcred, sc_uid);
+ CP(wcred32, wcred, sc_ruid);
+ CP(wcred32, wcred, sc_svuid);
+ CP(wcred32, wcred, sc_gid);
+ CP(wcred32, wcred, sc_rgid);
+ CP(wcred32, wcred, sc_svgid);
+ CP(wcred32, wcred, sc_supp_groups_nb);
PTRIN_CP(wcred32, wcred, sc_supp_groups);
PTRIN_CP(wcred32, wcred, sc_label);
return (user_setcred(td, uap->flags, &wcred));
diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h
--- a/sys/sys/ucred.h
+++ b/sys/sys/ucred.h
@@ -181,7 +181,6 @@
SETCREDF_MAC_LABEL)
struct setcred32 {
-#define setcred32_copy_start sc_uid
uid_t sc_uid;
uid_t sc_ruid;
uid_t sc_svuid;
@@ -190,7 +189,6 @@
gid_t sc_svgid;
u_int sc_pad;
u_int sc_supp_groups_nb;
-#define setcred32_copy_end sc_supp_groups
uint32_t sc_supp_groups; /* gid_t [*] */
uint32_t sc_label; /* struct mac32 [*] */
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Feb 19, 9:54 AM (5 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28845207
Default Alt Text
D53757.id167027.diff (1 KB)
Attached To
Mode
D53757: freebsd32_setcred: Copy all of the setcred fields individually
Attached
Detach File
Event Timeline
Log In to Comment