···11-diff -rNu3 libtirpc-0.3.2-old/src/Makefile.am libtirpc-0.3.2/src/Makefile.am
22---- libtirpc-0.3.2-old/src/Makefile.am 2015-07-28 15:17:49.248168000 +0300
33-+++ libtirpc-0.3.2/src/Makefile.am 2015-07-28 15:18:04.870144456 +0300
44-@@ -69,7 +69,7 @@
55- endif
66-77- libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
88--libtirpc_la_SOURCES += netname.c netnamer.c rtime.c
99-+libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
1010-1111- CLEANFILES = cscope.* *~
1212- DISTCLEANFILES = Makefile.in
1313-diff -rNu3 libtirpc-0.3.2-old/src/rpcdname.c libtirpc-0.3.2/src/rpcdname.c
1414---- libtirpc-0.3.2-old/src/rpcdname.c 1970-01-01 03:00:00.000000000 +0300
1515-+++ libtirpc-0.3.2/src/rpcdname.c 2015-07-28 15:18:04.870144456 +0300
1616-@@ -0,0 +1,72 @@
1717-+/*
1818-+ * Copyright (c) 2009, Sun Microsystems, Inc.
1919-+ * All rights reserved.
2020-+ *
2121-+ * Redistribution and use in source and binary forms, with or without
2222-+ * modification, are permitted provided that the following conditions are met:
2323-+ * - Redistributions of source code must retain the above copyright notice,
2424-+ * this list of conditions and the following disclaimer.
2525-+ * - Redistributions in binary form must reproduce the above copyright notice,
2626-+ * this list of conditions and the following disclaimer in the documentation
2727-+ * and/or other materials provided with the distribution.
2828-+ * - Neither the name of Sun Microsystems, Inc. nor the names of its
2929-+ * contributors may be used to endorse or promote products derived
3030-+ * from this software without specific prior written permission.
3131-+ *
3232-+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
3333-+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3434-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3535-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
3636-+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
3737-+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
3838-+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3939-+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
4040-+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
4141-+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
4242-+ * POSSIBILITY OF SUCH DAMAGE.
4343-+ */
4444-+
4545-+/*
4646-+ * rpcdname.c
4747-+ * Gets the default domain name
4848-+ */
4949-+
5050-+#include <stdlib.h>
5151-+#include <unistd.h>
5252-+#include <string.h>
5353-+
5454-+static char *default_domain = 0;
5555-+
5656-+static char *
5757-+get_default_domain()
5858-+{
5959-+ char temp[256];
6060-+
6161-+ if (default_domain)
6262-+ return (default_domain);
6363-+ if (getdomainname(temp, sizeof(temp)) < 0)
6464-+ return (0);
6565-+ if ((int) strlen(temp) > 0) {
6666-+ default_domain = (char *)malloc((strlen(temp)+(unsigned)1));
6767-+ if (default_domain == 0)
6868-+ return (0);
6969-+ (void) strcpy(default_domain, temp);
7070-+ return (default_domain);
7171-+ }
7272-+ return (0);
7373-+}
7474-+
7575-+/*
7676-+ * This is a wrapper for the system call getdomainname which returns a
7777-+ * ypclnt.h error code in the failure case. It also checks to see that
7878-+ * the domain name is non-null, knowing that the null string is going to
7979-+ * get rejected elsewhere in the NIS client package.
8080-+ */
8181-+int
8282-+__rpc_get_default_domain(domain)
8383-+ char **domain;
8484-+{
8585-+ if ((*domain = get_default_domain()) != 0)
8686-+ return (0);
8787-+ return (-1);
8888-+}