From d877befa375d369de587b9495be6d7151ccac77f Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Sun, 13 Aug 1995 16:05:06 +0000 Subject: [PATCH] Small NIS tweak: frob pw_error() a little so that it can say either 'NIS information unchanged' or '/etc/master.passwd unchanged' depending on which was is being modified (conditional on -DYP). This is to save me the trouble of writing a whole other error routine (nis_error()?) for the upcoming changes to passwd and chpass. --- lib/libutil/pw_util.c | 9 ++++++++- usr.sbin/vipw/pw_util.c | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/libutil/pw_util.c b/lib/libutil/pw_util.c index 8dd4e4c5fd0a..60b4f77bf253 100644 --- a/lib/libutil/pw_util.c +++ b/lib/libutil/pw_util.c @@ -211,9 +211,16 @@ pw_error(name, err, eval) char *name; int err, eval; { +#ifdef YP + extern int _use_yp; +#endif /* YP */ if (err) warn(name); - +#ifdef YP + if (_use_yp) + warnx("NIS information unchanged"); + else +#endif /* YP */ warnx("%s: unchanged", _PATH_MASTERPASSWD); (void)unlink(tempname); exit(eval); diff --git a/usr.sbin/vipw/pw_util.c b/usr.sbin/vipw/pw_util.c index 8dd4e4c5fd0a..60b4f77bf253 100644 --- a/usr.sbin/vipw/pw_util.c +++ b/usr.sbin/vipw/pw_util.c @@ -211,9 +211,16 @@ pw_error(name, err, eval) char *name; int err, eval; { +#ifdef YP + extern int _use_yp; +#endif /* YP */ if (err) warn(name); - +#ifdef YP + if (_use_yp) + warnx("NIS information unchanged"); + else +#endif /* YP */ warnx("%s: unchanged", _PATH_MASTERPASSWD); (void)unlink(tempname); exit(eval);