2003-03-30 23:34:38

by Stephan Maciej

[permalink] [raw]
Subject: [PATCH 2.5.66 & 2.4.20] Fix sys_sethostname() and sys_setdomainname()

Hi,

a long time ago someone mentioned that sethostname() and setdomainname()
properly return -EFAULT when passing an invalid pointer to the new name, but
instead of leaving the fields in system_utsname unchanged the nodename and
domainname are set to an empty string.

The behaviour of sys_sethostname() can be verified using the attached program
(sethostname.c); sys_setdomainname() is almost the same so I guess that it
has the same defect :-)

The attached patches fix this.

Stephan


Attachments:
(No filename) (494.00 B)
sethostanddomainname-2.5.66.diff (1.08 kB)
sethostname.c (944.00 B)
sethostanddomainname-2.4.20.diff (1.05 kB)
Download all attachments