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
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)
/* 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
#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
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 */
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);
+}
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.
*****************************************************************************/