Re: Request for review: uname(), setdomainname(), getdomainname() cleanups

From: Roman Divacky <rdivacky_at_FreeBSD.org>
Date: Fri, 7 Nov 2008 12:13:05 +0100
On Fri, Nov 07, 2008 at 12:12:01PM +0100, Ed Schouten wrote:
> Hello all,
> 
> I just wrote this patch and I thought I'd better send it to the lists,
> because it affects a lot of random things (Linux emulation, priv(9)
> flags, etc).
> 
> Looking at kern_xxx.c, I see we've got a couple of functions there that
> actually have to be #ifdef'd with COMPAT_*, while they aren't. Looking
> at our CVS repository I can already confirm we don't need to implement
> uname(), setdomainname() and getdomainname() on RELENG_5 and later, so I
> put them in COMPAT_FREEBSD4. They are implemented as library routines
> nowdays. I think they could even be marked as COMPAT_43, but just to be
> sure I picked COMPAT_FREEBSD4.
> 
> Below is a list of things of interest:
> 
> - I noticed we have a PRIV_SETDOMAINNAME, but we don't use it inside
>   sysctl_domainname(). This means that you can bypass PRIV_SETDOMAINNAME
>   anyway, so remove it.
> 
> - I think it's better if we just implement getdomainname() and
>   setdomainname() by calling userland_sysctl(). This makes it less
>   likely to break if we would ever change sysctl_domainname() in
>   kern_mib.c.
> 
> - To make the linuxolator compile without enabling COMPAT_FREEBSD4, I
>   added a linux_setdomainname(). I also noticed linux_sethostname()
>   called userland_sysctl() without holding Giant.
> 
> - It wasn't easy to make uname(), setdomainname() and getdomainname()
>   work in COMPAT_FREEBSD32, because we would actually need a
>   "COMPAT4+NOPROTO" option for syscalls.master. Because these system
>   calls aren't likely to be used, I just disabled them. If it turns out
>   we really need them, we could reintroduce them.
> 
> Any comments? If not, I'll commit it to SVN in a day or two. Thanks!

I just quickly looked at it but I think it's correct and I like the
patch. OK from me
Received on Fri Nov 07 2008 - 10:16:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:37 UTC