2 * Copyright (c) 1995, 1996
3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by Bill Paul.
16 * 4. Neither the name of the author nor the names of any co-contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 #include <sys/cdefs.h>
34 __FBSDID("$FreeBSD$");
36 #include <sys/param.h>
37 #include <sys/fcntl.h>
38 #include <sys/socket.h>
42 #include <arpa/inet.h>
43 #include <netinet/in.h>
61 #include <rpcsvc/yp.h>
63 #include <rpcsvc/ypclnt.h>
64 #include "yppasswdd_extern.h"
66 #include "yppasswd_private.h"
67 #include "ypxfr_extern.h"
68 #include "yp_extern.h"
70 static struct passwd yp_password;
73 xlate_passwd(struct x_master_passwd *xpwd, struct passwd *pwd)
75 pwd->pw_name = xpwd->pw_name;
76 pwd->pw_passwd = xpwd->pw_passwd;
77 pwd->pw_uid = xpwd->pw_uid;
78 pwd->pw_gid = xpwd->pw_gid;
79 pwd->pw_change = xpwd->pw_change;
80 pwd->pw_class = xpwd->pw_class;
81 pwd->pw_gecos = xpwd->pw_gecos;
82 pwd->pw_dir = xpwd->pw_dir;
83 pwd->pw_shell = xpwd->pw_shell;
84 pwd->pw_expire = xpwd->pw_expire;
85 pwd->pw_fields = xpwd->pw_fields;
89 copy_yp_pass(char *p, int x, int m)
94 yp_password.pw_fields = 0;
96 buf = realloc(buf, m + 10);
99 /* Turn all colons into NULLs */
100 while (strchr(s, ':')) {
101 s = (strchr(s, ':') + 1);
106 #define EXPAND(e) e = t; while ((*t++ = *p++));
107 EXPAND(yp_password.pw_name);
108 yp_password.pw_fields |= _PWF_NAME;
109 EXPAND(yp_password.pw_passwd);
110 yp_password.pw_fields |= _PWF_PASSWD;
111 yp_password.pw_uid = atoi(p);
112 p += (strlen(p) + 1);
113 yp_password.pw_fields |= _PWF_UID;
114 yp_password.pw_gid = atoi(p);
115 p += (strlen(p) + 1);
116 yp_password.pw_fields |= _PWF_GID;
118 EXPAND(yp_password.pw_class);
119 yp_password.pw_fields |= _PWF_CLASS;
120 yp_password.pw_change = atol(p);
121 p += (strlen(p) + 1);
122 yp_password.pw_fields |= _PWF_CHANGE;
123 yp_password.pw_expire = atol(p);
124 p += (strlen(p) + 1);
125 yp_password.pw_fields |= _PWF_EXPIRE;
127 EXPAND(yp_password.pw_gecos);
128 yp_password.pw_fields |= _PWF_GECOS;
129 EXPAND(yp_password.pw_dir);
130 yp_password.pw_fields |= _PWF_DIR;
131 EXPAND(yp_password.pw_shell);
132 yp_password.pw_fields |= _PWF_SHELL;
138 validchars(char *arg)
142 for (i = 0; i < strlen(arg); i++) {
143 if (iscntrl(arg[i])) {
144 yp_error("string contains a control character");
148 yp_error("string contains a colon");
151 /* Be evil: truncate strings with \n in them silently. */
152 if (arg[i] == '\n') {
161 validate_master(struct passwd *opw __unused, struct x_master_passwd *npw)
164 if (npw->pw_name[0] == '+' || npw->pw_name[0] == '-') {
165 yp_error("client tried to modify an NIS entry");
169 if (validchars(npw->pw_shell)) {
170 yp_error("specified shell contains invalid characters");
174 if (validchars(npw->pw_gecos)) {
175 yp_error("specified gecos field contains invalid characters");
179 if (validchars(npw->pw_passwd)) {
180 yp_error("specified password contains invalid characters");
187 validate(struct passwd *opw, struct x_passwd *npw)
190 if (npw->pw_name[0] == '+' || npw->pw_name[0] == '-') {
191 yp_error("client tried to modify an NIS entry");
195 if ((uid_t)npw->pw_uid != opw->pw_uid) {
196 yp_error("UID mismatch: client says user %s has UID %d",
197 npw->pw_name, npw->pw_uid);
198 yp_error("database says user %s has UID %d", opw->pw_name,
203 if ((gid_t)npw->pw_gid != opw->pw_gid) {
204 yp_error("GID mismatch: client says user %s has GID %d",
205 npw->pw_name, npw->pw_gid);
206 yp_error("database says user %s has GID %d", opw->pw_name,
212 * Don't allow the user to shoot himself in the foot,
215 if (!ok_shell(npw->pw_shell)) {
216 yp_error("%s is not a valid shell", npw->pw_shell);
220 if (validchars(npw->pw_shell)) {
221 yp_error("specified shell contains invalid characters");
225 if (validchars(npw->pw_gecos)) {
226 yp_error("specified gecos field contains invalid characters");
230 if (validchars(npw->pw_passwd)) {
231 yp_error("specified password contains invalid characters");
239 * In order to have one rpc.yppasswdd support multiple domains,
240 * we have to cheat: we search each directory under /var/yp
241 * and try to match the user in each master.passwd.byname
242 * map that we find. If the user matches (username, uid and gid
243 * all agree), then we use that domain. If we match the user in
244 * more than one database, we must abort.
247 find_domain(struct x_passwd *pw)
252 char yp_mapdir[MAXPATHLEN + 2];
253 static char domain[YPMAXDOMAIN];
258 yp_error("performing multidomain lookup");
260 if ((dird = opendir(yp_dir)) == NULL) {
261 yp_error("opendir(%s) failed: %s", yp_dir, strerror(errno));
265 while ((dirp = readdir(dird)) != NULL) {
266 snprintf(yp_mapdir, sizeof yp_mapdir, "%s/%s",
267 yp_dir, dirp->d_name);
268 if (stat(yp_mapdir, &statbuf) < 0) {
269 yp_error("stat(%s) failed: %s", yp_mapdir,
274 if (S_ISDIR(statbuf.st_mode)) {
275 tmp = (char *)dirp->d_name;
276 key.data = pw->pw_name;
277 key.size = strlen(pw->pw_name);
279 if (yp_get_record(tmp,"master.passwd.byname",
280 &key, &data, 0) != YP_TRUE) {
283 *((char *)data.data + data.size) = '\0';
284 copy_yp_pass(data.data, 1, data.size);
285 if (yp_password.pw_uid == (uid_t)pw->pw_uid &&
286 yp_password.pw_gid == (gid_t)pw->pw_gid) {
288 snprintf(domain, YPMAXDOMAIN, "%s", tmp);
295 yp_error("found same user in two different domains");
298 return((char *)&domain);
301 static const char *maps[] = {
302 "master.passwd.byname",
303 "master.passwd.byuid",
308 static const char *formats[] = {
309 "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s",
310 "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s",
311 "%s:%s:%d:%d:%s:%s:%s",
312 "%s:%s:%d:%d:%s:%s:%s"
316 update_inplace(struct passwd *pw, char *domain)
319 DBT key = { NULL, 0 };
320 DBT data = { NULL, 0 };
321 char pwbuf[YPMAXRECORD];
325 static char yp_last[] = "YP_LAST_MODIFIED";
326 char yplastbuf[YPMAXRECORD];
328 snprintf(yplastbuf, sizeof yplastbuf, "%llu",
329 (unsigned long long)time(NULL));
331 for (i = 0; i < 4; i++) {
334 snprintf(keybuf, sizeof keybuf,
335 "%llu", (unsigned long long)pw->pw_uid);
337 key.size = strlen(keybuf);
339 key.data = pw->pw_name;
340 key.size = strlen(pw->pw_name);
344 * XXX The passwd.byname and passwd.byuid maps come in
345 * two flavors: secure and insecure. The secure version
346 * has a '*' in the password field whereas the insecure one
347 * has a real crypted password. The maps will be insecure
348 * if they were built with 'unsecure = TRUE' enabled in
349 * /var/yp/Makefile, but we'd have no way of knowing if
350 * this has been done unless we were to try parsing the
351 * Makefile, which is a disgusting thought. Instead, we
352 * read the records from the maps, skip to the first ':'
353 * in them, and then look at the character immediately
354 * following it. If it's an '*' then the map is 'secure'
355 * and we must not insert a real password into the pw_passwd
356 * field. If it's not an '*', then we put the real crypted
359 if (yp_get_record(domain,maps[i],&key,&data,1) != YP_TRUE) {
360 yp_error("couldn't read %s/%s: %s", domain,
361 maps[i], strerror(errno));
365 if ((ptr = strchr(data.data, ':')) == NULL) {
366 yp_error("no colon in passwd record?!");
371 * XXX Supposing we have more than one user with the same
372 * UID? (Or more than one user with the same name?) We could
373 * end up modifying the wrong record if were not careful.
376 if (strncmp(data.data, pw->pw_name,
377 strlen(pw->pw_name))) {
378 yp_error("warning: found entry for UID %d \
379 in map %s@%s with wrong name (%.*s)", pw->pw_uid, maps[i], domain,
380 (int)(ptr - (char *)data.data),
382 yp_error("there may be more than one user \
383 with the same UID - continuing");
388 * We're really being ultra-paranoid here.
389 * This is generally a 'can't happen' condition.
391 snprintf(pwbuf, sizeof pwbuf, ":%d:%d:", pw->pw_uid,
393 if (!strstr(data.data, pwbuf)) {
394 yp_error("warning: found entry for user %s \
395 in map %s@%s with wrong UID", pw->pw_name, maps[i], domain);
396 yp_error("there may be more than one user \
397 with the same name - continuing");
403 snprintf(pwbuf, sizeof pwbuf, formats[i],
404 pw->pw_name, pw->pw_passwd, pw->pw_uid,
405 pw->pw_gid, pw->pw_class, pw->pw_change,
406 pw->pw_expire, pw->pw_gecos, pw->pw_dir,
409 snprintf(pwbuf, sizeof pwbuf, formats[i],
410 pw->pw_name, *(ptr+1) == '*' ? "*" : pw->pw_passwd,
411 pw->pw_uid, pw->pw_gid, pw->pw_gecos, pw->pw_dir,
415 #define FLAGS O_RDWR|O_CREAT
417 if ((dbp = yp_open_db_rw(domain, maps[i], FLAGS)) == NULL) {
418 yp_error("couldn't open %s/%s r/w: %s",domain,
419 maps[i],strerror(errno));
424 data.size = strlen(pwbuf);
426 if (yp_put_record(dbp, &key, &data, 1) != YP_TRUE) {
427 yp_error("failed to update record in %s/%s", domain,
429 (void)(dbp->close)(dbp);
434 key.size = strlen(yp_last);
435 data.data = (char *)&yplastbuf;
436 data.size = strlen(yplastbuf);
438 if (yp_put_record(dbp, &key, &data, 1) != YP_TRUE) {
439 yp_error("failed to update timestamp in %s/%s", domain,
441 (void)(dbp->close)(dbp);
445 (void)(dbp->close)(dbp);
452 yppasswdproc_update_1_svc(yppasswd *argp, struct svc_req *rqstp)
455 struct sockaddr_in *rqhost;
460 int passwd_changed = 0;
461 int shell_changed = 0;
462 int gecos_changed = 0;
464 char *oldshell = NULL;
465 char *oldgecos = NULL;
467 char passfile_buf[MAXPATHLEN + 2];
468 char passfile_hold_buf[MAXPATHLEN + 2];
469 char *domain = yppasswd_domain;
470 static struct sockaddr_in clntaddr;
471 static struct timeval t_saved, t_test;
474 * Normal user updates always use the 'default' master.passwd file.
477 passfile = passfile_default;
480 rqhost = svc_getcaller(rqstp->rq_xprt);
482 gettimeofday(&t_test, NULL);
483 if (!bcmp(rqhost, &clntaddr, sizeof *rqhost) &&
484 t_test.tv_sec > t_saved.tv_sec &&
485 t_test.tv_sec - t_saved.tv_sec < 300) {
487 bzero(&clntaddr, sizeof clntaddr);
488 bzero(&t_saved, sizeof t_saved);
492 bcopy(rqhost, &clntaddr, sizeof clntaddr);
493 gettimeofday(&t_saved, NULL);
495 if (yp_access(resvport ? "master.passwd.byname" : NULL, rqstp)) {
496 yp_error("rejected update request from unauthorized host");
497 svcerr_auth(rqstp->rq_xprt, AUTH_BADCRED);
502 * Step one: find the user. (It's kinda pointless to
503 * proceed if the user doesn't exist.) We look for the
504 * user in the master.passwd.byname database, _NOT_ by
505 * using getpwent() and friends! We can't use getpwent()
506 * since the NIS master server is not guaranteed to be
507 * configured as an NIS client.
511 if ((domain = find_domain(&argp->newpw)) == NULL) {
512 yp_error("multidomain lookup failed - aborting update");
515 yp_error("updating user %s in domain %s",
516 argp->newpw.pw_name, domain);
519 key.data = argp->newpw.pw_name;
520 key.size = strlen(argp->newpw.pw_name);
522 if ((rval = yp_get_record(domain,"master.passwd.byname",
523 &key, &data, 0)) != YP_TRUE) {
524 if (rval == YP_NOKEY) {
525 yp_error("user %s not found in passwd database",
526 argp->newpw.pw_name);
528 yp_error("database access error: %s",
534 /* Nul terminate, please. */
535 *((char *)data.data + data.size) = '\0';
537 copy_yp_pass(data.data, 1, data.size);
539 /* Step 2: check that the supplied oldpass is valid. */
541 cryptpw = crypt(argp->oldpass, yp_password.pw_passwd);
542 if (cryptpw == NULL || strcmp(cryptpw, yp_password.pw_passwd)) {
543 yp_error("rejected change attempt -- bad password");
544 yp_error("client address: %s username: %s",
545 inet_ntoa(rqhost->sin_addr),
546 argp->newpw.pw_name);
550 /* Step 3: validate the arguments passed to us by the client. */
552 if (validate(&yp_password, &argp->newpw)) {
553 yp_error("rejecting change attempt: bad arguments");
554 yp_error("client address: %s username: %s",
555 inet_ntoa(rqhost->sin_addr),
556 argp->newpw.pw_name);
557 svcerr_decode(rqstp->rq_xprt);
561 /* Step 4: update the user's passwd structure. */
563 if (!no_chsh && strcmp(argp->newpw.pw_shell, yp_password.pw_shell)) {
564 oldshell = yp_password.pw_shell;
565 yp_password.pw_shell = argp->newpw.pw_shell;
570 if (!no_chfn && strcmp(argp->newpw.pw_gecos, yp_password.pw_gecos)) {
571 oldgecos = yp_password.pw_gecos;
572 yp_password.pw_gecos = argp->newpw.pw_gecos;
576 if (strcmp(argp->newpw.pw_passwd, yp_password.pw_passwd)) {
577 yp_password.pw_passwd = argp->newpw.pw_passwd;
578 yp_password.pw_change = 0;
583 * If the caller specified a domain other than our 'default'
584 * domain, change the path to master.passwd accordingly.
587 if (strcmp(domain, yppasswd_domain)) {
588 snprintf(passfile_buf, sizeof(passfile_buf),
589 "%s/%s/master.passwd", yp_dir, domain);
590 passfile = (char *)&passfile_buf;
594 * Create a filename to hold the original master.passwd
595 * so if our call to yppwupdate fails we can roll back
597 snprintf(passfile_hold_buf, sizeof(passfile_hold_buf),
598 "%s.hold", passfile);
599 passfile_hold = (char *)&passfile_hold_buf;
602 /* Step 5: make a new password file with the updated info. */
604 if (pw_init(dirname(passfile), passfile)) {
605 yp_error("pw_init() failed");
608 if ((pfd = pw_lock()) == -1) {
610 yp_error("pw_lock() failed");
613 if ((tfd = pw_tmp(-1)) == -1) {
615 yp_error("pw_tmp() failed");
618 if (pw_copy(pfd, tfd, &yp_password, NULL) == -1) {
620 yp_error("pw_copy() failed");
623 if (rename(passfile, passfile_hold) == -1) {
625 yp_error("rename of %s to %s failed", passfile,
630 if (strcmp(passfile, _PATH_MASTERPASSWD) == 0) {
632 * NIS server is exporting the system's master.passwd.
633 * Call pw_mkdb to rebuild passwd and the .db files
635 if (pw_mkdb(yp_password.pw_name) == -1) {
637 yp_error("pw_mkdb() failed");
638 rename(passfile_hold, passfile);
643 * NIS server is exporting a private master.passwd.
644 * Rename tempfile into final location
646 if (rename(pw_tempname(), passfile) == -1) {
648 yp_error("rename of %s to %s failed",
649 pw_tempname(), passfile);
650 rename(passfile_hold, passfile);
658 if ((rval = update_inplace(&yp_password, domain))) {
659 yp_error("inplace update failed -- rebuilding maps");
663 switch ((pid = fork())) {
665 if (inplace && !rval) {
666 execlp(MAP_UPDATE_PATH, MAP_UPDATE, passfile,
667 yppasswd_domain, "pushpw", (char *)NULL);
669 execlp(MAP_UPDATE_PATH, MAP_UPDATE, passfile,
670 yppasswd_domain, (char *)NULL);
672 yp_error("couldn't exec map update process: %s",
675 rename(passfile_hold, passfile);
679 yp_error("fork() failed: %s", strerror(errno));
681 rename(passfile_hold, passfile);
685 unlink(passfile_hold);
690 yp_error("update completed for user %s (uid %d) in %s:",
691 argp->newpw.pw_name, argp->newpw.pw_uid, passfile);
694 yp_error("password changed");
697 yp_error("gecos changed ('%s' -> '%s')",
698 oldgecos, argp->newpw.pw_gecos);
701 yp_error("shell changed ('%s' -> '%s')",
702 oldshell, argp->newpw.pw_shell);
710 * Note that this function performs a little less sanity checking
711 * than the last one. Since only the superuser is allowed to use it,
712 * it is assumed that the caller knows what he's doing.
715 yppasswdproc_update_master_1_svc(master_yppasswd *argp,
716 struct svc_req *rqstp)
725 char passfile_buf[MAXPATHLEN + 2];
726 char passfile_hold_buf[MAXPATHLEN + 2];
727 struct sockaddr_in *rqhost;
729 struct passwd newpasswd;
732 transp = rqstp->rq_xprt;
735 * NO AF_INET CONNETCIONS ALLOWED!
737 rqhost = svc_getcaller(transp);
738 if (rqhost->sin_family != AF_UNIX) {
739 yp_error("Alert! %s/%d attempted to use superuser-only \
740 procedure!\n", inet_ntoa(rqhost->sin_addr), rqhost->sin_port);
741 svcerr_auth(transp, AUTH_BADCRED);
745 if (rqstp->rq_cred.oa_flavor != AUTH_SYS) {
746 yp_error("caller didn't send proper credentials");
747 svcerr_auth(transp, AUTH_BADCRED);
751 if (__rpc_get_local_uid(transp, &uid) < 0) {
752 yp_error("caller didn't send proper credentials");
753 svcerr_auth(transp, AUTH_BADCRED);
758 yp_error("caller euid is %d, expecting 0 -- rejecting request",
760 svcerr_auth(rqstp->rq_xprt, AUTH_BADCRED);
764 passfile = passfile_default;
766 key.data = argp->newpw.pw_name;
767 key.size = strlen(argp->newpw.pw_name);
770 * The superuser may add entries to the passwd maps if
771 * rpc.yppasswdd is started with the -a flag. Paranoia
772 * prevents me from allowing additions by default.
774 if ((rval = yp_get_record(argp->domain, "master.passwd.byname",
775 &key, &data, 0)) != YP_TRUE) {
776 if (rval == YP_NOKEY) {
777 yp_error("user %s not found in passwd database",
778 argp->newpw.pw_name);
780 yp_error("notice: adding user %s to \
781 master.passwd database for domain %s", argp->newpw.pw_name, argp->domain);
783 yp_error("restart rpc.yppasswdd with the -a flag to \
784 allow additions to be made to the password database");
786 yp_error("database access error: %s",
789 if (!allow_additions)
793 /* Nul terminate, please. */
794 *((char *)data.data + data.size) = '\0';
796 copy_yp_pass(data.data, 1, data.size);
800 * Perform a small bit of sanity checking.
802 if (validate_master(rval == YP_TRUE ? &yp_password:NULL,&argp->newpw)){
803 yp_error("rejecting update attempt for %s: bad arguments",
804 argp->newpw.pw_name);
809 * If the caller specified a domain other than our 'default'
810 * domain, change the path to master.passwd accordingly.
813 if (strcmp(argp->domain, yppasswd_domain)) {
814 snprintf(passfile_buf, sizeof(passfile_buf),
815 "%s/%s/master.passwd", yp_dir, argp->domain);
816 passfile = (char *)&passfile_buf;
820 * Create a filename to hold the original master.passwd
821 * so if our call to yppwupdate fails we can roll back
823 snprintf(passfile_hold_buf, sizeof(passfile_hold_buf),
824 "%s.hold", passfile);
825 passfile_hold = (char *)&passfile_hold_buf;
827 if (pw_init(dirname(passfile), passfile)) {
828 yp_error("pw_init() failed");
831 if ((pfd = pw_lock()) == -1) {
833 yp_error("pw_lock() failed");
836 if ((tfd = pw_tmp(-1)) == -1) {
838 yp_error("pw_tmp() failed");
841 xlate_passwd(&argp->newpw, &newpasswd);
842 if (pw_copy(pfd, tfd, &newpasswd, NULL) == -1) {
844 yp_error("pw_copy() failed");
847 if (rename(passfile, passfile_hold) == -1) {
849 yp_error("rename of %s to %s failed", passfile,
853 if (strcmp(passfile, _PATH_MASTERPASSWD) == 0) {
855 * NIS server is exporting the system's master.passwd.
856 * Call pw_mkdb to rebuild passwd and the .db files
858 if (pw_mkdb(argp->newpw.pw_name) == -1) {
860 yp_error("pw_mkdb() failed");
861 rename(passfile_hold, passfile);
866 * NIS server is exporting a private master.passwd.
867 * Rename tempfile into final location
869 if (rename(pw_tempname(), passfile) == -1) {
871 yp_error("rename of %s to %s failed",
872 pw_tempname(), passfile);
873 rename(passfile_hold, passfile);
880 xlate_passwd(&argp->newpw, &newpasswd);
881 if ((rval = update_inplace(&newpasswd, argp->domain))) {
882 yp_error("inplace update failed -- rebuilding maps");
886 switch ((pid = fork())) {
888 if (inplace && !rval) {
889 execlp(MAP_UPDATE_PATH, MAP_UPDATE, passfile,
890 argp->domain, "pushpw", (char *)NULL);
892 execlp(MAP_UPDATE_PATH, MAP_UPDATE, passfile,
893 argp->domain, (char *)NULL);
895 yp_error("couldn't exec map update process: %s",
898 rename(passfile_hold, passfile);
902 yp_error("fork() failed: %s", strerror(errno));
904 rename(passfile_hold, passfile);
908 unlink(passfile_hold);
912 yp_error("performed update of user %s (uid %d) domain %s",