+1999-08-09 Danilo Almeida <dalmeida@mit.edu>
+
+ * Makefile.in: Build kpasswd under windows.
+
1999-07-22 Tom Yu <tlyu@mit.edu>
* Makefile.in (install-mkdirs): Use mkinstalldirs rather than
WINMAKEFILES=Makefile \
clients\Makefile clients\kdestroy\Makefile \
clients\kinit\Makefile clients\klist\Makefile \
+ clients\kpasswd\Makefile \
include\Makefile include\krb5\Makefile \
lib\Makefile lib\crypto\Makefile \
lib\crypto\crc32\Makefile lib\crypto\des\Makefile \
##DOS## $(WCONFIG) config < $@.in > $@
##DOS##clients\klist\Makefile: clients\klist\Makefile.in $(MKFDEP)
##DOS## $(WCONFIG) config < $@.in > $@
+##DOS##clients\kpasswd\Makefile: clients\kpasswd\Makefile.in $(MKFDEP)
+##DOS## $(WCONFIG) config < $@.in > $@
##DOS##include\Makefile: include\Makefile.in $(MKFDEP)
##DOS## $(WCONFIG) config < $@.in > $@
##DOS##include\krb5\Makefile: include\krb5\Makefile.in $(MKFDEP)
ZIP=zip
FILES= ./* \
clients/* clients/kdestroy/* clients/kinit/* clients/klist/* \
+ clients/kpasswd/* \
config/* include/* include/kerberosIV/* \
include/krb5/* include/krb5/stock/* include/sys/* lib/* \
lib/crypto/* lib/crypto/crc32/* lib/crypto/des/* lib/crypto/dk/* \
$(CP) clients\klist\$(OUTPRE)klist.exe $(KBINDIR)\.
$(CP) clients\kinit\$(OUTPRE)kinit.exe $(KBINDIR)\.
$(CP) clients\kdestroy\$(OUTPRE)kdestroy.exe $(KBINDIR)\.
+ $(CP) clients\kpasswd\$(OUTPRE)kpasswd.exe $(KBINDIR)\.
+1999-08-09 Danilo Almeida <dalmeida@mit.edu>
+
+ * Makefile.in: Build kpasswd under windows.
+
Tue May 18 19:52:56 1999 Danilo Almeida <dalmeida@mit.edu>
* Makefile.in: Remove - from recursive Win32 make invocation.
@echo Making all in clients\kinit
cd ..\kinit
$(MAKE) -$(MFLAGS)
+ @echo Making all in clients\kpasswd
+ cd ..\kpasswd
+ $(MAKE) -$(MFLAGS)
cd ..
clean-windows::
+1999-08-09 Danilo Almeida <dalmeida@mit.edu>
+
+ * kpasswd.c:
+ * Makefile.in: Build kpasswd under windows.
+
1998-11-13 Theodore Ts'o <tytso@rsts-11.mit.edu>
* Makefile.in: Set the myfulldir and mydir variables (which are
kpasswd.o: $(srcdir)/kpasswd.c
all-unix:: kpasswd
-all-windows:: kpasswd.exe
clean-unix::
$(RM) kpasswd.o kpasswd
-clean-windows::
- $(RM) kpasswd.obj kpasswd.exe
-
install-all install-kdc install-server install-client install-unix::
$(INSTALL_PROGRAM) kpasswd $(DESTDIR)$(CLIENT_BINDIR)/`echo kpasswd|sed '$(transform)'`
$(INSTALL_DATA) $(srcdir)/kpasswd.M $(DESTDIR)$(CLIENT_MANDIR)/`echo kpasswd|sed '$(transform)'`.1;
-kpasswd.exe: kpasswd.obj
- link /out:kpasswd.exe kpasswd.obj $(BUILDTOP)\lib\libkrb5.lib
+##WIN32##INCLUDES = /I$(BUILDTOP)\include /I$(BUILDTOP)\include\krb5
+##WIN32##CFLAGS = $(CCOPTS2) $(INCLUDES)
+
+##WIN32##all-windows:: $(OUTPRE)kpasswd.exe
+##WIN32##$(OUTPRE)kpasswd.exe: $(OUTPRE)kpasswd.obj $(KLIB) $(CLIB)
+##WIN32## link $(LINKOPTS2) -out:$@ $**
#include <stdio.h>
#include <sys/types.h>
-#include <pwd.h>
+
+#ifndef _WIN32
#include <unistd.h>
+#endif
#include <krb5.h>
#define P1 "Enter new password: "
#define P2 "Enter it again: "
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+
+void get_name_from_passwd_file(program_name, kcontext, me)
+ char * program_name;
+ krb5_context kcontext;
+ krb5_principal * me;
+{
+ struct passwd *pw;
+ krb5_error_code code;
+ if (pw = getpwuid((int) getuid())) {
+ if ((code = krb5_parse_name(kcontext, pw->pw_name, me))) {
+ com_err (program_name, code, "when parsing name %s", pw->pw_name);
+ exit(1);
+ }
+ } else {
+ fprintf(stderr, "Unable to identify user from password file\n");
+ exit(1);
+ }
+}
+#else /* HAVE_PWD_H */
+void get_name_from_passwd_file(kcontext, me)
+ krb5_context kcontext;
+ krb5_principal * me;
+{
+ fprintf(stderr, "Unable to identify user\n");
+ exit(1);
+}
+#endif /* HAVE_PWD_H */
+
int main(int argc, char *argv[])
{
krb5_error_code ret;
krb5_context context;
krb5_principal princ;
char *pname;
- struct passwd *pwd;
krb5_ccache ccache;
krb5_get_init_creds_opt opts;
krb5_creds creds;
exit(1);
}
+#if 0
krb5_init_ets(context);
+#endif
/* in order, use the first of:
- a name specified on the command line
com_err(argv[0], ret, "closing ccache");
exit(1);
}
- } else if (pwd = getpwuid(getuid())) {
- if (ret = krb5_parse_name(context, pwd->pw_name, &princ)) {
- com_err(argv[0], ret, "parsing client name");
- exit(1);
- }
} else {
- com_err(argv[0], 0,
- "no matching password entry while looking for username");
- exit(1);
+ get_name_from_passwd_file(argv[0], context, &princ);
}
krb5_get_init_creds_opt_init(&opts);