From 4b484e007f44a62fb92d63bf345660cb76111d26 Mon Sep 17 00:00:00 2001 From: ton Date: Mon, 20 Aug 2007 15:48:19 -0700 Subject: 6430185 tnchkdb prints inconsistent error messages when the paths of the 3 database files cannot be parsed 6546024 tnchkdb displays "No error" when an invalid template name is specified in the tnrhtp datatbase --- usr/src/cmd/tsol/tnchkdb/tnchkdb.c | 2 +- usr/src/lib/libtsnet/common/tsol_sgettpent.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'usr/src') diff --git a/usr/src/cmd/tsol/tnchkdb/tnchkdb.c b/usr/src/cmd/tsol/tnchkdb/tnchkdb.c index 29de0789a7..11ff21f99a 100644 --- a/usr/src/cmd/tsol/tnchkdb/tnchkdb.c +++ b/usr/src/cmd/tsol/tnchkdb/tnchkdb.c @@ -287,7 +287,7 @@ check_tnrhtp(const char *file) if ((fp = fopen(file, "r")) == NULL) { err = errno; (void) fprintf(stderr, - gettext("tnchkdb: cannot open %1$s: %2$s\n"), file, + gettext("tnchkdb: failed to open %1$s: %2$s\n"), file, strerror(err)); exitval = 2; tnrhtp_bad = B_TRUE; diff --git a/usr/src/lib/libtsnet/common/tsol_sgettpent.c b/usr/src/lib/libtsnet/common/tsol_sgettpent.c index 295fdba190..e2dbea6986 100644 --- a/usr/src/lib/libtsnet/common/tsol_sgettpent.c +++ b/usr/src/lib/libtsnet/common/tsol_sgettpent.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. * * From "tsol_tndb_parser.c 7.24 01/09/05 SMI; TSOL 2.x" @@ -268,8 +268,10 @@ tpstr_to_ent(tsol_tpstr_t *tpstrp, int *errp, char **errstrp) return (NULL); } if (strlcpy(tpentp->name, template, sizeof (tpentp->name)) >= - sizeof (tpentp->name)) + sizeof (tpentp->name)) { + *errp = LTSNET_ILL_NAME; goto err_ret; + } kv = _str2kva(attrs, KV_ASSIGN, KV_DELIMITER); *errp = parse_remainder(tpentp, kv); _kva_free(kv); -- cgit v1.2.3