Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Mar 2002 11:07:13 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 8387 for review
Message-ID:  <200203251907.g2PJ7Dj79325@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=8387

Change 8387 by jhb@jhb_laptop on 2002/03/25 11:06:24

	Integ more suser() API changes.

Affected files ...

... //depot/projects/smpng/sys/alpha/osf1/osf1_misc.c#11 integrate
... //depot/projects/smpng/sys/compat/linux/linux_misc.c#16 integrate
... //depot/projects/smpng/sys/compat/linux/linux_uid16.c#8 integrate
... //depot/projects/smpng/sys/fs/hpfs/hpfs_vnops.c#7 integrate
... //depot/projects/smpng/sys/fs/msdosfs/msdosfs_vnops.c#7 integrate
... //depot/projects/smpng/sys/gnu/ext2fs/ext2_vnops.c#6 integrate
... //depot/projects/smpng/sys/kern/kern_acct.c#9 integrate
... //depot/projects/smpng/sys/kern/kern_acl.c#12 integrate
... //depot/projects/smpng/sys/kern/kern_exec.c#29 integrate
... //depot/projects/smpng/sys/kern/kern_jail.c#16 integrate
... //depot/projects/smpng/sys/kern/kern_linker.c#15 integrate
... //depot/projects/smpng/sys/kern/kern_prot.c#49 integrate
... //depot/projects/smpng/sys/kern/kern_resource.c#14 integrate
... //depot/projects/smpng/sys/kern/kern_sysctl.c#14 integrate
... //depot/projects/smpng/sys/kern/kern_xxx.c#4 integrate
... //depot/projects/smpng/sys/kern/tty.c#12 integrate
... //depot/projects/smpng/sys/kern/tty_pty.c#11 integrate
... //depot/projects/smpng/sys/kern/vfs_subr.c#20 integrate
... //depot/projects/smpng/sys/kern/vfs_syscalls.c#25 integrate
... //depot/projects/smpng/sys/kern/vfs_vnops.c#18 integrate
... //depot/projects/smpng/sys/netinet/in_pcb.c#18 integrate
... //depot/projects/smpng/sys/netinet/tcp_subr.c#15 integrate
... //depot/projects/smpng/sys/netinet/udp_usrreq.c#16 integrate
... //depot/projects/smpng/sys/netinet6/in6_pcb.c#10 integrate
... //depot/projects/smpng/sys/netncp/ncp_subr.h#3 integrate
... //depot/projects/smpng/sys/netsmb/smb_subr.h#5 integrate
... //depot/projects/smpng/sys/nfsserver/nfs_serv.c#13 integrate
... //depot/projects/smpng/sys/ufs/ffs/ffs_alloc.c#9 integrate
... //depot/projects/smpng/sys/ufs/ifs/ifs_vnops.c#3 integrate
... //depot/projects/smpng/sys/ufs/ufs/ufs_extattr.c#12 integrate
... //depot/projects/smpng/sys/ufs/ufs/ufs_quota.c#10 integrate
... //depot/projects/smpng/sys/ufs/ufs/ufs_readwrite.c#6 integrate
... //depot/projects/smpng/sys/ufs/ufs/ufs_vfsops.c#7 integrate
... //depot/projects/smpng/sys/ufs/ufs/ufs_vnops.c#12 integrate

Differences ...

==== //depot/projects/smpng/sys/alpha/osf1/osf1_misc.c#11 (text+ko) ====

@@ -1062,7 +1062,7 @@
 	uid = SCARG(uap, uid);
 	oldcred = p->p_ucred;
 
-	if ((error = suser_xxx(p->p_ucred, NULL, PRISON_ROOT)) != 0 &&
+	if ((error = suser_cred(p->p_ucred, PRISON_ROOT)) != 0 &&
 	    uid != oldcred->cr_ruid && uid != oldcred->cr_svuid)
 		return (error);
 
@@ -1108,7 +1108,7 @@
 	gid = SCARG(uap, gid);
 	oldcred = p->p_ucred;
 
-	if (((error = suser_xxx(p->p_ucred, NULL, PRISON_ROOT)) != 0 ) &&
+	if (((error = suser_cred(p->p_ucred, PRISON_ROOT)) != 0 ) &&
 	    gid != oldcred->cr_rgid && gid != oldcred->cr_svgid)
 		return (error);
 

==== //depot/projects/smpng/sys/compat/linux/linux_misc.c#16 (text+ko) ====

@@ -980,7 +980,7 @@
 	 * Keep cr_groups[0] unchanged to prevent that.
 	 */
 
-	if ((error = suser_xxx(oldcred, NULL, PRISON_ROOT)) != 0)
+	if ((error = suser_cred(oldcred, PRISON_ROOT)) != 0)
 		return (error);
 
 	if (ngrp >= NGROUPS)

==== //depot/projects/smpng/sys/compat/linux/linux_uid16.c#8 (text+ko) ====

@@ -108,7 +108,7 @@
 	 * Keep cr_groups[0] unchanged to prevent that.
 	 */
 
-	if ((error = suser_xxx(oldcred, NULL, PRISON_ROOT)) != 0)
+	if ((error = suser_cred(oldcred, PRISON_ROOT)) != 0)
 		return (error);
 
 	if (ngrp >= NGROUPS)

==== //depot/projects/smpng/sys/fs/hpfs/hpfs_vnops.c#7 (text+ko) ====

@@ -529,7 +529,7 @@
 		if (vp->v_mount->mnt_flag & MNT_RDONLY)
 			return (EROFS);
 		if (cred->cr_uid != hp->h_uid &&
-		    (error = suser_xxx(cred, td->td_proc, PRISON_ROOT)) &&
+		    (error = suser_cred(cred, PRISON_ROOT)) &&
 		    ((vap->va_vaflags & VA_UTIMES_NULL) == 0 ||
 		    (error = VOP_ACCESS(vp, VWRITE, cred, td))))
 			return (error);

==== //depot/projects/smpng/sys/fs/msdosfs/msdosfs_vnops.c#7 (text+ko) ====

@@ -376,7 +376,7 @@
 		if (vp->v_mount->mnt_flag & MNT_RDONLY)
 			return (EROFS);
 		if (cred->cr_uid != pmp->pm_uid &&
-		    (error = suser_xxx(cred, ap->a_td->td_proc, PRISON_ROOT)))
+		    (error = suser_cred(cred, PRISON_ROOT)))
 			return (error);
 		/*
 		 * We are very inconsistent about handling unsupported
@@ -390,7 +390,7 @@
 		 * set ATTR_ARCHIVE for directories `cp -pr' from a more
 		 * sensible file system attempts it a lot.
 		 */
-		if (suser_xxx(cred, ap->a_td->td_proc, PRISON_ROOT)) {
+		if (suser_cred(cred, PRISON_ROOT)) {
 			if (vap->va_flags & SF_SETTABLE)
 				return EPERM;
 		}
@@ -417,7 +417,7 @@
 			gid = pmp->pm_gid;
 		if ((cred->cr_uid != pmp->pm_uid || uid != pmp->pm_uid ||
 		    (gid != pmp->pm_gid && !groupmember(gid, cred))) &&
-		    (error = suser_xxx(cred, ap->a_td->td_proc, PRISON_ROOT)))
+		    (error = suser_cred(cred, PRISON_ROOT)))
 			return error;
 		if (uid != pmp->pm_uid || gid != pmp->pm_gid)
 			return EINVAL;
@@ -449,7 +449,7 @@
 		if (vp->v_mount->mnt_flag & MNT_RDONLY)
 			return (EROFS);
 		if (cred->cr_uid != pmp->pm_uid &&
-		    (error = suser_xxx(cred, ap->a_td->td_proc, PRISON_ROOT)) &&
+		    (error = suser_cred(cred, PRISON_ROOT)) &&
 		    ((vap->va_vaflags & VA_UTIMES_NULL) == 0 ||
 		    (error = VOP_ACCESS(ap->a_vp, VWRITE, cred, ap->a_td))))
 			return (error);
@@ -472,7 +472,7 @@
 		if (vp->v_mount->mnt_flag & MNT_RDONLY)
 			return (EROFS);
 		if (cred->cr_uid != pmp->pm_uid &&
-		    (error = suser_xxx(cred, ap->a_td->td_proc, PRISON_ROOT)))
+		    (error = suser_cred(cred, PRISON_ROOT)))
 			return (error);
 		if (vp->v_type != VDIR) {
 			/* We ignore the read and execute bits. */

==== //depot/projects/smpng/sys/gnu/ext2fs/ext2_vnops.c#6 (text+ko) ====

@@ -1153,7 +1153,7 @@
 	tvp->v_type = IFTOVT(mode);	/* Rest init'd in getnewvnode(). */
 	ip->i_nlink = 1;
 	if ((ip->i_mode & ISGID) && !groupmember(ip->i_gid, cnp->cn_cred) &&
-	    suser_xxx(cnp->cn_cred, 0, PRISON_ROOT))
+	    suser_cred(cnp->cn_cred, PRISON_ROOT))
 		ip->i_mode &= ~ISGID;
 
 	if (cnp->cn_flags & ISWHITEOUT)

==== //depot/projects/smpng/sys/kern/kern_acct.c#9 (text+ko) ====

@@ -123,7 +123,7 @@
 	if (td != curthread)
 		panic("acct");		/* XXXKSE DIAGNOSTIC */
 	/* Make sure that the caller is root. */
-	error = suser_xxx(td->td_proc->p_ucred, NULL, 0);
+	error = suser(td, 0);
 	if (error)
 		goto done2;
 

==== //depot/projects/smpng/sys/kern/kern_acl.c#12 (text+ko) ====

@@ -89,7 +89,7 @@
 	 * a DAC entry that matches but has failed to allow access.
 	 */
 #ifndef CAPABILITIES
-	if (suser_xxx(cred, NULL, PRISON_ROOT) == 0)
+	if (suser_cred(cred, PRISON_ROOT) == 0)
 		cap_granted = (VEXEC | VREAD | VWRITE | VADMIN);
 	else
 		cap_granted = 0;

==== //depot/projects/smpng/sys/kern/kern_exec.c#29 (text+ko) ====

@@ -353,7 +353,7 @@
 		 * we do not regain any tracing during a possible block.
 		 */
 		setsugid(p);
-		if (p->p_tracep && suser_xxx(oldcred, NULL, PRISON_ROOT)) {
+		if (p->p_tracep && suser_cred(oldcred, PRISON_ROOT)) {
 			struct vnode *vtmp;
 
 			if ((vtmp = p->p_tracep) != NULL) {

==== //depot/projects/smpng/sys/kern/kern_jail.c#16 (text+ko) ====

@@ -87,7 +87,7 @@
 	pr->pr_ip = j.ip_number;
 	PROC_LOCK(p);
 	/* Implicitly fail if already in jail.  */
-	error = suser_xxx(p->p_ucred, NULL, 0);
+	error = suser_cred(p->p_ucred, 0);
 	if (error)
 		goto badcred;
 	oldcred = p->p_ucred;

==== //depot/projects/smpng/sys/kern/kern_linker.c#15 (text+ko) ====

@@ -703,7 +703,7 @@
 
 	mtx_lock(&Giant);
 
-	if ((error = suser_xxx(td->td_ucred, NULL, 0)) != 0)
+	if ((error = suser(td, 0)) != 0)
 		goto out;
 
 	pathname = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
@@ -750,7 +750,7 @@
 
 	mtx_lock(&Giant);
 
-	if ((error = suser_xxx(td->td_ucred, NULL, 0)) != 0)
+	if ((error = suser(td, 0)) != 0)
 		goto out;
 
 	lf = linker_find_file_by_id(SCARG(uap, fileid));

==== //depot/projects/smpng/sys/kern/kern_prot.c#49 (text+ko) ====

@@ -582,7 +582,7 @@
 #ifdef POSIX_APPENDIX_B_4_2_2	/* Use BSD-compat clause from B.4.2.2 */
 	    uid != oldcred->cr_uid &&		/* allow setuid(geteuid()) */
 #endif
-	    (error = suser_xxx(oldcred, NULL, PRISON_ROOT)) != 0)
+	    (error = suser_cred(oldcred, PRISON_ROOT)) != 0)
 		goto done2;
 
 	newcred = crdup(oldcred);
@@ -595,7 +595,7 @@
 #ifdef POSIX_APPENDIX_B_4_2_2	/* Use the clause from B.4.2.2 */
 	    uid == oldcred->cr_uid ||
 #endif
-	    suser_xxx(oldcred, NULL, PRISON_ROOT) == 0) /* we are using privs */
+	    suser_cred(oldcred, PRISON_ROOT) == 0) /* we are using privs */
 #endif
 	{
 		/*
@@ -658,7 +658,7 @@
 	oldcred = p->p_ucred;
 	if (euid != oldcred->cr_ruid &&		/* allow seteuid(getuid()) */
 	    euid != oldcred->cr_svuid &&	/* allow seteuid(saved uid) */
-	    (error = suser_xxx(oldcred, NULL, PRISON_ROOT)) != 0)
+	    (error = suser_cred(oldcred, PRISON_ROOT)) != 0)
 		goto done2;
 	/*
 	 * Everything's okay, do it.  Copy credentials so other references do
@@ -718,7 +718,7 @@
 #ifdef POSIX_APPENDIX_B_4_2_2	/* Use BSD-compat clause from B.4.2.2 */
 	    gid != oldcred->cr_groups[0] && /* allow setgid(getegid()) */
 #endif
-	    (error = suser_xxx(oldcred, NULL, PRISON_ROOT)) != 0)
+	    (error = suser_cred(oldcred, PRISON_ROOT)) != 0)
 		goto done2;
 
 	newcred = crdup(oldcred);
@@ -731,7 +731,7 @@
 #ifdef POSIX_APPENDIX_B_4_2_2	/* use the clause from B.4.2.2 */
 	    gid == oldcred->cr_groups[0] ||
 #endif
-	    suser_xxx(oldcred, NULL, PRISON_ROOT) == 0) /* we are using privs */
+	    suser_cred(oldcred, PRISON_ROOT) == 0) /* we are using privs */
 #endif
 	{
 		/*
@@ -793,7 +793,7 @@
 	oldcred = p->p_ucred;
 	if (egid != oldcred->cr_rgid &&		/* allow setegid(getgid()) */
 	    egid != oldcred->cr_svgid &&	/* allow setegid(saved gid) */
-	    (error = suser_xxx(oldcred, NULL, PRISON_ROOT)) != 0)
+	    (error = suser_cred(oldcred, PRISON_ROOT)) != 0)
 		goto done2;
 	newcred = crdup(oldcred);
 	if (oldcred->cr_groups[0] != egid) {
@@ -830,7 +830,7 @@
 	ngrp = uap->gidsetsize;
 	mtx_lock(&Giant);
 	oldcred = p->p_ucred;
-	if ((error = suser_xxx(oldcred, NULL, PRISON_ROOT)) != 0)
+	if ((error = suser_cred(oldcred, PRISON_ROOT)) != 0)
 		goto done2;
 	if (ngrp > NGROUPS) {
 		error = EINVAL;
@@ -894,7 +894,7 @@
 	      ruid != oldcred->cr_svuid) ||
 	     (euid != (uid_t)-1 && euid != oldcred->cr_uid &&
 	      euid != oldcred->cr_ruid && euid != oldcred->cr_svuid)) &&
-	    (error = suser_xxx(oldcred, NULL, PRISON_ROOT)) != 0)
+	    (error = suser_cred(oldcred, PRISON_ROOT)) != 0)
 		goto done2;
 	newcred = crdup(oldcred);
 	if (euid != (uid_t)-1 && oldcred->cr_uid != euid) {
@@ -946,7 +946,7 @@
 	    rgid != oldcred->cr_svgid) ||
 	     (egid != (gid_t)-1 && egid != oldcred->cr_groups[0] &&
 	     egid != oldcred->cr_rgid && egid != oldcred->cr_svgid)) &&
-	    (error = suser_xxx(oldcred, NULL, PRISON_ROOT)) != 0)
+	    (error = suser_cred(oldcred, PRISON_ROOT)) != 0)
 		goto done2;
 	newcred = crdup(oldcred);
 	if (egid != (gid_t)-1 && oldcred->cr_groups[0] != egid) {
@@ -1009,7 +1009,7 @@
 	     (suid != (uid_t)-1 && suid != oldcred->cr_ruid &&
 	    suid != oldcred->cr_svuid &&
 	      suid != oldcred->cr_uid)) &&
-	    (error = suser_xxx(oldcred, NULL, PRISON_ROOT)) != 0)
+	    (error = suser_cred(oldcred, PRISON_ROOT)) != 0)
 		goto done2;
 	newcred = crdup(oldcred);
 	if (euid != (uid_t)-1 && oldcred->cr_uid != euid) {
@@ -1072,7 +1072,7 @@
 	     (sgid != (gid_t)-1 && sgid != oldcred->cr_rgid &&
 	      sgid != oldcred->cr_svgid &&
 	      sgid != oldcred->cr_groups[0])) &&
-	    (error = suser_xxx(oldcred, NULL, PRISON_ROOT)) != 0)
+	    (error = suser_cred(oldcred, PRISON_ROOT)) != 0)
 		goto done2;
 	newcred = crdup(oldcred);
 	if (egid != (gid_t)-1 && oldcred->cr_groups[0] != egid) {
@@ -1366,7 +1366,7 @@
 {
 
 	if (!see_other_uids && u1->cr_ruid != u2->cr_ruid) {
-		if (suser_xxx(u1, NULL, PRISON_ROOT) != 0)
+		if (suser_cred(u1, PRISON_ROOT) != 0)
 			return (ESRCH);
 	}
 	return (0);
@@ -1454,7 +1454,7 @@
 			break;
 		default:
 			/* Not permitted without privilege. */
-			error = suser_xxx(cred, NULL, PRISON_ROOT);
+			error = suser_cred(cred, PRISON_ROOT);
 			if (error)
 				return (error);
 		}
@@ -1469,7 +1469,7 @@
 	    cred->cr_uid != proc->p_ucred->cr_ruid &&
 	    cred->cr_uid != proc->p_ucred->cr_svuid) {
 		/* Not permitted without privilege. */
-		error = suser_xxx(cred, NULL, PRISON_ROOT);
+		error = suser_cred(cred, PRISON_ROOT);
 		if (error)
 			return (error);
 	}
@@ -1527,7 +1527,7 @@
 		return (0);
 	if (p1->p_ucred->cr_uid == p2->p_ucred->cr_ruid)
 		return (0);
-	if (suser_xxx(0, p1, PRISON_ROOT) == 0)
+	if (suser_cred(p1->p_ucred, PRISON_ROOT) == 0)
 		return (0);
 
 #ifdef CAPABILITIES
@@ -1568,7 +1568,7 @@
 	int credentialchanged, error, grpsubset, i, uidsubset;
 
 	if (!unprivileged_proc_debug) {
-		error = suser_xxx(NULL, p1, PRISON_ROOT);
+		error = suser_cred(p1->p_ucred, PRISON_ROOT);
 		if (error)
 			return (error);
 	}
@@ -1614,7 +1614,7 @@
 	 * require CAP_SYS_PTRACE.
 	 */
 	if (!grpsubset || !uidsubset || credentialchanged) {
-		error = suser_xxx(NULL, p1, PRISON_ROOT);
+		error = suser_cred(p1->p_ucred, PRISON_ROOT);
 		if (error)
 			return (error);
 	}
@@ -1877,7 +1877,7 @@
 	char logintmp[MAXLOGNAME];
 
 	mtx_lock(&Giant);
-	if ((error = suser_xxx(0, p, PRISON_ROOT)) != 0)
+	if ((error = suser(td, PRISON_ROOT)) != 0)
 		goto done2;
 	error = copyinstr((caddr_t) uap->namebuf, (caddr_t) logintmp,
 	    sizeof(logintmp), (size_t *)0);

==== //depot/projects/smpng/sys/kern/kern_resource.c#14 (text+ko) ====

@@ -258,7 +258,7 @@
 	if (n < PRIO_MIN)
 		n = PRIO_MIN;
 	if (n < chgp->p_ksegrp.kg_nice /* XXXKSE */  &&
-	    suser_xxx(curp->p_ucred, NULL, 0))
+	    suser(td, 0))
 		return (EACCES);
 	chgp->p_ksegrp.kg_nice /* XXXKSE */  = n;
 	(void)resetpriority(&chgp->p_ksegrp); /* XXXKSE */
@@ -320,7 +320,7 @@
 		    (error = copyin(uap->rtp, &rtp, sizeof(struct rtprio))))
 			break;
 		/* disallow setting rtprio in most cases if not superuser */
-		if (suser_xxx(curp->p_ucred, NULL, 0) != 0) {
+		if (suser(td, 0) != 0) {
 			/* can't set someone else's */
 			if (uap->pid) {
 				error = EPERM;
@@ -521,7 +521,7 @@
 
 	if (limp->rlim_cur > alimp->rlim_max ||
 	    limp->rlim_max > alimp->rlim_max)
-		if ((error = suser_xxx(0, p, PRISON_ROOT)))
+		if ((error = suser(td, PRISON_ROOT)))
 			return (error);
 	if (limp->rlim_cur > limp->rlim_max)
 		limp->rlim_cur = limp->rlim_max;

==== //depot/projects/smpng/sys/kern/kern_sysctl.c#14 (text+ko) ====

@@ -1084,7 +1084,7 @@
 			flags = PRISON_ROOT;
 		else
 			flags = 0;
-		error = suser_xxx(NULL, req->td->td_proc, flags);
+		error = suser(req->td, flags);
 		if (error)
 			return (error);
 	}

==== //depot/projects/smpng/sys/kern/kern_xxx.c#4 (text+ko) ====

@@ -97,7 +97,7 @@
 	name[0] = CTL_KERN;
 	name[1] = KERN_HOSTNAME;
 	mtx_lock(&Giant);
-	if ((error = suser_xxx(0, td->td_proc, PRISON_ROOT)) == 0) {
+	if ((error = suser(td, PRISON_ROOT)) == 0) {
 		error = userland_sysctl(td, name, 2, 0, 0, 0,
 		    uap->hostname, uap->len, 0);
 	}

==== //depot/projects/smpng/sys/kern/tty.c#12 (text+ko) ====

@@ -851,7 +851,7 @@
 			    ISSET(constty->t_state, TS_CONNECTED))
 				return (EBUSY);
 #ifndef	UCONSOLE
-			if ((error = suser_xxx(p->p_ucred, NULL, 0)) != 0)
+			if ((error = suser(td, 0)) != 0)
 				return (error);
 #endif
 			constty = tp;
@@ -1023,9 +1023,9 @@
 		splx(s);
 		break;
 	case TIOCSTI:			/* simulate terminal input */
-		if ((flag & FREAD) == 0 && suser_xxx(p->p_ucred, NULL, 0))
+		if ((flag & FREAD) == 0 && suser(td, 0))
 			return (EPERM);
-		if (!isctty(p, tp) && suser_xxx(p->p_ucred, NULL, 0))
+		if (!isctty(p, tp) && suser(td, 0))
 			return (EACCES);
 		s = spltty();
 		(*linesw[tp->t_line].l_rint)(*(u_char *)data, tp);
@@ -1099,7 +1099,7 @@
 		}
 		break;
 	case TIOCSDRAINWAIT:
-		error = suser_xxx(p->p_ucred, NULL, 0);
+		error = suser(td, 0);
 		if (error)
 			return (error);
 		tp->t_timeout = *(int *)data * hz;

==== //depot/projects/smpng/sys/kern/tty_pty.c#11 (text+ko) ====

@@ -187,7 +187,7 @@
 		tp->t_lflag = TTYDEF_LFLAG;
 		tp->t_cflag = TTYDEF_CFLAG;
 		tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
-	} else if (tp->t_state & TS_XCLUDE && suser_xxx(td->td_ucred, NULL, 0)) {
+	} else if (tp->t_state & TS_XCLUDE && suser_cred(td->td_ucred, 0)) {
 		return (EBUSY);
 	} else if (pti->pt_prison != td->td_ucred->cr_prison) {
 		return (EBUSY);

==== //depot/projects/smpng/sys/kern/vfs_subr.c#20 (text+ko) ====

@@ -3140,7 +3140,7 @@
 		return (0);
 
 privcheck:
-	if (!suser_xxx(cred, NULL, PRISON_ROOT)) {
+	if (!suser_cred(cred, PRISON_ROOT)) {
 		/* XXX audit: privilege used */
 		if (privused != NULL)
 			*privused = 1;

==== //depot/projects/smpng/sys/kern/vfs_syscalls.c#25 (text+ko) ====

@@ -213,7 +213,7 @@
 	/*
 	 * Silently enforce MNT_NOSUID and MNT_NODEV for non-root users
 	 */
-	if (suser_xxx(td->td_ucred, 0, 0)) 
+	if (suser(td, 0)) 
 		fsflags |= MNT_NOSUID | MNT_NODEV;
 	/*
 	 * Get vnode to be covered
@@ -777,7 +777,7 @@
 	if (error)
 		return (error);
 	sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
-	if (suser_xxx(td->td_ucred, 0, 0)) {
+	if (suser(td, 0)) {
 		bcopy((caddr_t)sp, (caddr_t)&sb, sizeof(sb));
 		sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
 		sp = &sb;
@@ -820,7 +820,7 @@
 	if (error)
 		return (error);
 	sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
-	if (suser_xxx(td->td_ucred, 0, 0)) {
+	if (suser(td, 0)) {
 		bcopy((caddr_t)sp, (caddr_t)&sb, sizeof(sb));
 		sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
 		sp = &sb;
@@ -1049,7 +1049,7 @@
 	struct nameidata nd;
 	struct vnode *vp;
 
-	error = suser_xxx(0, td->td_proc, PRISON_ROOT);
+	error = suser(td, PRISON_ROOT);
 	if (error)
 		return (error);
 	FILEDESC_LOCK(fdp);
@@ -1335,7 +1335,7 @@
 		error = suser_td(td);
 		break;
 	default:
-		error = suser_xxx(0, td->td_proc, PRISON_ROOT);
+		error = suser(td, PRISON_ROOT);
 		break;
 	}
 	if (error)
@@ -2295,7 +2295,7 @@
 	 * chown can't fail when done as root.
 	 */
 	if (vp->v_type == VCHR || vp->v_type == VBLK) {
-		error = suser_xxx(td->td_ucred, td->td_proc, PRISON_ROOT);
+		error = suser(td, PRISON_ROOT);
 		if (error)
 			return (error);
 	}
@@ -3553,7 +3553,7 @@
 	}
 	VOP_UNLOCK(vp, 0, td);
 	if (td->td_ucred->cr_uid != vattr.va_uid) {
-		error = suser_xxx(0, td->td_proc, PRISON_ROOT);
+		error = suser(td, PRISON_ROOT);
 		if (error)
 			goto out;
 	}
@@ -3918,7 +3918,7 @@
 	if ((error = VFS_STATFS(mp, sp, td)) != 0)
 		return (error);
 	sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
-	if (suser_xxx(td->td_ucred, 0, 0)) {
+	if (suser(td, 0)) {
 		bcopy((caddr_t)sp, (caddr_t)&sb, sizeof(sb));
 		sb.f_fsid.val[0] = sb.f_fsid.val[1] = 0;
 		sp = &sb;

==== //depot/projects/smpng/sys/kern/vfs_vnops.c#18 (text+ko) ====

@@ -637,7 +637,7 @@
 	}
 	
 	sb->st_flags = vap->va_flags;
-	if (suser_xxx(td->td_ucred, 0, 0))
+	if (suser(td, 0))
 		sb->st_gen = 0;
 	else
 		sb->st_gen = vap->va_gen;

==== //depot/projects/smpng/sys/netinet/in_pcb.c#18 (text+ko) ====

@@ -228,8 +228,8 @@
 		if (lport) {
 			struct inpcb *t;
 			/* GROSS */
-			if (ntohs(lport) < IPPORT_RESERVED && p &&
-			    suser_xxx(0, p, PRISON_ROOT))
+			if (ntohs(lport) < IPPORT_RESERVED && td &&
+			    suser(td, PRISON_ROOT))
 				return (EACCES);
 			if (td && jailed(td->td_ucred))
 				prison = 1;
@@ -292,7 +292,7 @@
 			last  = ipport_hilastauto;
 			lastport = &pcbinfo->lasthi;
 		} else if (inp->inp_flags & INP_LOWPORT) {
-			if (p && (error = suser_xxx(0, p, PRISON_ROOT))) {
+			if (td && (error = suser(td, PRISON_ROOT))) {
 				inp->inp_laddr.s_addr = INADDR_ANY;
 				return error;
 			}

==== //depot/projects/smpng/sys/netinet/tcp_subr.c#15 (text+ko) ====

@@ -907,7 +907,7 @@
 	struct inpcb *inp;
 	int error, s;
 
-	error = suser_xxx(0, req->td->td_proc, PRISON_ROOT);
+	error = suser(req->td, PRISON_ROOT);
 	if (error)
 		return (error);
 	error = SYSCTL_IN(req, addrs, sizeof(addrs));
@@ -943,7 +943,7 @@
 	struct inpcb *inp;
 	int error, s, mapped = 0;
 
-	error = suser_xxx(0, req->td->td_proc, PRISON_ROOT);
+	error = suser(req->td, PRISON_ROOT);
 	if (error)
 		return (error);
 	error = SYSCTL_IN(req, addrs, sizeof(addrs));

==== //depot/projects/smpng/sys/netinet/udp_usrreq.c#16 (text+ko) ====

@@ -636,7 +636,7 @@
 	struct inpcb *inp;
 	int error, s;
 
-	error = suser_xxx(0, req->td->td_proc, PRISON_ROOT);
+	error = suser(req->td, PRISON_ROOT);
 	if (error)
 		return (error);
 	error = SYSCTL_IN(req, addrs, sizeof(addrs));

==== //depot/projects/smpng/sys/netinet6/in6_pcb.c#10 (text+ko) ====

@@ -183,7 +183,7 @@
 
 			/* GROSS */
 			if (ntohs(lport) < IPV6PORT_RESERVED && td &&
-			    suser_xxx(0, td->td_proc, PRISON_ROOT))
+			    suser(td, PRISON_ROOT))
 				return(EACCES);
 			if (so->so_cred->cr_uid != 0 &&
 			    !IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) {

==== //depot/projects/smpng/sys/netncp/ncp_subr.h#3 (text+ko) ====

@@ -84,7 +84,7 @@
 
 #define checkbad(fn) {error=(fn);if(error) goto bad;}
 
-#define	ncp_suser(cred)	suser_xxx(cred, NULL, 0)
+#define	ncp_suser(cred)	suser_cred(cred, 0)
 
 #define ncp_isowner(conn,cred) ((cred)->cr_uid == (conn)->nc_owner->cr_uid)
 

==== //depot/projects/smpng/sys/netsmb/smb_subr.h#5 (text+ko) ====

@@ -70,7 +70,7 @@
 	 SIGISMEMBER(set, SIGHUP) || SIGISMEMBER(set, SIGKILL) ||	\
 	 SIGISMEMBER(set, SIGQUIT))
 
-#define	smb_suser(cred)	suser_xxx(cred, NULL, 0)
+#define	smb_suser(cred)	suser_cred(cred, 0)
 
 /*
  * Compatibility wrappers for simple locks

==== //depot/projects/smpng/sys/nfsserver/nfs_serv.c#13 (text+ko) ====

@@ -1742,8 +1742,8 @@
 			if (vap->va_type == VCHR && rdev == 0xffffffff)
 				vap->va_type = VFIFO;
                         if (vap->va_type != VFIFO &&
-                            (error = suser_xxx(cred, 0, 0))) {
-				goto ereply;
+                            (error = suser_cred(cred, 0))) {
+				goto nfsmreply0;
                         }
 			vap->va_rdev = rdev;
 			error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, vap);
@@ -1947,7 +1947,7 @@
 		if (error)
 			NDFREE(&nd, NDF_ONLY_PNBUF);
 	} else {
-		if (vtyp != VFIFO && (error = suser_xxx(cred, 0, 0)))
+		if (vtyp != VFIFO && (error = suser_cred(cred, 0)))
 			goto out;
 		error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, vap);
 		if (error) {

==== //depot/projects/smpng/sys/ufs/ffs/ffs_alloc.c#9 (text+ko) ====

@@ -126,7 +126,7 @@
 retry:
 	if (size == fs->fs_bsize && fs->fs_cstotal.cs_nbfree == 0)
 		goto nospace;
-	if (suser_xxx(cred, NULL, PRISON_ROOT) &&
+	if (suser_cred(cred, PRISON_ROOT) &&
 	    freespace(fs, fs->fs_minfree) - numfrags(fs, size) < 0)
 		goto nospace;
 #ifdef QUOTA
@@ -207,7 +207,7 @@
 #endif /* DIAGNOSTIC */
 	reclaimed = 0;
 retry:
-	if (suser_xxx(cred, NULL, PRISON_ROOT) &&
+	if (suser_cred(cred, PRISON_ROOT) &&
 	    freespace(fs, fs->fs_minfree) -  numfrags(fs, nsize - osize) < 0)
 		goto nospace;
 	if ((bprev = ip->i_db[lbprev]) == 0) {

==== //depot/projects/smpng/sys/ufs/ifs/ifs_vnops.c#3 (text+ko) ====

@@ -269,7 +269,7 @@
 	if (DOINGSOFTDEP(tvp))
 		softdep_change_linkcnt(ip);
 	if ((ip->i_mode & ISGID) && !groupmember(ip->i_gid, cnp->cn_cred) &&
-	    suser_xxx(cnp->cn_cred, 0, 0))
+	    suser_cred(cnp->cn_cred, 0))
 		ip->i_mode &= ~ISGID;
 
 	if (cnp->cn_flags & ISWHITEOUT)

==== //depot/projects/smpng/sys/ufs/ufs/ufs_extattr.c#12 (text+ko) ====

@@ -714,7 +714,7 @@
 	 * Processes with privilege, but in jail, are not allowed to
 	 * configure extended attributes.
 	 */
-	if ((error = suser_xxx(td->td_ucred, td->td_proc, 0))) {
+	if ((error = suser(td, 0))) {
 		if (filename_vp != NULL)
 			VOP_UNLOCK(filename_vp, 0, td);
 		return (error);
@@ -811,7 +811,7 @@
 	switch (uele->uele_attrnamespace) {
 	case EXTATTR_NAMESPACE_SYSTEM:
 		/* Potentially should be: return (EPERM); */
-		return (suser_xxx(cred, td->td_proc, 0));
+		return (suser_cred(cred, 0));
 	case EXTATTR_NAMESPACE_USER:
 		return (VOP_ACCESS(vp, access, cred, td));
 	default:

==== //depot/projects/smpng/sys/ufs/ufs/ufs_quota.c#10 (text+ko) ====

@@ -150,7 +150,7 @@
 		}
 		return (0);
 	}
-	if ((flags & FORCE) == 0 && suser_xxx(cred, NULL, 0)) {
+	if ((flags & FORCE) == 0 && suser_cred(cred, 0)) {
 		for (i = 0; i < MAXQUOTAS; i++) {
 			if ((dq = ip->i_dquot[i]) == NODQUOT)
 				continue;
@@ -271,7 +271,7 @@
 		}
 		return (0);
 	}
-	if ((flags & FORCE) == 0 && suser_xxx(cred, NULL, 0)) {
+	if ((flags & FORCE) == 0 && suser_cred(cred, 0)) {
 		for (i = 0; i < MAXQUOTAS; i++) {
 			if ((dq = ip->i_dquot[i]) == NODQUOT)
 				continue;

==== //depot/projects/smpng/sys/ufs/ufs/ufs_readwrite.c#6 (text+ko) ====

@@ -566,7 +566,7 @@
 	 * tampering.
 	 */
 	if (resid > uio->uio_resid && ap->a_cred && 
-	    suser_xxx(ap->a_cred, NULL, PRISON_ROOT))
+	    suser_cred(ap->a_cred, PRISON_ROOT))
 		ip->i_mode &= ~(ISUID | ISGID);
 	if (resid > uio->uio_resid)
 		VN_KNOTE(vp, NOTE_WRITE | (extended ? NOTE_EXTEND : 0));

==== //depot/projects/smpng/sys/ufs/ufs/ufs_vfsops.c#7 (text+ko) ====

@@ -119,7 +119,7 @@
 			break;
 		/* fall through */
 	default:
-		if ((error = suser_xxx(0, td->td_proc, PRISON_ROOT)) != 0)
+		if ((error = suser(td, PRISON_ROOT)) != 0)
 			return (error);
 	}
 

==== //depot/projects/smpng/sys/ufs/ufs/ufs_vnops.c#12 (text+ko) ====

@@ -484,7 +484,7 @@
 		 * Privileged non-jail processes may not modify system flags
 		 * if securelevel > 0 and any existing system flags are set.
 		 */
-		if (!suser_xxx(cred, NULL, PRISON_ROOT)) {
+		if (!suser_cred(cred, PRISON_ROOT)) {
 			if (ip->i_flags
 			    & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) {
 				error = securelevel_gt(cred, 0);
@@ -616,7 +616,7 @@
 	 * as well as set the setgid bit on a file with a group that the
 	 * process is not a member of.
 	 */
-	if (suser_xxx(cred, NULL, PRISON_ROOT)) {
+	if (suser_cred(cred, PRISON_ROOT)) {
 		if (vp->v_type != VDIR && (mode & S_ISTXT))
 			return (EFTYPE);
 		if (!groupmember(ip->i_gid, cred) && (mode & ISGID))
@@ -666,7 +666,7 @@
 	 */
 	if ((uid != ip->i_uid || 
 	    (gid != ip->i_gid && !groupmember(gid, cred))) &&
-	    (error = suser_xxx(cred, td->td_proc, PRISON_ROOT)))
+	    (error = suser_cred(cred, PRISON_ROOT)))
 		return (error);
 	ogid = ip->i_gid;
 	ouid = ip->i_uid;
@@ -733,7 +733,7 @@
 		panic("ufs_chown: lost quota");
 #endif /* QUOTA */
 	ip->i_flag |= IN_CHANGE;
-	if (suser_xxx(cred, NULL, PRISON_ROOT) && (ouid != uid || ogid != gid))
+	if (suser_cred(cred, PRISON_ROOT) && (ouid != uid || ogid != gid))
 		ip->i_mode &= ~(ISUID | ISGID);
 	return (0);
 }
@@ -2370,7 +2370,7 @@
 	if (DOINGSOFTDEP(tvp))
 		softdep_change_linkcnt(ip);
 	if ((ip->i_mode & ISGID) && !groupmember(ip->i_gid, cnp->cn_cred) &&
-	    suser_xxx(cnp->cn_cred, NULL, PRISON_ROOT))
+	    suser_cred(cnp->cn_cred, PRISON_ROOT))
 		ip->i_mode &= ~ISGID;
 
 	if (cnp->cn_flags & ISWHITEOUT)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203251907.g2PJ7Dj79325>