From 9e8a365cc203124c81763eda2eb3239d99a4764e Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sat, 23 Feb 2008 22:21:18 +0000 Subject: correct pathnames reported; pr#5742 --- usr.sbin/ypserv/mknetid/mknetid.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'usr.sbin/ypserv/mknetid') diff --git a/usr.sbin/ypserv/mknetid/mknetid.c b/usr.sbin/ypserv/mknetid/mknetid.c index f05c1df1913..82c0df08351 100644 --- a/usr.sbin/ypserv/mknetid/mknetid.c +++ b/usr.sbin/ypserv/mknetid/mknetid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mknetid.c,v 1.14 2006/04/03 05:01:23 deraadt Exp $ */ +/* $OpenBSD: mknetid.c,v 1.15 2008/02/23 22:21:17 deraadt Exp $ */ /* * Copyright (c) 1996 Mats O Jansson @@ -27,7 +27,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: mknetid.c,v 1.14 2006/04/03 05:01:23 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: mknetid.c,v 1.15 2008/02/23 22:21:17 deraadt Exp $"; #endif #include @@ -541,21 +541,21 @@ main(int argc, char *argv[]) if (pfile == NULL) { fprintf(stderr,"mknetid: can't open file \"%s\"\n", PasswdFile); - exit(1); + goto bad; } gfile = fopen(GroupFile, "r"); if (gfile == NULL) { fprintf(stderr,"mknetid: can't open file \"%s\"\n", - PasswdFile); - exit(1); + GroupFile); + goto bad; } hfile = fopen(HostFile, "r"); if (hfile == NULL) { fprintf(stderr,"mknetid: can't open file \"%s\"\n", - PasswdFile); - exit(1); + HostFile); + goto bad; } printf("NetidFile: %s\n", NetidFile); @@ -570,4 +570,8 @@ main(int argc, char *argv[]) if (mfile != NULL) print_netid(mfile, NetidFile); return (0); + +bad: + fprintf(stderr, "mknetid: passwd, group, host and netid maps not updated!\n"); + exit(1); } -- cgit v1.2.3