[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Andreas Schneider
The branch, master has been updated
   via  dd895e5... vfs_smb_traffic_analyzer.c: set the len variable when 
running protocol v1.
  from  85a3853... s3:rpc_server: make use of the npa_tstream code to 
connect to named pipes

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


- Log -
commit dd895e526c4751865c587819d9e958c8fce9190b
Author: Holger Hetterich 
Date:   Sun May 23 23:18:58 2010 +0200

vfs_smb_traffic_analyzer.c: set the len variable when running protocol v1.

Signed-off-by: Andreas Schneider 

---

Summary of changes:
 source3/modules/vfs_smb_traffic_analyzer.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_smb_traffic_analyzer.c 
b/source3/modules/vfs_smb_traffic_analyzer.c
index dcb0199..75450c7 100644
--- a/source3/modules/vfs_smb_traffic_analyzer.c
+++ b/source3/modules/vfs_smb_traffic_analyzer.c
@@ -471,6 +471,7 @@ static void 
smb_traffic_analyzer_send_data(vfs_handle_struct *handle,
tm->tm_min,
tm->tm_sec,
(int)seconds);
+   len = strlen(str);
if (write_data(rf_sock->sock, str, len) != len) {
DEBUG(1, ("smb_traffic_analyzer_send_data_socket: "
"error sending V1 protocol data to socket!\n"));


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Günther Deschner
The branch, master has been updated
   via  869eed7... s3-lanman: use samr for api_RNetUserGetInfo.
   via  a1fc7ae... s4-smbtorture: create the user to test in 
test_usergetinfo() in RAP-SAM.
  from  dd895e5... vfs_smb_traffic_analyzer.c: set the len variable when 
running protocol v1.

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


- Log -
commit 869eed76e6dcf4da9fecac5f9b4089c94e9a6bdf
Author: Günther Deschner 
Date:   Wed May 26 23:36:33 2010 +0200

s3-lanman: use samr for api_RNetUserGetInfo.

Following MS-RAP 3.2.5.13 NetUserGetInfo Command.

Guenther

commit a1fc7aebfc327c3553be47c44048c7c458316a25
Author: Günther Deschner 
Date:   Thu May 27 13:25:31 2010 +0200

s4-smbtorture: create the user to test in test_usergetinfo() in RAP-SAM.

Guenther

---

Summary of changes:
 source3/smbd/lanman.c |  157 +
 source4/torture/rap/sam.c |   30 -
 2 files changed, 157 insertions(+), 30 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 871e2b7..30b3981 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -4027,15 +4027,18 @@ static bool api_RNetUserGetInfo(connection_struct 
*conn, uint16 vuid,
char *endp;
const char *level_string;
 
-   /* get NIS home of a previously validated user - simeon */
-   /* With share level security vuid will always be zero.
-  Don't depend on vuser being non-null !!. JRA */
-   user_struct *vuser = get_valid_user_struct(sconn, vuid);
-   if(vuser != NULL) {
-   DEBUG(3,("  Username of UID %d is %s\n",
-(int)vuser->server_info->utok.uid,
-vuser->server_info->unix_name));
-   }
+   TALLOC_CTX *mem_ctx = talloc_tos();
+   NTSTATUS status;
+   struct rpc_pipe_client *cli = NULL;
+   struct policy_handle connect_handle, domain_handle, user_handle;
+   struct lsa_String domain_name;
+   struct dom_sid2 *domain_sid;
+   struct lsa_String names;
+   struct samr_Ids rids;
+   struct samr_Ids types;
+   int errcode = W_ERROR_V(WERR_USER_NOT_FOUND);
+   uint32_t rid;
+   union samr_UserInfo *info;
 
if (!str1 || !str2 || !UserName || !p) {
return False;
@@ -4072,9 +4075,6 @@ static bool api_RNetUserGetInfo(connection_struct *conn, 
uint16 vuid,
return False;
}
 
-   SSVAL(*rparam,0,NERR_Success);
-   SSVAL(*rparam,2,0); /* converter word */
-
p = *rdata;
endp = *rdata + *rdata_len;
p2 = get_safe_ptr(*rdata,*rdata_len,p,usri11_end);
@@ -4082,6 +4082,104 @@ static bool api_RNetUserGetInfo(connection_struct 
*conn, uint16 vuid,
return False;
}
 
+   ZERO_STRUCT(connect_handle);
+   ZERO_STRUCT(domain_handle);
+   ZERO_STRUCT(user_handle);
+
+   status = rpc_pipe_open_internal(mem_ctx, &ndr_table_samr.syntax_id,
+   rpc_samr_dispatch, conn->server_info,
+   &cli);
+   if (!NT_STATUS_IS_OK(status)) {
+   DEBUG(0,("api_RNetUserGetInfo: could not connect to samr: %s\n",
+ nt_errstr(status)));
+   errcode = W_ERROR_V(ntstatus_to_werror(status));
+   goto out;
+   }
+
+   status = rpccli_samr_Connect2(cli, mem_ctx,
+ global_myname(),
+ SAMR_ACCESS_CONNECT_TO_SERVER |
+ SAMR_ACCESS_ENUM_DOMAINS |
+ SAMR_ACCESS_LOOKUP_DOMAIN,
+ &connect_handle);
+   if (!NT_STATUS_IS_OK(status)) {
+   errcode = W_ERROR_V(ntstatus_to_werror(status));
+   goto out;
+   }
+
+   init_lsa_String(&domain_name, get_global_sam_name());
+
+   status = rpccli_samr_LookupDomain(cli, mem_ctx,
+ &connect_handle,
+ &domain_name,
+ &domain_sid);
+   if (!NT_STATUS_IS_OK(status)) {
+   errcode = W_ERROR_V(ntstatus_to_werror(status));
+   goto out;
+   }
+
+   status = rpccli_samr_OpenDomain(cli, mem_ctx,
+   &connect_handle,
+   SAMR_DOMAIN_ACCESS_OPEN_ACCOUNT,
+   domain_sid,
+   &domain_handle);
+   if (!NT_STATUS_IS_OK(status)) {
+   errcode = W_ERROR_V(ntstatus_to_werror(status));
+   goto out;
+   }
+
+   init_lsa_String(&names, UserName);
+
+

[SCM] Samba Shared Repository - branch v3-5-test updated

2010-05-27 Thread Karolin Seeger
The branch, v3-5-test has been updated
   via  73d4135... s3-selftest: enable RPC-WINREG against s3.
   via  b541fb1... s3-winreg_nt: Fixed QueryValue with data=NULL to get the 
length. (cherry picked from commit 4567bf9df53e62c0f30279235d56d13cb38de190)
   via  5d9f173... s3-winreg: change notify call has no meaning when called 
remotely.
   via  4f527cf... s3-winreg: make QueryValue pass RPC-WINREG test again.
  from  4c5a1b6... Fix bug #7448 - smbd crash when sambaLMPassword and 
sambaNTPassword entries missing from ldap.

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


- Log -
commit 73d413524e62796fdcfa4ac06a6499ecd6b9978f
Author: Günther Deschner 
Date:   Tue May 25 14:13:20 2010 +0200

s3-selftest: enable RPC-WINREG against s3.

Guenther

The last 4 patches address bug #7453 (winreg: QueryValue crashes on NULL 
pointer
dereference).

commit b541fb1500aad87aee46ef48036f3b4a05b119cd
Author: Andreas Schneider 
Date:   Fri Apr 16 11:04:27 2010 +0200

s3-winreg_nt: Fixed QueryValue with data=NULL to get the length. (cherry 
picked from commit 4567bf9df53e62c0f30279235d56d13cb38de190)

commit 5d9f173d28fab6ea1afc36978c88f881bb7da52e
Author: Günther Deschner 
Date:   Tue Mar 16 15:29:14 2010 +0100

s3-winreg: change notify call has no meaning when called remotely.

Just return not supported to make smbtorture happy.

Guenther
(cherry picked from commit e46d3d9475c59af8ba6810aeb1403c1aa9e37d9d)

commit 4f527cf96a2c208c32f97073b6453386b4a1825c
Author: Günther Deschner 
Date:   Thu Mar 11 20:48:24 2010 +0100

s3-winreg: make QueryValue pass RPC-WINREG test again.

Guenther
(cherry picked from commit 24a7f8f2dbae73e862b9b3d4c6f0692054c354b3)

---

Summary of changes:
 source3/rpc_server/srv_winreg_nt.c|   12 +++-
 source3/script/tests/test_posix_s3.sh |2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/srv_winreg_nt.c 
b/source3/rpc_server/srv_winreg_nt.c
index 5912322..04c9c8c 100644
--- a/source3/rpc_server/srv_winreg_nt.c
+++ b/source3/rpc_server/srv_winreg_nt.c
@@ -230,6 +230,10 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct 
winreg_QueryValue *r)
if ( !regkey )
return WERR_BADFID;
 
+   if (r->in.value_name->name == NULL) {
+   return WERR_INVALID_PARAM;
+   }
+
if ((r->out.data_length == NULL) || (r->out.type == NULL) || 
(r->out.data_size == NULL)) {
return WERR_INVALID_PARAM;
}
@@ -316,7 +320,9 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct 
winreg_QueryValue *r)
} else {
*r->out.data_length = outbuf_size;
*r->out.data_size = outbuf_size;
-   memcpy(r->out.data, outbuf, outbuf_size);
+   if (r->out.data) {
+   memcpy(r->out.data, outbuf, outbuf_size);
+   }
status = WERR_OK;
}
 
@@ -952,10 +958,6 @@ WERROR _winreg_LoadKey(pipes_struct *p, struct 
winreg_LoadKey *r)
 
 WERROR _winreg_NotifyChangeKeyValue(pipes_struct *p, struct 
winreg_NotifyChangeKeyValue *r)
 {
-   /* fill in your code here if you think this call should
-  do anything */
-
-   p->rng_fault_state = True;
return WERR_NOT_SUPPORTED;
 }
 
diff --git a/source3/script/tests/test_posix_s3.sh 
b/source3/script/tests/test_posix_s3.sh
index 79cb3f6..7fc8da8 100755
--- a/source3/script/tests/test_posix_s3.sh
+++ b/source3/script/tests/test_posix_s3.sh
@@ -40,7 +40,7 @@ raw="$raw RAW-SAMBA3ROOTDIRFID"
 rpc="RPC-AUTHCONTEXT RPC-SAMBA3-BIND RPC-SAMBA3-SRVSVC RPC-SAMBA3-SHARESEC"
 rpc="$rpc RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC RPC-SAMBA3-WINREG"
 rpc="$rpc RPC-SAMBA3-NETLOGON RPC-SAMBA3-SESSIONKEY RPC-SAMBA3-GETUSERNAME"
-rpc="$rpc RPC-SVCCTL RPC-SPOOLSS RPC-SPOOLSS-WIN RPC-NTSVCS"
+rpc="$rpc RPC-SVCCTL RPC-SPOOLSS RPC-SPOOLSS-WIN RPC-NTSVCS RPC-WINREG"
 rpc="$rpc RPC-LSA-GETUSER RPC-LSA-LOOKUPSIDS RPC-LSA-LOOKUPNAMES"
 rpc="$rpc RPC-LSA-PRIVILEGES "
 rpc="$rpc RPC-SAMR RPC-SAMR-USERS RPC-SAMR-USERS-PRIVILEGES RPC-SAMR-PASSWORDS"


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Volker Lendecke
The branch, master has been updated
   via  9b534ad... s3: Remove an unused variable
  from  869eed7... s3-lanman: use samr for api_RNetUserGetInfo.

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


- Log -
commit 9b534ad1453ab180533edd7e687ce17d871572f0
Author: Volker Lendecke 
Date:   Thu May 27 14:27:58 2010 +0200

s3: Remove an unused variable

---

Summary of changes:
 source3/smbd/lanman.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 30b3981..77ed2d4 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -4017,7 +4017,6 @@ static bool api_RNetUserGetInfo(connection_struct *conn, 
uint16 vuid,
char **rdata,char **rparam,
int *rdata_len,int *rparam_len)
 {
-   struct smbd_server_connection *sconn = smbd_server_conn;
char *str1 = get_safe_str_ptr(param,tpscnt,param,2);
char *str2 = skip_string(param,tpscnt,str1);
char *UserName = skip_string(param,tpscnt,str2);


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Günther Deschner
The branch, master has been updated
   via  eff1339... s3-waf: fix the build after tstream changes.
  from  9b534ad... s3: Remove an unused variable

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


- Log -
commit eff13393b32d35d84f7afb564df5c7df8af58445
Author: Günther Deschner 
Date:   Thu May 27 17:09:39 2010 +0200

s3-waf: fix the build after tstream changes.

Guenther

---

Summary of changes:
 source3/wscript_build |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/wscript_build b/source3/wscript_build
index fac9c23..c45f62b 100644
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -394,13 +394,15 @@ RPC_SPOOLSS_SRC = '''rpc_server/srv_spoolss_nt.c
 RPC_EVENTLOG_SRC = '''rpc_server/srv_eventlog_nt.c
${LIB_EVENTLOG_SRC} ../librpc/gen_ndr/srv_eventlog.c'''
 
+NPA_TSTREAM_SRC = '''../libcli/named_pipe_auth/npa_tstream.c'''
+
 RPC_PIPE_SRC = '''rpc_server/srv_pipe_hnd.c
rpc_server/srv_pipe.c rpc_server/srv_lsa_hnd.c'''
 
 RPC_ECHO_SRC = '''rpc_server/srv_echo_nt.c ../librpc/gen_ndr/srv_echo.c'''
 
 #TODO: RPC_SERVER_SRC used to include RPC_STATIC modules
-RPC_SERVER_SRC = '''${RPC_PIPE_SRC}'''
+RPC_SERVER_SRC = '''${RPC_PIPE_SRC} ${NPA_TSTREAM_SRC}'''
 
 RPC_PARSE_SRC = '''${RPC_PARSE_SRC2}'''
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Volker Lendecke
The branch, master has been updated
   via  abbf8ef... s3: Fix a bad memleak in the async echo responder
  from  eff1339... s3-waf: fix the build after tstream changes.

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


- Log -
commit abbf8efb24c3d079ff2f7e39b2bf8382efa2ad5c
Author: Volker Lendecke 
Date:   Thu May 27 18:12:30 2010 +0200

s3: Fix a bad memleak in the async echo responder

---

Summary of changes:
 source3/smbd/process.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 128a612..ed70b9c 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -2669,7 +2669,7 @@ static void smbd_echo_reader(struct tevent_context *ev,
 
DEBUG(10,("echo_handler[%d]: reading pdu\n", (int)sys_getpid()));
 
-   status = receive_smb_talloc(state, smbd_server_fd(),
+   status = receive_smb_talloc(state->pending, smbd_server_fd(),
(char **)(void 
*)&state->pending[num_pending].iov_base,
0 /* timeout */,
&unread,


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Kai Blin
The branch, master has been updated
   via  21e8548... s3-waf: Also set "developer" env when building in 
developer mode
  from  abbf8ef... s3: Fix a bad memleak in the async echo responder

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


- Log -
commit 21e8548c0a3ea8fcca4e97a9b0f8b5a2cddf3d29
Author: Kai Blin 
Date:   Thu May 27 22:42:23 2010 +0200

s3-waf: Also set "developer" env when building in developer mode

---

Summary of changes:
 source3/wscript |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/wscript b/source3/wscript
index 3bc9bd1..6dc05c8 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -61,6 +61,7 @@ def configure(conf):
 conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
 if Options.options.developer:
 conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
+conv.env['developer'] = True
 
 if Options.options.with_swat:
 conf.env['build_swat'] = True


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Kai Blin
The branch, master has been updated
   via  49a80fe... s3-waf: Fix typo
  from  21e8548... s3-waf: Also set "developer" env when building in 
developer mode

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


- Log -
commit 49a80fe6710a8c3c5977b35be2f55c2748b3bddc
Author: Kai Blin 
Date:   Thu May 27 22:45:13 2010 +0200

s3-waf: Fix typo

Sorry for the noise

---

Summary of changes:
 source3/wscript |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/wscript b/source3/wscript
index 6dc05c8..c3d4c43 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -61,7 +61,7 @@ def configure(conf):
 conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
 if Options.options.developer:
 conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
-conv.env['developer'] = True
+conf.env['developer'] = True
 
 if Options.options.with_swat:
 conf.env['build_swat'] = True


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Günther Deschner
The branch, master has been updated
   via  7bcd9c5... libndr: add support for relative_rap_convert.
  from  49a80fe... s3-waf: Fix typo

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


- Log -
commit 7bcd9c5583ac2f750aa9c90af7d1ac86eb36f86f
Author: Günther Deschner 
Date:   Fri Apr 30 01:08:07 2010 +0200

libndr: add support for relative_rap_convert.

Will not harm anyone, is only used for rare short (2byte) relative 
pointers, and
relative_rap_convert is always 0 so far (as all init functions using struct
ndr_pull will zero the struct).

Guenther

---

Summary of changes:
 librpc/ndr/libndr.h|1 +
 librpc/ndr/ndr_basic.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h
index 133a119..d5091a6 100644
--- a/librpc/ndr/libndr.h
+++ b/librpc/ndr/libndr.h
@@ -62,6 +62,7 @@ struct ndr_pull {
 
uint32_t relative_highest_offset;
uint32_t relative_base_offset;
+   uint32_t relative_rap_convert;
struct ndr_token_list *relative_base_list;
 
struct ndr_token_list *relative_list;
diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c
index f7d6ee0..d0d58b0 100644
--- a/librpc/ndr/ndr_basic.c
+++ b/librpc/ndr/ndr_basic.c
@@ -185,6 +185,7 @@ _PUBLIC_ enum ndr_err_code 
ndr_pull_relative_ptr_short(struct ndr_pull *ndr, uin
if (*v != 0) {
ndr->ptr_count++;
}
+   *(v) -= ndr->relative_rap_convert;
return NDR_ERR_SUCCESS;
 }
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Günther Deschner
The branch, master has been updated
   via  82982bd... s4-smbtorture: we can fully use autogenerated code to 
pull info unions now.
  from  7bcd9c5... libndr: add support for relative_rap_convert.

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


- Log -
commit 82982bd48086712d5efd2e9be79c16a4338605f7
Author: Günther Deschner 
Date:   Fri Apr 30 01:09:46 2010 +0200

s4-smbtorture: we can fully use autogenerated code to pull info unions now.

Guenther

---

Summary of changes:
 source4/torture/rap/rap.c |  262 -
 1 files changed, 90 insertions(+), 172 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index 8483160..d263f80 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -711,13 +711,32 @@ static NTSTATUS rap_pull_rap_PrintQueue5(TALLOC_CTX 
*mem_ctx, struct ndr_pull *n
return NT_STATUS_OK;
 }
 
+static enum ndr_err_code ndr_pull_rap_NetPrintQEnum_data(struct ndr_pull *ndr, 
struct rap_NetPrintQEnum *r)
+{
+   uint32_t cntr_info_0;
+   TALLOC_CTX *_mem_save_info_0;
+
+   NDR_PULL_ALLOC_N(ndr, r->out.info, r->out.count);
+   _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr);
+   NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0);
+   for (cntr_info_0 = 0; cntr_info_0 < r->out.count; cntr_info_0++) {
+   NDR_CHECK(ndr_pull_set_switch_value(ndr, 
&r->out.info[cntr_info_0], r->in.level));
+   NDR_CHECK(ndr_pull_rap_printq_info(ndr, NDR_SCALARS, 
&r->out.info[cntr_info_0]));
+   }
+   for (cntr_info_0 = 0; cntr_info_0 < r->out.count; cntr_info_0++) {
+   NDR_CHECK(ndr_pull_rap_printq_info(ndr, NDR_BUFFERS, 
&r->out.info[cntr_info_0]));
+   }
+   NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0);
+
+   return NDR_ERR_SUCCESS;
+}
+
 NTSTATUS smbcli_rap_netprintqenum(struct smbcli_tree *tree,
  TALLOC_CTX *mem_ctx,
  struct rap_NetPrintQEnum *r)
 {
struct rap_call *call;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
-   int i;
 
if (!(call = new_rap_cli_call(mem_ctx, RAP_WPrintQEnum))) {
return NT_STATUS_NO_MEMORY;
@@ -770,39 +789,11 @@ NTSTATUS smbcli_rap_netprintqenum(struct smbcli_tree 
*tree,
NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, 
&r->out.count));
NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, 
&r->out.available));
 
-   r->out.info = talloc_zero_array(mem_ctx, union rap_printq_info, 
r->out.count);
+   call->ndr_pull_data->relative_rap_convert = r->out.convert;
 
-   if (r->out.info == NULL) {
-   result = NT_STATUS_NO_MEMORY;
-   goto done;
-   }
+   NDR_GOTO(ndr_pull_rap_NetPrintQEnum_data(call->ndr_pull_data, r));
 
-   for (i=0; iout.count; i++) {
-   switch(r->in.level) {
-   case 0:
-   result = rap_pull_rap_PrintQueue0(mem_ctx, 
call->ndr_pull_data, r->out.convert, &r->out.info[i].info0);
-   break;
-   case 1:
-   result = rap_pull_rap_PrintQueue1(mem_ctx, 
call->ndr_pull_data, r->out.convert, &r->out.info[i].info1);
-   break;
-   case 2:
-   result = rap_pull_rap_PrintQueue2(mem_ctx, 
call->ndr_pull_data, r->out.convert, &r->out.info[i].info2);
-   break;
-   case 3:
-   result = rap_pull_rap_PrintQueue3(mem_ctx, 
call->ndr_pull_data, r->out.convert, &r->out.info[i].info3);
-   break;
-   case 4:
-   result = rap_pull_rap_PrintQueue4(mem_ctx, 
call->ndr_pull_data, r->out.convert, &r->out.info[i].info4);
-   break;
-   case 5:
-   result = rap_pull_rap_PrintQueue5(mem_ctx, 
call->ndr_pull_data, r->out.convert, &r->out.info[i].info5);
-   break;
-   }
-   }
-
-   if (!NT_STATUS_IS_OK(result)) {
-   goto done;
-   }
+   r->out.info = talloc_steal(mem_ctx, r->out.info);
 
if (DEBUGLEVEL >= 10) {
NDR_PRINT_OUT_DEBUG(rap_NetPrintQEnum, r);
@@ -869,39 +860,22 @@ NTSTATUS smbcli_rap_netprintqgetinfo(struct smbcli_tree 
*tree,
 
result = NT_STATUS_INVALID_PARAMETER;
 
+   ZERO_STRUCT(r->out);
+
NDR_GOTO(ndr_pull_rap_status(call->ndr_pull_param, NDR_SCALARS, 
&r->out.status));
NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, 
&r->out.convert));
NDR_GOTO(ndr_pull_uint16(call->ndr_pull_param, NDR_SCALARS, 
&r->out.available));
 
-   switch(r->in.level) {
-   case 0:
-   result = rap_pull_rap_PrintQueue0(

[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Günther Deschner
The branch, master has been updated
   via  7803bcd... s4-smbtorture: remove obsolete handmarshalled rap code.
  from  82982bd... s4-smbtorture: we can fully use autogenerated code to 
pull info unions now.

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


- Log -
commit 7803bcdae654f1474c57f0d31ed17f56492441e3
Author: Günther Deschner 
Date:   Thu Apr 29 23:34:27 2010 +0200

s4-smbtorture: remove obsolete handmarshalled rap code.

Guenther

---

Summary of changes:
 source4/torture/rap/rap.c |  281 -
 1 files changed, 0 insertions(+), 281 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/rap/rap.c b/source4/torture/rap/rap.c
index d263f80..33d6715 100644
--- a/source4/torture/rap/rap.c
+++ b/source4/torture/rap/rap.c
@@ -564,153 +564,6 @@ NTSTATUS smbcli_rap_netservergetinfo(struct smbcli_tree 
*tree,
return result;
 }
 
-static NTSTATUS rap_pull_rap_JobInfo0(TALLOC_CTX *mem_ctx, struct ndr_pull 
*ndr, uint16_t convert, struct rap_PrintJobInfo0 *r)
-{
-   NDR_RETURN(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobID));
-
-   return NT_STATUS_OK;
-}
-
-static NTSTATUS rap_pull_rap_JobInfo1(TALLOC_CTX *mem_ctx, struct ndr_pull 
*ndr, uint16_t convert, struct rap_PrintJobInfo1 *r)
-{
-   NDR_RETURN(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobID));
-   NDR_RETURN(ndr_pull_charset(ndr, NDR_SCALARS, &r->UserName, 21, 
sizeof(uint8_t), CH_DOS));
-   NDR_RETURN(ndr_pull_uint8(ndr, NDR_SCALARS, &r->Pad));
-   NDR_RETURN(ndr_pull_charset(ndr, NDR_SCALARS, &r->NotifyName, 16, 
sizeof(uint8_t), CH_DOS));
-   NDR_RETURN(ndr_pull_charset(ndr, NDR_SCALARS, &r->DataType, 10, 
sizeof(uint8_t), CH_DOS));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, 
&r->PrintParameterString));
-   NDR_RETURN(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobPosition));
-   NDR_RETURN(ndr_pull_rap_PrintJStatusCode(ndr, NDR_SCALARS, 
&r->JobStatus));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, &r->JobStatusString));
-   NDR_RETURN(ndr_pull_time_t(ndr, NDR_SCALARS, &r->TimeSubmitted));
-   NDR_RETURN(ndr_pull_uint32(ndr, NDR_SCALARS, &r->JobSize));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, 
&r->JobCommentString));
-
-   return NT_STATUS_OK;
-}
-
-static NTSTATUS rap_pull_rap_JobInfo2(TALLOC_CTX *mem_ctx, struct ndr_pull 
*ndr, uint16_t convert, struct rap_PrintJobInfo2 *r)
-{
-   NDR_RETURN(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobID));
-   NDR_RETURN(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Priority));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, &r->UserName));
-   NDR_RETURN(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobPosition));
-   NDR_RETURN(ndr_pull_rap_PrintJStatusCode(ndr, NDR_SCALARS, 
&r->JobStatus));
-   NDR_RETURN(ndr_pull_time_t(ndr, NDR_SCALARS, &r->TimeSubmitted));
-   NDR_RETURN(ndr_pull_uint32(ndr, NDR_SCALARS, &r->JobSize));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, 
&r->JobCommentString));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, &r->DocumentName));
-
-   return NT_STATUS_OK;
-}
-
-static NTSTATUS rap_pull_rap_JobInfo3(TALLOC_CTX *mem_ctx, struct ndr_pull 
*ndr, uint16_t convert, struct rap_PrintJobInfo3 *r)
-{
-   NDR_RETURN(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobID));
-   NDR_RETURN(ndr_pull_uint16(ndr, NDR_SCALARS, &r->Priority));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, &r->UserName));
-   NDR_RETURN(ndr_pull_uint16(ndr, NDR_SCALARS, &r->JobPosition));
-   NDR_RETURN(ndr_pull_rap_PrintJStatusCode(ndr, NDR_SCALARS, 
&r->JobStatus));
-   NDR_RETURN(ndr_pull_time_t(ndr, NDR_SCALARS, &r->TimeSubmitted));
-   NDR_RETURN(ndr_pull_uint32(ndr, NDR_SCALARS, &r->JobSize));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, 
&r->JobCommentString));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, &r->DocumentName));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, &r->NotifyName));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, &r->DataType));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, 
&r->PrintParameterString));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, &r->StatusString));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, &r->QueueName));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, 
&r->PrintProcessorName));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, 
&r->PrintProcessorParams));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, &r->DriverName));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, 
&r->DriverDataOffset));
-   RAP_RETURN(rap_pull_string(mem_ctx, ndr, convert, 
&r->PrinterNameOffset));
-
-   return NT_STATUS_OK;
-}
-
-static NTSTATUS rap_pull_rap_PrintQueue0(TALLOC_CTX *m

[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Günther Deschner
The branch, master has been updated
   via  667716d... s4-smbtorture: finally test all levels in 
rap_NetUserGetInfo RAP-SAM test.
  from  7803bcd... s4-smbtorture: remove obsolete handmarshalled rap code.

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


- Log -
commit 667716d2041fc531bfa6241b02bbfc12d7666e51
Author: Günther Deschner 
Date:   Thu May 27 16:10:10 2010 +0200

s4-smbtorture: finally test all levels in rap_NetUserGetInfo RAP-SAM test.

Guenther

---

Summary of changes:
 source4/torture/rap/sam.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/rap/sam.c b/source4/torture/rap/sam.c
index 7b97a08..290ba08 100644
--- a/source4/torture/rap/sam.c
+++ b/source4/torture/rap/sam.c
@@ -192,7 +192,7 @@ static bool test_usergetinfo_byname(struct torture_context 
*tctx,
 {
struct rap_NetUserGetInfo r;
int i;
-   uint16_t levels[] = { 0, 1, /*2,*/ 10, /*11*/ };
+   uint16_t levels[] = { 0, 1, 2, 10, 11 };
 
for (i=0; i < ARRAY_SIZE(levels); i++) {
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Günther Deschner
The branch, master has been updated
   via  606be25... s3:auth Free sampass as soon as we have server_info
   via  d9cffc0... s3:auth use info3 in auth_serversupplied_info
   via  6713f3d... s3:auth add function to copy a netr_SamInfo3 structure
   via  605cfef... s3:auth: add function to convert samu to netr_SamInfo3
  from  667716d... s4-smbtorture: finally test all levels in 
rap_NetUserGetInfo RAP-SAM test.

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


- Log -
commit 606be25ecf4a31cba9f15c43ebc650aecb17e765
Author: Simo Sorce 
Date:   Thu May 27 05:31:45 2010 -0400

s3:auth Free sampass as soon as we have server_info

We don't keep sampass in server_info anymore
So it makes no sense to keep it around.

Signed-off-by: Günther Deschner 

commit d9cffc01be58184312a6a7b55bd523cf8daefa78
Author: Simo Sorce 
Date:   Thu May 27 03:41:56 2010 -0400

s3:auth use info3 in auth_serversupplied_info

Signed-off-by: Günther Deschner 

commit 6713f3d945f09a732e620641771d9ff403aca9ef
Author: Simo Sorce 
Date:   Thu May 27 02:40:59 2010 -0400

s3:auth add function to copy a netr_SamInfo3 structure

Signed-off-by: Günther Deschner 

commit 605cfef56c23f39eba88545c43284b061e9755bd
Author: Simo Sorce 
Date:   Thu May 27 02:07:33 2010 -0400

s3:auth: add function to convert samu to netr_SamInfo3

Signed-off-by: Günther Deschner 

---

Summary of changes:
 source3/auth/auth_util.c   |  412 +++
 source3/auth/check_samsec.c|7 +-
 source3/auth/server_info.c |  504 +---
 source3/auth/server_info_sam.c |   11 +-
 source3/include/auth.h |2 +-
 source3/include/proto.h|7 +
 source3/modules/vfs_expand_msdfs.c |2 +-
 source3/modules/vfs_full_audit.c   |2 +-
 source3/modules/vfs_recycle.c  |2 +-
 source3/modules/vfs_smb_traffic_analyzer.c |6 +-
 source3/printing/printing.c|2 +-
 source3/rpc_server/srv_lsa_nt.c|2 +-
 source3/rpc_server/srv_netlog_nt.c |2 +-
 source3/smbd/lanman.c  |9 +-
 source3/smbd/password.c|6 +-
 source3/smbd/process.c |3 +-
 source3/smbd/service.c |   12 +-
 source3/smbd/sesssetup.c   |7 +-
 source3/smbd/smb2_sesssetup.c  |9 +-
 source3/smbd/uid.c |6 +-
 20 files changed, 400 insertions(+), 613 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index ad454b6..854ab89 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -455,7 +455,7 @@ static NTSTATUS log_nt_token(NT_USER_TOKEN *token)
 }
 
 /*
- * Create the token to use from server_info->sam_account and
+ * Create the token to use from server_info->info3 and
  * server_info->sids (the info3/sam groups). Find the unix gids.
  */
 
@@ -464,6 +464,7 @@ NTSTATUS create_local_token(struct auth_serversupplied_info 
*server_info)
NTSTATUS status;
size_t i;
struct dom_sid tmp_sid;
+   struct dom_sid user_sid;
 
/*
 * If winbind is not around, we can not make much use of the SIDs the
@@ -482,9 +483,13 @@ NTSTATUS create_local_token(struct 
auth_serversupplied_info *server_info)
&server_info->ptok);
 
} else {
+   sid_compose(&user_sid,
+   server_info->info3->base.domain_sid,
+   server_info->info3->base.rid);
+
server_info->ptok = create_local_nt_token(
server_info,
-   pdb_get_user_sid(server_info->sam_account),
+   &user_sid,
server_info->guest,
server_info->num_sids, server_info->sids);
status = server_info->ptok ?
@@ -592,7 +597,16 @@ NTSTATUS make_server_info_pw(struct 
auth_serversupplied_info **server_info,
return NT_STATUS_NO_MEMORY;
}
 
-   result->sam_account = sampass;
+   status = samu_to_SamInfo3(result, sampass,
+ global_myname(), &result->info3);
+   if (!NT_STATUS_IS_OK(status)) {
+   DEBUG(10, ("Failed to convert samu to info3: %s\n",
+  nt_errstr(status)));
+   TALLOC_FREE(sampass);
+   TALLOC_FREE(result);
+   return status;
+   }
+
 
result->unix_name = talloc_strdup(result, unix_username);
result->sanitized_username = sanitize_username(result, unix_username);
@@ -614,10 +628,13 @@ NTSTAT

Re: [SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Guenther Deschner
On Thu, May 27, 2010 at 05:57:35PM -0500, Günther Deschner wrote:
> The branch, master has been updated
>via  606be25... s3:auth Free sampass as soon as we have server_info
>via  d9cffc0... s3:auth use info3 in auth_serversupplied_info
>via  6713f3d... s3:auth add function to copy a netr_SamInfo3 structure
>via  605cfef... s3:auth: add function to convert samu to netr_SamInfo3
>   from  667716d... s4-smbtorture: finally test all levels in 
> rap_NetUserGetInfo RAP-SAM test.
> 
> http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master

Hi Simo,

arg... and of course I pushed and incomplete and old version of that
patchset :/

sorry, sorry, sorry.

Guenther

-- 
Günther DeschnerGPG-ID: 8EE11688
Red Hat gdesch...@redhat.com
Samba Team  g...@samba.org


pgpOFoHHGJ7JE.pgp
Description: PGP signature


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Günther Deschner
The branch, master has been updated
   via  2a6a696... s3:auth add function to convert wbcAuthUserInfo to 
netr_SamInfo3
  from  606be25... s3:auth Free sampass as soon as we have server_info

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


- Log -
commit 2a6a696e32798f2a2aabef61dfa421da6328d069
Author: Simo Sorce 
Date:   Thu May 27 03:21:35 2010 -0400

s3:auth add function to convert wbcAuthUserInfo to netr_SamInfo3

Signed-off-by: Günther Deschner 

---

Summary of changes:
 source3/auth/server_info.c |  135 
 source3/include/proto.h|2 +
 2 files changed, 137 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c
index e9ccdb6..d9b25bd 100644
--- a/source3/auth/server_info.c
+++ b/source3/auth/server_info.c
@@ -441,3 +441,138 @@ struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX 
*mem_ctx,
 
return info3;
 }
+
+static NTSTATUS wbcsids_to_samr_RidWithAttributeArray(
+   TALLOC_CTX *mem_ctx,
+   struct samr_RidWithAttributeArray *groups,
+   const struct dom_sid *domain_sid,
+   const struct wbcSidWithAttr *sids,
+   size_t num_sids)
+{
+   unsigned int i;
+   bool ok;
+
+   groups->rids = talloc_array(mem_ctx,
+   struct samr_RidWithAttribute, num_sids);
+   if (!groups->rids) {
+   return NT_STATUS_NO_MEMORY;
+   }
+
+   /* a wbcDomainSid is the same as a dom_sid */
+   for (i = 0; i < num_sids; i++) {
+   ok = sid_peek_check_rid(domain_sid,
+   (const struct dom_sid *)&sids[i].sid,
+   &groups->rids[i].rid);
+   if (!ok) continue;
+
+   groups->rids[i].attributes = SE_GROUP_MANDATORY |
+SE_GROUP_ENABLED_BY_DEFAULT |
+SE_GROUP_ENABLED;
+   groups->count++;
+   }
+
+   return NT_STATUS_OK;
+}
+
+struct netr_SamInfo3 *wbcAuthUserInfo_to_netr_SamInfo3(TALLOC_CTX *mem_ctx,
+   const struct wbcAuthUserInfo *info)
+{
+   struct netr_SamInfo3 *info3;
+   struct dom_sid user_sid;
+   struct dom_sid group_sid;
+   struct dom_sid domain_sid;
+   NTSTATUS status;
+   bool ok;
+
+   memcpy(&user_sid, &info->sids[0].sid, sizeof(user_sid));
+   memcpy(&group_sid, &info->sids[1].sid, sizeof(group_sid));
+
+   info3 = talloc_zero(mem_ctx, struct netr_SamInfo3);
+   if (!info3) return NULL;
+
+   info3->base.last_logon = info->logon_time;
+   info3->base.last_logoff = info->logoff_time;
+   info3->base.acct_expiry = info->kickoff_time;
+   info3->base.last_password_change = info->pass_last_set_time;
+   info3->base.allow_password_change = info->pass_can_change_time;
+   info3->base.force_password_change = info->pass_must_change_time;
+
+   if (info->account_name) {
+   info3->base.account_name.string =
+   talloc_strdup(info3, info->account_name);
+   RET_NOMEM(info3->base.account_name.string);
+   }
+   if (info->full_name) {
+   info3->base.full_name.string =
+   talloc_strdup(info3, info->full_name);
+   RET_NOMEM(info3->base.full_name.string);
+   }
+   if (info->logon_script) {
+   info3->base.logon_script.string =
+   talloc_strdup(info3, info->logon_script);
+   RET_NOMEM(info3->base.logon_script.string);
+   }
+   if (info->profile_path) {
+   info3->base.profile_path.string =
+   talloc_strdup(info3, info->profile_path);
+   RET_NOMEM(info3->base.profile_path.string);
+   }
+   if (info->home_directory) {
+   info3->base.home_directory.string =
+   talloc_strdup(info3, info->home_directory);
+   RET_NOMEM(info3->base.home_directory.string);
+   }
+   if (info->home_drive) {
+   info3->base.home_drive.string =
+   talloc_strdup(info3, info->home_drive);
+   RET_NOMEM(info3->base.home_drive.string);
+   }
+
+   info3->base.logon_count = info->logon_count;
+   info3->base.bad_password_count = info->bad_password_count;
+
+   sid_copy(&domain_sid, &user_sid);
+   sid_split_rid(&domain_sid, &info3->base.rid);
+
+   ok = sid_peek_check_rid(&domain_sid, &group_sid,
+   &info3->base.primary_gid);
+

[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Simo Sorce
The branch, master has been updated
   via  3bb8195... Fix Out of memory checks
  from  2a6a696... s3:auth add function to convert wbcAuthUserInfo to 
netr_SamInfo3

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


- Log -
commit 3bb819581b1dc2624a9e52c2cae065cc3bda6a4b
Author: Simo Sorce 
Date:   Thu May 27 19:22:02 2010 -0400

Fix Out of memory checks

Günther pushed an older version of the patch "s3:auth add function to copy 
a
netr_SamInfo3 structure" that was missing these fixes.

---

Summary of changes:
 source3/auth/server_info.c |   96 +++-
 1 files changed, 59 insertions(+), 37 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c
index d9b25bd..27f0487 100644
--- a/source3/auth/server_info.c
+++ b/source3/auth/server_info.c
@@ -393,51 +393,73 @@ struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX 
*mem_ctx,
 {
struct netr_SamInfo3 *info3;
 
-   info3 = talloc(mem_ctx, struct netr_SamInfo3);
+   info3 = talloc_zero(mem_ctx, struct netr_SamInfo3);
if (!info3) return NULL;
 
/* first copy all, then realloc pointers */
info3->base = orig->base;
 
-   info3->base.account_name.string =
-   talloc_strdup(info3, orig->base.account_name.string);
-   RET_NOMEM(info3->base.account_name.string);
-   info3->base.full_name.string =
-   talloc_strdup(info3, orig->base.full_name.string);
-   RET_NOMEM(info3->base.full_name.string);
-   info3->base.logon_script.string =
-   talloc_strdup(info3, orig->base.logon_script.string);
-   RET_NOMEM(info3->base.logon_script.string);
-   info3->base.profile_path.string =
-   talloc_strdup(info3, orig->base.profile_path.string);
-   RET_NOMEM(info3->base.profile_path.string);
-   info3->base.home_directory.string =
-   talloc_strdup(info3, orig->base.home_directory.string);
-   RET_NOMEM(info3->base.home_directory.string);
-   info3->base.home_drive.string =
-   talloc_strdup(info3, orig->base.home_drive.string);
-   RET_NOMEM(info3->base.home_drive.string);
-
-   info3->base.groups.rids =
-   talloc_memdup(info3, orig->base.groups.rids,
-   (sizeof(struct samr_RidWithAttribute) *
-   orig->base.groups.count));
-   RET_NOMEM(info3->base.groups.rids);
-
-   info3->base.logon_server.string =
-   talloc_strdup(info3, orig->base.logon_server.string);
-   RET_NOMEM(info3->base.logon_server.string);
-   info3->base.domain.string =
-   talloc_strdup(info3, orig->base.domain.string);
-   RET_NOMEM(info3->base.domain.string);
+   if (orig->base.account_name.string) {
+   info3->base.account_name.string =
+   talloc_strdup(info3, orig->base.account_name.string);
+   RET_NOMEM(info3->base.account_name.string);
+   }
+   if (orig->base.full_name.string) {
+   info3->base.full_name.string =
+   talloc_strdup(info3, orig->base.full_name.string);
+   RET_NOMEM(info3->base.full_name.string);
+   }
+   if (orig->base.logon_script.string) {
+   info3->base.logon_script.string =
+   talloc_strdup(info3, orig->base.logon_script.string);
+   RET_NOMEM(info3->base.logon_script.string);
+   }
+   if (orig->base.profile_path.string) {
+   info3->base.profile_path.string =
+   talloc_strdup(info3, orig->base.profile_path.string);
+   RET_NOMEM(info3->base.profile_path.string);
+   }
+   if (orig->base.home_directory.string) {
+   info3->base.home_directory.string =
+   talloc_strdup(info3, orig->base.home_directory.string);
+   RET_NOMEM(info3->base.home_directory.string);
+   }
+   if (orig->base.home_drive.string) {
+   info3->base.home_drive.string =
+   talloc_strdup(info3, orig->base.home_drive.string);
+   RET_NOMEM(info3->base.home_drive.string);
+   }
 
-   info3->base.domain_sid = sid_dup_talloc(info3, orig->base.domain_sid);
-   RET_NOMEM(info3->base.domain_sid);
+   if (orig->base.groups.count) {
+   info3->base.groups.rids =
+   talloc_memdup(info3, orig->base.groups.rids,
+   (sizeof(struct samr_RidWithAttribute) *
+   orig->base.groups.count));
+   RET_NOMEM(info3->base.groups.rids);
+   }
+
+   if (orig->base.logon_server.string) {
+   info3->base.logon_server.string =
+   talloc_strdup(inf

[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Simo Sorce
The branch, master has been updated
   via  20fb373... s3:auth remove login_server from server info
  from  3bb8195... Fix Out of memory checks

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


- Log -
commit 20fb37320224e8ed97473e60c1b70369d8069cb5
Author: Simo Sorce 
Date:   Thu May 27 19:41:07 2010 -0400

s3:auth remove login_server from server info

It is not used anymore, we have that information in
info3->base.logon_server already

---

Summary of changes:
 source3/auth/auth_util.c |3 ---
 source3/include/auth.h   |2 --
 2 files changed, 0 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
index 854ab89..7869637 100644
--- a/source3/auth/auth_util.c
+++ b/source3/auth/auth_util.c
@@ -1155,9 +1155,6 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
/* Ensure the primary group sid is at position 0. */
sort_sid_array_for_smbd(result, &group_sid);
 
-   result->login_server = talloc_strdup(result,
-info3->base.logon_server.string);
-
/* ensure we are never given NULL session keys */
 
if (memcmp(info3->base.key.key, zeros, sizeof(zeros)) == 0) {
diff --git a/source3/include/auth.h b/source3/include/auth.h
index 7996faf..ba8b23b 100644
--- a/source3/include/auth.h
+++ b/source3/include/auth.h
@@ -56,8 +56,6 @@ struct auth_serversupplied_info {
DATA_BLOB user_session_key;
DATA_BLOB lm_session_key;
 
-char *login_server; /* which server authorized the login? */
-
struct netr_SamInfo3 *info3;
 
void *pam_handle;


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Simo Sorce
The branch, master has been updated
   via  f888c82... s3:auth Add comment to clarify usage of session keys.
  from  20fb373... s3:auth remove login_server from server info

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


- Log -
commit f888c82fe08f7bf624aad53c20aaa634662b36dd
Author: Simo Sorce 
Date:   Thu May 27 20:40:22 2010 -0400

s3:auth Add comment to clarify usage of session keys.

Explain why we have what looks like a duplicate of session keys.
It is in fact not a duplicate.

---

Summary of changes:
 source3/include/auth.h |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/auth.h b/source3/include/auth.h
index ba8b23b..fbd73ae 100644
--- a/source3/include/auth.h
+++ b/source3/include/auth.h
@@ -53,6 +53,16 @@ struct auth_serversupplied_info {
 
NT_USER_TOKEN *ptok;
 
+   /* This is the final session key, as used by SMB signing, and
+* (truncated to 16 bytes) encryption on the SAMR and LSA pipes
+* when over ncacn_np.
+* It is calculated by NTLMSSP from the session key in the info3,
+* and is  set from the Kerberos session key using
+* krb5_auth_con_getremotesubkey().
+*
+* Bootom line, it is not the same as the session keys in info3.
+*/
+
DATA_BLOB user_session_key;
DATA_BLOB lm_session_key;
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Günther Deschner
The branch, master has been updated
   via  0ca8e22... s3-lanman: Fix api_RNetUserGetInfo level 2 marshalling 
offset calculation.
   via  c5eeb0d... s3-auth: fix c++ buildwarnings.
   via  38d69ca... s3-build: remove duplicate ndr_krb5pac.h inclusion.
   via  6d19475... s3-build: use ndr_misc.h where needed.
   via  66adb84... s3-build: only use ndr_samr.h where needed.
   via  60079f5... s3-idl: fix some missing dependencies to other IDL files.
   via  30eeb1e... s3-rpc_client: move protos to init_netlogon.h
  from  f888c82... s3:auth Add comment to clarify usage of session keys.

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


- Log -
commit 0ca8e2252b14811b9221acc95a510ab6a84f580f
Author: Günther Deschner 
Date:   Fri May 28 00:02:15 2010 +0200

s3-lanman: Fix api_RNetUserGetInfo level 2 marshalling offset calculation.

54 + 4 = 58 (and not 60).

Found by torture test.

Guenther

commit c5eeb0d155bc49fe7ead2a601bdd1bffaa5b119c
Author: Günther Deschner 
Date:   Fri May 28 02:47:12 2010 +0200

s3-auth: fix c++ buildwarnings.

Guenther

commit 38d69ca547d6eaead316d990dc140a8250cf64d2
Author: Günther Deschner 
Date:   Fri May 28 02:20:21 2010 +0200

s3-build: remove duplicate ndr_krb5pac.h inclusion.

Guenther

commit 6d194756e00c73672bbd43c9a5eb9efc93a84567
Author: Günther Deschner 
Date:   Fri May 28 02:20:02 2010 +0200

s3-build: use ndr_misc.h where needed.

Guenther

commit 66adb84e46489a94ea49fc70d93dfe90a601617c
Author: Günther Deschner 
Date:   Fri May 28 02:18:21 2010 +0200

s3-build: only use ndr_samr.h where needed.

Guenther

commit 60079f59b09d5f05ac1f09b015ec9bd765269035
Author: Günther Deschner 
Date:   Fri May 28 02:16:38 2010 +0200

s3-idl: fix some missing dependencies to other IDL files.

Guenther

commit 30eeb1e3d90e93a52d81503d022218b7b6521071
Author: Günther Deschner 
Date:   Fri May 28 01:19:25 2010 +0200

s3-rpc_client: move protos to init_netlogon.h

Guenther

---

Summary of changes:
 source3/auth/server_info.c |4 ++--
 source3/include/proto.h|   32 
 source3/libads/kerberos.c  |1 +
 source3/librpc/idl/libnet_join.idl |2 +-
 source3/librpc/idl/libnetapi.idl   |2 ++
 source3/librpc/idl/secrets.idl |2 ++
 source3/librpc/idl/wbint.idl   |2 +-
 source3/libsmb/passchange.c|1 +
 source3/rpc_client/cli_netlogon.c  |1 +
 source3/rpc_client/init_netlogon.c |1 +
 source3/rpc_client/init_netlogon.h |5 +
 source3/rpc_server/srv_lsa_hnd.c   |1 +
 source3/rpcclient/cmd_test.c   |1 +
 source3/smbd/lanman.c  |   32 
 source3/utils/net_rpc_shell.c  |1 +
 15 files changed, 48 insertions(+), 40 deletions(-)
 create mode 100644 source3/rpc_client/init_netlogon.h


Changeset truncated at 500 lines:

diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c
index 27f0487..2545e7d 100644
--- a/source3/auth/server_info.c
+++ b/source3/auth/server_info.c
@@ -431,7 +431,7 @@ struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX 
*mem_ctx,
}
 
if (orig->base.groups.count) {
-   info3->base.groups.rids =
+   info3->base.groups.rids = (struct samr_RidWithAttribute *)
talloc_memdup(info3, orig->base.groups.rids,
(sizeof(struct samr_RidWithAttribute) *
orig->base.groups.count));
@@ -455,7 +455,7 @@ struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX 
*mem_ctx,
}
 
if (orig->sidcount) {
-   info3->sids = talloc_memdup(info3, orig->sids,
+   info3->sids = (struct netr_SidAttr *)talloc_memdup(info3, 
orig->sids,
(sizeof(struct netr_SidAttr) *
orig->sidcount));
RET_NOMEM(info3->sids);
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 8c3f05e..cc14658 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -177,7 +177,18 @@ NTSTATUS auth_winbind_init(void);
 /* The following definitions come from auth/server_info.c  */
 
 struct auth_serversupplied_info *make_server_info(TALLOC_CTX *mem_ctx);
-
+NTSTATUS serverinfo_to_SamInfo2(struct auth_serversupplied_info *server_info,
+   uint8_t *pipe_session_key,
+   size_t pipe_session_key_len,
+   struct netr_SamInfo2 *sam2);
+NTSTATUS serverinfo_to_SamInfo3(struct auth_serversupplied_info *server_info,
+   uint8_t *pipe_session_key,
+   size_t pipe_ses

Build status as of Fri May 28 06:00:04 2010

2010-05-27 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2010-05-27 
00:00:26.0 -0600
+++ /home/build/master/cache/broken_results.txt 2010-05-28 00:00:05.0 
-0600
@@ -1,4 +1,4 @@
-Build status as of Thu May 27 06:00:04 2010
+Build status as of Fri May 28 06:00:04 2010
 
 Build counts:
 Tree Total  Broken Panic 
@@ -14,7 +14,7 @@
 samba-web0  0  0 
 samba_3_current 28 27 4 
 samba_3_master 28 28 0 
-samba_3_next 28 26 6 
+samba_3_next 28 28 6 
 samba_4_0_test 30 30 0 
 samba_4_0_waf 30 29 3 
 talloc   30 5  0 


[SCM] Samba Shared Repository - branch master updated

2010-05-27 Thread Andrew Bartlett
The branch, master has been updated
   via  892a4b2... waf Read VERSION file inside WAF to set package version
  from  0ca8e22... s3-lanman: Fix api_RNetUserGetInfo level 2 marshalling 
offset calculation.

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


- Log -
commit 892a4b24e79a71f5fd81bdb631d93615f2345bd9
Author: Andrew Bartlett 
Date:   Fri May 28 15:20:03 2010 +1000

waf Read VERSION file inside WAF to set package version

This replaces the call to mkversion.sh in both the Samba3 and Samba4
WAF builds.

Andrew Bartlett

---

Summary of changes:
 buildtools/wafsamba/samba_patterns.py |   27 --
 buildtools/wafsamba/samba_version.py  |  170 +
 buildtools/wafsamba/wafsamba.py   |1 +
 source3/wscript   |   18 ++--
 source4/wscript   |   11 ++-
 5 files changed, 208 insertions(+), 19 deletions(-)
 create mode 100644 buildtools/wafsamba/samba_version.py


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_patterns.py 
b/buildtools/wafsamba/samba_patterns.py
index cce19d3..ae0dbe2 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -3,15 +3,26 @@
 import Task
 from TaskGen import extension
 from samba_utils import *
+from wafsamba import samba_version_file
+
+def write_version_header(task):
+'''print version.h contents'''
+src = task.inputs[0].srcpath(task.env)
+tgt = task.outputs[0].bldpath(task.env)
+
+version = samba_version_file(src)
+string = str(version)
+   
+f = open(tgt, 'w')
+s = f.write(string)
+f.close()
+return 0
+
 
 def SAMBA_MKVERSION(bld, target):
 '''generate the version.h header for Samba'''
-bld.SET_BUILD_GROUP('setup')
-t = bld(rule="cd .. && ${SRC[0].abspath(env)} VERSION 
${TGT[0].abspath(env)}",
-source= [ "script/mkversion.sh", 'VERSION' ],
-target=target,
-shell=True,
-on_results=True,
-before="cc")
+t = bld.SAMBA_GENERATOR('VERSION', 
+rule=write_version_header,
+source= 'VERSION',
+target=target)
 Build.BuildContext.SAMBA_MKVERSION = SAMBA_MKVERSION
-
diff --git a/buildtools/wafsamba/samba_version.py 
b/buildtools/wafsamba/samba_version.py
new file mode 100644
index 000..9832c79
--- /dev/null
+++ b/buildtools/wafsamba/samba_version.py
@@ -0,0 +1,170 @@
+import os;
+import subprocess;
+
+class samba_version(object):
+def __init__(self, version_dict):
+'''Determine the version number of samba
+
+See VERSION for the format.  Entries on that file are 
+also accepted as dictionary entries here
+'''
+
+self.MAJOR=None
+self.MINOR=None
+self.RELEASE=None
+self.REVISION=None
+self.TP_RELEASE=None
+self.ALPHA_RELEASE=None
+self.PRE_RELEASE=None
+self.RC_RELEASE=None
+self.IS_GIT_SNAPSHOT=True
+self.RELEASE_NICKNAME=None
+self.VENDOR_SUFFIX=None
+self.VENDOR_PATCH=None
+
+for a, b in version_dict.iteritems():
+if a.startswith("SAMBA_VERSION_"):
+setattr(self, a[14:], b)
+else:
+setattr(self, a, b)
+
+if self.IS_GIT_SNAPSHOT is "yes":
+self.IS_GIT_SNAPSHOT=True
+elif self.IS_GIT_SNAPSHOT is "no":
+self.IS_GIT_SNAPSHOT=False
+
+ ##
+ ## start with "3.0.22"
+ ##
+self.MAJOR=int(self.MAJOR)
+self.MINOR=int(self.MINOR)
+self.RELEASE=int(self.RELEASE)
+
+SAMBA_VERSION_STRING = ("%u.%u.%u" % (self.MAJOR, self.MINOR, 
self.RELEASE))
+
+##
+## maybe add "3.0.22a" or "4.0.0tp11" or "4.0.0alpha1" or "3.0.22pre1" or 
"3.0.22rc1"
+## We do not do pre or rc version on patch/letter releases
+##
+if self.REVISION is not None:
+SAMBA_VERSION_STRING += self.REVISION
+if self.TP_RELEASE is not None:
+self.TP_RELEASE = int(self.TP_RELEASE)
+SAMBA_VERSION_STRING += ("tp%u" % self.TP_RELEASE)
+if self.ALPHA_RELEASE is not None:
+self.ALPHA_RELEASE = int(self.ALPHA_RELEASE)
+SAMBA_VERSION_STRING += ("alpha%u" % self.ALPHA_RELEASE)
+if self.PRE_RELEASE is not None:
+self.PRE_RELEASE = int(self.PRE_RELEASE)
+SAMBA_VERSION_STRING += ("pre%u" % self.PRE_RELEASE)
+if self.RC_RELEASE is not None:
+self.RC_RELEASE = int(self.RC_RELEASE)
+SAMBA_VERSION_STRING += ("rc%u" % self.RC_RELEASE)
+
+if self.IS_GIT_SNAPSHOT:
+#Get version from GIT
+try:
+git = subprocess.Popen('git show 
--pretty=format:"%h%n%ct%n%H%n%cd" --stat HEAD', stdout=subprocess.PIP