summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compat/Makefile.am1
-rw-r--r--compat/shell.h49
-rw-r--r--configure.ac1
-rw-r--r--nslcd/usermod.c1
4 files changed, 52 insertions, 0 deletions
diff --git a/compat/Makefile.am b/compat/Makefile.am
index 7391fee..66703c5 100644
--- a/compat/Makefile.am
+++ b/compat/Makefile.am
@@ -25,6 +25,7 @@ AM_CFLAGS = -fPIC
EXTRA_DIST = getopt_long.c getopt_long.h \
daemon.c daemon.h \
ether.c ether.h \
+ shell.h \
strndup.c strndup.h \
nss_compat.h socket.h \
ldap_compat.h pagectrl.c ldap_passwd_s.c ldap_initialize.c \
diff --git a/compat/shell.h b/compat/shell.h
new file mode 100644
index 0000000..09c480e
--- /dev/null
+++ b/compat/shell.h
@@ -0,0 +1,49 @@
+/*
+ shell.h - ethernet definitions for systems lacking those
+
+ Copyright (C) 2013 Arthur de Jong
+
+ This 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.
+
+ This 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 this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA
+*/
+
+#ifndef COMPAT__SHELL_H
+#define COMPAT__SHELL_H 1
+
+#ifdef HAVE_GETUSERSHELL
+#if !HAVE_DECL_GETUSERSHELL
+/* we define getusershell() here because on some platforms the function is
+ undefined */
+extern char *getusershell(void);
+#endif /* not HAVE_DECL_GETUSERSHELL */
+#endif /* HAVE_GETUSERSHELL */
+
+#ifdef HAVE_SETUSERSHELL
+#if !HAVE_DECL_SETUSERSHELL
+/* we define setusershell() here because on some platforms the function is
+ undefined */
+extern char *setusershell(void);
+#endif /* not HAVE_DECL_SETUSERSHELL */
+#endif /* HAVE_SETUSERSHELL */
+
+#ifdef HAVE_ENDUSERSHELL
+#if !HAVE_DECL_ENDUSERSHELL
+/* we define getusershell() here because on some platforms the function is
+ undefined */
+extern char *endusershell(void);
+#endif /* not HAVE_DECL_ENDUSERSHELL */
+#endif /* HAVE_ENDUSERSHELL */
+
+#endif /* not COMPAT__SHELL_H */
diff --git a/configure.ac b/configure.ac
index f9a501c..6a70fc0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -346,6 +346,7 @@ AC_FUNC_FORK
AC_CHECK_FUNCS(__assert_fail)
AC_SEARCH_LIBS(clock_gettime, rt)
AC_CHECK_FUNCS([setusershell getusershell endusershell])
+AC_CHECK_DECLS([setusershell, getusershell, endusershell])
# checks for types
AC_TYPE_MODE_T
diff --git a/nslcd/usermod.c b/nslcd/usermod.c
index 61f6bbe..968985a 100644
--- a/nslcd/usermod.c
+++ b/nslcd/usermod.c
@@ -36,6 +36,7 @@
#include "myldap.h"
#include "cfg.h"
#include "attmap.h"
+#include "compat/shell.h"
/* ensure that both userdn and username are filled in from the entry,
returns an LDAP result code */