Re: in_ioctl*: hoist identical privilege checks

2023-04-24 Thread Alexander Bluhm
On Sun, Apr 23, 2023 at 11:33:57PM +, Klemens Nanni wrote: > > > I can't think of a scenario where returning EPERM (this diff) instead of > > > whatever errno the currently earlier sanity checks yield would break. It would surprise me if some userland would rely on the error code when the ioct

Re: in_ioctl*: hoist identical privilege checks

2023-04-23 Thread Klemens Nanni
On Tue, Apr 18, 2023 at 10:44:36PM +, Klemens Nanni wrote: > On Sat, Apr 15, 2023 at 01:48:02PM +, Klemens Nanni wrote: > > On Fri, Apr 14, 2023 at 11:33:18PM +, Klemens Nanni wrote: > > > All cases do the same check up first, so merge it before the switch. > > Committed. > > > > It c

Re: in_ioctl*: hoist identical privilege checks

2023-04-18 Thread Klemens Nanni
On Sat, Apr 15, 2023 at 01:48:02PM +, Klemens Nanni wrote: > On Fri, Apr 14, 2023 at 11:33:18PM +, Klemens Nanni wrote: > > All cases do the same check up first, so merge it before the switch. Committed. > > It could be hoisted further in both in_ioctl() and in_ioctl_change_ifaddr(), > >

Re: in_ioctl*: hoist identical privilege checks

2023-04-15 Thread Klemens Nanni
On Fri, Apr 14, 2023 at 11:33:18PM +, Klemens Nanni wrote: > All cases do the same check up first, so merge it before the switch. > > It could be hoisted further in both in_ioctl() and in_ioctl_change_ifaddr(), > but that meant a change in errno return semantic, so leave it for now. in6.c alr

in_ioctl*: hoist identical privilege checks

2023-04-14 Thread Klemens Nanni
All cases do the same check up first, so merge it before the switch. It could be hoisted further in both in_ioctl() and in_ioctl_change_ifaddr(), but that meant a change in errno return semantic, so leave it for now. Feedback? Objection OK? Index: in.c ===