summaryrefslogtreecommitdiff
path: root/usr/src/lib/nsswitch
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/nsswitch')
-rw-r--r--usr/src/lib/nsswitch/compat/common/compat_common.c24
-rw-r--r--usr/src/lib/nsswitch/compat/req.flg30
-rw-r--r--usr/src/lib/nsswitch/files/common/files_common.c19
-rw-r--r--usr/src/lib/nsswitch/files/common/files_common.h15
-rw-r--r--usr/src/lib/nsswitch/files/common/getexecattr.c11
-rw-r--r--usr/src/lib/nsswitch/files/req.flg30
-rw-r--r--usr/src/lib/nsswitch/req.flg30
-rw-r--r--usr/src/lib/nsswitch/user/Makefile.com6
-rw-r--r--usr/src/lib/nsswitch/user/common/user_common.c26
-rw-r--r--usr/src/lib/nsswitch/user/common/user_common.h14
-rw-r--r--usr/src/lib/nsswitch/user/req.flg30
11 files changed, 51 insertions, 184 deletions
diff --git a/usr/src/lib/nsswitch/compat/common/compat_common.c b/usr/src/lib/nsswitch/compat/common/compat_common.c
index ed16ed3ac6..fe21797abf 100644
--- a/usr/src/lib/nsswitch/compat/common/compat_common.c
+++ b/usr/src/lib/nsswitch/compat/common/compat_common.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Common code and structures used by name-service-switch "compat" backends.
@@ -38,7 +37,6 @@
#include <bsm/libbsm.h>
#include <user_attr.h>
#include "compat_common.h"
-#include "../../../libnsl/include/nsl_stdio_prv.h"
/*
* This should be in a header.
@@ -116,7 +114,7 @@ struct compat_backend {
compat_backend_op_t *ops;
int n_ops;
const char *filename;
- __NSL_FILE *f;
+ FILE *f;
int minbuf;
char *buf;
int linelen; /* <== Explain use, lifetime */
@@ -359,11 +357,11 @@ _nss_compat_setent(be, dummy)
/* Backend isn't initialized properly? */
return (NSS_UNAVAIL);
}
- if ((be->f = __nsl_fopen(be->filename, "r")) == 0) {
+ if ((be->f = fopen(be->filename, "rF")) == 0) {
return (NSS_UNAVAIL);
}
} else {
- __nsl_rewind(be->f);
+ rewind(be->f);
}
strset_free(&be->minuses);
/* ===> ??? nss_endent(be->db_rootp, be->db_initf, &be->db_context); */
@@ -385,7 +383,7 @@ _nss_compat_endent(be, dummy)
void *dummy;
{
if (be->f != 0) {
- __nsl_fclose(be->f);
+ fclose(be->f);
be->f = 0;
}
if (be->buf != 0) {
@@ -425,7 +423,7 @@ _nss_compat_destr(be, dummy)
static int
read_line(f, buffer, buflen)
- __NSL_FILE *f;
+ FILE *f;
char *buffer;
int buflen;
{
@@ -433,7 +431,7 @@ read_line(f, buffer, buflen)
while (1) {
int linelen;
- if (__nsl_fgets(buffer, buflen, f) == 0) {
+ if (fgets(buffer, buflen, f) == 0) {
/* End of file */
return (-1);
}
@@ -450,13 +448,13 @@ read_line(f, buffer, buflen)
buffer[--linelen] = '\0';
return (linelen);
}
- if (__nsl_feof(f)) {
+ if (feof(f)) {
/* Line is last line in file, and has no newline */
return (linelen);
}
/* Line too long for buffer; toss it and loop for next line */
/* ===== should syslog() in cases where previous code did */
- while (__nsl_fgets(buffer, buflen, f) != 0 &&
+ while (fgets(buffer, buflen, f) != 0 &&
buffer[strlen(buffer) - 1] != '\n') {
;
}
diff --git a/usr/src/lib/nsswitch/compat/req.flg b/usr/src/lib/nsswitch/compat/req.flg
deleted file mode 100644
index 6d6493b45c..0000000000
--- a/usr/src/lib/nsswitch/compat/req.flg
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-echo_file usr/src/lib/libnsl/include/nsl_stdio_prv.h
diff --git a/usr/src/lib/nsswitch/files/common/files_common.c b/usr/src/lib/nsswitch/files/common/files_common.c
index 2a8c30bc43..bdf03a3ca9 100644
--- a/usr/src/lib/nsswitch/files/common/files_common.c
+++ b/usr/src/lib/nsswitch/files/common/files_common.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 1995-2003 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Common code and structures used by name-service-switch "files" backends.
@@ -54,11 +53,11 @@ _nss_files_setent(be, dummy)
/* Backend isn't initialized properly? */
return (NSS_UNAVAIL);
}
- if ((be->f = __nsl_fopen(be->filename, "r")) == 0) {
+ if ((be->f = fopen(be->filename, "rF")) == 0) {
return (NSS_UNAVAIL);
}
} else {
- __nsl_rewind(be->f);
+ rewind(be->f);
}
return (NSS_SUCCESS);
}
@@ -70,7 +69,7 @@ _nss_files_endent(be, dummy)
void *dummy;
{
if (be->f != 0) {
- __nsl_fclose(be->f);
+ fclose(be->f);
be->f = 0;
}
if (be->buf != 0) {
@@ -93,7 +92,7 @@ _nss_files_endent(be, dummy)
*/
int
_nss_files_read_line(f, buffer, buflen)
- __NSL_FILE *f;
+ FILE *f;
char *buffer;
int buflen;
{
@@ -104,7 +103,7 @@ _nss_files_read_line(f, buffer, buflen)
while (1) {
linelen = 0;
while (linelen < buflen - 1) { /* "- 1" saves room for \n\0 */
- switch (c = __nsl_getc_unlocked(f)) {
+ switch (c = getc_unlocked(f)) {
case EOF:
if (linelen == 0 ||
buffer[linelen - 1] == '\\') {
@@ -131,7 +130,7 @@ _nss_files_read_line(f, buffer, buflen)
/* Buffer overflow -- eat rest of line and loop again */
/* ===> Should syslog() */
do {
- c = __nsl_getc_unlocked(f);
+ c = getc_unlocked(f);
if (c == EOF) {
return (-1);
}
diff --git a/usr/src/lib/nsswitch/files/common/files_common.h b/usr/src/lib/nsswitch/files/common/files_common.h
index 06ba03b576..87980f8310 100644
--- a/usr/src/lib/nsswitch/files/common/files_common.h
+++ b/usr/src/lib/nsswitch/files/common/files_common.h
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -39,8 +38,6 @@
#include <nss_dbdefs.h>
#include <stdio.h>
-#include "../../../libnsl/include/nsl_stdio_prv.h"
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -80,7 +77,7 @@ struct files_backend {
files_backend_op_t *ops;
int n_ops;
const char *filename;
- __NSL_FILE *f;
+ FILE *f;
int minbuf;
char *buf;
files_hash_t *hashinfo;
@@ -103,7 +100,7 @@ extern nss_backend_t *_nss_files_constr(files_backend_op_t *ops,
const char *filename,
int min_bufsize,
files_hash_t *fhp);
-extern nss_status_t _nss_files_destr (files_backend_ptr_t, void *dummy);
+extern nss_status_t _nss_files_destr(files_backend_ptr_t, void *dummy);
extern nss_status_t _nss_files_setent(files_backend_ptr_t, void *dummy);
extern nss_status_t _nss_files_endent(files_backend_ptr_t, void *dummy);
extern nss_status_t _nss_files_getent_rigid(files_backend_ptr_t, void *);
@@ -123,10 +120,10 @@ extern nss_status_t _nss_files_XY_hash(files_backend_ptr_t be,
files_hash_t *fhp,
int hashop,
files_XY_check_func check);
-int _nss_files_read_line(__NSL_FILE *f, char *buffer, int buflen);
+int _nss_files_read_line(FILE *f, char *buffer, int buflen);
#else
extern nss_backend_t *_nss_files_constr();
-extern nss_status_t _nss_files_destr ();
+extern nss_status_t _nss_files_destr();
extern nss_status_t _nss_files_setent();
extern nss_status_t _nss_files_endent();
extern nss_status_t _nss_files_getent_rigid();
diff --git a/usr/src/lib/nsswitch/files/common/getexecattr.c b/usr/src/lib/nsswitch/files/common/getexecattr.c
index 2c5f5b482d..502c0112b9 100644
--- a/usr/src/lib/nsswitch/files/common/getexecattr.c
+++ b/usr/src/lib/nsswitch/files/common/getexecattr.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 1999-2003 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -129,12 +128,12 @@ _exec_files_XY_all(files_backend_ptr_t be,
(void) _nss_files_endent(be, 0);
return (NSS_UNAVAIL);
}
- if ((be->f = __nsl_fopen(be->filename, "r")) == 0) {
+ if ((be->f = fopen(be->filename, "rF")) == 0) {
(void) _nss_files_endent(be, 0);
(void) rw_unlock(&exec_lock);
return (NSS_UNAVAIL);
}
- exec_fd = __nsl_fileno(be->f);
+ exec_fd = fileno(be->f);
if (f_buf != NULL)
free(f_buf);
if ((f_buf = malloc(f_size)) == NULL) {
diff --git a/usr/src/lib/nsswitch/files/req.flg b/usr/src/lib/nsswitch/files/req.flg
deleted file mode 100644
index 6d6493b45c..0000000000
--- a/usr/src/lib/nsswitch/files/req.flg
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-echo_file usr/src/lib/libnsl/include/nsl_stdio_prv.h
diff --git a/usr/src/lib/nsswitch/req.flg b/usr/src/lib/nsswitch/req.flg
deleted file mode 100644
index 6d6493b45c..0000000000
--- a/usr/src/lib/nsswitch/req.flg
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-echo_file usr/src/lib/libnsl/include/nsl_stdio_prv.h
diff --git a/usr/src/lib/nsswitch/user/Makefile.com b/usr/src/lib/nsswitch/user/Makefile.com
index dc99a72441..c51cc34604 100644
--- a/usr/src/lib/nsswitch/user/Makefile.com
+++ b/usr/src/lib/nsswitch/user/Makefile.com
@@ -2,9 +2,8 @@
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
@@ -41,7 +40,6 @@ include ../../../Makefile.rootfs
CPPFLAGS += -I../../../common/inc
-LDLIBS += -lnsl
DYNLIB1 = nss_user.so$(VERS)
all: $(DYNLIB1) fnamecheck
diff --git a/usr/src/lib/nsswitch/user/common/user_common.c b/usr/src/lib/nsswitch/user/common/user_common.c
index 6959ba4a3d..1a52140be3 100644
--- a/usr/src/lib/nsswitch/user/common/user_common.c
+++ b/usr/src/lib/nsswitch/user/common/user_common.c
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Common code and structures used by name-service-switch "user" backends.
@@ -34,15 +33,14 @@
* but this here is just yer standard fgets() thang.
*/
+#include "user_common.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <fcntl.h>
#include <poll.h>
#include <unistd.h>
-#include "user_common.h"
#include <sys/stat.h>
-#include "../../../libnsl/include/nsl_stdio_prv.h"
#include <string.h>
nss_status_t
@@ -55,11 +53,11 @@ _nss_user_setent(be, dummy)
/* Backend isn't initialized properly? */
return (NSS_UNAVAIL);
}
- if ((be->f = __nsl_fopen(be->filename, "r")) == 0) {
+ if ((be->f = fopen(be->filename, "rF")) == 0) {
return (NSS_UNAVAIL);
}
} else {
- __nsl_rewind(be->f);
+ rewind(be->f);
}
return (NSS_SUCCESS);
}
@@ -70,7 +68,7 @@ _nss_user_endent(be, dummy)
void *dummy;
{
if (be->f != 0) {
- __nsl_fclose(be->f);
+ fclose(be->f);
be->f = 0;
}
if (be->buf != 0) {
@@ -93,7 +91,7 @@ _nss_user_endent(be, dummy)
*/
int
_nss_user_read_line(f, buffer, buflen)
- __NSL_FILE *f;
+ FILE *f;
char *buffer;
int buflen;
{
@@ -103,7 +101,7 @@ _nss_user_read_line(f, buffer, buflen)
while (1) {
linelen = 0;
while (linelen < buflen - 1) { /* "- 1" saves room for \n\0 */
- switch (c = __nsl_getc_unlocked(f)) {
+ switch (c = getc_unlocked(f)) {
case EOF:
if (linelen == 0 ||
buffer[linelen - 1] == '\\') {
@@ -130,7 +128,7 @@ _nss_user_read_line(f, buffer, buflen)
/* Buffer overflow -- eat rest of line and loop again */
/* ===> Should syslog() */
do {
- c = __nsl_getc_unlocked(f);
+ c = getc_unlocked(f);
if (c == EOF) {
return (-1);
}
@@ -276,7 +274,7 @@ _nss_user_constr(ops, n_ops, filename, min_bufsize)
{
user_backend_ptr_t be;
- if ((be = (user_backend_ptr_t) malloc(sizeof (*be))) == 0) {
+ if ((be = (user_backend_ptr_t)malloc(sizeof (*be))) == 0) {
return (0);
}
be->ops = ops;
@@ -289,5 +287,5 @@ _nss_user_constr(ops, n_ops, filename, min_bufsize)
be->f = 0;
be->buf = 0;
- return ((nss_backend_t *) be);
+ return ((nss_backend_t *)be);
}
diff --git a/usr/src/lib/nsswitch/user/common/user_common.h b/usr/src/lib/nsswitch/user/common/user_common.h
index d0539447b0..2f1b79a42f 100644
--- a/usr/src/lib/nsswitch/user/common/user_common.h
+++ b/usr/src/lib/nsswitch/user/common/user_common.h
@@ -2,9 +2,8 @@
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
@@ -38,7 +37,6 @@
#include <nss_common.h>
#include <nss_dbdefs.h>
#include <stdio.h>
-#include "../../../libnsl/include/nsl_stdio_prv.h"
#ifdef __cplusplus
extern "C" {
@@ -53,7 +51,7 @@ struct user_backend {
user_backend_op_t *ops;
int n_ops;
const char *filename;
- __NSL_FILE *f;
+ FILE *f;
int minbuf;
char *buf;
};
@@ -74,7 +72,7 @@ extern nss_backend_t *_nss_user_constr(user_backend_op_t *ops,
int n_ops,
const char *filename,
int min_bufsize);
-extern nss_status_t _nss_user_destr (user_backend_ptr_t, void *dummy);
+extern nss_status_t _nss_user_destr(user_backend_ptr_t, void *dummy);
extern nss_status_t _nss_user_setent(user_backend_ptr_t, void *dummy);
extern nss_status_t _nss_user_endent(user_backend_ptr_t, void *dummy);
extern nss_status_t _nss_user_do_all(user_backend_ptr_t,
@@ -86,12 +84,12 @@ extern nss_status_t _nss_user_XY_all(user_backend_ptr_t be,
int netdb,
const char *filter,
user_XY_check_func check);
-extern int _nss_user_read_line(__NSL_FILE *f,
+extern int _nss_user_read_line(FILE *f,
char *buffer,
int buflen);
#else
extern nss_backend_t *_nss_user_constr();
-extern nss_status_t _nss_user_destr ();
+extern nss_status_t _nss_user_destr();
extern nss_status_t _nss_user_setent();
extern nss_status_t _nss_user_endent();
extern nss_status_t _nss_user_do_all();
diff --git a/usr/src/lib/nsswitch/user/req.flg b/usr/src/lib/nsswitch/user/req.flg
deleted file mode 100644
index 6d6493b45c..0000000000
--- a/usr/src/lib/nsswitch/user/req.flg
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License"). You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
-# Use is subject to license terms.
-#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-echo_file usr/src/lib/libnsl/include/nsl_stdio_prv.h