summaryrefslogtreecommitdiff
path: root/usr/src/lib/libtsnet/common
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libtsnet/common')
-rw-r--r--usr/src/lib/libtsnet/common/libtsnet.h6
-rw-r--r--usr/src/lib/libtsnet/common/tsol_getrhent.c8
-rw-r--r--usr/src/lib/libtsnet/common/tsol_gettpent.c8
3 files changed, 13 insertions, 9 deletions
diff --git a/usr/src/lib/libtsnet/common/libtsnet.h b/usr/src/lib/libtsnet/common/libtsnet.h
index c1f9b695bd..1ab8f8448c 100644
--- a/usr/src/lib/libtsnet/common/libtsnet.h
+++ b/usr/src/lib/libtsnet/common/libtsnet.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* All symbols and functions in this header file and library are private to Sun
@@ -70,7 +70,7 @@ extern "C" {
/* Template entry parsing */
extern tsol_tpent_t *tsol_gettpbyname(const char *);
extern tsol_tpent_t *tsol_gettpent(void);
-extern tsol_tpent_t *tsol_fgettpent(FILE *);
+extern tsol_tpent_t *tsol_fgettpent(FILE *, boolean_t *);
extern void tsol_freetpent(tsol_tpent_t *);
extern void tsol_settpent(int);
extern void tsol_endtpent(void);
@@ -80,7 +80,7 @@ extern tsol_tpent_t *tpstr_to_ent(tsol_tpstr_t *, int *, char **);
/* Remote host entry parsing */
extern tsol_rhent_t *tsol_getrhbyaddr(const void *, size_t, int);
extern tsol_rhent_t *tsol_getrhent(void);
-extern tsol_rhent_t *tsol_fgetrhent(FILE *);
+extern tsol_rhent_t *tsol_fgetrhent(FILE *, boolean_t *);
extern void tsol_freerhent(tsol_rhent_t *);
extern void tsol_setrhent(int);
extern void tsol_endrhent(void);
diff --git a/usr/src/lib/libtsnet/common/tsol_getrhent.c b/usr/src/lib/libtsnet/common/tsol_getrhent.c
index 24455f0960..8843cf7427 100644
--- a/usr/src/lib/libtsnet/common/tsol_getrhent.c
+++ b/usr/src/lib/libtsnet/common/tsol_getrhent.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* From "tsol_getrhent.c 7.6 00/09/22 SMI; TSOL 2.x"
@@ -128,7 +128,7 @@ tsol_getrhent(void)
}
tsol_rhent_t *
-tsol_fgetrhent(FILE *f)
+tsol_fgetrhent(FILE *f, boolean_t *error)
{
int err = 0;
char *errstr = NULL;
@@ -149,11 +149,13 @@ tsol_fgetrhent(FILE *f)
* Loop until we find a non-blank, non-comment line, or
* until EOF. No need to log blank lines, comments.
*/
- if (err != LTSNET_EMPTY)
+ if (err != LTSNET_EMPTY) {
(void) fprintf(stderr, "%s: %.32s%s: %s\n",
gettext("Error parsing tnrhdb file"), errstr,
(strlen(errstr) > 32)? "...": "",
(char *)tsol_strerror(err, errno));
+ *error = B_TRUE;
+ }
_nss_XbyY_fgets(f, &arg);
rhstrp = (tsol_rhstr_t *)NSS_XbyY_FINI(&arg);
if (rhstrp == NULL) /* EOF */
diff --git a/usr/src/lib/libtsnet/common/tsol_gettpent.c b/usr/src/lib/libtsnet/common/tsol_gettpent.c
index ab20c85620..467bd8fccb 100644
--- a/usr/src/lib/libtsnet/common/tsol_gettpent.c
+++ b/usr/src/lib/libtsnet/common/tsol_gettpent.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* From "tsol_gettpent.c 7.13 00/10/13 SMI; TSOL 2.x"
@@ -122,7 +122,7 @@ tsol_gettpent(void)
}
tsol_tpent_t *
-tsol_fgettpent(FILE *f)
+tsol_fgettpent(FILE *f, boolean_t *error)
{
int err = 0;
char *errstr = NULL;
@@ -143,11 +143,13 @@ tsol_fgettpent(FILE *f)
* Loop until we find a non-blank, non-comment line, or
* until EOF. No need to log blank lines, comments.
*/
- if (err != LTSNET_EMPTY)
+ if (err != LTSNET_EMPTY) {
(void) fprintf(stderr, "%s: %.32s%s: %s\n",
gettext("Error parsing tnrhtp file"), errstr,
(strlen(errstr) > 32)? "...": "",
(char *)tsol_strerror(err, errno));
+ *error = B_TRUE;
+ }
_nss_XbyY_fgets(f, &arg);
tpstrp = (tsol_tpstr_t *)NSS_XbyY_FINI(&arg);
if (tpstrp == NULL) /* EOF */