[SCM] Samba Shared Repository - branch v3-3-stable updated - release-3-3-0rc1-8-g4339dd5

Karolin Seeger kseeger at samba.org
Mon Dec 8 14:58:54 GMT 2008


The branch, v3-3-stable has been updated
       via  4339dd53ca388c25cfb769666f9a7b09eb67ecc5 (commit)
       via  ceca806fa7e0fa7aeae7fac283fc4513a877ba39 (commit)
       via  ad0f5300b77ba261af159e2de5b2435e7cea0082 (commit)
       via  914b12564f3d20e40700b72dc9500a5924a3e0cf (commit)
       via  1c311e985697ae1ceb8c61ecd1576c31fa85e1ad (commit)
       via  e3a867b059728a51498255115c74030052adf3ce (commit)
       via  cd16198913ed40149e3d3d3a607cefc046978780 (commit)
       via  33bc2776505acc77cf3d07dc9bd51e7fd7ff6987 (commit)
      from  42847a557e9177bf053b7307d964abaa8a773d0d (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-stable


- Log -----------------------------------------------------------------
commit 4339dd53ca388c25cfb769666f9a7b09eb67ecc5
Author: Günther Deschner <gd at samba.org>
Date:   Tue Dec 2 12:57:02 2008 +0100

    s3-net: allow to list a keytab generated using net rpc vampire.
    
    Guenther
    (cherry picked from commit c554080dd988791ec2db37c96ff7cc709b0ee6ab)
    (cherry picked from commit 5f0b7973e04013cc5e3032cb2e96f5e718fb50b5)

commit ceca806fa7e0fa7aeae7fac283fc4513a877ba39
Author: Bo Yang <boyang at novell.com>
Date:   Tue Dec 2 08:35:26 2008 +0800

    Fix script installmo.sh when no .po file exists
    (cherry picked from commit f7825e07c9674f994d7c0d571448c2927721fdaf)

commit ad0f5300b77ba261af159e2de5b2435e7cea0082
Author: Günther Deschner <gd at samba.org>
Date:   Sat Nov 29 00:12:26 2008 +0100

    s3-libnetjoin: Fix bug #5749. Re-set acctflags while joining. fix from metze.
    
    Guenther
    (cherry picked from commit bc3a277455dd4557e796ddc0bef0f52a11f889e7)

commit 914b12564f3d20e40700b72dc9500a5924a3e0cf
Author: Günther Deschner <gd at samba.org>
Date:   Sat Nov 29 00:10:18 2008 +0100

    s3-libnetjoin: remove unused md4_trust_password, found by metze.
    
    Guenther
    (cherry picked from commit f479fdc29813c3452fd22c4a2780f0bc5066e664)

commit 1c311e985697ae1ceb8c61ecd1576c31fa85e1ad
Author: Günther Deschner <gd at samba.org>
Date:   Fri Nov 28 11:15:29 2008 +0100

    s3-samr: add init_samr_user_info25 and init_samr_user_info26.
    
    Guenther
    (cherry picked from commit b72a6e2e9d93be619d6cd242ccfdf8ac07715bc3)

commit e3a867b059728a51498255115c74030052adf3ce
Author: Günther Deschner <gd at samba.org>
Date:   Mon Nov 24 18:49:37 2008 +0100

    s3-samr: fix init_samr_user_info{23,24} callers.
    
    Guenther
    (cherry picked from commit 82dfb92cae1ffc52a92ea27ba96dc875ce0ae4a1)

commit cd16198913ed40149e3d3d3a607cefc046978780
Author: Günther Deschner <gd at samba.org>
Date:   Mon Nov 24 16:32:18 2008 +0100

    s3-build: re-run make samba3-idl.
    
    Guenther
    (cherry picked from commit c28e83417dc67083b06fb060f5382ceb082bbdcd)

commit 33bc2776505acc77cf3d07dc9bd51e7fd7ff6987
Author: Günther Deschner <gd at samba.org>
Date:   Mon Nov 24 16:31:49 2008 +0100

    samr: fix samr_UserInfo24 and samr_UserInfo26.
    
    Guenther
    (cherry picked from commit 0315308cbc724bbf54b7767b4af307217833f541)

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

Summary of changes:
 source/include/proto.h           |   40 ++++++++++++++--
 source/libads/kerberos_keytab.c  |    7 ++-
 source/libnet/libnet_join.c      |   53 ++++++++++++---------
 source/librpc/gen_ndr/ndr_samr.c |   12 ++--
 source/librpc/gen_ndr/samr.h     |    4 +-
 source/librpc/idl/samr.idl       |    4 +-
 source/rpc_client/init_samr.c    |   98 +++++++++++++++++++++++++++++++++++---
 source/script/installmo.sh       |    4 ++
 source/utils/net_rpc.c           |    2 +-
 source/utils/net_rpc_join.c      |    3 +-
 10 files changed, 180 insertions(+), 47 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/include/proto.h b/source/include/proto.h
index cb2588b..99e9d76 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -7467,11 +7467,43 @@ void init_samr_user_info23(struct samr_UserInfo23 *r,
 			   uint8_t nt_password_set,
 			   uint8_t lm_password_set,
 			   uint8_t password_expired,
-			   uint8_t data[516],
-			   uint8_t pw_len);
+			   struct samr_CryptPassword *pwd_buf);
 void init_samr_user_info24(struct samr_UserInfo24 *r,
-			   uint8_t data[516],
-			   uint8_t pw_len);
+			   struct samr_CryptPassword *pwd_buf,
+			   uint8_t password_expired);
+void init_samr_user_info25(struct samr_UserInfo25 *r,
+			   NTTIME last_logon,
+			   NTTIME last_logoff,
+			   NTTIME last_password_change,
+			   NTTIME acct_expiry,
+			   NTTIME allow_password_change,
+			   NTTIME force_password_change,
+			   const char *account_name,
+			   const char *full_name,
+			   const char *home_directory,
+			   const char *home_drive,
+			   const char *logon_script,
+			   const char *profile_path,
+			   const char *description,
+			   const char *workstations,
+			   const char *comment,
+			   struct lsa_BinaryString *parameters,
+			   uint32_t rid,
+			   uint32_t primary_gid,
+			   uint32_t acct_flags,
+			   uint32_t fields_present,
+			   struct samr_LogonHours logon_hours,
+			   uint16_t bad_password_count,
+			   uint16_t logon_count,
+			   uint16_t country_code,
+			   uint16_t code_page,
+			   uint8_t nt_password_set,
+			   uint8_t lm_password_set,
+			   uint8_t password_expired,
+			   struct samr_CryptPasswordEx *pwd_buf);
+void init_samr_user_info26(struct samr_UserInfo26 *r,
+			   struct samr_CryptPasswordEx *pwd_buf,
+			   uint8_t password_expired);
 void init_samr_CryptPasswordEx(const char *pwd,
 			       DATA_BLOB *session_key,
 			       struct samr_CryptPasswordEx *pwd_buf);
diff --git a/source/libads/kerberos_keytab.c b/source/libads/kerberos_keytab.c
index 883f582..c4e6709 100644
--- a/source/libads/kerberos_keytab.c
+++ b/source/libads/kerberos_keytab.c
@@ -725,8 +725,11 @@ int ads_keytab_list(const char *keytab_name)
 
 		ret = smb_krb5_enctype_to_string(context, enctype, &etype_s);
 		if (ret) {
-			SAFE_FREE(princ_s);
-			goto out;
+			if (asprintf(&etype_s, "UNKNOWN: %d\n", enctype) == -1)
+			{
+				SAFE_FREE(princ_s);
+				goto out;
+			}
 		}
 
 		printf("%3d  %s\t\t %s\n", kt_entry.vno, etype_s, princ_s);
diff --git a/source/libnet/libnet_join.c b/source/libnet/libnet_join.c
index 3b6af5e..d53cb68 100644
--- a/source/libnet/libnet_join.c
+++ b/source/libnet/libnet_join.c
@@ -762,7 +762,6 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
 	struct lsa_String lsa_acct_name;
 	uint32_t user_rid;
 	uint32_t acct_flags = ACB_WSTRUST;
-	uchar md4_trust_password[16];
 	struct samr_Ids user_rids;
 	struct samr_Ids name_types;
 	union samr_UserInfo user_info;
@@ -898,14 +897,6 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
 		goto done;
 	}
 
-	/* Create a random machine account password and generate the hash */
-
-	E_md4hash(r->in.machine_password, md4_trust_password);
-
-	init_samr_CryptPasswordEx(r->in.machine_password,
-				  &cli->user_session_key,
-				  &crypt_pwd_ex);
-
 	/* Fill in the additional account flags now */
 
 	acct_flags |= ACB_PWNOEXP;
@@ -916,23 +907,40 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
 		;;
 	}
 
-	/* Set password and account flags on machine account */
-
-	ZERO_STRUCT(user_info.info25);
-
-	user_info.info25.info.fields_present = ACCT_NT_PWD_SET |
-					       ACCT_LM_PWD_SET |
-					       SAMR_FIELD_ACCT_FLAGS;
-
-	user_info.info25.info.acct_flags = acct_flags;
-	memcpy(&user_info.info25.password.data, crypt_pwd_ex.data,
-	       sizeof(crypt_pwd_ex.data));
+	/* Set account flags on machine account */
+	ZERO_STRUCT(user_info.info16);
+	user_info.info16.acct_flags = acct_flags;
 
 	status = rpccli_samr_SetUserInfo(pipe_hnd, mem_ctx,
 					 &user_pol,
-					 25,
+					 16,
 					 &user_info);
 
+	if (!NT_STATUS_IS_OK(status)) {
+
+		rpccli_samr_DeleteUser(pipe_hnd, mem_ctx,
+				       &user_pol);
+
+		libnet_join_set_error_string(mem_ctx, r,
+			"Failed to set account flags for machine account (%s)\n",
+			nt_errstr(status));
+		goto done;
+	}
+
+	/* Set password on machine account - first try level 26 */
+
+	init_samr_CryptPasswordEx(r->in.machine_password,
+				  &cli->user_session_key,
+				  &crypt_pwd_ex);
+
+	init_samr_user_info26(&user_info.info26, &crypt_pwd_ex,
+			      PASS_DONT_CHANGE_AT_NEXT_LOGON);
+
+	status = rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx,
+					  &user_pol,
+					  26,
+					  &user_info);
+
 	if (NT_STATUS_EQUAL(status, NT_STATUS(DCERPC_FAULT_INVALID_TAG))) {
 
 		/* retry with level 24 */
@@ -941,7 +949,8 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
 					&cli->user_session_key,
 					&crypt_pwd);
 
-		init_samr_user_info24(&user_info.info24, crypt_pwd.data, 24);
+		init_samr_user_info24(&user_info.info24, &crypt_pwd,
+				      PASS_DONT_CHANGE_AT_NEXT_LOGON);
 
 		status = rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx,
 						  &user_pol,
diff --git a/source/librpc/gen_ndr/ndr_samr.c b/source/librpc/gen_ndr/ndr_samr.c
index 9c5a886..bd87a50 100644
--- a/source/librpc/gen_ndr/ndr_samr.c
+++ b/source/librpc/gen_ndr/ndr_samr.c
@@ -2961,7 +2961,7 @@ static enum ndr_err_code ndr_push_samr_UserInfo24(struct ndr_push *ndr, int ndr_
 	if (ndr_flags & NDR_SCALARS) {
 		NDR_CHECK(ndr_push_align(ndr, 1));
 		NDR_CHECK(ndr_push_samr_CryptPassword(ndr, NDR_SCALARS, &r->password));
-		NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pw_len));
+		NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
 	}
 	if (ndr_flags & NDR_BUFFERS) {
 	}
@@ -2973,7 +2973,7 @@ static enum ndr_err_code ndr_pull_samr_UserInfo24(struct ndr_pull *ndr, int ndr_
 	if (ndr_flags & NDR_SCALARS) {
 		NDR_CHECK(ndr_pull_align(ndr, 1));
 		NDR_CHECK(ndr_pull_samr_CryptPassword(ndr, NDR_SCALARS, &r->password));
-		NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pw_len));
+		NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
 	}
 	if (ndr_flags & NDR_BUFFERS) {
 	}
@@ -2985,7 +2985,7 @@ _PUBLIC_ void ndr_print_samr_UserInfo24(struct ndr_print *ndr, const char *name,
 	ndr_print_struct(ndr, name, "samr_UserInfo24");
 	ndr->depth++;
 	ndr_print_samr_CryptPassword(ndr, "password", &r->password);
-	ndr_print_uint8(ndr, "pw_len", r->pw_len);
+	ndr_print_uint8(ndr, "password_expired", r->password_expired);
 	ndr->depth--;
 }
 
@@ -3074,7 +3074,7 @@ static enum ndr_err_code ndr_push_samr_UserInfo26(struct ndr_push *ndr, int ndr_
 	if (ndr_flags & NDR_SCALARS) {
 		NDR_CHECK(ndr_push_align(ndr, 1));
 		NDR_CHECK(ndr_push_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password));
-		NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->pw_len));
+		NDR_CHECK(ndr_push_uint8(ndr, NDR_SCALARS, r->password_expired));
 	}
 	if (ndr_flags & NDR_BUFFERS) {
 	}
@@ -3086,7 +3086,7 @@ static enum ndr_err_code ndr_pull_samr_UserInfo26(struct ndr_pull *ndr, int ndr_
 	if (ndr_flags & NDR_SCALARS) {
 		NDR_CHECK(ndr_pull_align(ndr, 1));
 		NDR_CHECK(ndr_pull_samr_CryptPasswordEx(ndr, NDR_SCALARS, &r->password));
-		NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->pw_len));
+		NDR_CHECK(ndr_pull_uint8(ndr, NDR_SCALARS, &r->password_expired));
 	}
 	if (ndr_flags & NDR_BUFFERS) {
 	}
@@ -3098,7 +3098,7 @@ _PUBLIC_ void ndr_print_samr_UserInfo26(struct ndr_print *ndr, const char *name,
 	ndr_print_struct(ndr, name, "samr_UserInfo26");
 	ndr->depth++;
 	ndr_print_samr_CryptPasswordEx(ndr, "password", &r->password);
-	ndr_print_uint8(ndr, "pw_len", r->pw_len);
+	ndr_print_uint8(ndr, "password_expired", r->password_expired);
 	ndr->depth--;
 }
 
diff --git a/source/librpc/gen_ndr/samr.h b/source/librpc/gen_ndr/samr.h
index a60cfae..f3925d9 100644
--- a/source/librpc/gen_ndr/samr.h
+++ b/source/librpc/gen_ndr/samr.h
@@ -524,7 +524,7 @@ struct samr_UserInfo23 {
 
 struct samr_UserInfo24 {
 	struct samr_CryptPassword password;
-	uint8_t pw_len;
+	uint8_t password_expired;
 };
 
 struct samr_CryptPasswordEx {
@@ -538,7 +538,7 @@ struct samr_UserInfo25 {
 
 struct samr_UserInfo26 {
 	struct samr_CryptPasswordEx password;
-	uint8_t pw_len;
+	uint8_t password_expired;
 };
 
 union samr_UserInfo {
diff --git a/source/librpc/idl/samr.idl b/source/librpc/idl/samr.idl
index 43019b6..4c70898 100644
--- a/source/librpc/idl/samr.idl
+++ b/source/librpc/idl/samr.idl
@@ -959,7 +959,7 @@ import "misc.idl", "lsa.idl", "security.idl";
 
 	typedef struct {
 		samr_CryptPassword password;
-		uint8 pw_len;
+		uint8 password_expired;
 	} samr_UserInfo24;
 
 	typedef [flag(NDR_PAHEX)] struct {
@@ -973,7 +973,7 @@ import "misc.idl", "lsa.idl", "security.idl";
 
 	typedef struct {
 		samr_CryptPasswordEx password;
-		uint8 pw_len;
+		uint8 password_expired;
 	} samr_UserInfo26;
 
 	typedef [switch_type(uint16)] union {
diff --git a/source/rpc_client/init_samr.c b/source/rpc_client/init_samr.c
index 2e75753..0e6c277 100644
--- a/source/rpc_client/init_samr.c
+++ b/source/rpc_client/init_samr.c
@@ -410,8 +410,7 @@ void init_samr_user_info23(struct samr_UserInfo23 *r,
 			   uint8_t nt_password_set,
 			   uint8_t lm_password_set,
 			   uint8_t password_expired,
-			   uint8_t data[516],
-			   uint8_t pw_len)
+			   struct samr_CryptPassword *pwd_buf)
 {
 	memset(r, '\0', sizeof(*r));
 	init_samr_user_info21(&r->info,
@@ -444,7 +443,7 @@ void init_samr_user_info23(struct samr_UserInfo23 *r,
 			      lm_password_set,
 			      password_expired);
 
-	memcpy(r->password.data, data, sizeof(r->password.data));
+	r->password = *pwd_buf;
 }
 
 /*************************************************************************
@@ -452,13 +451,98 @@ void init_samr_user_info23(struct samr_UserInfo23 *r,
  *************************************************************************/
 
 void init_samr_user_info24(struct samr_UserInfo24 *r,
-			   uint8_t data[516],
-			   uint8_t pw_len)
+			   struct samr_CryptPassword *pwd_buf,
+			   uint8_t password_expired)
 {
 	DEBUG(10, ("init_samr_user_info24:\n"));
 
-	memcpy(r->password.data, data, sizeof(r->password.data));
-	r->pw_len = pw_len;
+	r->password = *pwd_buf;
+	r->password_expired = password_expired;
+}
+
+/*************************************************************************
+ init_samr_user_info25
+ *************************************************************************/
+
+void init_samr_user_info25(struct samr_UserInfo25 *r,
+			   NTTIME last_logon,
+			   NTTIME last_logoff,
+			   NTTIME last_password_change,
+			   NTTIME acct_expiry,
+			   NTTIME allow_password_change,
+			   NTTIME force_password_change,
+			   const char *account_name,
+			   const char *full_name,
+			   const char *home_directory,
+			   const char *home_drive,
+			   const char *logon_script,
+			   const char *profile_path,
+			   const char *description,
+			   const char *workstations,
+			   const char *comment,
+			   struct lsa_BinaryString *parameters,
+			   uint32_t rid,
+			   uint32_t primary_gid,
+			   uint32_t acct_flags,
+			   uint32_t fields_present,
+			   struct samr_LogonHours logon_hours,
+			   uint16_t bad_password_count,
+			   uint16_t logon_count,
+			   uint16_t country_code,
+			   uint16_t code_page,
+			   uint8_t nt_password_set,
+			   uint8_t lm_password_set,
+			   uint8_t password_expired,
+			   struct samr_CryptPasswordEx *pwd_buf)
+{
+	DEBUG(10, ("init_samr_user_info25:\n"));
+
+	memset(r, '\0', sizeof(*r));
+	init_samr_user_info21(&r->info,
+			      last_logon,
+			      last_logoff,
+			      last_password_change,
+			      acct_expiry,
+			      allow_password_change,
+			      force_password_change,
+			      account_name,
+			      full_name,
+			      home_directory,
+			      home_drive,
+			      logon_script,
+			      profile_path,
+			      description,
+			      workstations,
+			      comment,
+			      parameters,
+			      rid,
+			      primary_gid,
+			      acct_flags,
+			      fields_present,
+			      logon_hours,
+			      bad_password_count,
+			      logon_count,
+			      country_code,
+			      code_page,
+			      nt_password_set,
+			      lm_password_set,
+			      password_expired);
+
+	r->password = *pwd_buf;
+}
+
+/*************************************************************************
+ init_samr_user_info26
+ *************************************************************************/
+
+void init_samr_user_info26(struct samr_UserInfo26 *r,
+			   struct samr_CryptPasswordEx *pwd_buf,
+			   uint8_t password_expired)
+{
+	DEBUG(10, ("init_samr_user_info26:\n"));
+
+	r->password = *pwd_buf;
+	r->password_expired = password_expired;
 }
 
 /*************************************************************************
diff --git a/source/script/installmo.sh b/source/script/installmo.sh
index a1f9c58..9c4ab1e 100644
--- a/source/script/installmo.sh
+++ b/source/script/installmo.sh
@@ -24,6 +24,10 @@ for dir in $SRCDIR/locale/*; do
 	for f in $SRCDIR/locale/$MODULE/*.po; do
 		BASE=`basename $f`
 		LANGUAGE=`echo $BASE | sed 's/\.po//g'`
+		if test "$LANGUAGE" = '*'; then
+			echo "No .po file exists!"
+			exit 0
+		fi
 		FNAME="$DESTDIR/$LOCALEDIR/$LANGUAGE/LC_MESSAGES/$MODULE.mo"
 		if test ! -d "$DESTDIR/$LOCALEDIR/$LANGUAGE/LC_MESSAGES/"; then
 			mkdir -p "$DESTDIR/$LOCALEDIR/$LANGUAGE/LC_MESSAGES/"
diff --git a/source/utils/net_rpc.c b/source/utils/net_rpc.c
index fb3002e..5b16801 100644
--- a/source/utils/net_rpc.c
+++ b/source/utils/net_rpc.c
@@ -5257,7 +5257,7 @@ static NTSTATUS rpc_trustdom_add_internals(struct net_context *c,
 				      0, 0, ACB_DOMTRUST, SAMR_FIELD_ACCT_FLAGS,
 				      hours,
 				      0, 0, 0, 0, 0, 0, 0,
-				      crypt_pwd.data, 24);
+				      &crypt_pwd);
 
 		result = rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx,
 						  &user_pol,
diff --git a/source/utils/net_rpc_join.c b/source/utils/net_rpc_join.c
index 5bc38f9..d8641bf 100644
--- a/source/utils/net_rpc_join.c
+++ b/source/utils/net_rpc_join.c
@@ -343,7 +343,8 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv)
 				&cli->user_session_key,
 				&crypt_pwd);
 
-	init_samr_user_info24(&set_info.info24, crypt_pwd.data, 24);
+	init_samr_user_info24(&set_info.info24, &crypt_pwd,
+			      PASS_DONT_CHANGE_AT_NEXT_LOGON);
 
 	CHECK_RPC_ERR(rpccli_samr_SetUserInfo2(pipe_hnd, mem_ctx,
 					       &user_pol,


-- 
Samba Shared Repository


More information about the samba-cvs mailing list