Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177847805
D56675.1795422636.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D56675.1795422636.diff
View Options
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -83,6 +83,7 @@
#include <sys/socketvar.h>
#include <sys/signalvar.h>
#include <sys/stat.h>
+#include <sys/sysent.h>
#include <sys/sx.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
@@ -2752,8 +2753,24 @@
error = EINVAL;
}
UNP_PCB_UNLOCK(unp);
- if (error == 0)
- error = sooptcopyout(sopt, &xu, sizeof(xu));
+ if (error != 0)
+ break;
+#ifdef COMPAT_FREEBSD32
+ if (SV_PROC_FLAG(sopt->sopt_td->td_proc, SV_ILP32)) {
+ struct xucred32 xu32 = {};
+ int i;
+
+ xu32.cr_version = xu.cr_version;
+ xu32.cr_uid = xu.cr_uid;
+ xu32.cr_ngroups = xu.cr_ngroups;
+ for (i = 0; i < XU_NGROUPS; i++)
+ xu32.cr_groups[i] = xu.cr_groups[i];
+ xu32.cr_pid = xu.cr_pid;
+ error = sooptcopyout(sopt, &xu32, sizeof(xu32));
+ break;
+ }
+#endif
+ error = sooptcopyout(sopt, &xu, sizeof(xu));
break;
case LOCAL_CREDS:
diff --git a/sys/sys/ucred.h b/sys/sys/ucred.h
--- a/sys/sys/ucred.h
+++ b/sys/sys/ucred.h
@@ -193,6 +193,17 @@
uint32_t sc_label; /* struct mac32 [*] */
};
+#ifdef COMPAT_FREEBSD32
+/* 32-bit compatible version of xucred */
+struct xucred32 {
+ u_int cr_version; /* structure layout version */
+ uid_t cr_uid; /* effective user id */
+ short cr_ngroups; /* number of groups (incl. cr_gid). */
+ gid_t cr_groups[XU_NGROUPS]; /* groups */
+ pid_t cr_pid;
+};
+#endif
+
struct thread;
/* Common native and 32-bit compatibility entry point. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 23, 8:30 AM (10 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41926361
Default Alt Text
D56675.1795422636.diff (1 KB)
Attached To
Mode
D56675: Fix LOCAL_PEERCRED in 32-bit compat mode
Attached
Detach File
Event Timeline