PERFORCE change 79531 for review
Robert Watson
rwatson at FreeBSD.org
Mon Jul 4 11:03:34 GMT 2005
http://perforce.freebsd.org/chv.cgi?CH=79531
Change 79531 by rwatson at rwatson_paprika on 2005/07/04 11:03:25
Convert remaining suser() calls in tty.c into cap_check() calls.
Not a perfect semantic match, but not too bad either.
Affected files ...
.. //depot/projects/trustedbsd/sebsd/sys/kern/tty.c#11 edit
Differences ...
==== //depot/projects/trustedbsd/sebsd/sys/kern/tty.c#11 (text+ko) ====
@@ -1028,7 +1028,7 @@
break;
case TIOCMSDTRWAIT:
/* must be root since the wait applies to following logins */
- error = suser(td);
+ error = cap_check(td, CAP_SYS_TTY_CONFIG);
if (error)
return (error);
tp->t_dtr_wait = *(int *)data * hz / 100;
@@ -3124,7 +3124,8 @@
goto out;
goto open_top;
}
- if (tp->t_state & TS_XCLUDE && suser(td))
+ if (tp->t_state & TS_XCLUDE && cap_check(td,
+ CAP_SYS_TTY_CONFIG))
return (EBUSY);
} else {
/*
@@ -3353,7 +3354,7 @@
ct = dev->si_drv2;
switch (cmd) {
case TIOCSETA:
- error = suser(td);
+ error = cap_check(td, CAP_SYS_TTY_CONFIG);
if (error != 0)
return (error);
*ct = *(struct termios *)data;
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message
More information about the trustedbsd-cvs
mailing list