aboutsummaryrefslogtreecommitdiff
path: root/Linux-PAM/libpam_misc
diff options
context:
space:
mode:
Diffstat (limited to 'Linux-PAM/libpam_misc')
-rw-r--r--Linux-PAM/libpam_misc/Makefile19
-rw-r--r--Linux-PAM/libpam_misc/help_env.c2
-rw-r--r--Linux-PAM/libpam_misc/include/security/pam_misc.h2
-rw-r--r--Linux-PAM/libpam_misc/misc_conv.c42
-rw-r--r--Linux-PAM/libpam_misc/xstrdup.c2
5 files changed, 43 insertions, 24 deletions
diff --git a/Linux-PAM/libpam_misc/Makefile b/Linux-PAM/libpam_misc/Makefile
index 8d5a68e6..97166668 100644
--- a/Linux-PAM/libpam_misc/Makefile
+++ b/Linux-PAM/libpam_misc/Makefile
@@ -1,5 +1,5 @@
#
-# $Id: Makefile,v 1.1.1.2 2002/09/15 20:08:40 hartmans Exp $
+# $Id: Makefile,v 1.9 2005/03/29 20:41:20 toady Exp $
#
# lots of debugging information goes to /tmp/pam-debug.log
@@ -12,6 +12,9 @@ ifeq ($(WITH_LIBDEBUG),yes)
else
LIBNAME=libpam_misc
endif
+ifeq ($(WITH_PRELUDE),yes)
+ CFLAGS += -DPRELUDE -DLIBPRELUDE_CONFIG_PREFIX=\"`libprelude-config --prefix`\"
+endif
VERSION=.$(MAJOR_REL)
MODIFICATION=.$(MINOR_REL)
@@ -60,9 +63,9 @@ static/%.o : %.c
$(LIBNAMED): $(DLIBOBJECTS)
ifeq ($(DYNAMIC_LIBPAM),yes)
ifeq ($(USESONAME),yes)
- $(LD_L) $(SOSWITCH) $(LIBNAMEDNAME) -o $@ $(DLIBOBJECTS) $(MODULES) $(LINKLIBS)
+ $(LD_L) $(SOSWITCH)$(LIBNAMEDNAME) -o $@ $(DLIBOBJECTS) $(MODULES) $(LINKLIBS)
else
- $(LD_L) -o $@ $(DLIBOBJECTS) $(MODULES)
+ $(LD_L) -o $@ $(DLIBOBJECTS) $(MODULES) $(LINKLIBS)
endif
ifeq ($(NEEDSONAME),yes)
rm -f $(LIBNAMEDFULL)
@@ -74,9 +77,12 @@ endif
$(LIBNAMEDSTATIC): $(SLIBOBJECTS)
ifeq ($(STATIC_LIBPAM),yes)
+ $(AR) rcu $@ $(SLIBOBJECTS) $(MODULES)
+ifdef RANLIB
$(AR) rc $@ $(SLIBOBJECTS) $(MODULES)
$(RANLIB) $@
endif
+endif
install: all
$(MKDIR) $(FAKEROOT)$(INCLUDED)
@@ -84,7 +90,11 @@ install: all
ifeq ($(DYNAMIC_LIBPAM),yes)
$(MKDIR) $(FAKEROOT)$(libdir)
$(INSTALL) -m $(SHLIBMODE) $(LIBNAMED) $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
+ifndef FAKEROOT
$(LDCONFIG)
+else
+ $(LDCONFIG) -n $(FAKEROOT)$(libdir)
+endif
ifneq ($(DYNTYPE),"sl")
( cd $(FAKEROOT)$(libdir) ; rm -f $(LIBNAMED) ; ln -s $(LIBNAMEDNAME) $(LIBNAMED) )
endif
@@ -97,11 +107,14 @@ remove:
rm -f $(FAKEROOT)$(INCLUDED)/pam_misc.h
rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDFULL)
rm -f $(FAKEROOT)$(libdir)/$(LIBNAMED)
+ifndef FAKEROOT
$(LDCONFIG)
+endif
rm -f $(FAKEROOT)$(libdir)/$(LIBNAMEDSTATIC)
clean:
rm -f a.out core *~ static/*.o dynamic/*.o
rm -f *.a *.out *.o *.so ./include/security/*~
+ rm -f *.orig $(LIBNAMEDNAME) $(LIBNAMEDFULL)
if [ -d dynamic ]; then rmdir dynamic ; fi
if [ -d static ]; then rmdir static ; fi
diff --git a/Linux-PAM/libpam_misc/help_env.c b/Linux-PAM/libpam_misc/help_env.c
index 3a342ed5..e1390984 100644
--- a/Linux-PAM/libpam_misc/help_env.c
+++ b/Linux-PAM/libpam_misc/help_env.c
@@ -1,5 +1,5 @@
/*
- * $Id: help_env.c,v 1.1.1.1 2001/04/29 04:17:12 hartmans Exp $
+ * $Id: help_env.c,v 1.2 2000/12/04 19:02:34 baggins Exp $
*
* This file was written by Andrew G. Morgan <morgan@parc.power.net>
*
diff --git a/Linux-PAM/libpam_misc/include/security/pam_misc.h b/Linux-PAM/libpam_misc/include/security/pam_misc.h
index e042e8e9..66c7ab4a 100644
--- a/Linux-PAM/libpam_misc/include/security/pam_misc.h
+++ b/Linux-PAM/libpam_misc/include/security/pam_misc.h
@@ -1,4 +1,4 @@
-/* $Id: pam_misc.h,v 1.1.1.2 2002/09/15 20:08:41 hartmans Exp $ */
+/* $Id: pam_misc.h,v 1.4 2001/05/01 04:27:37 agmorgan Exp $ */
#ifndef __PAMMISC_H
#define __PAMMISC_H
diff --git a/Linux-PAM/libpam_misc/misc_conv.c b/Linux-PAM/libpam_misc/misc_conv.c
index e352bb9a..1c66f96c 100644
--- a/Linux-PAM/libpam_misc/misc_conv.c
+++ b/Linux-PAM/libpam_misc/misc_conv.c
@@ -1,5 +1,5 @@
/*
- * $Id: misc_conv.c,v 1.1.1.2 2002/09/15 20:08:40 hartmans Exp $
+ * $Id: misc_conv.c,v 1.6 2004/09/22 12:51:20 kukuk Exp $
*
* A generic conversation function for text based applications
*
@@ -127,24 +127,23 @@ static int get_delay(void)
}
/* read a line of input string, giving prompt when appropriate */
-static char *read_string(int echo, const char *prompt)
+static int read_string(int echo, const char *prompt, char **retstr)
{
struct termios term_before, term_tmp;
- char line[INPUTSIZE], *input;
+ char line[INPUTSIZE];
struct sigaction old_sig;
- int delay, nc, have_term=0;
+ int delay, nc = -1, have_term = 0;
sigset_t oset, nset;
-
- D(("called with echo='%s', prompt='%s'.", echo ? "ON":"OFF" , prompt));
- input = line;
+ D(("called with echo='%s', prompt='%s'.", echo ? "ON":"OFF" , prompt));
if (isatty(STDIN_FILENO)) { /* terminal state */
/* is a terminal so record settings and flush it */
if ( tcgetattr(STDIN_FILENO, &term_before) != 0 ) {
D(("<error: failed to get terminal settings>"));
- return NULL;
+ *retstr = NULL;
+ return -1;
}
memcpy(&term_tmp, &term_before, sizeof(term_tmp));
if (!echo) {
@@ -203,7 +202,7 @@ static char *read_string(int echo, const char *prompt)
}
line[nc] = '\0';
}
- input = x_strdup(line);
+ *retstr = x_strdup(line);
_pam_overwrite(line);
goto cleanexit; /* return malloc()ed string */
@@ -211,11 +210,19 @@ static char *read_string(int echo, const char *prompt)
} else if (nc == 0) { /* Ctrl-D */
D(("user did not want to type anything"));
- input = x_strdup("");
+ *retstr = NULL;
if (echo) {
fprintf(stderr, "\n");
}
goto cleanexit; /* return malloc()ed "" */
+ } else if (nc == -1) {
+ /* Don't loop forever if read() returns -1. */
+ D(("error reading input from the user: %s", strerror(errno)));
+ if (echo) {
+ fprintf(stderr, "\n");
+ }
+ *retstr = NULL;
+ goto cleanexit; /* return NULL */
}
}
}
@@ -224,7 +231,7 @@ static char *read_string(int echo, const char *prompt)
D(("the timer appears to have expired"));
- input = NULL;
+ *retstr = NULL;
_pam_overwrite(line);
cleanexit:
@@ -234,9 +241,7 @@ static char *read_string(int echo, const char *prompt)
(void) tcsetattr(STDIN_FILENO, TCSADRAIN, &term_before);
}
- D(("returning [%s]", input));
-
- return input;
+ return nc;
}
/* end of read_string functions */
@@ -276,17 +281,18 @@ int misc_conv(int num_msg, const struct pam_message **msgm,
for (count=0; count < num_msg; ++count) {
char *string=NULL;
+ int nc;
switch (msgm[count]->msg_style) {
case PAM_PROMPT_ECHO_OFF:
- string = read_string(CONV_ECHO_OFF,msgm[count]->msg);
- if (string == NULL) {
+ nc = read_string(CONV_ECHO_OFF,msgm[count]->msg, &string);
+ if (nc < 0) {
goto failed_conversation;
}
break;
case PAM_PROMPT_ECHO_ON:
- string = read_string(CONV_ECHO_ON,msgm[count]->msg);
- if (string == NULL) {
+ nc = read_string(CONV_ECHO_ON,msgm[count]->msg, &string);
+ if (nc < 0) {
goto failed_conversation;
}
break;
diff --git a/Linux-PAM/libpam_misc/xstrdup.c b/Linux-PAM/libpam_misc/xstrdup.c
index f5bfde66..cce476e8 100644
--- a/Linux-PAM/libpam_misc/xstrdup.c
+++ b/Linux-PAM/libpam_misc/xstrdup.c
@@ -1,4 +1,4 @@
-/* $Id: xstrdup.c,v 1.1.1.1 2001/04/29 04:17:12 hartmans Exp $ */
+/* $Id: xstrdup.c,v 1.1.1.1 2000/06/20 22:11:25 agmorgan Exp $ */
#include <malloc.h>
#include <string.h>