mkntpwd: New Java JNI interface

joshua at prestoncentral.com joshua at prestoncentral.com
Thu Feb 16 19:27:43 GMT 2006


Hey everyone,

I'm fairly new, but I have something to give back.

Anyhow, I'm not sure if the mkntpwd utility is still being actively
developed, supported or if I even have the right maintainers (or if any
even exist), but if not, I apologize in advance.

I've recently been working on a Java web app to change Windows passwords
stored in Sun Identity Server (iPlanet/Sun One).  I've run into an issue
where I was having problems hashing the passwords in Java, so I wrote a
wrapper to contain the mkntpwd program into a library that implements the
Java Native Interface.  This allows a Java application to generate LM and
NT hashes without too much trickery.  I've got the sources on my website,
and the only file I've modified from the original was the Makefile.

So far, it works like a charm.

Anyhow, the tarballs are located at:

Original:
http://www.prestoncentral.com/home/uploads/media/mkntpwd-orig.tar.gz

New:
http://www.prestoncentral.com/home/uploads/media/mkntpwd.tar.gz

I'm not sure what the policy is for distribution, but if these are found
to be useful, they can be added if its not in violation of the existing
license.

Thanks!

Joshua Preston
joshua at prestoncentral.com




--- mkntpwd-orig/Makefile       Fri Dec 14 07:22:26 2001
+++ mkntpwd-new/Makefile        Thu Feb 16 13:42:04 2006
@@ -51,12 +51,22 @@

 OBJS = getopt.o        md4.o           mkntpwd.o       smbdes.o

+### Added 2006-16-02 - Joshua Preston <joshua at prestoncentral.com>
+LIB_OBJS = md4.c       smbdes.c        smbpasswdutil.c
+SYS_TYPE=solaris
+
+build: mkntpwd libsambapasswdutil
+
 mkntpwd: $(OBJS)
        $(CC) $(CFLAGS) $(XLIBS) -o mkntpwd $(OBJS)

+### Added 2006-16-02 - Joshua Preston <joshua at prestoncentral.com>
+libsambapasswdutil: $(LIB_OBJS)
+       $(CC) $(CFLAGS) -fPIC -D_REENTRANT -shared -I/usr/java/include
-I/usr/java/include/$(SYS_TYPE) -o libsambapasswdutil.so $(LIB_OBJS)
+
 clean:
-       rm -f core *.o mkntpwd
+       rm -f core *.o *.class libsambapasswdutil.so mkntpwd

-install: mkntpwd
-       install -m 555 mkntpwd $(PREFIX)/sbin/mkntpwd
-
+install: build
+       install -m 555 mkntpwd $(PREFIX)/bin/mkntpwd
+       install -m 555 libsambapasswdutil.so
$(PREFIX)/lib/libsambapasswdutil.so




More information about the samba-technical mailing list