Lines Matching refs:nisbuf
86 nis_authorized(nisbuf_t *nisbuf)
94 if (strcmp(nisbuf->master, thishost) != 0)
197 nisbuf_t *nisbuf = NULL;
202 res = nis_getpwnam(name, items, rep, (void **)&nisbuf);
206 pw = nisbuf->pwd;
242 w->data.val_i = nisbuf->pwd->pw_uid;
245 w->data.val_i = nisbuf->pwd->pw_gid;
264 * Do not release nisbuf->domain.
270 if (nisbuf->master)
271 free(nisbuf->master);
272 if (nisbuf->scratch)
273 free(nisbuf->scratch);
274 if (nisbuf->c2scratch)
275 free(nisbuf->c2scratch);
276 free(nisbuf->pwd);
277 free(nisbuf);
292 nisbuf_t *nisbuf;
295 nisbuf = calloc(sizeof (*nisbuf), 1);
296 if (nisbuf == NULL)
299 nisbuf->pwd = malloc(sizeof (struct passwd));
300 if (nisbuf->pwd == NULL) {
301 free(nisbuf);
306 * Do not release nisbuf->domain.
312 if (yp_get_default_domain(&nisbuf->domain) != 0) {
314 free(nisbuf->pwd);
315 free(nisbuf);
319 if (yp_master(nisbuf->domain, "passwd.byname", &nisbuf->master) != 0) {
322 if (nisbuf->master)
323 free(nisbuf->master);
324 free(nisbuf->pwd);
325 free(nisbuf);
329 nisresult = yp_match(nisbuf->domain, "passwd.byname", name,
330 strlen(name), &(nisbuf->scratch),
331 &(nisbuf->scratchlen));
333 free(nisbuf->pwd);
334 if (nisbuf->scratch)
335 free(nisbuf->scratch);
336 if (nisbuf->master)
337 free(nisbuf->master);
338 free(nisbuf);
342 nis_to_pwd(nisbuf->scratch, nisbuf->pwd);
352 if (nisbuf->pwd->pw_passwd[0] == '#' &&
353 nisbuf->pwd->pw_passwd[1] == '#') {
354 char *key = &nisbuf->pwd->pw_passwd[2];
360 nisresult = yp_match(nisbuf->domain, "passwd.adjunct.byname",
361 key, keylen, &(nisbuf->c2scratch),
362 &(nisbuf->c2scratchlen));
364 if (nisresult == 0 && nisbuf->c2scratch != NULL) {
366 p = nisbuf->c2scratch;
368 nisbuf->pwd->pw_passwd = strsep(&p, ":");
372 free(nisbuf->pwd);
373 if (nisbuf->scratch)
374 free(nisbuf->scratch);
375 if (nisbuf->master)
376 free(nisbuf->master);
377 free(nisbuf);
382 *buf = (void *)nisbuf;
398 nisbuf_t *nisbuf = (nisbuf_t *)buf;
412 nisbuf->pwd->pw_passwd, nisbuf->pwd);
425 nisbuf->pwd->pw_passwd = crypt(p->data.val_s, salt);
429 nisbuf->pwd->pw_uid = (uid_t)p->data.val_i;
432 nisbuf->pwd->pw_gid = (gid_t)p->data.val_i;
435 nisbuf->pwd->pw_age = p->data.val_s;
438 nisbuf->pwd->pw_comment = p->data.val_s;
441 nisbuf->pwd->pw_gecos = p->data.val_s;
444 nisbuf->pwd->pw_dir = p->data.val_s;
447 nisbuf->pwd->pw_shell = p->data.val_s;
474 nisbuf_t *nisbuf = (nisbuf_t *)buf;
486 yppasswd.newpw = *nisbuf->pwd;
492 if (nis_authorized(nisbuf)) {
499 client = clnt_tp_create(nisbuf->master, YPPASSWDPROG,
504 client = clnt_create(nisbuf->master, YPPASSWDPROG,
507 client = clnt_create(nisbuf->master, YPPASSWDPROG,
523 if (nisbuf->pwd)
524 free(nisbuf->pwd);
525 if (nisbuf->master)
526 free(nisbuf->master);
527 if (nisbuf->scratch)
528 free(nisbuf->scratch);
529 if (nisbuf->c2scratch)
530 free(nisbuf->c2scratch);