From 87ac253d003ccd08b76c2984d39089374777bb0e Mon Sep 17 00:00:00 2001 From: Paul Pluzhnikov Date: Fri, 28 Feb 2014 06:44:46 -0800 Subject: [PATCH] Forward-port google-nsl-stub --- google-nsl-stub/Makefile | 32 ++++++++++++++++++++++++++ google-nsl-stub/configure | 6 +++++ google-nsl-stub/shlib-versions | 1 + google-nsl-stub/ypclnt.c | 42 ++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 google-nsl-stub/Makefile create mode 100644 google-nsl-stub/configure create mode 100644 google-nsl-stub/shlib-versions create mode 100644 google-nsl-stub/ypclnt.c diff --git a/google-nsl-stub/Makefile b/google-nsl-stub/Makefile new file mode 100644 index 00000000000..ef5b6a6c242 --- /dev/null +++ b/google-nsl-stub/Makefile @@ -0,0 +1,32 @@ +# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# This file is part of the GNU C Library. + +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# . + +# Makefile for google-nsl-stub add-on subdirectory of GNU C Library. +# Based on libidn/Makefile. + +subdir := google-nsl-stub + +extra-libs = libnsl +extra-libs-others = $(extra-libs) + +libnsl-routines := ypclnt + +include $(..)Makeconfig + +libnsl-inhibit-o = $(filter-out .os,$(object-suffixes)) + +include $(..)Rules diff --git a/google-nsl-stub/configure b/google-nsl-stub/configure new file mode 100644 index 00000000000..c9010847289 --- /dev/null +++ b/google-nsl-stub/configure @@ -0,0 +1,6 @@ +# This is a shell script fragment sourced by the main configure script. +# We're obliged to give here the canonical name that will be used to +# as a subdirectory to search for in other add-ons' sysdeps trees. + +libc_add_on_canonical=google-nsl-stub +libc_add_on_subdirs=. diff --git a/google-nsl-stub/shlib-versions b/google-nsl-stub/shlib-versions new file mode 100644 index 00000000000..ca13c8c1f60 --- /dev/null +++ b/google-nsl-stub/shlib-versions @@ -0,0 +1 @@ +.*-.*-.* libnsl=1 diff --git a/google-nsl-stub/ypclnt.c b/google-nsl-stub/ypclnt.c new file mode 100644 index 00000000000..67867fe7d78 --- /dev/null +++ b/google-nsl-stub/ypclnt.c @@ -0,0 +1,42 @@ +/* Copyright (C) 2013 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* This is a Google-local stub version of nis/ypclnt.c. These functions + are required for dynamic linking of some precompiled executables. */ + +#include +#include + +int yp_get_default_domain(char **domp) { + /* We duplicate glibc's error behavior and return a null pointer. */ + *domp = NULL; + return 12; /* YPERR_NODOM */ +} + +static const char err[] = "not implemented in Google-local stub"; +char *yperr_string(int incode) { + return err; +} + +int yp_match(char *indomain, char *inmap, const char *inkey, int inkeylen, + char **outval, int *outvallen) { + *outval = malloc(2); + (*outval)[0] = '\n'; + (*outval)[1] = '\0'; + *outvallen = 0; + return 0; +} -- 2.47.2