Lines Matching defs:nisbuf

85 nis_privileged(nisbuf_t *nisbuf)
93 if (strcmp(nisbuf->master, thishost) != 0)
193 nisbuf_t *nisbuf = NULL;
198 res = nis_getpwnam(name, items, rep, (void **)&nisbuf);
202 pw = nisbuf->pwd;
238 w->data.val_i = nisbuf->pwd->pw_uid;
241 w->data.val_i = nisbuf->pwd->pw_gid;
259 * Do not release nisbuf->domain.
265 if (nisbuf->master)
266 free(nisbuf->master);
267 if (nisbuf->scratch)
268 free(nisbuf->scratch);
269 if (nisbuf->c2scratch)
270 free(nisbuf->c2scratch);
271 free(nisbuf->pwd);
272 free(nisbuf);
287 nisbuf_t *nisbuf;
290 nisbuf = calloc(sizeof (*nisbuf), 1);
291 if (nisbuf == NULL)
294 nisbuf->pwd = malloc(sizeof (struct passwd));
295 if (nisbuf->pwd == NULL) {
296 free(nisbuf);
301 * Do not release nisbuf->domain.
307 if (yp_get_default_domain(&nisbuf->domain) != 0) {
309 free(nisbuf->pwd);
310 free(nisbuf);
314 if (yp_master(nisbuf->domain, "passwd.byname", &nisbuf->master) != 0) {
317 if (nisbuf->master)
318 free(nisbuf->master);
319 free(nisbuf->pwd);
320 free(nisbuf);
324 nisresult = yp_match(nisbuf->domain, "passwd.byname", name,
325 strlen(name), &(nisbuf->scratch),
326 &(nisbuf->scratchlen));
328 (void) free(nisbuf->pwd);
329 if (nisbuf->scratch)
330 (void) free(nisbuf->scratch);
331 if (nisbuf->master)
332 (void) free(nisbuf->master);
333 (void) free(nisbuf);
337 nis_to_pwd(nisbuf->scratch, nisbuf->pwd);
347 if (nisbuf->pwd->pw_passwd[0] == '#' &&
348 nisbuf->pwd->pw_passwd[1] == '#') {
349 char *key = &nisbuf->pwd->pw_passwd[2];
355 nisresult = yp_match(nisbuf->domain, "passwd.adjunct.byname",
356 key, keylen, &(nisbuf->c2scratch),
357 &(nisbuf->c2scratchlen));
359 if (nisresult == 0 && nisbuf->c2scratch != NULL) {
361 p = nisbuf->c2scratch;
363 nisbuf->pwd->pw_passwd = strsep(&p, ":");
367 *buf = (void *)nisbuf;
383 nisbuf_t *nisbuf = (nisbuf_t *)buf;
397 nisbuf->pwd->pw_passwd, nisbuf->pwd);
410 nisbuf->pwd->pw_passwd = crypt(p->data.val_s, salt);
414 nisbuf->pwd->pw_uid = (uid_t)p->data.val_i;
417 nisbuf->pwd->pw_gid = (gid_t)p->data.val_i;
420 nisbuf->pwd->pw_age = p->data.val_s;
423 nisbuf->pwd->pw_comment = p->data.val_s;
426 nisbuf->pwd->pw_gecos = p->data.val_s;
429 nisbuf->pwd->pw_dir = p->data.val_s;
432 nisbuf->pwd->pw_shell = p->data.val_s;
459 nisbuf_t *nisbuf = (nisbuf_t *)buf;
471 yppasswd.newpw = *nisbuf->pwd;
477 if (nis_privileged(nisbuf)) {
484 client = clnt_tp_create(nisbuf->master, YPPASSWDPROG,
489 client = clnt_create(nisbuf->master, YPPASSWDPROG,
492 client = clnt_create(nisbuf->master, YPPASSWDPROG,
508 if (nisbuf->pwd)
509 (void) free(nisbuf->pwd);
510 if (nisbuf->master)
511 (void) free(nisbuf->master);
512 if (nisbuf->scratch)
513 (void) free(nisbuf->scratch);
514 if (nisbuf->c2scratch)
515 (void) free(nisbuf->c2scratch);