[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-5-206-g54e3135

Karolin Seeger kseeger at samba.org
Wed Dec 10 11:26:55 GMT 2008


The branch, v3-2-stable has been updated
       via  54e3135523d8c592b76d3929c5fd127c62f7f969 (commit)
       via  3bd2171a21573f361b5349fde23f32954acded68 (commit)
       via  73c5a41fadbbb370e9550c3835328e82529dc40f (commit)
       via  222b07d9f471ef5cd6588989fdf5665863ef20e1 (commit)
       via  585fae3738863639711644f56fa9a0145161a570 (commit)
       via  0c26dd0cf567a952443878bbac5b6499c8d1e769 (commit)
       via  d9679a4d2f9791cecee58b297a54d9a942807717 (commit)
       via  fe4a949edad252ad81fb717de03fa1dc028165fe (commit)
       via  8618d11934b2a93e40a922bcea499229b2b90ba4 (commit)
      from  32dcaab09e893c9a33629dccc5103ad67e8231fd (commit)

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


- Log -----------------------------------------------------------------
commit 54e3135523d8c592b76d3929c5fd127c62f7f969
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)
    (cherry picked from commit a6a8025d48e63a8bcb1fb03efa8ab85e415f8a38)

commit 3bd2171a21573f361b5349fde23f32954acded68
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)
    (cherry picked from commit a4164a55b5b20ae347a22810405c738f868d8493)

commit 73c5a41fadbbb370e9550c3835328e82529dc40f
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 b51eaa4a4da0dfc46919e9a544b3d26569a1495c)

commit 222b07d9f471ef5cd6588989fdf5665863ef20e1
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 948a2e5d38b5d69e3c65e81d0b0fd750410bc066)

commit 585fae3738863639711644f56fa9a0145161a570
Author: Günther Deschner <gd at samba.org>
Date:   Wed Jul 30 19:52:56 2008 +0200

    rpc_client: use init_samr_CryptPassword(Ex) in client tools.
    
    Guenther
    (cherry picked from commit 97f7f9f21f17e8414de15953cf4eaa9959dc6f75)
    (cherry picked from commit 458e85603673e04577fc493528c870c3d5ec6b54)

commit 0c26dd0cf567a952443878bbac5b6499c8d1e769
Author: Günther Deschner <gd at samba.org>
Date:   Fri Jul 18 20:42:55 2008 +0200

    rpc_client: add init_samr_CryptPasswordEx and init_samr_CryptPassword.
    
    Guenther
    (cherry picked from commit 599155842583781736933ef340e37fd5c87f88ca)

commit d9679a4d2f9791cecee58b297a54d9a942807717
Author: Günther Deschner <gd at samba.org>
Date:   Tue Nov 18 17:06:53 2008 +0100

    s3: merge german pam_winbind message translations from master.
    
    Guenther
    (cherry picked from commit aa0ef2f97d98e7ca80636a4dc8093d2034d0dbf1)
    (cherry picked from commit 1ac0175bb13ce34fbb2deaa880a4021625b259be)

commit fe4a949edad252ad81fb717de03fa1dc028165fe
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)
    (cherry picked from commit bfd02c2d2391a5c4faea4f7c1c1fb22d527218a3)

commit 8618d11934b2a93e40a922bcea499229b2b90ba4
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)
    (cherry picked from commit 16a4f8f7dc59c6b586259b2d5daf1b23d25b2d7f)

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

Summary of changes:
 source/libnet/libnet_join.c      |   76 ++++++++--------
 source/librpc/gen_ndr/ndr_samr.c |   12 ++--
 source/librpc/gen_ndr/samr.h     |    4 +-
 source/librpc/idl/samr.idl       |    4 +-
 source/locale/pam_winbind/de.po  |  181 ++++++++++++++++++++++++++++++++++++++
 source/rpc_client/init_samr.c    |  144 ++++++++++++++++++++++++++++--
 source/utils/net_rpc.c           |   25 +++---
 source/utils/net_rpc_join.c      |   12 ++--
 8 files changed, 383 insertions(+), 75 deletions(-)
 create mode 100644 source/locale/pam_winbind/de.po


Changeset truncated at 500 lines:

diff --git a/source/libnet/libnet_join.c b/source/libnet/libnet_join.c
index 7451cb2..526a0bd 100644
--- a/source/libnet/libnet_join.c
+++ b/source/libnet/libnet_join.c
@@ -734,15 +734,13 @@ 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 pwbuf[532];
-	struct MD5Context md5ctx;
-	uchar md5buffer[16];
-	DATA_BLOB digested_session_key;
-	uchar md4_trust_password[16];
 	struct samr_Ids user_rids;
 	struct samr_Ids name_types;
 	union samr_UserInfo user_info;
 
+	struct samr_CryptPassword crypt_pwd;
+	struct samr_CryptPasswordEx crypt_pwd_ex;
+
 	ZERO_STRUCT(sam_pol);
 	ZERO_STRUCT(domain_pol);
 	ZERO_STRUCT(user_pol);
@@ -870,23 +868,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);
-	encode_pw_buffer(pwbuf, r->in.machine_password, STR_UNICODE);
-
-	generate_random_buffer((uint8_t*)md5buffer, sizeof(md5buffer));
-	digested_session_key = data_blob_talloc(mem_ctx, 0, 16);
-
-	MD5Init(&md5ctx);
-	MD5Update(&md5ctx, md5buffer, sizeof(md5buffer));
-	MD5Update(&md5ctx, cli->user_session_key.data,
-		  cli->user_session_key.length);
-	MD5Final(digested_session_key.data, &md5ctx);
-
-	SamOEMhashBlob(pwbuf, sizeof(pwbuf), &digested_session_key);
-	memcpy(&pwbuf[516], md5buffer, sizeof(md5buffer));
-
 	/* Fill in the additional account flags now */
 
 	acct_flags |= ACB_PWNOEXP;
@@ -897,33 +878,50 @@ 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, pwbuf, sizeof(pwbuf));
+	/* 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_EQUAL(status, NT_STATUS(DCERPC_FAULT_INVALID_TAG))) {
+	if (!NT_STATUS_IS_OK(status)) {
 
-		uchar pwbuf2[516];
+		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;
+	}
 
-		encode_pw_buffer(pwbuf2, r->in.machine_password, STR_UNICODE);
+	/* 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 */
-		init_samr_user_info24(&user_info.info24, pwbuf2, 24);
 
-		SamOEMhashBlob(user_info.info24.password.data, 516,
-			       &cli->user_session_key);
+		init_samr_CryptPassword(r->in.machine_password,
+					&cli->user_session_key,
+					&crypt_pwd);
+
+		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 522c6a9..108e9c5 100644
--- a/source/librpc/gen_ndr/samr.h
+++ b/source/librpc/gen_ndr/samr.h
@@ -499,7 +499,7 @@ struct samr_UserInfo23 {
 
 struct samr_UserInfo24 {
 	struct samr_CryptPassword password;
-	uint8_t pw_len;
+	uint8_t password_expired;
 };
 
 struct samr_CryptPasswordEx {
@@ -513,7 +513,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 e823d1d..b8337fd 100644
--- a/source/librpc/idl/samr.idl
+++ b/source/librpc/idl/samr.idl
@@ -835,7 +835,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 {
@@ -849,7 +849,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/locale/pam_winbind/de.po b/source/locale/pam_winbind/de.po
new file mode 100644
index 0000000..5a7223d
--- /dev/null
+++ b/source/locale/pam_winbind/de.po
@@ -0,0 +1,181 @@
+# pam_winbind message translations (german)
+# Copyright (C) 2008 Guenther Deschner <gd at samba.org>
+# This file is distributed under the same license as the pam_winbind package.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: @PACKAGE@\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2008-11-17 12:00+0100\n"
+"PO-Revision-Date: 2008-11-13 14:29+0100\n"
+"Last-Translator: Guenther Deschner <gd at samba.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: ../../nsswitch/pam_winbind.c:579
+msgid "Success"
+msgstr "Erfolgreich"
+
+#: ../../nsswitch/pam_winbind.c:581
+msgid "No primary Domain Controler available"
+msgstr "Kein primärer Domänen-Controller verfügbar"
+
+#: ../../nsswitch/pam_winbind.c:583
+msgid "No domain controllers found"
+msgstr "Keine Domänen-Controller gefunden"
+
+#: ../../nsswitch/pam_winbind.c:585
+msgid "No logon servers"
+msgstr "Keine Anmeldeserver verfügbar"
+
+#: ../../nsswitch/pam_winbind.c:587
+msgid "Password too short"
+msgstr "Passwort ist zu kurz"
+
+#: ../../nsswitch/pam_winbind.c:589
+msgid "The password of this user is too recent to change"
+msgstr "Das Passwort des Benutzers kann noch nicht erneut geändert werden"
+
+#: ../../nsswitch/pam_winbind.c:591
+msgid "Password is already in password history"
+msgstr "Das neue Passwort ist bereits in der Passwort-Historie enthalten"
+
+#: ../../nsswitch/pam_winbind.c:593
+msgid "Your password has expired"
+msgstr "Ihr Passwort ist abgelaufen"
+
+#: ../../nsswitch/pam_winbind.c:595
+msgid "You need to change your password now"
+msgstr "Sie müssen Ihr Passwort unmittelbar ändern"
+
+#: ../../nsswitch/pam_winbind.c:597
+msgid "You are not allowed to logon from this workstation"
+msgstr "Sie können sich nicht von diesem Arbeitsplatz aus anmelden"
+
+#: ../../nsswitch/pam_winbind.c:599
+msgid "You are not allowed to logon at this time"
+msgstr "Sie können sich zum jetzigen Zeitpunkt nicht anmelden"
+
+#: ../../nsswitch/pam_winbind.c:601
+msgid "Your account has expired. Please contact your System administrator"
+msgstr "Ihr Benutzerkonto ist abgelaufen. Bitte kontaktieren Sie ihren System-Administrator"
+
+#: ../../nsswitch/pam_winbind.c:604
+msgid "Your account is disabled. Please contact your System administrator"
+msgstr "Ihr Benutzerkonto ist deaktiviert. Bitte kontaktieren Sie ihren System-Administrator"
+
+#: ../../nsswitch/pam_winbind.c:607
+msgid "Your account has been locked. Please contact your System administrator"
+msgstr "Ihr Benutzerkonto wurde gesperrt. Bitte kontaktieren Sie ihren System-Administrator"
+
+#: ../../nsswitch/pam_winbind.c:610 ../../nsswitch/pam_winbind.c:612 ../../nsswitch/pam_winbind.c:614
+msgid "Invalid Trust Account"
+msgstr "Ungültiges Maschinen-Konto"
+
+#: ../../nsswitch/pam_winbind.c:616
+msgid "Access is denied"
+msgstr "Zugriff verweigert"
+
+#: ../../nsswitch/pam_winbind.c:854
+msgid "Your password expires today"
+msgstr "Ihr Passwort läuft heute ab"
+
+#: ../../nsswitch/pam_winbind.c:860
+#, c-format
+msgid "Your password will expire in %d %s"
+msgstr "Ihr Passwort wird in %d %s ungültig"
+
+#: ../../nsswitch/pam_winbind.c:861
+msgid "days"
+msgstr "Tagen"
+
+#: ../../nsswitch/pam_winbind.c:861
+msgid "day"
+msgstr "Tag"
+
+#: ../../nsswitch/pam_winbind.c:1253
+msgid "Grace login. Please change your password as soon you're online again"
+msgstr "Kulanzanmeldung. Bitte ändern sie ihr Passwort sobald sie wieder online sind"
+
+#: ../../nsswitch/pam_winbind.c:1263
+msgid "Domain Controller unreachable, using cached credentials instead. Network resources may be unavailable"
+msgstr "Domänen-Controller unerreichbar. Anmeldung erfolgte mit gespeicherten Anmeldedaten. Netzwerk Ressourcen können momentan nicht verfügbar sein"
+
+#: ../../nsswitch/pam_winbind.c:1288
+msgid ""
+"Failed to establish your Kerberos Ticket cache due time differences\n"
+"with the domain controller.  Please verify the system time.\n"
+msgstr ""
+"Anforderung eines Kerberos Tickets aufgrund Zeitunterscheid zum \n"
+"Domänen-Controller fehlgeschlagen. Bitte überprüfen Sie die Systemzeit.\n"
+
+#: ../../nsswitch/pam_winbind.c:1356
+msgid "Your password "
+msgstr "Ihr Passwort "
+
+#: ../../nsswitch/pam_winbind.c:1363
+#, c-format
+msgid "must be at least %d characters; "
+msgstr "muß mindestens %d Zeichen lang sein; "
+
+#: ../../nsswitch/pam_winbind.c:1372
+#, c-format
+msgid "cannot repeat any of your previous %d passwords; "
+msgstr "kann keines der %d vorherigen Passwörter enthalten; "
+
+#: ../../nsswitch/pam_winbind.c:1382
+msgid "must contain capitals, numerals or punctuation; and cannot contain your account or full name; "
+msgstr "muß Großbuchstaben, Ziffern oder Punktzeichen enthalten; kann nicht den Benutzer- oder vollen Namen enthalten; "
+
+#: ../../nsswitch/pam_winbind.c:1392
+msgid "Please type a different password. Type a password which meets these requirements in both text boxes."
+msgstr "Bitte wählen Sie ein anderes Passwort. Geben Sie ein geeignetes Passwort in beide Textfelder ein."
+
+#: ../../nsswitch/pam_winbind.c:1419
+#, c-format
+msgid "Creating directory: %s failed: %s"
+msgstr "Anlegen des Verzeichnis: %s fehlgeschlagen: %s"
+
+#: ../../nsswitch/pam_winbind.c:1877
+msgid "Password does not meet complexity requirements"
+msgstr "Passwort genügt nicht den Komplexitätsanforderungen"
+
+#.
+#. * First get the name of a user
+#.
+#: ../../nsswitch/pam_winbind.c:2336 ../../nsswitch/pam_winbind.c:2883
+msgid "Username: "
+msgstr "Benuzername: "
+
+#: ../../nsswitch/pam_winbind.c:2513
+msgid "Password: "
+msgstr "Passwort: "
+
+#. instruct user what is happening
+#: ../../nsswitch/pam_winbind.c:2921
+#, fuzzy
+msgid "Changing password for"
+msgstr "Ändere Passwort für"
+
+#: ../../nsswitch/pam_winbind.c:2934
+msgid "(current) NT password: "
+msgstr "(aktuelles) NT Passwort: "
+
+#: ../../nsswitch/pam_winbind.c:3004
+msgid "Enter new NT password: "
+msgstr "Neues NT Passwort eingeben: "
+
+#: ../../nsswitch/pam_winbind.c:3005
+msgid "Retype new NT password: "
+msgstr "Neues NT Passwort wiederholen: "
+
+#.
+#. * here is the string to inform the user that the new passwords they
+#. * typed were not the same.
+#.
+#: ../../nsswitch/pam_winbind.h:122
+msgid "Sorry, passwords do not match"
+msgstr "Passwörter stimmen leider nicht überein"
diff --git a/source/rpc_client/init_samr.c b/source/rpc_client/init_samr.c
index c5d7dcd..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,11 +451,142 @@ 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,


-- 
Samba Shared Repository


More information about the samba-cvs mailing list