aboutsummaryrefslogtreecommitdiff
path: root/nis/nss_nisplus
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-09-10 03:20:33 +0000
committerUlrich Drepper <drepper@redhat.com>2005-09-10 03:20:33 +0000
commitff3cacc50c42290ff76922257247c95f27fa3736 (patch)
tree3763ebc50123e2cf7d51090539c2073125cc0014 /nis/nss_nisplus
parentf7ca66d1156ce7e7532aa604d8fe4209eeee1f55 (diff)
downloadglibc-ff3cacc50c42290ff76922257247c95f27fa3736.tar
glibc-ff3cacc50c42290ff76922257247c95f27fa3736.tar.gz
glibc-ff3cacc50c42290ff76922257247c95f27fa3736.tar.bz2
glibc-ff3cacc50c42290ff76922257247c95f27fa3736.zip
* inet/getnetgrent_r.c: Include assert.cvs/fedora-glibc-20050912T0656
(setup): Remove FUNC_NAME and ALL arguments, assume they are always "setnetgrent" and 1. (endnetgrent_hook): New function. (internal_endnetgrent): Use it. (__internal_setnetgrent_reuse): Use it. Adjust setup caller. If status is NSS_STATUS_SUCCESS, yet action is continue, call endnetgrent hook. (internal_getnetgrent_r): Use __nss_lookup_function rather than setup. Recompute getfct pointer after successful __internal_setnetgrent_reuse. Don't use __nss_next. (innetgr): Use __nss_lookup_function instead of __nss_lookup. Adjust setup caller. * nss/nss_files/files-netgrp.c (_nss_files_endnetgrent): Always clear data_size and cursor. Add libnss_files_hidden_proto and libnss_files_hidden_def. (_nss_files_setnetgrent): Call _nss_files_endnetgrent on failure. * nis/nss_nis/nis-netgrp.c (internal_endnetgrent): Always clear data_size and cursor. (_nss_nis_setnetgrent): Don't call internal_endnetgrent. (_nss_nis_getnetgrent_r): Remove result->cursor == NULL handling. * nis/nss_nisplus/nisplus-netgrp.c (internal_endnetgrent): Always clear data_size and position. (_nss_nisplus_setnetgrent): Don't call internal_endnetgrent. 2005-09-09 Ulrich Drepper <drepper@redhat.com> * nss/getent.c (netgroup_keys): Call endnetgrent. (main): Call mtrace. * nss/nss_files/files-netgrp.c (_nss_files_setnetgrent): We don't need locking for the stream. Use feof_unlocked. 2005-09-09 Jakub Jelinek <jakub@redhat.com>
Diffstat (limited to 'nis/nss_nisplus')
-rw-r--r--nis/nss_nisplus/nisplus-netgrp.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/nis/nss_nisplus/nisplus-netgrp.c b/nis/nss_nisplus/nisplus-netgrp.c
index 607bc2c1ca..344d65f4c4 100644
--- a/nis/nss_nisplus/nisplus-netgrp.c
+++ b/nis/nss_nisplus/nisplus-netgrp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
@@ -141,13 +141,10 @@ _nss_nisplus_getnetgrent_r (struct __netgrent *result, char *buffer,
static void
internal_endnetgrent (struct __netgrent *netgrp)
{
- if (netgrp->data != NULL)
- {
- nis_freeresult ((nis_result *) netgrp->data);
- netgrp->data = NULL;
- netgrp->data_size = 0;
- netgrp->position = 0;
- }
+ nis_freeresult ((nis_result *) netgrp->data);
+ netgrp->data = NULL;
+ netgrp->data_size = 0;
+ netgrp->position = 0;
}
enum nss_status
@@ -161,8 +158,6 @@ _nss_nisplus_setnetgrent (const char *group, struct __netgrent *netgrp)
status = NSS_STATUS_SUCCESS;
- internal_endnetgrent (netgrp);
-
sprintf (buf, "[name=%s],netgroup.org_dir", group);
netgrp->data = (char *) nis_list (buf, EXPAND_NAME, NULL, NULL);