ypclnt_connect.c (1dd3ff6658ecdcc75c575807d504e23a9c451bdd) | ypclnt_connect.c (c0f2281eddc9d5dd8f5106611b93b8668ebb112d) |
---|---|
1/*- 2 * Copyright (c) 2002 Networks Associates Technology, Inc. 3 * All rights reserved. 4 * 5 * This software was developed for the FreeBSD Project by ThinkSec AS and 6 * NAI Labs, the Security Research Division of Network Associates, Inc. 7 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 8 * DARPA CHATS research program. --- 50 unchanged lines hidden (view full) --- 59 return (-1); 60 } 61 if (getdomainname(ypclnt->domain, MAXHOSTNAMELEN) != 0) { 62 ypclnt_error(ypclnt, __func__, 63 "can't get NIS domain name"); 64 return (-1); 65 } 66 } | 1/*- 2 * Copyright (c) 2002 Networks Associates Technology, Inc. 3 * All rights reserved. 4 * 5 * This software was developed for the FreeBSD Project by ThinkSec AS and 6 * NAI Labs, the Security Research Division of Network Associates, Inc. 7 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the 8 * DARPA CHATS research program. --- 50 unchanged lines hidden (view full) --- 59 return (-1); 60 } 61 if (getdomainname(ypclnt->domain, MAXHOSTNAMELEN) != 0) { 62 ypclnt_error(ypclnt, __func__, 63 "can't get NIS domain name"); 64 return (-1); 65 } 66 } |
67 YPCLNT_DEBUG("domain '%s'", ypclnt->domain); |
|
67 68 /* map must be specified */ 69 if (ypclnt->map == NULL) { 70 ypclnt_error(ypclnt, __func__, 71 "caller must specify map name"); 72 return (-1); 73 } | 68 69 /* map must be specified */ 70 if (ypclnt->map == NULL) { 71 ypclnt_error(ypclnt, __func__, 72 "caller must specify map name"); 73 return (-1); 74 } |
75 YPCLNT_DEBUG("map '%s'", ypclnt->map); |
|
74 75 /* get master server for requested map unless specified */ 76 if (ypclnt->server == NULL) { 77 r = yp_master(ypclnt->domain, ypclnt->map, &ypclnt->server); 78 if (r != 0) { 79 ypclnt_error(ypclnt, __func__, 80 "can't get NIS server name: %s", yperr_string(r)); 81 return (-1); 82 } 83 } | 76 77 /* get master server for requested map unless specified */ 78 if (ypclnt->server == NULL) { 79 r = yp_master(ypclnt->domain, ypclnt->map, &ypclnt->server); 80 if (r != 0) { 81 ypclnt_error(ypclnt, __func__, 82 "can't get NIS server name: %s", yperr_string(r)); 83 return (-1); 84 } 85 } |
86 YPCLNT_DEBUG("server '%s'", ypclnt->server); |
|
84 85 ypclnt_error(ypclnt, NULL, NULL); 86 return (0); 87} | 87 88 ypclnt_error(ypclnt, NULL, NULL); 89 return (0); 90} |