tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: /sbin/reboot and secmodel

>    128          if (geteuid())
>    129                  errx(1, "%s", strerror(EPERM));

> I think that the check of the uid can be removed since we trust the
> secmodel.

I don't think it was there because we didn't trust other things; all
the things reboot has traditionally done have been harmless when
attempted by root; doing that check is just a way of failing out early
and gracefully instead of getting a peculiar error from the first
root-only thing attempted.

It might be nice to just check whether we have rights to call reboot,
early, for the same reason.  (If there's no way to test for such
privilege without actually doing it, then perhaps that should change!)

> But for the signal SIGTSTP send to the init, I don't know, and
> honestly I don't know what init does catching this signal :)

init(8) says "init will cease creating new getty(8)'s and allow the
system to slowly die away, if it is sent a terminal stop (TSTP) signal
[...]".  (Well, it does in all three versions I have easy access to, at
least: 1.4T, 3.1, and 4.0.)

/~\ The ASCII                           der Mouse
\ / Ribbon Campaign
 X  Against HTML     
/ \ Email!           7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index