hash passwords

Roland Bauerschmidt rb at debian.org
Wed Jul 11 07:24:56 GMT 2001


Gerald Carter wrote:
> See the smbencrypt code in ftp.samba.org/pub/samba/contributed/

Thanks! This is excatly what I was looking for... I did some small
modifications so it doesn't segfault if run without command line
arguments, and also clears the passed password from the process list.

	Roland

--- smbencrypt.old/main.c       Wed Jul  4 14:43:25 2001
+++ smbencrypt/main.c   Wed Jul 11 09:23:10 2001
@@ -4,7 +4,15 @@
 int main(int argc,char *argv[])
 {
        char result[66];
-       char *p=strdup(argv[1]);
+       char *p;
+       
+       if(argc != 2) {
+               fprintf(stderr, "Usage: smbencrypt password\n");
+               exit(1);
+       }
+       
+       p=strdup(argv[1]);
+       memset(argv[1], 0, strlen(argv[1]));
        
        SambaPassGen(p,result);

-- 
Roland Bauerschmidt




More information about the samba-technical mailing list