* configure.in: Create makefile in misc.
* Makefile.in (LOCAL_SUBDIRS): Add misc.
* misc/test_getpw.c: New file.
* misc/Makefile.in: New file, based on ../resolve/Makefile.in.
(test_getpw): New target.
(check): Build and run it.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17161
dc483132-0cff-0310-8789-
dd5450dbe970
+2005-03-28 Ken Raeburn <raeburn@mit.edu>
+
+ * configure.in: Create makefile in misc.
+ * Makefile.in (LOCAL_SUBDIRS): Add misc.
+
2005-02-09 Ken Raeburn <raeburn@mit.edu>
* gss-threads: New subdirectory.
mydir=.
BUILDTOP=$(REL)..
LOCAL_SUBDIRS = resolve asn.1 create hammer verify gssapi dejagnu shlib \
- gss-threads
+ gss-threads misc
RUN_SETUP = @KRB5_RUN_ENV@ KRB5_KDC_PROFILE=kdc.conf KRB5_CONFIG=$(SRCTOP)/config-files/krb5.conf
KRB5_RUN_ENV= @KRB5_RUN_ENV@
fi
AC_SUBST(KRB4_DEJAGNU_TEST)
KRB5_AC_PRIOCNTL_HACK
-V5_AC_OUTPUT_MAKEFILE(. resolve asn.1 create hammer verify gssapi dejagnu threads shlib gss-threads)
+V5_AC_OUTPUT_MAKEFILE(. resolve asn.1 create hammer verify gssapi dejagnu threads shlib gss-threads misc)
--- /dev/null
+2005-03-28 Ken Raeburn <raeburn@mit.edu>
+
+ * test_getpw.c: New file.
+ * Makefile.in: New file, based on ../resolve/Makefile.in.
+ (test_getpw): New target.
+ (check): Build and run it.
+
--- /dev/null
+thisconfigdir=./..
+myfulldir=tests/misc
+mydir=misc
+BUILDTOP=$(REL)..$(S)..
+RUN_SETUP = @KRB5_RUN_ENV@
+PROG_LIBPATH=-L$(TOPLIBD)
+PROG_RPATH=$(KRB5_LIBDIR)
+
+OBJS=test_getpw.o
+SRCS=$(srcdir)/test_getpw.c
+
+all:: test_getpw
+
+check:: test_getpw
+ $(RUN_SETUP) ./test_getpw
+
+test_getpw: $(srcdir)/../misc/test_getpw.c ../../include/krb5/autoconf.h
+ $(CC_LINK) $(ALL_CFLAGS) -o test_getpw $(srcdir)/../misc/test_getpw.c
+
+install::
+
+clean::
+ $(RM) test_getpw
+
+# +++ Dependency line eater +++
+#
+# Makefile dependencies follow. This must be the last section in
+# the Makefile.in file
+#
+$(OUTPRE)test_getpw.$(OBJEXT): test_getpw.c $(BUILDTOP)/include/krb5/autoconf.h \
+ $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h
--- /dev/null
+#include "krb5/autoconf.h"
+#include "k5-platform.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <pwd.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+int main()
+{
+ uid_t my_uid;
+ struct passwd *pwd, pwx;
+ char pwbuf[BUFSIZ];
+ int x;
+
+ my_uid = getuid();
+ printf("my uid: %ld\n", (long) my_uid);
+
+ x = k5_getpwuid_r(my_uid, &pwx, pwbuf, sizeof(pwbuf), &pwd);
+ printf("k5_getpwuid_r returns %d\n", x);
+ if (x != 0)
+ exit(1);
+ printf(" username is '%s'\n", pwd->pw_name);
+ exit(0);
+}