diff options
author | tjr <tjr@FreeBSD.org> | 2003-08-23 15:45:57 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2003-08-23 15:45:57 +0000 |
commit | 8958714bb8409f154b6e7a7d33e2191f9bedfb44 (patch) | |
tree | 12dbb7efe0ee4f28d5705080857e8bed45b6cb89 | |
parent | 52c7b39fff984b2b70621f84eea067d8afbdd2cb (diff) | |
download | FreeBSD-src-8958714bb8409f154b6e7a7d33e2191f9bedfb44.zip FreeBSD-src-8958714bb8409f154b6e7a7d33e2191f9bedfb44.tar.gz |
Fix a logic error in osethostid() that was introduced in rev. 1.34:
allow hostid to be set when suser() returns 0, not when it returns
an error. This would have allowed non-root users to set the host ID.
-rw-r--r-- | sys/kern/kern_xxx.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_xxx.c b/sys/kern/kern_xxx.c index f3d8154..47988da 100644 --- a/sys/kern/kern_xxx.c +++ b/sys/kern/kern_xxx.c @@ -144,11 +144,12 @@ osethostid(td, uap) { int error; - mtx_lock(&Giant); if ((error = suser(td))) - hostid = uap->hostid; + return (error); + mtx_lock(&Giant); + hostid = uap->hostid; mtx_unlock(&Giant); - return (error); + return (0); } /* |