On Tue, Jun 24, 2003 at 09:56:58PM +0300, Alex Lyashkov wrote:
> On Tuesday 24 June 2003 21:17, Chris Murton wrote:
> > vserver-1:/# hostname host-28
> > hostname: you must be root to change the host name
> > vserver-1:/# whoami
> > root
> >
> > Any thoughts? ;)
> >
> Any original vserver have this bug.
> I fix it in snapshot rh-vserver-1052304359.diff.gz (7 may).

hrm, this is _not_ a bug ...

you change the hostname by specifying S_HOSTNAME=<name>
in the /etc/vservers/<name>.conf file ...

best,
Herbert

> For fix you must change one lines in kernel/sys.c.
> From
> asmlinkage long sys_sethostname(char *name, int len)
> {
>         int errno;
>         char *nodename;
> 
>         if( (!capable(CAP_SYS_ADMIN)))
>                 return -EPERM;
> To
> asmlinkage long sys_sethostname(char *name, int len)
> {
>         int errno;
>         char *nodename;
> 
>         if( (!capable(CAP_SYS_ADMIN)) && ! is_vps_admin())
>                 return -EPERM;
> 
> Also need fix sys_setdomainname.
> 
> -- 
> With best regards,
> Alex

Reply via email to