summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile26
-rw-r--r--examples/xsh.c27
2 files changed, 14 insertions, 39 deletions
diff --git a/examples/Makefile b/examples/Makefile
index c6882473..bd15ddf2 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -2,18 +2,15 @@
# $Id$
#
-dummy:
-
- @echo "*** This is not a top level Makefile!"
+include ../Make.Rules
PROGS = blank xsh check_user
SRCS = blank.c xsh.c check_user.c
+PROGSUID =
-# have removed the following pair since they no longer conform to
-# any recognized conventions: vpass test
-# ditto: vpass.c test.c
+CFLAGS += -I../libpam_misc/inlcude -I../libpamc/include
-PROGSUID =
+LOADLIBES = -L../libpam -L../libpamc -L../libpam_misc -lpam -lpam_misc
all: $(PROGS)
@@ -26,17 +23,18 @@ blank: blank.o
xsh: xsh.o
$(CC) $(CFLAGS) -o $@ $< $(LOADLIBES)
+clean:
+ rm -f *.a *.so *.o *~ $(PROGS) $(PROGSUID)
+ rm -f *.a *.out *.o *.so
+
+# note, the programs are test programs, they should not be
+# installed on your system!
+
install: all
if [ -n "$(PROGS)" ]; then cp $(PROGS) ../bin ; fi
if [ -n "$(PROGSUID)" ]; then \
- $(INSTALL) -m 4555 -o root -g bin $(PROGSUID) ../bin ; fi
-
-clean:
- rm -f *.a *.so *.o *~ $(PROGS) $(PROGSUID)
+ $(INSTALL) -m 4555 $(PROGSUID) ../bin ; fi
remove:
cd ../bin ; rm -f $(PROGS) $(PROGSUID)
-
-extraclean: clean
- rm -f *.a *.out *.o *.so
for x in $(PROGS) $(PROGSUID) ; do rm -f ../bin/$$x ; done
diff --git a/examples/xsh.c b/examples/xsh.c
index d4b50b37..13971a2d 100644
--- a/examples/xsh.c
+++ b/examples/xsh.c
@@ -1,31 +1,8 @@
/*
* $Id$
- *
- * $Log$
- * Revision 1.1 2000/06/20 22:11:13 agmorgan
- * Initial revision
- *
- * Revision 1.2 1999/11/08 05:39:53 morgan
- * removed void main def which was making gcc complain
- *
- * Revision 1.1.1.1 1998/07/12 05:17:14 morgan
- * Linux PAM sources pre-0.66
- *
- * Revision 1.4 1996/11/10 21:09:45 morgan
- * no gcc warnings
- *
- * Revision 1.3 1996/07/07 23:53:36 morgan
- * added support for non standard pam_fail_delay
- *
- * Revision 1.2 1996/05/02 04:44:48 morgan
- * moved conversaation to a libmisc routine.
- *
- * Revision 1.1 1996/04/07 08:18:55 morgan
- * Initial revision
- *
*/
-/* Andrew Morgan (morgan@parc.power.net) -- an example application
+/* Andrew Morgan (morgan@kernel.org) -- an example application
* that invokes a shell, based on blank.c */
#include <stdio.h>
@@ -53,7 +30,7 @@ static struct pam_conv conv = {
/* ------- the application itself -------- */
-int main(int argc, char **argv, char **envp)
+int main(int argc, char **argv)
{
pam_handle_t *pamh=NULL;
char *username=NULL;