Moved check_plaintext_password() into smbd/chgpasswd.c from smbd/ipc.c.
authorJeremy Allison <jra@samba.org>
Wed, 5 Jan 2000 23:46:47 +0000 (23:46 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 5 Jan 2000 23:46:47 +0000 (23:46 +0000)
configure configure.in include/config.h.in: Added <sys/un.h> autoconf
code for Luke's UNIX domain sockets code.
Jeremy.
(This used to be commit 210d61db08136122f51a93428607fccd582c9e7d)

source3/configure
source3/configure.in
source3/include/config.h.in
source3/include/includes.h
source3/include/proto.h
source3/smbd/chgpasswd.c
source3/smbd/ipc.c

index c1a2a0bf7ec5b8a86f5b77818a1ed581fc302456..21d6ecfd99fa748584ceeaaffd3f11cd6c3a1b8c 100755 (executable)
@@ -1867,7 +1867,7 @@ else
 fi
 done
 
-for ac_hdr in sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h
+for ac_hdr in sys/param.h ctype.h sys/un.h sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
index 5d82418d40138dbd932bca35f169fef868af46a1..9a45771fbb178d651ef791551640d9e420b5655f 100644 (file)
@@ -175,7 +175,7 @@ AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
 AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
 AC_CHECK_HEADERS(compat.h rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
-AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
+AC_CHECK_HEADERS(sys/param.h ctype.h sys/un.h sys/wait.h sys/resource.h sys/ioctl.h sys/mode.h)
 AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h string.h strings.h stdlib.h sys/socket.h)
 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
 AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
index 2761b1e384f386ca300c8fbeb55b1651b678f7c6..0da717ac428235af850508a69e671ac2edb29555 100644 (file)
 /* Define if you have the <sys/time.h> header file.  */
 #undef HAVE_SYS_TIME_H
 
+/* Define if you have the <sys/un.h> header file.  */
+#undef HAVE_SYS_UN_H
+
 /* Define if you have the <sys/unistd.h> header file.  */
 #undef HAVE_SYS_UNISTD_H
 
index 7986c12c91a9778ff2b6d984c5ae1dbd4cd0d596..e2139345c096d540629da5bf195e22d728191037 100644 (file)
 #include <sys/socket.h>
 #endif
 
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+
 #ifdef HAVE_SYS_SYSCALL_H
 #include <sys/syscall.h>
 #elif HAVE_SYSCALL_H
index 0222e890d21a7dd721c7b3f65906521188f075d4..dd25ae1d7914757d1745fa48ca82d644d6694cba 100644 (file)
@@ -2531,6 +2531,8 @@ BOOL check_oem_password(char *user,
                         struct smb_passwd **psmbpw, char *new_passwd,
                         int new_passwd_size);
 BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL override);
+BOOL check_plaintext_password(char *user,char *old_passwd,
+                              int old_passwd_size, struct smb_passwd **psmbpw);
 
 /*The following definitions come from  smbd/close.c  */
 
index b86091e773fa28bb3f9fd757444a2179f6657909..406f4604b11f2dad867387c7dde2fc106ac8cfaf 100644 (file)
@@ -789,3 +789,46 @@ BOOL change_oem_password(struct smb_passwd *smbpw, char *new_passwd, BOOL overri
 
   return ret;
 }
+
+/***********************************************************
+ Code to check a plaintext password against smbpasswd entries.
+***********************************************************/
+
+BOOL check_plaintext_password(char *user,char *old_passwd,
+                              int old_passwd_size, struct smb_passwd **psmbpw)
+{
+  struct smb_passwd *smbpw = NULL;
+  uchar old_pw[16],old_ntpw[16];
+
+  become_root(False);
+  *psmbpw = smbpw = getsmbpwnam(user);
+  unbecome_root(False);
+
+  if (smbpw == NULL) {
+    DEBUG(0,("check_plaintext_password: getsmbpwnam returned NULL\n"));
+    return False;
+  }
+
+  if (smbpw->acct_ctrl & ACB_DISABLED) {
+    DEBUG(0,("check_plaintext_password: account %s disabled.\n", user));
+    return(False);
+  }
+
+  nt_lm_owf_gen(old_passwd,old_ntpw,old_pw);
+
+#ifdef DEBUG_PASSWORD
+  DEBUG(100,("check_plaintext_password: smbpw->smb_nt_passwd \n"));
+  dump_data(100,smbpw->smb_nt_passwd,16);
+  DEBUG(100,("check_plaintext_password: old_ntpw \n"));
+  dump_data(100,old_ntpw,16);
+  DEBUG(100,("check_plaintext_password: smbpw->smb_passwd \n"));
+  dump_data(100,smbpw->smb_passwd,16);
+  DEBUG(100,("check_plaintext_password: old_pw\n"));
+  dump_data(100,old_pw,16);
+#endif
+
+  if(memcmp(smbpw->smb_nt_passwd,old_ntpw,16) && memcmp(smbpw->smb_passwd,old_pw,16))
+    return(False);
+  else
+    return(True);
+}
index 086a4bfa0b4f58af2faeb59abf865ed884a0f131..737b364c6b05094759baffd96286c44f9a0182d4 100644 (file)
@@ -1660,49 +1660,6 @@ static BOOL api_NetRemoteTOD(connection_struct *conn,uint16 vuid, char *param,ch
   return(True);
 }
 
-/***********************************************************
- Code to check a plaintext password against smbpasswd entries.
-***********************************************************/
-
-static BOOL check_plaintext_password(char *user,char *old_passwd,
-                                     int old_passwd_size, struct smb_passwd **psmbpw)
-{
-  struct smb_passwd *smbpw = NULL;
-  uchar old_pw[16],old_ntpw[16];
-
-  become_root(False);
-  *psmbpw = smbpw = getsmbpwnam(user);
-  unbecome_root(False);
-
-  if (smbpw == NULL) {
-    DEBUG(0,("check_plaintext_password: getsmbpwnam returned NULL\n"));
-    return False;
-  }
-
-  if (smbpw->acct_ctrl & ACB_DISABLED) {
-    DEBUG(0,("check_plaintext_password: account %s disabled.\n", user));
-    return(False);
-  }
-
-  nt_lm_owf_gen(old_passwd,old_ntpw,old_pw);
-
-#ifdef DEBUG_PASSWORD
-  DEBUG(100,("check_plaintext_password: smbpw->smb_nt_passwd \n"));
-  dump_data(100,smbpw->smb_nt_passwd,16);
-  DEBUG(100,("check_plaintext_password: old_ntpw \n"));
-  dump_data(100,old_ntpw,16);
-  DEBUG(100,("check_plaintext_password: smbpw->smb_passwd \n"));
-  dump_data(100,smbpw->smb_passwd,16);
-  DEBUG(100,("check_plaintext_password: old_pw\n"));
-  dump_data(100,old_pw,16);
-#endif
-
-  if(memcmp(smbpw->smb_nt_passwd,old_ntpw,16) && memcmp(smbpw->smb_passwd,old_pw,16))
-    return(False);
-  else
-    return(True);
-}
-
 /****************************************************************************
  Set the user password.
 *****************************************************************************/