summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-01-05 23:46:47 +0000
committerJeremy Allison <jra@samba.org>2000-01-05 23:46:47 +0000
commit5983a77020a27dd6d7591107070e5167833727d2 (patch)
treec93931faa7f9171c5b4e50a3ad5a27dcf1d6c899 /source3
parentc4914e2202c17dd37b88c63446c14f7eb5f94d56 (diff)
downloadsamba-5983a77020a27dd6d7591107070e5167833727d2.tar.gz
samba-5983a77020a27dd6d7591107070e5167833727d2.tar.bz2
samba-5983a77020a27dd6d7591107070e5167833727d2.zip
Moved check_plaintext_password() into smbd/chgpasswd.c from smbd/ipc.c.
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)
Diffstat (limited to 'source3')
-rwxr-xr-xsource3/configure2
-rw-r--r--source3/configure.in2
-rw-r--r--source3/include/config.h.in3
-rw-r--r--source3/include/includes.h4
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/smbd/chgpasswd.c43
-rw-r--r--source3/smbd/ipc.c43
7 files changed, 54 insertions, 45 deletions
diff --git a/source3/configure b/source3/configure
index c1a2a0bf7e..21d6ecfd99 100755
--- a/source3/configure
+++ b/source3/configure
@@ -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
diff --git a/source3/configure.in b/source3/configure.in
index 5d82418d40..9a45771fbb 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -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)
diff --git a/source3/include/config.h.in b/source3/include/config.h.in
index 2761b1e384..0da717ac42 100644
--- a/source3/include/config.h.in
+++ b/source3/include/config.h.in
@@ -843,6 +843,9 @@
/* 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
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 7986c12c91..e2139345c0 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -110,6 +110,10 @@
#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
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 0222e890d2..dd25ae1d79 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -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 */
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c
index b86091e773..406f4604b1 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/smbd/chgpasswd.c
@@ -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);
+}
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index 086a4bfa0b..737b364c6b 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -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.
*****************************************************************************/