[SCM] Samba Shared Repository - branch master updated
Matthias Dieter Wallnöfer
mdw at samba.org
Mon Jul 5 07:38:43 MDT 2010
The branch, master has been updated
via 6071ca9... s4:include/smbldap.h - introduce a placeholder for "LDAPMessage" if we don't link against a LDAP library
via 1d166fd... s4:winbind/wb_cmd_setpwent.c - fix a possible crash condition in the "winbind struct test"
via afcf18f... s4:samr RPC server - "SetUserInfo" - allow some more informations to be set
via 915ddf0... samr.idl:UserInfo structures - fix some names according to MS-SAMR documentation
from 3278554... s3: Make talloc_attrs() static
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 6071ca9daed6e18302da546e5de0c7b1d282bbd2
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date: Mon Jul 5 15:19:31 2010 +0200
s4:include/smbldap.h - introduce a placeholder for "LDAPMessage" if we don't link against a LDAP library
commit 1d166fd3cff7ed8b6d3d17427fb18fa9f6405b48
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date: Mon Jul 5 11:44:48 2010 +0200
s4:winbind/wb_cmd_setpwent.c - fix a possible crash condition in the "winbind struct test"
Use a "talloc_strdup" for duplicating usernames.
commit afcf18f3c996558135cb2535e10a9d5dd32f86e7
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date: Sun Jul 4 23:21:07 2010 +0200
s4:samr RPC server - "SetUserInfo" - allow some more informations to be set
Taken from the s3 implementation.
commit 915ddf0dc74d2b36d5da2c1bf377a289291c13b8
Author: Matthias Dieter Wallnöfer <mdw at samba.org>
Date: Sun Jul 4 22:34:43 2010 +0200
samr.idl:UserInfo structures - fix some names according to MS-SAMR documentation
See MS-SAMR section "FULL IDL"
-----------------------------------------------------------------------
Summary of changes:
librpc/idl/samr.idl | 6 +++---
source3/include/smbldap.h | 1 +
source3/lib/netapi/user.c | 4 ++--
source3/rpc_server/srv_samr_nt.c | 2 +-
source4/rpc_server/samr/dcesrv_samr.c | 25 +++++++++++++++++++++++++
source4/winbind/wb_cmd_setpwent.c | 18 ++++++++++--------
6 files changed, 42 insertions(+), 14 deletions(-)
Changeset truncated at 500 lines:
diff --git a/librpc/idl/samr.idl b/librpc/idl/samr.idl
index da7b1aa..d977ddd 100644
--- a/librpc/idl/samr.idl
+++ b/librpc/idl/samr.idl
@@ -806,7 +806,7 @@ import "misc.idl", "lsa.idl", "security.idl";
typedef struct {
lsa_String comment;
- lsa_String unknown; /* settable, but doesn't stick. probably obsolete */
+ lsa_String reserved; /* settable, but doesn't stick. probably obsolete */
uint16 country_code;
uint16 code_page;
} samr_UserInfo2;
@@ -982,7 +982,7 @@ import "misc.idl", "lsa.idl", "security.idl";
lsa_BinaryString parameters;
lsa_BinaryString lm_owf_password;
lsa_BinaryString nt_owf_password;
- lsa_String unknown3;
+ lsa_String private_data;
uint32 buf_count;
[size_is(buf_count)] uint8 *buffer;
uint32 rid;
@@ -997,7 +997,7 @@ import "misc.idl", "lsa.idl", "security.idl";
uint8 lm_password_set;
uint8 nt_password_set;
uint8 password_expired;
- uint8 unknown4;
+ uint8 private_data_sensitive;
} samr_UserInfo21;
typedef [public, flag(NDR_PAHEX)] struct {
diff --git a/source3/include/smbldap.h b/source3/include/smbldap.h
index e3becdb..f2a0280 100644
--- a/source3/include/smbldap.h
+++ b/source3/include/smbldap.h
@@ -235,6 +235,7 @@ char *smbldap_talloc_dn(TALLOC_CTX *mem_ctx, LDAP *ld,
#else
#define LDAP void
+#define LDAPMessage void
#define LDAPMod void
#define LDAP_CONST const
#define LDAPControl void
diff --git a/source3/lib/netapi/user.c b/source3/lib/netapi/user.c
index dcc28e7..7107b32 100644
--- a/source3/lib/netapi/user.c
+++ b/source3/lib/netapi/user.c
@@ -113,7 +113,7 @@ static void convert_USER_INFO_X_to_samr_user_info21(struct USER_INFO_X *infoX,
info21->parameters = zero_parameters;
info21->lm_owf_password = zero_parameters;
info21->nt_owf_password = zero_parameters;
- info21->unknown3.string = NULL;
+ info21->private_data.string = NULL;
info21->buf_count = 0;
info21->buffer = NULL;
info21->rid = infoX->usriX_user_id;
@@ -128,7 +128,7 @@ static void convert_USER_INFO_X_to_samr_user_info21(struct USER_INFO_X *infoX,
info21->lm_password_set = 0;
info21->nt_password_set = 0;
info21->password_expired = infoX->usriX_password_expired;
- info21->unknown4 = 0;
+ info21->private_data_sensitive = 0;
}
/****************************************************************
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index 499f959..7b74fd8 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -2464,7 +2464,7 @@ static NTSTATUS get_user_info_2(TALLOC_CTX *mem_ctx,
struct samu *pw)
{
r->comment.string = talloc_strdup(mem_ctx, pdb_get_comment(pw));
- r->unknown.string = NULL;
+ r->reserved.string = NULL;
r->country_code = 0;
r->code_page = 0;
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 9200d37..882bf3f 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -3199,6 +3199,10 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
return NT_STATUS_INVALID_PARAMETER;
#define IFSET(bit) if (bit & r->in.info->info21.fields_present)
+ IFSET(SAMR_FIELD_LAST_LOGON)
+ SET_UINT64(msg, info21.last_logon, "lastLogon");
+ IFSET(SAMR_FIELD_LAST_LOGOFF)
+ SET_UINT64(msg, info21.last_logoff, "lastLogoff");
IFSET(SAMR_FIELD_ACCT_EXPIRY)
SET_UINT64(msg, info21.acct_expiry, "accountExpires");
IFSET(SAMR_FIELD_ACCOUNT_NAME)
@@ -3227,6 +3231,10 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
SET_AFLAGS(msg, info21.acct_flags, "userAccountControl");
IFSET(SAMR_FIELD_LOGON_HOURS)
SET_LHOURS(msg, info21.logon_hours, "logonHours");
+ IFSET(SAMR_FIELD_BAD_PWD_COUNT)
+ SET_UINT (msg, info21.bad_password_count, "badPwdCount");
+ IFSET(SAMR_FIELD_NUM_LOGONS)
+ SET_UINT (msg, info21.logon_count, "logonCount");
IFSET(SAMR_FIELD_COUNTRY_CODE)
SET_UINT (msg, info21.country_code, "countryCode");
IFSET(SAMR_FIELD_CODE_PAGE)
@@ -3284,6 +3292,10 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
return NT_STATUS_INVALID_PARAMETER;
#define IFSET(bit) if (bit & r->in.info->info23.info.fields_present)
+ IFSET(SAMR_FIELD_LAST_LOGON)
+ SET_UINT64(msg, info23.info.last_logon, "lastLogon");
+ IFSET(SAMR_FIELD_LAST_LOGOFF)
+ SET_UINT64(msg, info23.info.last_logoff, "lastLogoff");
IFSET(SAMR_FIELD_ACCT_EXPIRY)
SET_UINT64(msg, info23.info.acct_expiry, "accountExpires");
IFSET(SAMR_FIELD_ACCOUNT_NAME)
@@ -3312,6 +3324,11 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
SET_AFLAGS(msg, info23.info.acct_flags, "userAccountControl");
IFSET(SAMR_FIELD_LOGON_HOURS)
SET_LHOURS(msg, info23.info.logon_hours, "logonHours");
+ IFSET(SAMR_FIELD_BAD_PWD_COUNT)
+ SET_UINT (msg, info23.info.bad_password_count, "badPwdCount");
+ IFSET(SAMR_FIELD_NUM_LOGONS)
+ SET_UINT (msg, info23.info.logon_count, "logonCount");
+
IFSET(SAMR_FIELD_COUNTRY_CODE)
SET_UINT (msg, info23.info.country_code, "countryCode");
IFSET(SAMR_FIELD_CODE_PAGE)
@@ -3378,6 +3395,10 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
return NT_STATUS_INVALID_PARAMETER;
#define IFSET(bit) if (bit & r->in.info->info25.info.fields_present)
+ IFSET(SAMR_FIELD_LAST_LOGON)
+ SET_UINT64(msg, info25.info.last_logon, "lastLogon");
+ IFSET(SAMR_FIELD_LAST_LOGOFF)
+ SET_UINT64(msg, info25.info.last_logoff, "lastLogoff");
IFSET(SAMR_FIELD_ACCT_EXPIRY)
SET_UINT64(msg, info25.info.acct_expiry, "accountExpires");
IFSET(SAMR_FIELD_ACCOUNT_NAME)
@@ -3406,6 +3427,10 @@ static NTSTATUS dcesrv_samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALL
SET_AFLAGS(msg, info25.info.acct_flags, "userAccountControl");
IFSET(SAMR_FIELD_LOGON_HOURS)
SET_LHOURS(msg, info25.info.logon_hours, "logonHours");
+ IFSET(SAMR_FIELD_BAD_PWD_COUNT)
+ SET_UINT (msg, info25.info.bad_password_count, "badPwdCount");
+ IFSET(SAMR_FIELD_NUM_LOGONS)
+ SET_UINT (msg, info25.info.logon_count, "logonCount");
IFSET(SAMR_FIELD_COUNTRY_CODE)
SET_UINT (msg, info25.info.country_code, "countryCode");
IFSET(SAMR_FIELD_CODE_PAGE)
diff --git a/source4/winbind/wb_cmd_setpwent.c b/source4/winbind/wb_cmd_setpwent.c
index 9384849..8164d6f 100644
--- a/source4/winbind/wb_cmd_setpwent.c
+++ b/source4/winbind/wb_cmd_setpwent.c
@@ -112,28 +112,30 @@ static void cmd_setpwent_recv_user_list(struct composite_context *ctx)
if (composite_nomem(user_list, state->ctx)) return;
state->ctx->status = libnet_UserList_recv(ctx, state->result,
- user_list);
+ user_list);
if (NT_STATUS_IS_OK(state->ctx->status) ||
NT_STATUS_EQUAL(state->ctx->status, STATUS_MORE_ENTRIES)) {
- if( state->result->page_index == -1) { /* First run*/
+ if (state->result->page_index == -1) { /* First run*/
state->result->user_list = user_list;
state->result->page_index = 0;
state->result->libnet_ctx = state->libnet_ctx;
} else {
- int i;
+ int i, cnt = state->result->user_list->out.count
+ + user_list->out.count;
struct userlist *tmp;
tmp = state->result->user_list->out.users;
- state->result->user_list->out.users = talloc_realloc(state->result,tmp,struct userlist,
- state->result->user_list->out.count+user_list->out.count);
+ state->result->user_list->out.users = talloc_realloc(state->result,
+ tmp, struct userlist,
+ cnt);
tmp = state->result->user_list->out.users;
for(i=0;i<user_list->out.count;i++ ) {
- tmp[i+state->result->user_list->out.count].username = talloc_steal(state->result,user_list->out.users[i].username);
+ tmp[state->result->user_list->out.count + i].username
+ = talloc_strdup(state->result, user_list->out.users[i].username);
}
- state->result->user_list->out.count += user_list->out.count;
+ state->result->user_list->out.count = cnt;
talloc_free(user_list);
}
-
if (NT_STATUS_IS_OK(state->ctx->status) ) {
composite_done(state->ctx);
} else {
--
Samba Shared Repository
More information about the samba-cvs
mailing list