nis_util.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Copyright (c) 1997-2026 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, see
  13. <https://www.gnu.org/licenses/>. */
  14. #include <string.h>
  15. #include <rpcsvc/nis.h>
  16. #include <shlib-compat.h>
  17. #include "nis_xdr.h"
  18. #include "nis_intern.h"
  19. fd_result *
  20. __nis_finddirectory (directory_obj *dir, const_nis_name name)
  21. {
  22. nis_error status;
  23. fd_args fd_args;
  24. fd_result *fd_res;
  25. fd_args.dir_name = (char *)name;
  26. fd_args.requester = nis_local_host();
  27. fd_res = calloc (1, sizeof (fd_result));
  28. if (fd_res == NULL)
  29. return NULL;
  30. status = __do_niscall2 (dir->do_servers.do_servers_val,
  31. dir->do_servers.do_servers_len,
  32. NIS_FINDDIRECTORY, (xdrproc_t) _xdr_fd_args,
  33. (caddr_t) &fd_args, (xdrproc_t) _xdr_fd_result,
  34. (caddr_t) fd_res, NO_AUTHINFO|USE_DGRAM, NULL);
  35. if (status != NIS_SUCCESS)
  36. fd_res->status = status;
  37. return fd_res;
  38. }
  39. libnsl_hidden_nolink_def (__nis_finddirectory, GLIBC_2_1)
  40. /* The hash implementation is in a separate file. */
  41. #include "nis_hash.c"