summaryrefslogtreecommitdiff
path: root/libexec/ypxfr
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-12-16 21:57:44 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-12-16 21:57:44 +0000
commitdb83a3919361df2df5556f49f8ca5c5aaf782a5f (patch)
tree892dfdcc6bf82341b29c082fba554ebe207a15dd /libexec/ypxfr
parent1dcc79e3e8d1139074a8ccab3d60536c2db96bc2 (diff)
downloadsrc-test2-db83a3919361df2df5556f49f8ca5c5aaf782a5f.tar.gz
src-test2-db83a3919361df2df5556f49f8ca5c5aaf782a5f.zip
Revert r228592, as the non-messy way of fixing ypxfr breaks other yp
programs (e.g. usr.sbin/rpc.yppasswdd). Spotted by: np MFC after: 1 week
Notes
Notes: svn path=/head/; revision=228599
Diffstat (limited to 'libexec/ypxfr')
-rw-r--r--libexec/ypxfr/yp_dbwrite.c10
-rw-r--r--libexec/ypxfr/ypxfr_extern.h2
-rw-r--r--libexec/ypxfr/ypxfr_getmap.c1
-rw-r--r--libexec/ypxfr/ypxfr_main.c2
4 files changed, 8 insertions, 7 deletions
diff --git a/libexec/ypxfr/yp_dbwrite.c b/libexec/ypxfr/yp_dbwrite.c
index c44932da3283..488f9e4ad446 100644
--- a/libexec/ypxfr/yp_dbwrite.c
+++ b/libexec/ypxfr/yp_dbwrite.c
@@ -58,10 +58,10 @@ yp_open_db_rw(const char *domain, const char *map, const int flags)
char buf[1025];
- yp_errno = YPXFR_SUCC;
+ yp_errno = YP_TRUE;
if (map[0] == '.' || strchr(map, '/')) {
- yp_errno = YPXFR_BADARGS;
+ yp_errno = YP_BADARGS;
return (NULL);
}
@@ -73,13 +73,13 @@ yp_open_db_rw(const char *domain, const char *map, const int flags)
if (dbp == NULL) {
switch (errno) {
case ENOENT:
- yp_errno = YPXFR_NOMAP;
+ yp_errno = YP_NOMAP;
break;
case EFTYPE:
- yp_errno = YPXFR_MADDR;
+ yp_errno = YP_BADDB;
break;
default:
- yp_errno = YPXFR_YPERR;
+ yp_errno = YP_YPERR;
break;
}
}
diff --git a/libexec/ypxfr/ypxfr_extern.h b/libexec/ypxfr/ypxfr_extern.h
index 67aede1b03f4..f843b645b6dd 100644
--- a/libexec/ypxfr/ypxfr_extern.h
+++ b/libexec/ypxfr/ypxfr_extern.h
@@ -46,7 +46,7 @@ extern BTREEINFO openinfo_b;
extern char *yp_dir;
extern int debug;
-extern ypxfrstat yp_errno;
+extern enum ypstat yp_errno;
extern void yp_error(const char *, ...);
extern int _yp_check(char **);
extern const char *ypxfrerr_string(ypxfrstat);
diff --git a/libexec/ypxfr/ypxfr_getmap.c b/libexec/ypxfr/ypxfr_getmap.c
index c9c1f2f30ecc..452b18667ad3 100644
--- a/libexec/ypxfr/ypxfr_getmap.c
+++ b/libexec/ypxfr/ypxfr_getmap.c
@@ -46,6 +46,7 @@ extern bool_t xdr_ypresp_all_seq(XDR *, unsigned long *);
int (*ypresp_allfn)();
void *ypresp_data;
extern DB *specdbp;
+extern enum ypstat yp_errno;
/*
* This is largely the same as yp_all() except we do the transfer
diff --git a/libexec/ypxfr/ypxfr_main.c b/libexec/ypxfr/ypxfr_main.c
index 7e4e24302920..f6b478a89d3c 100644
--- a/libexec/ypxfr/ypxfr_main.c
+++ b/libexec/ypxfr/ypxfr_main.c
@@ -88,7 +88,7 @@ ypxfr_exit(ypxfrstat retval, char *temp)
exit(1);
}
- ypxfr_resp.status = (yppush_status)retval;
+ ypxfr_resp.status = retval;
if (yppushproc_xfrresp_1(&ypxfr_resp, clnt) == NULL) {
yp_error("%s", clnt_sperror(clnt, "callback failed"));