summaryrefslogtreecommitdiffstats
path: root/sys/i386/ibcs2
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/ibcs2')
-rw-r--r--sys/i386/ibcs2/ibcs2_misc.c22
-rw-r--r--sys/i386/ibcs2/ibcs2_socksys.c3
-rw-r--r--sys/i386/ibcs2/ibcs2_sysi86.c2
3 files changed, 14 insertions, 13 deletions
diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c
index 164c369..46542ba1 100644
--- a/sys/i386/ibcs2/ibcs2_misc.c
+++ b/sys/i386/ibcs2/ibcs2_misc.c
@@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/file.h> /* Must come after sys/malloc.h */
#include <sys/mutex.h>
+#include <sys/priv.h>
#include <sys/reboot.h>
#include <sys/resourcevar.h>
#include <sys/stat.h>
@@ -1008,14 +1009,22 @@ ibcs2_plock(td, uap)
#define IBCS2_DATALOCK 4
- if ((error = suser(td)) != 0)
- return EPERM;
switch(uap->cmd) {
case IBCS2_UNLOCK:
+ error = priv_check(td, PRIV_VM_MUNLOCK);
+ if (error)
+ return (error);
+ /* XXX - TODO */
+ return (0);
+
case IBCS2_PROCLOCK:
case IBCS2_TEXTLOCK:
case IBCS2_DATALOCK:
- return 0; /* XXX - TODO */
+ error = priv_check(td, PRIV_VM_MLOCK);
+ if (error)
+ return (error);
+ /* XXX - TODO */
+ return 0;
}
return EINVAL;
}
@@ -1043,9 +1052,6 @@ ibcs2_uadmin(td, uap)
#define SCO_AD_GETBMAJ 0
#define SCO_AD_GETCMAJ 1
- if (suser(td))
- return EPERM;
-
switch(uap->cmd) {
case SCO_A_REBOOT:
case SCO_A_SHUTDOWN:
@@ -1055,11 +1061,11 @@ ibcs2_uadmin(td, uap)
case SCO_AD_PWRDOWN:
case SCO_AD_PWRNAP:
r.opt = RB_HALT;
- reboot(td, &r);
+ return (reboot(td, &r));
case SCO_AD_BOOT:
case SCO_AD_IBOOT:
r.opt = RB_AUTOBOOT;
- reboot(td, &r);
+ return (reboot(td, &r));
}
return EINVAL;
case SCO_A_REMOUNT:
diff --git a/sys/i386/ibcs2/ibcs2_socksys.c b/sys/i386/ibcs2/ibcs2_socksys.c
index 515f318..f4939cf 100644
--- a/sys/i386/ibcs2/ibcs2_socksys.c
+++ b/sys/i386/ibcs2/ibcs2_socksys.c
@@ -174,9 +174,6 @@ ibcs2_setipdomainname(td, uap)
char hname[MAXHOSTNAMELEN], *ptr;
int error, sctl[2], hlen;
- if ((error = suser(td)))
- return (error);
-
/* W/out a hostname a domain-name is nonsense */
if ( strlen(hostname) == 0 )
return EINVAL;
diff --git a/sys/i386/ibcs2/ibcs2_sysi86.c b/sys/i386/ibcs2/ibcs2_sysi86.c
index 12321d1..4d76218 100644
--- a/sys/i386/ibcs2/ibcs2_sysi86.c
+++ b/sys/i386/ibcs2/ibcs2_sysi86.c
@@ -76,8 +76,6 @@ ibcs2_sysi86(struct thread *td, struct ibcs2_sysi86_args *args)
int name[2];
int error;
- if ((error = suser(td)))
- return (error);
name[0] = CTL_KERN;
name[1] = KERN_HOSTNAME;
mtx_lock(&Giant);
OpenPOWER on IntegriCloud