Deleted Added
sdiff udiff text old ( 164033 ) new ( 180291 )
full compact
1/*-
2 * Copyright (c) 1994, 1995 Scott Bartram
3 * Copyright (c) 1994 Arne H Juul
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: head/sys/i386/ibcs2/ibcs2_socksys.c 164033 2006-11-06 13:42:10Z rwatson $");
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/sysproto.h>
32#include <sys/jail.h>
33#include <sys/kernel.h>
34#include <sys/sysctl.h>
35
36#include <i386/ibcs2/ibcs2_socksys.h>
37#include <i386/ibcs2/ibcs2_util.h>
38
39/* Local structures */
40struct getipdomainname_args {
41 char *ipdomainname;

--- 128 unchanged lines hidden (view full) ---

170ibcs2_setipdomainname(td, uap)
171 struct thread *td;
172 struct setipdomainname_args *uap;
173{
174 char hname[MAXHOSTNAMELEN], *ptr;
175 int error, sctl[2], hlen;
176
177 /* W/out a hostname a domain-name is nonsense */
178 if ( strlen(hostname) == 0 )
179 return EINVAL;
180
181 /* Get the host's unqualified name (strip off the domain) */
182 snprintf(hname, sizeof(hname), "%s", hostname);
183 ptr = index(hname, '.');
184 if ( ptr != NULL ) {
185 ptr++;
186 *ptr = '\0';
187 } else {
188 if (strlcat(hname, ".", sizeof(hname)) >= sizeof(hname))
189 return (EINVAL);
190 }

--- 18 unchanged lines hidden ---