[SCM] Samba Shared Repository - branch master updated

2010-12-20 Thread Kamen Mazdrashki
The branch, master has been updated
   via  33a57db s4-pydsdb: Use local memory context in 
py_dsdb_get_oid_from_attid()
  from  e1d3de3 dnspython: Merge in new upstream.

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


- Log -
commit 33a57db3a542c364eb82499e5765a2caef00af33
Author: Kamen Mazdrashki kame...@samba.org
Date:   Mon Dec 20 11:39:26 2010 +0200

s4-pydsdb: Use local memory context in py_dsdb_get_oid_from_attid()

This version reverts changes from commit 
b974966cc2b4d0b5b0d83206070b5f7c5c6495d1
and is what Matthieu Patou had commited in 
d784ecec555a3d9737e6f4b3894f27904d2b833c
with added reference to the schema cache.

I think referencing schema here is the right thing to be done
as thus we garantee that schema cache will stay in memory
for the time our function is executed

Autobuild-User: Kamen Mazdrashki kame...@samba.org
Autobuild-Date: Mon Dec 20 12:01:53 CET 2010 on sn-devel-104

---

Summary of changes:
 source4/dsdb/pydsdb.c |   20 
 1 files changed, 16 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c
index af03504..1a51b86 100644
--- a/source4/dsdb/pydsdb.c
+++ b/source4/dsdb/pydsdb.c
@@ -249,25 +249,37 @@ static PyObject *py_dsdb_get_oid_from_attid(PyObject 
*self, PyObject *args)
const char *oid;
PyObject *ret;
WERROR status;
+   TALLOC_CTX *mem_ctx;
 
if (!PyArg_ParseTuple(args, Oi, py_ldb, attid))
return NULL;
 
PyErr_LDB_OR_RAISE(py_ldb, ldb);
 
-   schema = dsdb_get_schema(ldb, NULL);
+   mem_ctx = talloc_new(NULL);
+   if (!mem_ctx) {
+   PyErr_NoMemory();
+   return NULL;
+   }
 
+   schema = dsdb_get_schema(ldb, mem_ctx);
if (!schema) {
PyErr_SetString(PyExc_RuntimeError, Failed to find a schema 
from ldb \n);
+   talloc_free(mem_ctx);
return NULL;
}

status = dsdb_schema_pfm_oid_from_attid(schema-prefixmap, attid,
-   NULL, oid);
-   PyErr_WERROR_IS_ERR_RAISE(status);
+   mem_ctx, oid);
+   if (!W_ERROR_IS_OK(status)) {
+   PyErr_SetWERROR(status);
+   talloc_free(mem_ctx);
+   return NULL;
+   }
 
ret = PyString_FromString(oid);
-   talloc_free(discard_const_p(char, oid));
+
+   talloc_free(mem_ctx);
 
return ret;
 }


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-20 Thread Günther Deschner
The branch, master has been updated
   via  9dce43a s4-smbtorture: run the winreg tests also against an added 
driver.
  from  33a57db s4-pydsdb: Use local memory context in 
py_dsdb_get_oid_from_attid()

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


- Log -
commit 9dce43a809eae4b44bf1e2b301844a0753c037e9
Author: Günther Deschner g...@samba.org
Date:   Fri Dec 17 16:34:47 2010 +0100

s4-smbtorture: run the winreg tests also against an added driver.

Guenther

Autobuild-User: Günther Deschner g...@samba.org
Autobuild-Date: Mon Dec 20 14:31:43 CET 2010 on sn-devel-104

---

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


Changeset truncated at 500 lines:

diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index 114b3e1..630694d 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -8628,6 +8628,25 @@ static bool test_PrinterDriver_args(struct 
torture_context *tctx,
return ret;
}
 
+   {
+   struct dcerpc_pipe *p2;
+   struct policy_handle hive_handle;
+   struct dcerpc_binding_handle *b2;
+
+   torture_assert_ntstatus_ok(tctx,
+   torture_rpc_connection(tctx, p2, ndr_table_winreg),
+   could not open winreg pipe);
+   b2 = p2-binding_handle;
+
+   torture_assert(tctx, test_winreg_OpenHKLM(tctx, b2, 
hive_handle), );
+
+   ret = test_GetDriverInfo_winreg(tctx, b, NULL, NULL, 
r-driver_name, r-architecture, r-version, b2, hive_handle, server_name);
+
+   test_winreg_CloseKey(tctx, b2, hive_handle);
+
+   talloc_free(p2);
+   }
+
if (ex) {
return test_DeletePrinterDriverEx(tctx, b, server_name, 
r-driver_name, r-architecture, delete_flags, r-version);
} else {


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-20 Thread Volker Lendecke
The branch, master has been updated
   via  bfc4fe4 s3: Remove unused retry from cli_start_connection
   via  d096de5 s3: Remove unused retry from cli_full_connection
   via  6601906 s3: Always retry the DC connection in auth_domain
   via  09cccee s3: Remove some unused variables
  from  9dce43a s4-smbtorture: run the winreg tests also against an added 
driver.

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


- Log -
commit bfc4fe401259085f9e17c75a7ec171be0bc5f35f
Author: Volker Lendecke v...@samba.org
Date:   Mon Dec 20 16:43:39 2010 +0100

s3: Remove unused retry from cli_start_connection

Autobuild-User: Volker Lendecke vlen...@samba.org
Autobuild-Date: Mon Dec 20 17:58:33 CET 2010 on sn-devel-104

commit d096de56b16c50c7cc22df08895dc29567ee15d7
Author: Volker Lendecke v...@samba.org
Date:   Mon Dec 20 16:37:23 2010 +0100

s3: Remove unused retry from cli_full_connection

commit 660190632e4f8ace65f4944f4686ea42444056c0
Author: Volker Lendecke v...@samba.org
Date:   Mon Dec 20 16:22:02 2010 +0100

s3: Always retry the DC connection in auth_domain

The only condition that cli_full_connection marks as non-retryable is the 
basic
name lookup and TCP connect. To me this is pretty fishy. For example if the
negprot fails, this is supposed to be more retryable than a NetBIOS name 
lookup
failure? I'd rather think the opposite is true.

Jeremy, this is code from 2002, 389a16d9d533. If you have any comments from
back then, let me know :-)

Volker

commit 09cccee27302044dd2fa3e94c60bf7854c4d2e45
Author: Volker Lendecke v...@samba.org
Date:   Mon Dec 20 15:58:55 2010 +0100

s3: Remove some unused variables

---

Summary of changes:
 libgpo/gpo_fetch.c  |2 +-
 source3/auth/auth_domain.c  |   12 
 source3/client/smbspool.c   |2 +-
 source3/include/proto.h |6 ++
 source3/libnet/libnet_join.c|6 +++---
 source3/libsmb/cliconnect.c |   19 ---
 source3/libsmb/libsmb_server.c  |2 +-
 source3/libsmb/trusts_util.c|5 ++---
 source3/rpc_server/srv_spoolss_nt.c |2 +-
 source3/rpcclient/cmd_spoolss.c |2 +-
 source3/rpcclient/rpcclient.c   |3 +--
 source3/torture/locktest2.c |2 +-
 source3/torture/torture.c   |8 +++-
 source3/utils/net_ads.c |2 +-
 source3/utils/net_util.c|6 +++---
 source3/utils/netlookup.c   |3 +--
 source3/utils/smbcacls.c|3 +--
 source3/utils/smbcquotas.c  |3 +--
 18 files changed, 32 insertions(+), 56 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libgpo/gpo_fetch.c b/libgpo/gpo_fetch.c
index ad6c2a8..00f9b5c 100644
--- a/libgpo/gpo_fetch.c
+++ b/libgpo/gpo_fetch.c
@@ -150,7 +150,7 @@ static NTSTATUS gpo_connect_server(ADS_STRUCT *ads, struct 
loadparm_context *lp_
ads-auth.password,
CLI_FULL_CONNECTION_USE_KERBEROS |
CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS,
-   Undefined, NULL);
+   Undefined);
if (!NT_STATUS_IS_OK(result)) {
DEBUG(10,(check_refresh_gpo: 
failed to connect: %s\n,
diff --git a/source3/auth/auth_domain.c b/source3/auth/auth_domain.c
index cac482c..0f541cd 100644
--- a/source3/auth/auth_domain.c
+++ b/source3/auth/auth_domain.c
@@ -113,8 +113,7 @@ static NTSTATUS connect_to_domain_password_server(struct 
cli_state **cli,
const char *domain,
const char *dc_name,
struct sockaddr_storage *dc_ss, 
-   struct rpc_pipe_client 
**pipe_ret,
-   bool *retry)
+   struct rpc_pipe_client 
**pipe_ret)
 {
 NTSTATUS result;
struct rpc_pipe_client *netlogon_pipe = NULL;
@@ -143,9 +142,8 @@ static NTSTATUS connect_to_domain_password_server(struct 
cli_state **cli,
}
 
/* Attempt connection */
-   *retry = True;
result = cli_full_connection(cli, global_myname(), dc_name, dc_ss, 0, 
-   IPC$, IPC, , , , 0, Undefined, retry);
+   IPC$, IPC, , , , 0, Undefined);
 
if (!NT_STATUS_IS_OK(result)) {
/* map to something more useful */
@@ -267,7 +265,6 @@ static NTSTATUS domain_client_validate(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *netlogon_pipe = NULL;
NTSTATUS nt_status = NT_STATUS_NO_LOGON_SERVERS;
int i;
-   bool retry = True;
 
/*
 * At this point, 

[SCM] Samba Shared Repository - branch master updated

2010-12-20 Thread Andreas Schneider
The branch, master has been updated
   via  139e2cb s3-printing: fix printer_list_traverse()
  from  bfc4fe4 s3: Remove unused retry from cli_start_connection

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


- Log -
commit 139e2cbb13ca230b65ad4b1f5ff91a795d8cca02
Author: David Disseldorp dd...@suse.de
Date:   Mon Dec 20 16:08:02 2010 +0100

s3-printing: fix printer_list_traverse()

The tdb traverse function returns the number of elements traversed, or
less than zero on error, printer_list_traverse() is incorrectly checking
for non-zero return.

Autobuild-User: Andreas Schneider a...@samba.org
Autobuild-Date: Mon Dec 20 18:44:41 CET 2010 on sn-devel-104

---

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


Changeset truncated at 500 lines:

diff --git a/source3/printing/printer_list.c b/source3/printing/printer_list.c
index edc398b..f3f00f0 100644
--- a/source3/printing/printer_list.c
+++ b/source3/printing/printer_list.c
@@ -293,7 +293,7 @@ static NTSTATUS printer_list_traverse(printer_list_trv_fn_t 
*fn,
}
 
ret = db-traverse(db, fn, private_data);
-   if (ret != 0) {
+   if (ret  0) {
return NT_STATUS_UNSUCCESSFUL;
}
 


-- 
Samba Shared Repository


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

2010-12-20 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  eb03383 From metze's work on sparse attributes. 
FILE_ATTRIBUTE_SPARSE is valid on get but not on set. (cherry picked from 
commit e9f9e803f03be20e5f573484be7b5e7351472786)
   via  22d9791 s3-printing: fix printer_list_traverse()
  from  f1c3c4b s3: Fix bug 7066 -- wbcAuthenticateEx gives unix times

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


- Log -
commit eb03383e8a51f489f30412f7be23aace4a36c24c
Author: Jeremy Allison j...@samba.org
Date:   Mon Dec 20 10:23:27 2010 -0800

From metze's work on sparse attributes. FILE_ATTRIBUTE_SPARSE is valid on 
get but not on set.
(cherry picked from commit e9f9e803f03be20e5f573484be7b5e7351472786)

commit 22d979142941ac4135b20c937156a83d8439fb06
Author: David Disseldorp dd...@suse.de
Date:   Mon Dec 20 16:08:02 2010 +0100

s3-printing: fix printer_list_traverse()

The tdb traverse function returns the number of elements traversed, or
less than zero on error, printer_list_traverse() is incorrectly checking
for non-zero return.

Autobuild-User: Andreas Schneider a...@samba.org
Autobuild-Date: Mon Dec 20 18:44:41 CET 2010 on sn-devel-104
(cherry picked from commit 139e2cbb13ca230b65ad4b1f5ff91a795d8cca02)

---

Summary of changes:
 source3/include/smb.h   |3 +--
 source3/printing/printer_list.c |2 +-
 source3/smbd/dosmode.c  |3 ++-
 3 files changed, 4 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/smb.h b/source3/include/smb.h
index b87caf2..2b397cc 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -1211,8 +1211,7 @@ struct bitmap {
FILE_ATTRIBUTE_HIDDEN|\
FILE_ATTRIBUTE_SYSTEM|\
FILE_ATTRIBUTE_DIRECTORY|\
-   FILE_ATTRIBUTE_ARCHIVE|\
-   FILE_ATTRIBUTE_SPARSE)
+   FILE_ATTRIBUTE_ARCHIVE)
 
 /* Flags - combined with attributes. */
 #define FILE_FLAG_WRITE_THROUGH0x8000L
diff --git a/source3/printing/printer_list.c b/source3/printing/printer_list.c
index edc398b..f3f00f0 100644
--- a/source3/printing/printer_list.c
+++ b/source3/printing/printer_list.c
@@ -293,7 +293,7 @@ static NTSTATUS printer_list_traverse(printer_list_trv_fn_t 
*fn,
}
 
ret = db-traverse(db, fn, private_data);
-   if (ret != 0) {
+   if (ret  0) {
return NT_STATUS_UNSUCCESSFUL;
}
 
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 628f887..2c6dcd0 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -318,7 +318,8 @@ static bool get_ea_dos_attribute(connection_struct *conn,
if (S_ISDIR(smb_fname-st.st_ex_mode)) {
dosattr |= aDIR;
}
-   *pattr = (uint32)(dosattr  SAMBA_ATTRIBUTES_MASK);
+   /* FILE_ATTRIBUTE_SPARSE is valid on get but not on set. */
+   *pattr = (uint32)(dosattr  
(SAMBA_ATTRIBUTES_MASK|FILE_ATTRIBUTE_SPARSE));
 
DEBUG(8,(get_ea_dos_attribute returning (0x%x), dosattr));
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-20 Thread Jeremy Allison
The branch, master has been updated
   via  e7707d5 From metze's work on sparse attributes. 
FILE_ATTRIBUTE_SPARSE is valid on get but not on set.
  from  139e2cb s3-printing: fix printer_list_traverse()

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


- Log -
commit e7707d5abd7365c89405963c7cac0c0382d9179e
Author: Jeremy Allison j...@samba.org
Date:   Mon Dec 20 10:23:27 2010 -0800

From metze's work on sparse attributes. FILE_ATTRIBUTE_SPARSE is valid on 
get but not on set.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Mon Dec 20 20:11:22 CET 2010 on sn-devel-104

---

Summary of changes:
 source3/include/smb.h  |3 +--
 source3/smbd/dosmode.c |3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/smb.h b/source3/include/smb.h
index b87caf2..2b397cc 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -1211,8 +1211,7 @@ struct bitmap {
FILE_ATTRIBUTE_HIDDEN|\
FILE_ATTRIBUTE_SYSTEM|\
FILE_ATTRIBUTE_DIRECTORY|\
-   FILE_ATTRIBUTE_ARCHIVE|\
-   FILE_ATTRIBUTE_SPARSE)
+   FILE_ATTRIBUTE_ARCHIVE)
 
 /* Flags - combined with attributes. */
 #define FILE_FLAG_WRITE_THROUGH0x8000L
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 628f887..2c6dcd0 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -318,7 +318,8 @@ static bool get_ea_dos_attribute(connection_struct *conn,
if (S_ISDIR(smb_fname-st.st_ex_mode)) {
dosattr |= aDIR;
}
-   *pattr = (uint32)(dosattr  SAMBA_ATTRIBUTES_MASK);
+   /* FILE_ATTRIBUTE_SPARSE is valid on get but not on set. */
+   *pattr = (uint32)(dosattr  
(SAMBA_ATTRIBUTES_MASK|FILE_ATTRIBUTE_SPARSE));
 
DEBUG(8,(get_ea_dos_attribute returning (0x%x), dosattr));
 


-- 
Samba Shared Repository


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

2010-12-20 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  7dff32f CREATE in a compound CREATE/NOTIFY sequence was being 
passed through set_operation_credits() twice (ultimately perhaps because of bug 
7331 involving this compound sequence and the need to be ready for any incoming 
CANCEL of the NOTIFY). This had the server thinking it had granted more credit 
than it actually had, which lead to zero-credits being granted in interim 
NOTIFY responses. (cherry picked from commit 
0a9b65262c76fdad8331fbc580dbe578a403407b)
  from  eb03383 From metze's work on sparse attributes. 
FILE_ATTRIBUTE_SPARSE is valid on get but not on set. (cherry picked from 
commit e9f9e803f03be20e5f573484be7b5e7351472786)

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


- Log -
commit 7dff32fb7263cfdce015ffd66ea9997685edf817
Author: Ken Harris ken.har...@mathworks.com
Date:   Mon Dec 20 10:44:48 2010 -0800

CREATE in a compound CREATE/NOTIFY sequence was being passed through 
set_operation_credits()
twice (ultimately perhaps because of bug 7331 involving this compound 
sequence and the need
to be ready for any incoming CANCEL of the NOTIFY). This had the server 
thinking it had
granted more credit than it actually had, which lead to zero-credits being 
granted in interim
NOTIFY responses.
(cherry picked from commit 0a9b65262c76fdad8331fbc580dbe578a403407b)

---

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


Changeset truncated at 500 lines:

diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 924e41f..025f403 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -1443,23 +1443,6 @@ static NTSTATUS smbd_smb2_request_reply(struct 
smbd_smb2_request *req)
 
req-subreq = NULL;
 
-   smb2_setup_nbt_length(req-out.vector, req-out.vector_count);
-
-   /* Set credit for this operation (zero credits if this
-  is a final reply for an async operation). */
-   smb2_set_operation_credit(req-sconn,
-   req-async ? NULL : req-in.vector[i],
-   req-out.vector[i]);
-
-   if (req-do_signing) {
-   NTSTATUS status;
-   status = smb2_signing_sign_pdu(req-session-session_key,
-  req-out.vector[i], 3);
-   if (!NT_STATUS_IS_OK(status)) {
-   return status;
-   }
-   }
-
req-current_idx += 3;
 
if (req-current_idx  req-out.vector_count) {
@@ -1482,6 +1465,23 @@ static NTSTATUS smbd_smb2_request_reply(struct 
smbd_smb2_request *req)
return NT_STATUS_OK;
}
 
+   smb2_setup_nbt_length(req-out.vector, req-out.vector_count);
+
+   /* Set credit for this operation (zero credits if this
+  is a final reply for an async operation). */
+   smb2_set_operation_credit(req-sconn,
+   req-async ? NULL : req-in.vector[i],
+   req-out.vector[i]);
+
+   if (req-do_signing) {
+   NTSTATUS status;
+   status = smb2_signing_sign_pdu(req-session-session_key,
+  req-out.vector[i], 3);
+   if (!NT_STATUS_IS_OK(status)) {
+   return status;
+   }
+   }
+
if (DEBUGLEVEL = 10) {
dbgtext(smbd_smb2_request_reply: sending...\n);
print_req_vectors(req);


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-20 Thread Jeremy Allison
The branch, master has been updated
   via  09aea03 CREATE in a compound CREATE/NOTIFY sequence was being 
passed through set_operation_credits() twice (ultimately perhaps because of bug 
7331 involving this compound sequence and the need to be ready for any incoming 
CANCEL of the NOTIFY). This had the server thinking it had granted more credit 
than it actually had, which lead to zero-credits being granted in interim 
NOTIFY responses.
  from  e7707d5 From metze's work on sparse attributes. 
FILE_ATTRIBUTE_SPARSE is valid on get but not on set.

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


- Log -
commit 09aea038139f8717d38f0fdae6be9cf46bd86b15
Author: Ken Harris ken.har...@mathworks.com
Date:   Mon Dec 20 10:44:48 2010 -0800

CREATE in a compound CREATE/NOTIFY sequence was being passed through 
set_operation_credits()
twice (ultimately perhaps because of bug 7331 involving this compound 
sequence and the need
to be ready for any incoming CANCEL of the NOTIFY). This had the server 
thinking it had
granted more credit than it actually had, which lead to zero-credits being 
granted in interim
NOTIFY responses.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Mon Dec 20 20:59:55 CET 2010 on sn-devel-104

---

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


Changeset truncated at 500 lines:

diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 924e41f..025f403 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -1443,23 +1443,6 @@ static NTSTATUS smbd_smb2_request_reply(struct 
smbd_smb2_request *req)
 
req-subreq = NULL;
 
-   smb2_setup_nbt_length(req-out.vector, req-out.vector_count);
-
-   /* Set credit for this operation (zero credits if this
-  is a final reply for an async operation). */
-   smb2_set_operation_credit(req-sconn,
-   req-async ? NULL : req-in.vector[i],
-   req-out.vector[i]);
-
-   if (req-do_signing) {
-   NTSTATUS status;
-   status = smb2_signing_sign_pdu(req-session-session_key,
-  req-out.vector[i], 3);
-   if (!NT_STATUS_IS_OK(status)) {
-   return status;
-   }
-   }
-
req-current_idx += 3;
 
if (req-current_idx  req-out.vector_count) {
@@ -1482,6 +1465,23 @@ static NTSTATUS smbd_smb2_request_reply(struct 
smbd_smb2_request *req)
return NT_STATUS_OK;
}
 
+   smb2_setup_nbt_length(req-out.vector, req-out.vector_count);
+
+   /* Set credit for this operation (zero credits if this
+  is a final reply for an async operation). */
+   smb2_set_operation_credit(req-sconn,
+   req-async ? NULL : req-in.vector[i],
+   req-out.vector[i]);
+
+   if (req-do_signing) {
+   NTSTATUS status;
+   status = smb2_signing_sign_pdu(req-session-session_key,
+  req-out.vector[i], 3);
+   if (!NT_STATUS_IS_OK(status)) {
+   return status;
+   }
+   }
+
if (DEBUGLEVEL = 10) {
dbgtext(smbd_smb2_request_reply: sending...\n);
print_req_vectors(req);


-- 
Samba Shared Repository


[SCM] Samba Website Repository - branch master updated

2010-12-20 Thread Jim McDonough
The branch, master has been updated
   via  d2e2b00 Update addresses for Conservancy
  from  932dd98 Updated entries for PrimaStasys.

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


- Log -
commit d2e2b007ca9fa7c103ba24d0a0a75702831c2912
Author: Jim McDonough j...@samba.org
Date:   Mon Dec 20 15:25:14 2010 -0500

Update addresses for Conservancy

---

Summary of changes:
 donations.html |8 
 1 files changed, 4 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/donations.html b/donations.html
index bc26511..bdeb9dd 100755
--- a/donations.html
+++ b/donations.html
@@ -32,9 +32,9 @@ src=https://www.paypal.com/en_US/i/btn/x-click-but21.gif; 
border=0 name=subm
 
 pre
Samba Team
-   c/o The Software Freedom Conservancy
-   1995 BROADWAY FL 17
-   NEW YORK NY 10023-5882
+   c/o Software Freedom Conservancy, Inc.
+   137 Montague St Ste 380
+   Brooklyn, NY 11201-3548
 /pre
 
 br
@@ -47,7 +47,7 @@ the USA, so donations in the USA may be tax-deductible./p
 pIf you would like to make a larger corporate donation then we would 
certainly
 like to discuss that. Please send a email to 
 a
-href=mailto:conserva...@softwarefreedom.org;conserva...@softwarefreedom.org/a
+href=mailto:donat...@sfconservancy.org;donat...@sfconservancy.org/a
 or talk to any Samba Team member./p
 
 h3Why do we need money?/h3


-- 
Samba Website Repository


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

2010-12-20 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  132c57d Added call out to a Linux-compatible fallocate() when we 
need to extend a file allocation extent without changing end-of-file size. 
(cherry picked from commit 00d2d16262909fde2c144a504d7d554767b7fd45)
  from  7dff32f CREATE in a compound CREATE/NOTIFY sequence was being 
passed through set_operation_credits() twice (ultimately perhaps because of bug 
7331 involving this compound sequence and the need to be ready for any incoming 
CANCEL of the NOTIFY). This had the server thinking it had granted more credit 
than it actually had, which lead to zero-credits being granted in interim 
NOTIFY responses. (cherry picked from commit 
0a9b65262c76fdad8331fbc580dbe578a403407b)

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


- Log -
commit 132c57df21571ad0400e3d26e5e0a0db3a9d9fd7
Author: Jeremy Allison j...@samba.org
Date:   Mon Dec 20 16:53:16 2010 -0800

Added call out to a Linux-compatible fallocate() when we need to extend a 
file
allocation extent without changing end-of-file size.
(cherry picked from commit 00d2d16262909fde2c144a504d7d554767b7fd45)

---

Summary of changes:
 source3/configure.in  |   35 +++
 source3/include/proto.h   |1 +
 source3/lib/system.c  |   35 +++
 source3/modules/vfs_default.c |5 +++--
 source3/smbd/vfs.c|   13 -
 5 files changed, 86 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/configure.in b/source3/configure.in
index 5f81a19..c772f58 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -741,6 +741,7 @@ AC_CHECK_HEADERS(sys/syslog.h syslog.h)
 AC_CHECK_HEADERS(langinfo.h locale.h)
 AC_CHECK_HEADERS(xfs/libxfs.h)
 AC_CHECK_HEADERS(netgroup.h)
+AC_CHECK_HEADERS(linux/falloc.h)
 
 AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[
 #if HAVE_RPC_RPC_H
@@ -1095,6 +1096,7 @@ AC_CHECK_FUNCS(sigprocmask sigblock sigaction sigset 
innetgr setnetgrent getnetg
 AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf)
 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf stat64 fstat64)
 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt lseek64 ftruncate64 
posix_fallocate posix_fallocate64)
+AC_CHECK_FUNCS(fallocate fallocate64)
 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam)
 AC_CHECK_FUNCS(opendir64 readdir64 seekdir64 telldir64 rewinddir64 closedir64)
 AC_CHECK_FUNCS(getpwent_r)
@@ -2563,6 +2565,39 @@ fi
 fi
 # end utmp details
 
+AC_CACHE_CHECK([for linux fallocate],samba_cv_HAVE_LINUX_FALLOCATE,[
+AC_TRY_COMPILE([
+#if defined(HAVE_UNISTD_H)
+#include unistd.h
+#endif
+#include sys/types.h
+#define _GNU_SOURCE
+#include fcntl.h
+#if defined(HAVE_LINUX_FALLOC_H)
+#include linux/falloc.h
+#endif],
+[int ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 10);],
+samba_cv_HAVE_LINUX_FALLOCATE=yes,samba_cv_HAVE_LINUX_FALLOCATE=no)])
+if test x$samba_cv_HAVE_LINUX_FALLOCATE = xyes  test 
x$ac_cv_func_fallocate = xyes; then
+AC_DEFINE(HAVE_LINUX_FALLOCATE,1,[Whether the Linux 'fallocate' function 
is available])
+fi
+
+AC_CACHE_CHECK([for linux fallocate64],samba_cv_HAVE_LINUX_FALLOCATE64,[
+AC_TRY_COMPILE([
+#if defined(HAVE_UNISTD_H)
+#include unistd.h
+#endif
+#include sys/types.h
+#define _GNU_SOURCE
+#include fcntl.h
+#if defined(HAVE_LINUX_FALLOC_H)
+#include linux/falloc.h
+#endif],
+[int ret = fallocate64(0, FALLOC_FL_KEEP_SIZE, 0, 10);],
+samba_cv_HAVE_LINUX_FALLOCATE64=yes,samba_cv_HAVE_LINUX_FALLOCATE64=no)])
+if test x$samba_cv_HAVE_LINUX_FALLOCATE64 = xyes  test 
x$ac_cv_func_fallocate64 = xyes; then
+AC_DEFINE(HAVE_LINUX_FALLOCATE64,1,[Whether the Linux 'fallocate64' 
function is available])
+fi
 
 ICONV_LOOK_DIRS=/usr /usr/local /sw /opt
 AC_ARG_WITH(libiconv,
diff --git a/source3/include/proto.h b/source3/include/proto.h
index e26f43e..8b2ba95 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -888,6 +888,7 @@ int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf,
  bool fake_dir_create_times);
 int sys_ftruncate(int fd, SMB_OFF_T offset);
 int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len);
+int sys_fallocate(int fd, enum vfs_fallocate_mode mode, SMB_OFF_T offset, 
SMB_OFF_T len);
 SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence);
 int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence);
 SMB_OFF_T sys_ftell(FILE *fp);
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 1c00ad8..d5b833c 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -695,6 +695,41 @@ int sys_posix_fallocate(int fd, SMB_OFF_T offset, 
SMB_OFF_T len)
 }
 
 /***
+ An fallocate() function that matches the semantics of the Linux one.

[SCM] Samba Shared Repository - branch master updated

2010-12-20 Thread Jeremy Allison
The branch, master has been updated
   via  8998f4b Added call out to a Linux-compatible fallocate() when we 
need to extend a file allocation extent without changing end-of-file size.
  from  09aea03 CREATE in a compound CREATE/NOTIFY sequence was being 
passed through set_operation_credits() twice (ultimately perhaps because of bug 
7331 involving this compound sequence and the need to be ready for any incoming 
CANCEL of the NOTIFY). This had the server thinking it had granted more credit 
than it actually had, which lead to zero-credits being granted in interim 
NOTIFY responses.

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


- Log -
commit 8998f4b01310e4b45e75d8d5f3260b5ba5c1cdf9
Author: Jeremy Allison j...@samba.org
Date:   Mon Dec 20 16:53:16 2010 -0800

Added call out to a Linux-compatible fallocate() when we need to extend a 
file
allocation extent without changing end-of-file size.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Tue Dec 21 02:41:24 CET 2010 on sn-devel-104

---

Summary of changes:
 source3/configure.in  |   35 +++
 source3/include/proto.h   |1 +
 source3/lib/system.c  |   35 +++
 source3/modules/vfs_default.c |5 +++--
 source3/smbd/vfs.c|   13 -
 5 files changed, 86 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/configure.in b/source3/configure.in
index b43d0b3..ed99b17 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -741,6 +741,7 @@ AC_CHECK_HEADERS(sys/syslog.h syslog.h)
 AC_CHECK_HEADERS(langinfo.h locale.h)
 AC_CHECK_HEADERS(xfs/libxfs.h)
 AC_CHECK_HEADERS(netgroup.h)
+AC_CHECK_HEADERS(linux/falloc.h)
 
 AC_CHECK_HEADERS(rpcsvc/yp_prot.h,,,[[
 #if HAVE_RPC_RPC_H
@@ -1095,6 +1096,7 @@ AC_CHECK_FUNCS(sigprocmask sigblock sigaction sigset 
innetgr setnetgrent getnetg
 AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf)
 AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf stat64 fstat64)
 AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt lseek64 ftruncate64 
posix_fallocate posix_fallocate64)
+AC_CHECK_FUNCS(fallocate fallocate64)
 AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam)
 AC_CHECK_FUNCS(opendir64 readdir64 seekdir64 telldir64 rewinddir64 closedir64)
 AC_CHECK_FUNCS(getpwent_r)
@@ -2563,6 +2565,39 @@ fi
 fi
 # end utmp details
 
+AC_CACHE_CHECK([for linux fallocate],samba_cv_HAVE_LINUX_FALLOCATE,[
+AC_TRY_COMPILE([
+#if defined(HAVE_UNISTD_H)
+#include unistd.h
+#endif
+#include sys/types.h
+#define _GNU_SOURCE
+#include fcntl.h
+#if defined(HAVE_LINUX_FALLOC_H)
+#include linux/falloc.h
+#endif],
+[int ret = fallocate(0, FALLOC_FL_KEEP_SIZE, 0, 10);],
+samba_cv_HAVE_LINUX_FALLOCATE=yes,samba_cv_HAVE_LINUX_FALLOCATE=no)])
+if test x$samba_cv_HAVE_LINUX_FALLOCATE = xyes  test 
x$ac_cv_func_fallocate = xyes; then
+AC_DEFINE(HAVE_LINUX_FALLOCATE,1,[Whether the Linux 'fallocate' function 
is available])
+fi
+
+AC_CACHE_CHECK([for linux fallocate64],samba_cv_HAVE_LINUX_FALLOCATE64,[
+AC_TRY_COMPILE([
+#if defined(HAVE_UNISTD_H)
+#include unistd.h
+#endif
+#include sys/types.h
+#define _GNU_SOURCE
+#include fcntl.h
+#if defined(HAVE_LINUX_FALLOC_H)
+#include linux/falloc.h
+#endif],
+[int ret = fallocate64(0, FALLOC_FL_KEEP_SIZE, 0, 10);],
+samba_cv_HAVE_LINUX_FALLOCATE64=yes,samba_cv_HAVE_LINUX_FALLOCATE64=no)])
+if test x$samba_cv_HAVE_LINUX_FALLOCATE64 = xyes  test 
x$ac_cv_func_fallocate64 = xyes; then
+AC_DEFINE(HAVE_LINUX_FALLOCATE64,1,[Whether the Linux 'fallocate64' 
function is available])
+fi
 
 ICONV_LOOK_DIRS=/usr /usr/local /sw /opt
 AC_ARG_WITH(libiconv,
diff --git a/source3/include/proto.h b/source3/include/proto.h
index dabb315..566b3f3 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -888,6 +888,7 @@ int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf,
  bool fake_dir_create_times);
 int sys_ftruncate(int fd, SMB_OFF_T offset);
 int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len);
+int sys_fallocate(int fd, enum vfs_fallocate_mode mode, SMB_OFF_T offset, 
SMB_OFF_T len);
 SMB_OFF_T sys_lseek(int fd, SMB_OFF_T offset, int whence);
 int sys_fseek(FILE *fp, SMB_OFF_T offset, int whence);
 SMB_OFF_T sys_ftell(FILE *fp);
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 02322b7..4cf6a29 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -695,6 +695,41 @@ int sys_posix_fallocate(int fd, SMB_OFF_T offset, 
SMB_OFF_T len)
 }
 
 /***
+ An fallocate() function that matches the semantics of the Linux one.
+/
+
+#ifdef HAVE_LINUX_FALLOC_H
+#include linux/falloc.h

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

2010-12-20 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  a2956e7 Keep track of the sparse status of an open file handle. 
Allows bypass of strict allocation on sparse files. Files opened as POSIX opens 
are always sparse. (cherry picked from commit 
3db2614ccd1948792cc403f0302c7516319461b2)
  from  132c57d Added call out to a Linux-compatible fallocate() when we 
need to extend a file allocation extent without changing end-of-file size. 
(cherry picked from commit 00d2d16262909fde2c144a504d7d554767b7fd45)

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


- Log -
commit a2956e7d2b66a828d7355841bcb3edfe188a12d3
Author: Jeremy Allison j...@samba.org
Date:   Mon Dec 20 17:58:33 2010 -0800

Keep track of the sparse status of an open file handle. Allows bypass of
strict allocation on sparse files. Files opened as POSIX opens are always
sparse.
(cherry picked from commit 3db2614ccd1948792cc403f0302c7516319461b2)

---

Summary of changes:
 source3/include/smb.h |1 +
 source3/modules/vfs_default.c |2 +-
 source3/smbd/dosmode.c|2 ++
 source3/smbd/fileio.c |3 ++-
 source3/smbd/open.c   |9 +
 5 files changed, 15 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/smb.h b/source3/include/smb.h
index 2b397cc..8d12fb9 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -344,6 +344,7 @@ typedef struct files_struct {
bool initial_delete_on_close; /* Only set at NTCreateX if file was 
created. */
bool delete_on_close;
bool posix_open;
+   bool is_sparse;
struct smb_filename *fsp_name;
 
struct vfs_fsp_data *vfs_extension;
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 54f38c3..9cca349 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -895,7 +895,7 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, 
files_struct *fsp, SMB_O
 
START_PROFILE(syscall_ftruncate);
 
-   if (lp_strict_allocate(SNUM(fsp-conn))) {
+   if (lp_strict_allocate(SNUM(fsp-conn))  !fsp-is_sparse) {
result = strict_allocate_ftruncate(handle, fsp, len);
END_PROFILE(syscall_ftruncate);
return result;
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 2c6dcd0..cf95348 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -911,6 +911,8 @@ NTSTATUS file_set_sparse(connection_struct *conn,
 FILE_NOTIFY_CHANGE_ATTRIBUTES,
 fsp-fsp_name-base_name);
 
+   fsp-is_sparse = sparse;
+
return NT_STATUS_OK;
 }
 
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index aec6554..da40013 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -128,7 +128,8 @@ static ssize_t real_write_file(struct smb_request *req,
 ret = vfs_write_data(req, fsp, data, n);
 } else {
fsp-fh-pos = pos;
-   if (pos  lp_strict_allocate(SNUM(fsp-conn))) {
+   if (pos  lp_strict_allocate(SNUM(fsp-conn) 
+   !fsp-is_sparse)) {
if (vfs_fill_sparse(fsp, pos) == -1) {
return -1;
}
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 80756d6..32a08b5 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2221,6 +2221,15 @@ static NTSTATUS open_file_ntcreate(connection_struct 
*conn,
}
}
 
+   /* Determine sparse flag. */
+   if (posix_open) {
+   /* POSIX opens are sparse by default. */
+   fsp-is_sparse = true;
+   } else {
+   fsp-is_sparse = (file_existed 
+   (existing_dos_attributes  FILE_ATTRIBUTE_SPARSE));
+   }
+
/*
 * Take care of inherited ACLs on created files - if default ACL not
 * selected.


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-20 Thread Andrew Tridgell
The branch, master has been updated
   via  4820c97 dns: fixed the padding for dnsp_name fields in LDAP
   via  049a16c dns: auto-calculate the wDataLength field in DNS records
   via  8c04657 s4-dns: fixed a crash bug in dlz_bind9 code
   via  b9a2852 dnsp: fixed parsing of dns_name structures
  from  8998f4b Added call out to a Linux-compatible fallocate() when we 
need to extend a file allocation extent without changing end-of-file size.

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


- Log -
commit 4820c97e9ea00e73f3188f9834a03913ed74df80
Author: Andrew Tridgell tri...@samba.org
Date:   Tue Dec 21 11:59:54 2010 +1100

dns: fixed the padding for dnsp_name fields in LDAP

all names are NUL terminated, but may have additional padding as well

Autobuild-User: Andrew Tridgell tri...@samba.org
Autobuild-Date: Tue Dec 21 03:26:26 CET 2010 on sn-devel-104

commit 049a16c8ef475f6b327292d231022fd4c5aaddf1
Author: Andrew Tridgell tri...@samba.org
Date:   Tue Dec 21 11:59:05 2010 +1100

dns: auto-calculate the wDataLength field in DNS records

we need this for creating new records

commit 8c04657600cd6702dbfc66744fe2268c59ebea0b
Author: Andrew Tridgell tri...@samba.org
Date:   Tue Dec 21 11:57:50 2010 +1100

s4-dns: fixed a crash bug in dlz_bind9 code

we need to keep el_ctx for the next part of the loop

commit b9a2852fdd68a0691ff567557824be44bb08b27a
Author: Andrew Tridgell tri...@samba.org
Date:   Wed Dec 15 23:52:32 2010 +1100

dnsp: fixed parsing of dns_name structures

its not a pad byte, its a trailing zero

---

Summary of changes:
 librpc/idl/dnsp.idl|4 ++--
 librpc/ndr/ndr_dnsp.c  |   25 -
 source4/dns_server/dlz_bind9.c |2 --
 3 files changed, 22 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/idl/dnsp.idl b/librpc/idl/dnsp.idl
index 905e420..eed0c47 100644
--- a/librpc/idl/dnsp.idl
+++ b/librpc/idl/dnsp.idl
@@ -92,7 +92,7 @@ interface dnsp
dnsp_name   nameTarget;
} dnsp_srv;
 
-   typedef [nodiscriminant] union {
+   typedef [nodiscriminant,gensize] union {
[case(DNS_TYPE_A)] [flag(NDR_BIG_ENDIAN)]   ipv4address ipv4;
[case(DNS_TYPE_NS)] dnsp_name ns;
[case(DNS_TYPE_CNAME)]  dnsp_name cname;
@@ -109,7 +109,7 @@ interface dnsp
/* this is the format for the dnsRecord attribute in the DNS
   partitions in AD */
typedef [public] struct {
-   uint16  wDataLength;
+   [value(ndr_size_dnsRecordData(data,wType,ndr-flags))] uint16 
wDataLength;
dns_record_type wType;
uint32  dwFlags;
uint32  dwSerial;
diff --git a/librpc/ndr/ndr_dnsp.c b/librpc/ndr/ndr_dnsp.c
index 256638a..ae78425 100644
--- a/librpc/ndr/ndr_dnsp.c
+++ b/librpc/ndr/ndr_dnsp.c
@@ -36,14 +36,16 @@ _PUBLIC_ void ndr_print_dnsp_name(struct ndr_print *ndr, 
const char *name,
 */
 _PUBLIC_ enum ndr_err_code ndr_pull_dnsp_name(struct ndr_pull *ndr, int 
ndr_flags, const char **name)
 {
-   uint8_t len, count;
+   uint8_t len, count, termination;
int i;
-   uint32_t total_len;
+   uint32_t total_len, raw_offset;
char *ret;
 
NDR_CHECK(ndr_pull_uint8(ndr, ndr_flags, len));
NDR_CHECK(ndr_pull_uint8(ndr, ndr_flags, count));
 
+   raw_offset = ndr-offset;
+
ret = talloc_strdup(ndr-current_mem_ctx, );
if (!ret) {
return ndr_pull_error(ndr, NDR_ERR_ALLOC, Failed to pull 
dnsp);
@@ -68,19 +70,32 @@ _PUBLIC_ enum ndr_err_code ndr_pull_dnsp_name(struct 
ndr_pull *ndr, int ndr_flag
ret[newlen-1] = 0;
total_len = newlen;
}
+   NDR_CHECK(ndr_pull_uint8(ndr, ndr_flags, termination));
+   if (termination != 0) {
+   return ndr_pull_error(ndr, NDR_ERR_ALLOC, Failed to pull dnsp 
- not NUL terminated);
+   }
+   if (ndr-offset  raw_offset + len) {
+   return ndr_pull_error(ndr, NDR_ERR_ALLOC, Failed to pull dnsp 
- overrun by %u bytes,
+ ndr-offset - (raw_offset + len));
+   }
+   /* there could be additional pad bytes */
+   while (ndr-offset  raw_offset + len) {
+   uint8_t pad;
+   NDR_CHECK(ndr_pull_uint8(ndr, ndr_flags, pad));
+   }
(*name) = ret;
-   NDR_PULL_ALIGN(ndr, 2);
return NDR_ERR_SUCCESS;
 }
 
 enum ndr_err_code ndr_push_dnsp_name(struct ndr_push *ndr, int ndr_flags, 
const char *name)
 {
int count, total_len, i;
+
/* count the dots */
for (count=i=0; name[i]; i++) {
if (name[i] == '.') count++;
}

[SCM] Samba Shared Repository - branch master updated

2010-12-20 Thread Jeremy Allison
The branch, master has been updated
   via  0a5f4f5 Keep track of the sparse status of an open file handle. 
Allows bypass of strict allocation on sparse files. Files opened as POSIX opens 
are always sparse.
  from  4820c97 dns: fixed the padding for dnsp_name fields in LDAP

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


- Log -
commit 0a5f4f523fe3dcb90033ee53c838ad6030f608b4
Author: Jeremy Allison j...@samba.org
Date:   Mon Dec 20 17:58:33 2010 -0800

Keep track of the sparse status of an open file handle. Allows bypass of
strict allocation on sparse files. Files opened as POSIX opens are always
sparse.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Tue Dec 21 04:12:22 CET 2010 on sn-devel-104

---

Summary of changes:
 source3/include/smb.h |1 +
 source3/modules/vfs_default.c |2 +-
 source3/smbd/dosmode.c|2 ++
 source3/smbd/fileio.c |3 ++-
 source3/smbd/open.c   |9 +
 5 files changed, 15 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/smb.h b/source3/include/smb.h
index 2b397cc..8d12fb9 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -344,6 +344,7 @@ typedef struct files_struct {
bool initial_delete_on_close; /* Only set at NTCreateX if file was 
created. */
bool delete_on_close;
bool posix_open;
+   bool is_sparse;
struct smb_filename *fsp_name;
 
struct vfs_fsp_data *vfs_extension;
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 54f38c3..9cca349 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -895,7 +895,7 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, 
files_struct *fsp, SMB_O
 
START_PROFILE(syscall_ftruncate);
 
-   if (lp_strict_allocate(SNUM(fsp-conn))) {
+   if (lp_strict_allocate(SNUM(fsp-conn))  !fsp-is_sparse) {
result = strict_allocate_ftruncate(handle, fsp, len);
END_PROFILE(syscall_ftruncate);
return result;
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index 2c6dcd0..cf95348 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -911,6 +911,8 @@ NTSTATUS file_set_sparse(connection_struct *conn,
 FILE_NOTIFY_CHANGE_ATTRIBUTES,
 fsp-fsp_name-base_name);
 
+   fsp-is_sparse = sparse;
+
return NT_STATUS_OK;
 }
 
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index aec6554..da40013 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -128,7 +128,8 @@ static ssize_t real_write_file(struct smb_request *req,
 ret = vfs_write_data(req, fsp, data, n);
 } else {
fsp-fh-pos = pos;
-   if (pos  lp_strict_allocate(SNUM(fsp-conn))) {
+   if (pos  lp_strict_allocate(SNUM(fsp-conn) 
+   !fsp-is_sparse)) {
if (vfs_fill_sparse(fsp, pos) == -1) {
return -1;
}
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 80756d6..32a08b5 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2221,6 +2221,15 @@ static NTSTATUS open_file_ntcreate(connection_struct 
*conn,
}
}
 
+   /* Determine sparse flag. */
+   if (posix_open) {
+   /* POSIX opens are sparse by default. */
+   fsp-is_sparse = true;
+   } else {
+   fsp-is_sparse = (file_existed 
+   (existing_dos_attributes  FILE_ATTRIBUTE_SPARSE));
+   }
+
/*
 * Take care of inherited ACLs on created files - if default ACL not
 * selected.


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2010-12-20 Thread Andrew Bartlett
The branch, master has been updated
   via  446f8a1 s4-auth Ensure that we always copy across domain groups
   via  6f7423c s4-auth Remove duplicate copies of session_info creation 
code
   via  1961d7a s4-auth rework session_info handling not to require an auth 
context
   via  94a59b7 s4-auth Remove event context from privilage database 
handling
   via  becaa18 s4-auth Remove obsolete comment
   via  912faf1 s4:dsdb/schema/schema_* - adaptions needed for removed 
const on OIDs
   via  ef618f5 s4:lib/ldb-samba/ldif_handlers.c - adaption needed for 
removed const on OIDs
   via  13fa674 s3/s4:auth SPNEGO - adaptions for the removed const from 
OIDs
   via  464b8fa librpc/ndr/ndr_*.c - remove const from OIDs
   via  3b591ca lib/util/asn1.c - remove the const specifier from OID
   via  32bae10 s4:dsdb/common/util.c - remove unused variable ndr_err
   via  89522ea s4:auth/gensec/spnego.c - remove unused variable principal
  from  0a5f4f5 Keep track of the sparse status of an open file handle. 
Allows bypass of strict allocation on sparse files. Files opened as POSIX opens 
are always sparse.

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


- Log -
commit 446f8a163cfdcfb2c4bb2b8b8adc720bf96c05a5
Author: Andrew Bartlett abart...@samba.org
Date:   Tue Dec 21 14:08:34 2010 +1100

s4-auth Ensure that we always copy across domain groups

Even if we can't calculate the local groups (because we don't have a
local SAM to do it with) we still need to include the domain groups in
the session_info token.

Andrew Bartlett

Autobuild-User: Andrew Bartlett abart...@samba.org
Autobuild-Date: Tue Dec 21 05:56:22 CET 2010 on sn-devel-104

commit 6f7423c7f1cc3a4596a955a90f315ffbf1025c3b
Author: Andrew Bartlett abart...@samba.org
Date:   Tue Dec 21 11:43:04 2010 +1100

s4-auth Remove duplicate copies of session_info creation code

We now just do or do not call into LDB based on some flags.

This means there may be some more link time dependencies, but we seem
to deal with those better now.

Andrew Bartlett

commit 1961d7a4119200b8a4ad7b0207e0cdcf2e10d3f8
Author: Andrew Bartlett abart...@samba.org
Date:   Tue Dec 21 10:19:53 2010 +1100

s4-auth rework session_info handling not to require an auth context

This reverts a previous move to have this based around the auth
subsystem, which just spread auth deps all over unrelated code.

Andrew Bartlett

commit 94a59b781ccc5a552a9141484740255977db4637
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Dec 20 21:26:35 2010 +1100

s4-auth Remove event context from privilage database handling

These local TDB operations can quite safely be handled in a new/nested
event context, rather than using the main event context.

Andrew Bartlett

commit becaa18a46f4ee14d8617c22e78da463fda823b2
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Dec 20 16:07:40 2010 +1100

s4-auth Remove obsolete comment

The code that this referred to went away in September with
7dbfeb0dc040889244a1110940af2d070f823374

Andrew Bartlett

commit 912faf1b080736a4855e3ea99b49f0ccbf76af33
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Sun Dec 19 16:37:04 2010 +0100

s4:dsdb/schema/schema_* - adaptions needed for removed const on OIDs

commit ef618f577870f28b8efd472a87d4dcf094d67d29
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Sun Dec 19 16:36:16 2010 +0100

s4:lib/ldb-samba/ldif_handlers.c - adaption needed for removed const on 
OIDs

commit 13fa6743d86ef6e51b3243cf3045242850358b43
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Wed Dec 15 17:17:09 2010 +0100

s3/s4:auth SPNEGO - adaptions for the removed const from OIDs

This is needed in order to suppress warnings.

commit 464b8fa3173de7cc801195a28b84786cb1c63833
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Wed Dec 15 17:21:04 2010 +0100

librpc/ndr/ndr_*.c - remove const from OIDs

commit 3b591caed00790c5d21b8774c7af87357c329d1c
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Wed Dec 15 17:02:49 2010 +0100

lib/util/asn1.c - remove the const specifier from OID

There is no reason to have it const since it's an allocated thing.

commit 32bae1051272e805e290e49dffb25e4a635ffdfb
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Sun Dec 19 16:30:10 2010 +0100

s4:dsdb/common/util.c - remove unused variable ndr_err

commit 89522ea5b17dea91608ca49c58bfe7d802e0638e
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Wed Dec 15 17:43:45 2010 +0100

s4:auth/gensec/spnego.c - remove unused variable principal

---

Summary of changes:
 lib/util/asn1.c  |   17 ++--
 lib/util/asn1.h