View | Details | Raw Unified | Return to bug 215202
Collapse All | Expand All

(-)w/sys/compat/linux/linux_socket.c (-4 / +1 lines)
Lines 1626-1635 linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) Link Here
1626
			    name, &xu, UIO_SYSSPACE, &xulen);
1626
			    name, &xu, UIO_SYSSPACE, &xulen);
1627
			if (error != 0)
1627
			if (error != 0)
1628
				return (error);
1628
				return (error);
1629
			/*
1629
			lxu.pid = xu.cr_pid;
1630
			 * XXX Use 0 for pid as the FreeBSD does not cache peer pid.
1631
			 */
1632
			lxu.pid = 0;
1633
			lxu.uid = xu.cr_uid;
1630
			lxu.uid = xu.cr_uid;
1634
			lxu.gid = xu.cr_gid;
1631
			lxu.gid = xu.cr_gid;
1635
			return (copyout(&lxu, PTRIN(args->optval), sizeof(lxu)));
1632
			return (copyout(&lxu, PTRIN(args->optval), sizeof(lxu)));
(-)w/sys/kern/kern_fork.c (-1 / +1 lines)
Lines 405-411 do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread * Link Here
405
	sx_sunlock(&proctree_lock);
405
	sx_sunlock(&proctree_lock);
406
406
407
	p2->p_state = PRS_NEW;		/* protect against others */
407
	p2->p_state = PRS_NEW;		/* protect against others */
408
	p2->p_pid = trypid;
408
	p2->p_pid = p2->p_ucred->cr_pid = trypid;
409
	AUDIT_ARG_PID(p2->p_pid);
409
	AUDIT_ARG_PID(p2->p_pid);
410
	LIST_INSERT_HEAD(&allproc, p2, p_list);
410
	LIST_INSERT_HEAD(&allproc, p2, p_list);
411
	allproc_gen++;
411
	allproc_gen++;
(-)w/sys/kern/kern_prot.c (+1 lines)
Lines 1924-1929 cru2x(struct ucred *cr, struct xucred *xcr) Link Here
1924
	bzero(xcr, sizeof(*xcr));
1924
	bzero(xcr, sizeof(*xcr));
1925
	xcr->cr_version = XUCRED_VERSION;
1925
	xcr->cr_version = XUCRED_VERSION;
1926
	xcr->cr_uid = cr->cr_uid;
1926
	xcr->cr_uid = cr->cr_uid;
1927
	xcr->cr_pid = cr->cr_pid;
1927
1928
1928
	ngroups = MIN(cr->cr_ngroups, XU_NGROUPS);
1929
	ngroups = MIN(cr->cr_ngroups, XU_NGROUPS);
1929
	xcr->cr_ngroups = ngroups;
1930
	xcr->cr_ngroups = ngroups;
(-)w/sys/sys/ucred.h (+2 lines)
Lines 69-74 struct ucred { Link Here
69
	gid_t	*cr_groups;		/* groups */
69
	gid_t	*cr_groups;		/* groups */
70
	int	cr_agroups;		/* Available groups */
70
	int	cr_agroups;		/* Available groups */
71
	gid_t   cr_smallgroups[XU_NGROUPS];	/* storage for small groups */
71
	gid_t   cr_smallgroups[XU_NGROUPS];	/* storage for small groups */
72
	pid_t	cr_pid; /* process id */
72
};
73
};
73
#define	NOCRED	((struct ucred *)0)	/* no credential available */
74
#define	NOCRED	((struct ucred *)0)	/* no credential available */
74
#define	FSCRED	((struct ucred *)-1)	/* filesystem credential */
75
#define	FSCRED	((struct ucred *)-1)	/* filesystem credential */
Lines 88-93 struct xucred { Link Here
88
	short	cr_ngroups;		/* number of groups */
89
	short	cr_ngroups;		/* number of groups */
89
	gid_t	cr_groups[XU_NGROUPS];	/* groups */
90
	gid_t	cr_groups[XU_NGROUPS];	/* groups */
90
	void	*_cr_unused1;		/* compatibility with old ucred */
91
	void	*_cr_unused1;		/* compatibility with old ucred */
92
	pid_t	cr_pid; /* process id */
91
};
93
};
92
#define	XUCRED_VERSION	0
94
#define	XUCRED_VERSION	0
93
95

Return to bug 215202