[SCM] Samba Shared Repository - branch master updated

Günther Deschner gd at samba.org
Wed May 26 14:17:45 MDT 2010


The branch, master has been updated
       via  2807ab3... s3-samr: move chgpasswd.c out of smbd and into the samr server.
      from  14b03d1... s3-smbd: remove unused change/check_lanman_password.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 2807ab358ec346a1da15522adce7f182d3ffefe5
Author: Günther Deschner <gd at samba.org>
Date:   Tue May 18 12:06:23 2010 +0200

    s3-samr: move chgpasswd.c out of smbd and into the samr server.
    
    Guenther

-----------------------------------------------------------------------

Summary of changes:
 source3/Makefile.in                                |    5 +++--
 source3/include/proto.h                            |   14 --------------
 .../srv_samr_chgpasswd.c}                          |   17 +++++++++--------
 source3/rpc_server/srv_samr_util.h                 |   14 ++++++++++++++
 source3/winbindd/winbindd_pam.c                    |    1 +
 5 files changed, 27 insertions(+), 24 deletions(-)
 rename source3/{smbd/chgpasswd.c => rpc_server/srv_samr_chgpasswd.c} (99%)


Changeset truncated at 500 lines:

diff --git a/source3/Makefile.in b/source3/Makefile.in
index bc0bca9..1651644 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -618,6 +618,7 @@ RPC_NETLOG_OBJ = rpc_server/srv_netlog_nt.o \
 
 RPC_SAMR_OBJ = rpc_server/srv_samr_nt.o \
                rpc_server/srv_samr_util.o \
+               rpc_server/srv_samr_chgpasswd.o \
 	       librpc/gen_ndr/srv_samr.o
 
 RPC_INITSHUTDOWN_OBJ =  librpc/gen_ndr/srv_initshutdown.o rpc_server/srv_initshutdown_nt.o
@@ -777,7 +778,7 @@ SMBD_OBJ_MAIN = smbd/server.o
 
 BUILDOPT_OBJ = smbd/build_options.o
 
-SMBD_OBJ_SRV = smbd/files.o smbd/chgpasswd.o smbd/connection.o \
+SMBD_OBJ_SRV = smbd/files.o smbd/connection.o \
 	       smbd/utmp.o smbd/session.o smbd/map_username.o \
                smbd/dfree.o smbd/dir.o smbd/password.o smbd/conn.o \
 	       smbd/share_access.o smbd/fileio.o \
@@ -1254,7 +1255,7 @@ WINBINDD_OBJ1 = \
 		auth/server_info_sam.o \
 		auth/user_info.o \
 		auth/pampass.o \
-		smbd/chgpasswd.o \
+		rpc_server/srv_samr_chgpasswd.o \
 		../nsswitch/libwbclient/wb_reqtrans.o
 
 WINBINDD_OBJ = \
diff --git a/source3/include/proto.h b/source3/include/proto.h
index cadbbd9..92c757b 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -5365,20 +5365,6 @@ struct blocking_lock_record *blocking_lock_cancel_smb1(files_struct *fsp,
 
 NTSTATUS change_trust_account_password( const char *domain, const char *remote_machine);
 
-/* The following definitions come from smbd/chgpasswd.c  */
-
-bool chgpasswd(const char *name, const struct passwd *pass,
-	       const char *oldpass, const char *newpass, bool as_root);
-NTSTATUS pass_oem_change(char *user,
-			 uchar password_encrypted_with_lm_hash[516],
-			 const uchar old_lm_hash_encrypted[16],
-			 uchar password_encrypted_with_nt_hash[516],
-			 const uchar old_nt_hash_encrypted[16],
-			 enum samPwdChangeReason *reject_reason);
-NTSTATUS check_password_complexity(const char *username,
-				   const char *password,
-				   enum samPwdChangeReason *samr_reject_reason);
-
 /* The following definitions come from smbd/close.c  */
 
 void set_close_write_time(struct files_struct *fsp, struct timespec ts);
diff --git a/source3/smbd/chgpasswd.c b/source3/rpc_server/srv_samr_chgpasswd.c
similarity index 99%
rename from source3/smbd/chgpasswd.c
rename to source3/rpc_server/srv_samr_chgpasswd.c
index 3a23321..2e76e55 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/rpc_server/srv_samr_chgpasswd.c
@@ -1,4 +1,4 @@
-/* 
+/*
    Unix SMB/CIFS implementation.
    Samba utility functions
    Copyright (C) Andrew Tridgell 1992-1998
@@ -48,6 +48,7 @@
 #include "includes.h"
 #include "../libcli/auth/libcli_auth.h"
 #include "../lib/crypto/arcfour.h"
+#include "rpc_server/srv_samr_util.h"
 
 #if ALLOW_CHANGE_PASSWORD
 
@@ -206,7 +207,7 @@ static int dochild(int master, const char *slavedev, const struct passwd *pass,
 	stermios.c_lflag &= ~(ECHO | ECHOE | ECHOK | ECHONL);
 	stermios.c_lflag |= ICANON;
 #ifdef ONLCR
- 	stermios.c_oflag &= ~(ONLCR);
+	stermios.c_oflag &= ~(ONLCR);
 #endif
 	if (tcsetattr(0, TCSANOW, &stermios) < 0)
 	{
@@ -618,7 +619,7 @@ the string %%u, and the given string %s does not.\n", passwordprogram ));
 
 #else /* ALLOW_CHANGE_PASSWORD */
 
-bool chgpasswd(const char *name, const struct passwd *pass, 
+bool chgpasswd(const char *name, const struct passwd *pass,
 	       const char *oldpass, const char *newpass, bool as_root)
 {
 	DEBUG(0, ("chgpasswd: Unix Password changing not compiled in (user=%s)\n", name));
@@ -700,20 +701,20 @@ static NTSTATUS check_oem_password(const char *user,
 		password_encrypted = password_encrypted_with_lm_hash;
 		encryption_key = lanman_pw;
 	} else if (nt_pass_set) {
-		DEBUG(1, ("NT password change supplied for user %s, but we have no NT password to check it with\n", 
+		DEBUG(1, ("NT password change supplied for user %s, but we have no NT password to check it with\n",
 			  user));
 		return NT_STATUS_WRONG_PASSWORD;
 	} else if (lm_pass_set) {
 		if (lp_lanman_auth()) {
-			DEBUG(1, ("LM password change supplied for user %s, but we have no LanMan password to check it with\n", 
+			DEBUG(1, ("LM password change supplied for user %s, but we have no LanMan password to check it with\n",
 				  user));
 		} else {
-			DEBUG(1, ("LM password change supplied for user %s, but we have disabled LanMan authentication\n", 
+			DEBUG(1, ("LM password change supplied for user %s, but we have disabled LanMan authentication\n",
 				  user));
 		}
 		return NT_STATUS_WRONG_PASSWORD;
 	} else {
-		DEBUG(1, ("password change requested for user %s, but no password supplied!\n", 
+		DEBUG(1, ("password change requested for user %s, but no password supplied!\n",
 			  user));
 		return NT_STATUS_WRONG_PASSWORD;
 	}
@@ -1009,7 +1010,7 @@ static NTSTATUS change_oem_password(struct samu *hnd, char *old_passwd, char *ne
 	}
 
 	if (pdb_get_account_policy(PDB_POLICY_MIN_PASSWORD_LEN, &min_len) && (str_charnum(new_passwd) < min_len)) {
-		DEBUG(1, ("user %s cannot change password - password too short\n", 
+		DEBUG(1, ("user %s cannot change password - password too short\n",
 			  username));
 		DEBUGADD(1, (" account policy min password len = %d\n", min_len));
 		if (samr_reject_reason) {
diff --git a/source3/rpc_server/srv_samr_util.h b/source3/rpc_server/srv_samr_util.h
index 9dbc8b5..fb6d026 100644
--- a/source3/rpc_server/srv_samr_util.h
+++ b/source3/rpc_server/srv_samr_util.h
@@ -61,3 +61,17 @@ void copy_id25_to_sam_passwd(struct samu *to,
 			     struct samr_UserInfo25 *from);
 void copy_id26_to_sam_passwd(struct samu *to,
 			     struct samr_UserInfo26 *from);
+
+/* The following definitions come from rpc_server/srv_samr_chgpasswd.c  */
+
+bool chgpasswd(const char *name, const struct passwd *pass,
+	       const char *oldpass, const char *newpass, bool as_root);
+NTSTATUS pass_oem_change(char *user,
+			 uchar password_encrypted_with_lm_hash[516],
+			 const uchar old_lm_hash_encrypted[16],
+			 uchar password_encrypted_with_nt_hash[516],
+			 const uchar old_nt_hash_encrypted[16],
+			 enum samPwdChangeReason *reject_reason);
+NTSTATUS check_password_complexity(const char *username,
+				   const char *password,
+				   enum samPwdChangeReason *samr_reject_reason);
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index cf5ffdf..9848bea 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -31,6 +31,7 @@
 #include "rpc_client/cli_netlogon.h"
 #include "smb_krb5.h"
 #include "../lib/crypto/arcfour.h"
+#include "rpc_server/srv_samr_util.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_WINBIND


-- 
Samba Shared Repository


More information about the samba-cvs mailing list