aboutsummaryrefslogtreecommitdiff
path: root/sys/miscfs/devfs
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>1999-04-27 11:18:52 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>1999-04-27 11:18:52 +0000
commitf711d546d27edc6115841ef780df0252d44a996d (patch)
treed19d0988b873086bf6eda1c6543fc9257015af3d /sys/miscfs/devfs
parentd5483ddfbae9694934b27c4e7f23a4f0d3e0f5f4 (diff)
downloadsrc-f711d546d27edc6115841ef780df0252d44a996d.tar.gz
src-f711d546d27edc6115841ef780df0252d44a996d.zip
Suser() simplification:
1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
Notes
Notes: svn path=/head/; revision=46112
Diffstat (limited to 'sys/miscfs/devfs')
-rw-r--r--sys/miscfs/devfs/devfs_vnops.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c
index e6df82953dfe..64387e6bd29f 100644
--- a/sys/miscfs/devfs/devfs_vnops.c
+++ b/sys/miscfs/devfs/devfs_vnops.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: devfs_vnops.c,v 1.69 1999/01/28 00:57:49 dillon Exp $
+ * $Id: devfs_vnops.c,v 1.70 1999/02/25 16:06:51 bde Exp $
*/
@@ -378,10 +378,10 @@ found:
return (0);
/*
* Root gets to do anything.
- * but only use suser prives as a last resort
+ * but only use suser_xxx prives as a last resort
* (Use of super powers is recorded in ap->a_p->p_acflag)
*/
- if( suser(cred, &ap->a_p->p_acflag) == 0) /* XXX what if no proc? */
+ if( suser_xxx(cred, &ap->a_p->p_acflag) == 0) /* XXX what if no proc? */
return 0;
return (EACCES);
}
@@ -519,7 +519,7 @@ DBPRINT(("setattr\n"));
#endif
if (((vap->va_vaflags & VA_UTIMES_NULL) == 0) &&
(cred->cr_uid != file_node->uid) &&
- suser(cred, &p->p_acflag))
+ suser_xxx(cred, &p->p_acflag))
return (EPERM);
if(VOP_ACCESS(vp, VWRITE, cred, p))
return (EACCES);
@@ -534,7 +534,7 @@ DBPRINT(("setattr\n"));
*/
if (vap->va_mode != (u_short)VNOVAL) {
if ((cred->cr_uid != file_node->uid)
- && suser(cred, &p->p_acflag))
+ && suser_xxx(cred, &p->p_acflag))
return (EPERM);
/* set drwxwxrwx stuff */
file_node->mode &= ~07777;
@@ -545,7 +545,7 @@ DBPRINT(("setattr\n"));
* Change the owner.. must be root to do this.
*/
if (vap->va_uid != (uid_t)VNOVAL) {
- if (suser(cred, &p->p_acflag))
+ if (suser_xxx(cred, &p->p_acflag))
return (EPERM);
file_node->uid = vap->va_uid;
}
@@ -553,8 +553,8 @@ DBPRINT(("setattr\n"));
/*
* Change the group.. must be root or owner to do this.
* If we are the owner, we must be in the target group too.
- * don't use suser() unless you have to as it reports
- * whether you needed suser powers or not.
+ * don't use suser_xxx() unless you have to as it reports
+ * whether you needed suser_xxx powers or not.
*/
if (vap->va_gid != (gid_t)VNOVAL) {
if (cred->cr_uid == file_node->uid){
@@ -568,7 +568,7 @@ DBPRINT(("setattr\n"));
* we can't do it with normal privs,
* do we have an ace up our sleeve?
*/
- if( suser(cred, &p->p_acflag))
+ if( suser_xxx(cred, &p->p_acflag))
return (EPERM);
cando:
file_node->gid = vap->va_gid;
@@ -580,7 +580,7 @@ cando:
* flags should be handled some day
*/
if (vap->va_flags != VNOVAL) {
- if (error = suser(cred, &p->p_acflag))
+ if (error = suser_xxx(cred, &p->p_acflag))
return error;
if (cred->cr_uid == 0)
;