[Pkg-privacy-commits] [onioncat] 236/241: add autoconf check for getpwnam_r()
Intrigeri
intrigeri at moszumanska.debian.org
Wed Aug 26 16:17:19 UTC 2015
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to branch upstream-master
in repository onioncat.
commit c8d71222065e8cd9138fcd5f4ea4c8f07bfce6b8
Author: eagle <eagle at 58e1ccc2-750e-0410-8d0d-f93ca75ab447>
Date: Wed Mar 19 13:08:03 2014 +0000
add autoconf check for getpwnam_r()
git-svn-id: https://www.cypherpunk.at/svn/onioncat/trunk@565 58e1ccc2-750e-0410-8d0d-f93ca75ab447
---
config.h.in | 3 +++
configure | 24 ++++++++++++------------
configure.ac | 2 +-
src/ocat.c | 10 +++++++++-
4 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/config.h.in b/config.h.in
index fb23cd9..5de2d0d 100644
--- a/config.h.in
+++ b/config.h.in
@@ -27,6 +27,9 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
+/* Define to 1 if you have the `getpwnam_r' function. */
+#undef HAVE_GETPWNAM_R
+
/* Define to 1 if you have the <linux/if_tun.h> header file. */
#undef HAVE_LINUX_IF_TUN_H
diff --git a/configure b/configure
index e66c45a..0075239 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for onioncat 0.2.2.r562.
+# Generated by GNU Autoconf 2.68 for onioncat 0.2.2.r565.
#
# Report bugs to <rahra at cypherpunk.at>.
#
@@ -559,8 +559,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='onioncat'
PACKAGE_TARNAME='onioncat'
-PACKAGE_VERSION='0.2.2.r562'
-PACKAGE_STRING='onioncat 0.2.2.r562'
+PACKAGE_VERSION='0.2.2.r565'
+PACKAGE_STRING='onioncat 0.2.2.r565'
PACKAGE_BUGREPORT='rahra at cypherpunk.at'
PACKAGE_URL=''
@@ -1221,7 +1221,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures onioncat 0.2.2.r562 to adapt to many kinds of systems.
+\`configure' configures onioncat 0.2.2.r565 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1291,7 +1291,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of onioncat 0.2.2.r562:";;
+ short | recursive ) echo "Configuration of onioncat 0.2.2.r565:";;
esac
cat <<\_ACEOF
@@ -1384,7 +1384,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-onioncat configure 0.2.2.r562
+onioncat configure 0.2.2.r565
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1694,7 +1694,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by onioncat $as_me 0.2.2.r562, which was
+It was created by onioncat $as_me 0.2.2.r565, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2509,7 +2509,7 @@ fi
# Define the identity of the package.
PACKAGE='onioncat'
- VERSION='0.2.2.r562'
+ VERSION='0.2.2.r565'
cat >>confdefs.h <<_ACEOF
@@ -2553,7 +2553,7 @@ ac_config_headers="$ac_config_headers config.h"
-$as_echo "#define SVN_REVISION \"562\"" >>confdefs.h
+$as_echo "#define SVN_REVISION \"565\"" >>confdefs.h
@@ -4537,7 +4537,7 @@ fi
#AC_FUNC_STRFTIME
#AC_FUNC_VPRINTF
#AC_CHECK_FUNCS([clock_gettime memset select socket strchr strerror])
-for ac_func in strlcat strlcpy ether_ntoa ether_ntoa_r
+for ac_func in strlcat strlcpy ether_ntoa ether_ntoa_r getpwnam_r
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -5086,7 +5086,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by onioncat $as_me 0.2.2.r562, which was
+This file was extended by onioncat $as_me 0.2.2.r565, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -5152,7 +5152,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-onioncat config.status 0.2.2.r562
+onioncat config.status 0.2.2.r565
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index beec57b..e0d686e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -195,7 +195,7 @@ AC_CHECK_MEMBER([struct ether_header.ether_dhost.ether_addr_octet],
#AC_FUNC_STRFTIME
#AC_FUNC_VPRINTF
#AC_CHECK_FUNCS([clock_gettime memset select socket strchr strerror])
-AC_CHECK_FUNCS([strlcat strlcpy ether_ntoa ether_ntoa_r])
+AC_CHECK_FUNCS([strlcat strlcpy ether_ntoa ether_ntoa_r getpwnam_r])
AC_CONFIG_FILES([Makefile src/cygwin/Makefile src/Makefile man/Makefile i2p/Makefile])
AC_OUTPUT
diff --git a/src/ocat.c b/src/ocat.c
index b6e5bed..1e5da7b 100644
--- a/src/ocat.c
+++ b/src/ocat.c
@@ -457,7 +457,10 @@ int parse_opt(int argc, char *argv[])
int main(int argc, char *argv[])
{
- char *s, ip6addr[INET6_ADDRSTRLEN], hw[20], def[100], pwdbuf[SIZE_1K];
+#ifdef HAVE_GETPWNAM_R
+ char pwdbuf[SIZE_1K];
+#endif
+ char *s, ip6addr[INET6_ADDRSTRLEN], hw[20], def[100];
int c;
struct passwd *pwd, pwdm;
int urlconv = 0, mode_detect = 0;
@@ -611,7 +614,12 @@ int main(int argc, char *argv[])
// getting passwd info for user
log_debug("getting user info for \"%s\"", CNF(usrname));
+#ifdef HAVE_GETPWNAM_R
c = getpwnam_r(CNF(usrname), &pwdm, pwdbuf, SIZE_1K, &pwd);
+#else
+ if ((pwd = getpwnam(CNF(usrname))) == NULL)
+ c = errno;
+#endif
if (!pwd)
{
log_msg(LOG_WARNING, "can't get information for user \"%s\": \"%s\", defaulting to uid %d",
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onioncat.git
More information about the Pkg-privacy-commits
mailing list