diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-09-12 07:10:59 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-09-12 07:10:59 +0000 |
commit | 5e6e144e096c83beefb5bd50ea22da7266e72aee (patch) | |
tree | 80b4ba2f5794225b6f0dbee4171394423dc82cf2 /nis | |
parent | 753ea4414a6a5994cf156d9a11582d18a1fb2a6f (diff) | |
download | glibc-5e6e144e096c83beefb5bd50ea22da7266e72aee.tar.gz |
Updated to fedora-glibc-20050912T0656
Diffstat (limited to 'nis')
-rw-r--r-- | nis/nss_nis/nis-netgrp.c | 16 | ||||
-rw-r--r-- | nis/nss_nisplus/nisplus-netgrp.c | 15 |
2 files changed, 9 insertions, 22 deletions
diff --git a/nis/nss_nis/nis-netgrp.c b/nis/nss_nis/nis-netgrp.c index 7bd6527f2d..049bd8cdb4 100644 --- a/nis/nss_nis/nis-netgrp.c +++ b/nis/nss_nis/nis-netgrp.c @@ -41,13 +41,10 @@ _nss_netgroup_parseline (char **cursor, struct __netgrent *netgrp, static void internal_nis_endnetgrent (struct __netgrent *netgrp) { - if (netgrp->data != NULL) - { - free (netgrp->data); - netgrp->data = NULL; - netgrp->data_size = 0; - netgrp->cursor = NULL; - } + free (netgrp->data); + netgrp->data = NULL; + netgrp->data_size = 0; + netgrp->cursor = NULL; } enum nss_status @@ -65,8 +62,6 @@ _nss_nis_setnetgrent (const char *group, struct __netgrent *netgrp) if (yp_get_default_domain (&domain)) return NSS_STATUS_UNAVAIL; - internal_nis_endnetgrent (netgrp); - status = yperr2nss (yp_match (domain, "netgroup", group, strlen (group), &netgrp->data, &len)); if (status == NSS_STATUS_SUCCESS) @@ -99,9 +94,6 @@ enum nss_status _nss_nis_getnetgrent_r (struct __netgrent *result, char *buffer, size_t buflen, int *errnop) { - if (result->cursor == NULL) - return NSS_STATUS_NOTFOUND; - return _nss_netgroup_parseline (&result->cursor, result, buffer, buflen, errnop); } 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); |