[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-159-g84d22f7
The branch, v3-2-test has been updated via 84d22f7747126608b9460f9591bb5967d871b82d (commit) from 2d3ff9c502105f92720131355b41e48be8d656c2 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test - Log - commit 84d22f7747126608b9460f9591bb5967d871b82d Author: Jeremy Allison <[EMAIL PROTECTED]> Date: Thu Nov 1 22:42:21 2007 -0700 Ensure we can't accidently do a pipe write with unread bytes in the socket buffer. Jeremy --- Summary of changes: source/smbd/reply.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source/smbd/reply.c b/source/smbd/reply.c index c83066d..de0e852 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -3949,6 +3949,11 @@ void reply_write_and_X(connection_struct *conn, struct smb_request *req) /* If it's an IPC, pass off the pipe handler. */ if (IS_IPC(conn)) { + if (req->unread_bytes) { + reply_doserror(req, ERRDOS, ERRbadmem); + END_PROFILE(SMBwriteX); + return; + } reply_pipe_write_and_X(req); END_PROFILE(SMBwriteX); return; -- Samba Shared Repository
[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-158-g2d3ff9c
The branch, v3-2-test has been updated via 2d3ff9c502105f92720131355b41e48be8d656c2 (commit) from 1c71546b6152d2930b98f766311bbd161ee0ee4e (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test - Log - commit 2d3ff9c502105f92720131355b41e48be8d656c2 Author: Jeremy Allison <[EMAIL PROTECTED]> Date: Thu Nov 1 22:24:39 2007 -0700 Be careful and take care of the correct lengths in large writeX calls. Jeremy. --- Summary of changes: source/smbd/reply.c | 16 +++- 1 files changed, 7 insertions(+), 9 deletions(-) Changeset truncated at 500 lines: diff --git a/source/smbd/reply.c b/source/smbd/reply.c index d4f3f1f..c83066d 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -3912,7 +3912,6 @@ void reply_write_and_X(connection_struct *conn, struct smb_request *req) unsigned int smb_doff; unsigned int smblen; char *data; - bool large_writeX; NTSTATUS status; START_PROFILE(SMBwriteX); @@ -3926,12 +3925,11 @@ void reply_write_and_X(connection_struct *conn, struct smb_request *req) numtowrite = SVAL(req->inbuf,smb_vwv10); smb_doff = SVAL(req->inbuf,smb_vwv11); smblen = smb_len(req->inbuf); - large_writeX = (req->wct == 14 && - (smblen > 0x || req->unread_bytes > 0x)); - /* Deal with possible LARGE_WRITEX */ - if (large_writeX) { - numtowrite |= size_t)SVAL(req->inbuf,smb_vwv9)) & 1 )<<16); + if (req->unread_bytes > 0x || + (smblen > smb_doff + 4 && + smblen - smb_doff + 4 > 0x)) { + numtowrite |= (((size_t)SVAL(req->inbuf,smb_vwv9))<<16); } if (req->unread_bytes) { @@ -3941,7 +3939,8 @@ void reply_write_and_X(connection_struct *conn, struct smb_request *req) return; } } else { - if (smb_doff > smblen || smb_doff + numtowrite > smblen) { + if (smb_doff + 4 > smblen || smb_doff + 4 + numtowrite < numtowrite || + smb_doff + 4 + numtowrite > smblen) { reply_doserror(req, ERRDOS, ERRbadmem); END_PROFILE(SMBwriteX); return; @@ -4032,8 +4031,7 @@ void reply_write_and_X(connection_struct *conn, struct smb_request *req) reply_outbuf(req, 6, 0); SSVAL(req->outbuf,smb_vwv2,nwritten); - if (large_writeX) - SSVAL(req->outbuf,smb_vwv4,(nwritten>>16)&1); + SSVAL(req->outbuf,smb_vwv4,nwritten>>16); if (nwritten < (ssize_t)numtowrite) { SCVAL(req->outbuf,smb_rcls,ERRHRD); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-157-g1c71546
The branch, v3-2-test has been updated via 1c71546b6152d2930b98f766311bbd161ee0ee4e (commit) from 779353b86d1699324149896f1ffa237c6ebe46ec (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test - Log - commit 1c71546b6152d2930b98f766311bbd161ee0ee4e Author: Jeremy Allison <[EMAIL PROTECTED]> Date: Thu Nov 1 21:51:45 2007 -0700 Ensure we detect a large writeX when using recvfile. More changes needed to make the UNIX_LARGE_WRITEX_CAP writes work (I'll add these tomorrow). Jeremy. --- Summary of changes: source/smbd/reply.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/source/smbd/reply.c b/source/smbd/reply.c index d2aa6c6..d4f3f1f 100644 --- a/source/smbd/reply.c +++ b/source/smbd/reply.c @@ -3926,7 +3926,8 @@ void reply_write_and_X(connection_struct *conn, struct smb_request *req) numtowrite = SVAL(req->inbuf,smb_vwv10); smb_doff = SVAL(req->inbuf,smb_vwv11); smblen = smb_len(req->inbuf); - large_writeX = ((req->wct == 14) && (smblen > 0x)); + large_writeX = (req->wct == 14 && + (smblen > 0x || req->unread_bytes > 0x)); /* Deal with possible LARGE_WRITEX */ if (large_writeX) { -- Samba Shared Repository
svn commit: samba r25788 - in branches/SAMBA_4_0: source/dsdb/samdb/ldb_modules testprogs/ejs
Author: abartlet Date: 2007-11-02 03:39:24 + (Fri, 02 Nov 2007) New Revision: 25788 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25788 Log: Use a single routine to handle the creation of modify requests in the linked_attributs code. This drasticly reduces the code duplication here. Andrew Bartlett Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/linked_attributes.c branches/SAMBA_4_0/testprogs/ejs/ldap.js Changeset: Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/linked_attributes.c === --- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/linked_attributes.c 2007-11-02 02:51:54 UTC (rev 25787) +++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/linked_attributes.c 2007-11-02 03:39:24 UTC (rev 25788) @@ -77,10 +77,135 @@ return ac; } +/* Common routine to handle reading the attributes and creating a + * series of modify requests */ + +static int setup_modifies(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, + struct linked_attributes_context *ac, + struct ldb_message *msg, + struct ldb_dn *olddn, struct ldb_dn *newdn) +{ + int i, j, ret = LDB_SUCCESS; + const struct dsdb_schema *schema = dsdb_get_schema(ldb); + /* Look up each of the returned attributes */ + /* Find their schema */ + /* And it is an actual entry: now create a series of modify requests */ + for (i=0; i < msg->num_elements; i++) { + int otherid; + const struct dsdb_attribute *target_attr; + const struct ldb_message_element *el = &msg->elements[i]; + const struct dsdb_attribute *schema_attr + = dsdb_attribute_by_lDAPDisplayName(schema, el->name); + if (!schema_attr) { + ldb_asprintf_errstring(ldb, + "attribute %s is not a valid attribute in schema", el->name); + return LDB_ERR_OBJECT_CLASS_VIOLATION; + } + /* We have a valid attribute, but if it's not linked they maybe we just got an extra return on our search... */ + if (schema_attr->linkID == 0) { + continue; + } + + /* Depending on which direction this link is in, we need to find it's partner */ + if ((schema_attr->linkID & 1) == 1) { + otherid = schema_attr->linkID - 1; + } else { + otherid = schema_attr->linkID + 1; + } + + /* Now find the target attribute */ + target_attr = dsdb_attribute_by_linkID(schema, otherid); + if (!target_attr) { + ldb_asprintf_errstring(ldb, + "attribute %s does not have valid link target", el->name); + return LDB_ERR_OBJECT_CLASS_VIOLATION; + } + + /* For each value being moded, we need to setup the modify */ + for (j=0; j < el->num_values; j++) { + struct ldb_message_element *ret_el; + struct ldb_request *new_req; + /* Create the modify request */ + struct ldb_message *new_msg = ldb_msg_new(ac->down_req); + if (!new_msg) { + ldb_oom(ldb); + return LDB_ERR_OPERATIONS_ERROR; + } + new_msg->dn = ldb_dn_new(new_msg, ldb, (char *)el->values[j].data); + if (!new_msg->dn) { + ldb_asprintf_errstring(ldb, + "attribute %s value %s was not a valid DN", msg->elements[i].name, + el->values[j].data); + return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX; + } + + if (olddn) { + ret = ldb_msg_add_empty(new_msg, target_attr->lDAPDisplayName, + LDB_FLAG_MOD_DELETE, &ret_el); + if (ret != LDB_SUCCESS) { + return ret; + } + ret_el->values = talloc_array(new_msg, struct ldb_val, 1); + if (!ret_el->values) { + ldb_oom(ldb); + return LDB_ERR_OPERATIONS_ERROR; + } + ret_el->valu
svn commit: samba r25787 - in branches/SAMBA_4_0/testprogs/ejs: .
Author: abartlet Date: 2007-11-02 02:51:54 + (Fri, 02 Nov 2007) New Revision: 25787 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25787 Log: Assert that we handle the group membership updating correctly, including when we delete members from the DB. Andrew Bartlett Modified: branches/SAMBA_4_0/testprogs/ejs/ldap.js Changeset: Modified: branches/SAMBA_4_0/testprogs/ejs/ldap.js === --- branches/SAMBA_4_0/testprogs/ejs/ldap.js2007-11-01 22:01:48 UTC (rev 25786) +++ branches/SAMBA_4_0/testprogs/ejs/ldap.js2007-11-02 02:51:54 UTC (rev 25787) @@ -509,6 +509,7 @@ assert(res.msgs[0].primaryGroupID == 513); // assert(res.msgs[0].sAMAccountType == 805306368); // assert(res.msgs[0].userAccountControl == 546); + assert(res.msgs[0].memberOf[0] == ("CN=ldaptestgroup2,CN=Users," + base_dn)); println("Testing ldb.search for (&(cn=ldaptestcomputer)(objectCategory=cn=computer,cn=schema,cn=configuration," + base_dn + "))"); var res2 = ldb.search("(&(cn=ldaptestcomputer)(objectCategory=cn=computer,cn=schema,cn=configuration," + base_dn + "))"); @@ -640,7 +641,26 @@ assert(res.msgs[0].nTSecurityDescriptor != undefined); assert(res.msgs[0].memberOf[0] == ("CN=ldaptestgroup2,CN=Users," + base_dn)); - ok = ldb.del(res.msgs[0].dn); +var attrs = new Array("cn", "name", "objectClass", "objectGUID", "whenCreated", "nTSecurityDescriptor", "member"); + println("Testing ldb.search for (&(cn=ldaptestgroup2)(objectClass=group))"); + var res = ldb.search("(&(cn=ldaptestgroup2)(objectClass=group))", base_dn, ldb.SCOPE_SUBTREE, attrs); + if (res.error != 0 || res.msgs.length != 1) { + println("Could not find (&(cn=ldaptestgroup2)(objectClass=group))"); + assert(res.error == 0); + assert(res.msgs.length == 1); + } + + assert(res.msgs[0].dn == ("CN=ldaptestgroup2,CN=Users," + base_dn)); + assert(res.msgs[0].cn == "ldaptestgroup2"); + assert(res.msgs[0].name == "ldaptestgroup2"); + assert(res.msgs[0].objectClass[0] == "top"); + assert(res.msgs[0].objectClass[1] == "group"); + assert(res.msgs[0].objectGUID != undefined); + assert(res.msgs[0].whenCreated != undefined); + assert(res.msgs[0].nTSecurityDescriptor != undefined); + assert(res.msgs[0].member[0] == ("CN=ldaptestuser2,CN=Users," + base_dn)); + + ok = ldb.del(("CN=ldaptestuser2,CN=Users," + base_dn)); if (ok.error != 0) { println(ok.errstr); assert(ok.error == 0);
Rev 675: patch from michael adam in http://samba.org/~tridge/ctdb
revno: 675 revision-id: [EMAIL PROTECTED] parent: [EMAIL PROTECTED] committer: Andrew Tridgell <[EMAIL PROTECTED]> branch nick: tridge timestamp: Fri 2007-11-02 13:20:29 +1100 message: patch from michael adam modified: web/download.html getting_the_code.htm-20070608005948-wn5ag3uowh6dbnwr-1 === modified file 'web/download.html' --- a/web/download.html 2007-06-12 04:43:26 + +++ b/web/download.html 2007-11-02 02:20:29 + @@ -29,7 +29,7 @@ -Samba3 ctdb verion +Samba3 ctdb version The fastest way to checkout an initial copy of the Samba3 tree with clustering patches is: rsync -avz samba.org::ftp/unpacked/samba_3_0_ctdb . @@ -49,7 +49,7 @@ Binary Packages -Note that packages are so far only available for RHEL4. Other packages +Note that packages are so far only available for RHEL5. Other packages will come later. See packages directory for package
[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-156-g779353b
The branch, v3-2-test has been updated via 779353b86d1699324149896f1ffa237c6ebe46ec (commit) via d6cdbfd875bb2653e831d314726c3240beb0a96b (commit) via b7d2fadbef044a89920da613b1aafc74a3d94e24 (commit) from 47dbddcb5361caa30ee60cf4e15bb50d557d1191 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test - Log - commit 779353b86d1699324149896f1ffa237c6ebe46ec Merge: d6cdbfd875bb2653e831d314726c3240beb0a96b 47dbddcb5361caa30ee60cf4e15bb50d557d1191 Author: Gerald (Jerry) Carter <[EMAIL PROTECTED]> Date: Thu Nov 1 21:30:43 2007 -0400 Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-test commit d6cdbfd875bb2653e831d314726c3240beb0a96b Author: Gerald (Jerry) Carter <[EMAIL PROTECTED]> Date: Thu Nov 1 15:53:44 2007 -0400 Patch 2 of 3 from Debian Samba packagers: The point is doing the following associations: - non discardable state data (all TDB files that may need to be backed up) go to statedir - shared data (codepage stuff) go to codepagedir The patch *does not change* the default location for these directories. So, there is no behaviour change when applying it. The main change is for samba developers who have to think when dealing with files that previously pertained to libdir whether they: - go in statedir - go in codepagedir - stay in libdir commit b7d2fadbef044a89920da613b1aafc74a3d94e24 Author: Gerald (Jerry) Carter <[EMAIL PROTECTED]> Date: Thu Nov 1 13:00:10 2007 -0400 Patch from Debian Samba package maintainers: Patch 1 of 3: - Patch 1 adds the new variables - Patch 2 makes uses of them for files belonging to the "state" path and the "code pages" path This patch seemed more easily acceptable, which explains why we separated it from patch 3 - Patch 3 reassigns files to the "cache" path. Indeed all "debatable" changes have been moved to that one The point is adding: - a path for non discardable state data: basically all TDB files that may need to be backed up - a path for shared data: mostly codepage stuff - a path for cache data to host files such as browse.dat, printers.tbd, .tdb All these are currently mixed in "libdir" (${prefix}/lib/samba by default). The patch keeps these new paths to point to ${prefix}/lib/samba by default and does therefore not change the software behaviour. Used alone, it just adds unused variables...so it can safely be used in sources without any behaviour change and no impact on Samba developers work. --- Summary of changes: source/Makefile.in | 16 +--- source/configure.in |7 +++ source/dynconfig.c | 31 +++ source/groupdb/mapping_ldb.c |8 source/groupdb/mapping_tdb.c |2 +- source/include/dynconfig.h |4 source/intl/lang_tdb.c |2 +- source/lib/account_pol.c |4 ++-- source/lib/sharesec.c|4 ++-- source/lib/util.c| 33 + source/lib/util_unistr.c |6 +++--- source/nmbd/nmbd_winsserver.c|4 ++-- source/param/loadparm.c |8 source/passdb/pdb_tdb.c |4 ++-- source/printing/nt_printing.c| 12 ++-- source/registry/reg_db.c | 10 +- source/registry/reg_perfcount.c |4 ++-- source/rpc_server/srv_eventlog_lib.c |4 ++-- source/winbindd/idmap_tdb.c |2 +- 19 files changed, 125 insertions(+), 40 deletions(-) Changeset truncated at 500 lines: diff --git a/source/Makefile.in b/source/Makefile.in index a1da65a..baa1828 100644 --- a/source/Makefile.in +++ b/source/Makefile.in @@ -127,6 +127,13 @@ SWATDIR = @swatdir@ # the directory where lock files go LOCKDIR = @lockdir@ +# FHS directories; equal to LOCKDIR if not using --with-fhs +CACHEDIR = @cachedir@ +STATEDIR = @statedir@ + +# Where to look for (and install) codepage databases. +CODEPAGEDIR = @codepagedir@ + # the directory where pid files go PIDDIR = @piddir@ @@ -154,7 +161,10 @@ PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \ -DLOGFILEBASE=\"$(LOGFILEBASE)\" \ -DSHLIBEXT=\"@[EMAIL PROTECTED]" \ -DCTDBDIR=\"$(CTDBDIR)\" \ - -DCONFIGDIR=\"$(CONFIGDIR)\" + -DCONFIGDIR=\"$(CONFIGDIR)\" \ + -DCODEPAGEDIR=\"$(CODEPAGEDIR)\" \ + -DCACHEDIR=\"$(CACHEDIR)\" \ + -DSTATEDIR=\"$(STATEDIR)\" # Note that all executable programs now provide for an optional executable suffix. @@ -1761,10 +1771,10 @@ installscripts: installdirs @$(SHELL) $(srcdir)/script/installscripts.sh $(INS
[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-153-g47dbddc
The branch, v3-2-test has been updated via 47dbddcb5361caa30ee60cf4e15bb50d557d1191 (commit) from b481abf5914dcafe5642c4d9394d02603e905bbb (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test - Log - commit 47dbddcb5361caa30ee60cf4e15bb50d557d1191 Author: Jeremy Allison <[EMAIL PROTECTED]> Date: Thu Nov 1 18:30:02 2007 -0700 Add brackets so as not to break the POSIX caps return. Jeremy. --- Summary of changes: source/smbd/trans2.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source/smbd/trans2.c b/source/smbd/trans2.c index 09a8fcc..c9ea029 100644 --- a/source/smbd/trans2.c +++ b/source/smbd/trans2.c @@ -2738,8 +2738,8 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned CIFS_UNIX_EXTATTR_CAP| CIFS_UNIX_POSIX_PATH_OPERATIONS_CAP| CIFS_UNIX_LARGE_READ_CAP| - large_write ? - CIFS_UNIX_LARGE_WRITE_CAP : 0))); + (large_write ? + CIFS_UNIX_LARGE_WRITE_CAP : 0; break; } -- Samba Shared Repository
Build status as of Fri Nov 2 00:00:02 2007
URL: http://build.samba.org/ --- /home/build/master/cache/broken_results.txt.old 2007-11-01 00:01:56.0 + +++ /home/build/master/cache/broken_results.txt 2007-11-02 00:00:34.0 + @@ -1,4 +1,4 @@ -Build status as of Thu Nov 1 00:00:02 2007 +Build status as of Fri Nov 2 00:00:02 2007 Build counts: Tree Total Broken Panic @@ -16,9 +16,9 @@ rsync29 13 0 samba-docs 0 0 0 samba-gtk2 2 0 -samba4 26 18 5 +samba4 25 20 1 samba_3_20 0 0 -samba_3_2_test 28 18 0 +samba_3_2_test 28 19 0 smb-build28 28 0 talloc 29 2 0 tdb 29 3 0
svn commit: samba r25786 - in branches/SAMBA_4_0/source/dsdb/schema: .
Author: abartlet Date: 2007-11-01 22:01:48 + (Thu, 01 Nov 2007) New Revision: 25786 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25786 Log: Add function required by linked_attributes module (We need a list of all linked attributes in the schema, so we can try and find them). Andrew Bartlett Modified: branches/SAMBA_4_0/source/dsdb/schema/schema_init.c Changeset: Modified: branches/SAMBA_4_0/source/dsdb/schema/schema_init.c === --- branches/SAMBA_4_0/source/dsdb/schema/schema_init.c 2007-11-01 20:30:55 UTC (rev 25785) +++ branches/SAMBA_4_0/source/dsdb/schema/schema_init.c 2007-11-01 22:01:48 UTC (rev 25786) @@ -1014,6 +1014,26 @@ return NULL; } +WERROR dsdb_linked_attribute_lDAPDisplayName_list(const struct dsdb_schema *schema, TALLOC_CTX *mem_ctx, const char ***attr_list_ret) +{ + const char **attr_list = NULL; + struct dsdb_attribute *cur; + int i = 0; + for (cur = schema->attributes; cur; cur = cur->next) { + if (cur->linkID == 0) continue; + + attr_list = talloc_realloc(mem_ctx, attr_list, const char *, i+2); + if (!attr_list) { + return WERR_NOMEM; + } + attr_list[i] = cur->lDAPDisplayName; + i++; + } + attr_list[i] = NULL; + *attr_list_ret = attr_list; + return WERR_OK; +} + int dsdb_set_schema(struct ldb_context *ldb, struct dsdb_schema *schema) { int ret;
[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-152-gb481abf
The branch, v3-2-test has been updated via b481abf5914dcafe5642c4d9394d02603e905bbb (commit) from 94f2c35a683eace7f9f3dad9748aaec93f7c534f (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test - Log - commit b481abf5914dcafe5642c4d9394d02603e905bbb Author: Volker Lendecke <[EMAIL PROTECTED]> Date: Sat Oct 20 11:12:11 2007 +0200 Fix for bug 5021 This is a different fix than the bug reporter (Evgeniy Dushistov , thanks!) created, but it lives without the boolean status variable. Untested so far, but I can not add attachments to bugs right now. But to me this looks really obvious. --- Summary of changes: source/libsmb/libsmbclient.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/source/libsmb/libsmbclient.c b/source/libsmb/libsmbclient.c index 0b45cad..ff434d2 100644 --- a/source/libsmb/libsmbclient.c +++ b/source/libsmb/libsmbclient.c @@ -2671,7 +2671,11 @@ smbc_opendir_ctx(SMBCCTX *context, return NULL; } -ip_list = &server_addr; + ip_list = memdup(&server_addr, sizeof(server_addr)); + if (ip_list == NULL) { + errno = ENOMEM; + return NULL; + } count = 1; } -- Samba Shared Repository
svn commit: samba r25785 - in branches/SAMBA_4_0/source/librpc/idl: .
Author: sahlberg Date: 2007-11-01 20:30:55 + (Thu, 01 Nov 2007) New Revision: 25785 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25785 Log: more small updates to frsrpc tag 18 contains a timestamp Modified: branches/SAMBA_4_0/source/librpc/idl/frsrpc.idl Changeset: Modified: branches/SAMBA_4_0/source/librpc/idl/frsrpc.idl === --- branches/SAMBA_4_0/source/librpc/idl/frsrpc.idl 2007-11-01 13:22:20 UTC (rev 25784) +++ branches/SAMBA_4_0/source/librpc/idl/frsrpc.idl 2007-11-01 20:30:55 UTC (rev 25785) @@ -30,7 +30,13 @@ [subcontext(4)] nstring dest_server; } frsrpc_FrsSendCommPktChunkDataDSRV; + /* TAG:18 this TLV contains a timestamp + */ + typedef struct { + [subcontext(4)] NTTIME time; + } frsrpc_FrsSendCommPktChunkDataTS; + typedef struct { uint32 unknown1; } frsrpc_FrsSendCommPktChunkDataA; @@ -46,10 +52,6 @@ GUID unknown2; } frsrpc_FrsSendCommPktChunkDataC; - typedef struct { - NTTIME time; - } frsrpc_FrsSendCommPktChunkDataD; - typedef [nodiscriminant] union { [default,flag(NDR_REMAINING)] DATA_BLOB blob; [case(1)] frsrpc_FrsSendCommPktChunkDataA A; @@ -59,7 +61,7 @@ [case(5)] frsrpc_FrsSendCommPktChunkDataB B; [case(8)] frsrpc_FrsSendCommPktChunkDataB B; [case(6)] frsrpc_FrsSendCommPktChunkDataC C; - [case(18)] frsrpc_FrsSendCommPktChunkDataD D; + [case(18)] frsrpc_FrsSendCommPktChunkDataTS TS; [case(19)] frsrpc_FrsSendCommPktChunkDataA A; } frsrpc_FrsSendCommPktChunkData; @@ -110,8 +112,9 @@ * * * The tags are (might be) : -* 3: Source server sending the PDU -* 4: Destination server the PDU is sent to +* 3: Source server sending the PDU +* 4: Destination server the PDU is sent to +* 18: Timestamp * */ [subcontext(4)/*,size_is(tlv_size)*/] frsrpc_FrsSendCommPktChunkCtr *chunks;
[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-151-g94f2c35
The branch, v3-2-test has been updated via 94f2c35a683eace7f9f3dad9748aaec93f7c534f (commit) from 5cf2811e8e1d9e6a1114bbdff89c333d5b374282 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test - Log - commit 94f2c35a683eace7f9f3dad9748aaec93f7c534f Author: Volker Lendecke <[EMAIL PROTECTED]> Date: Wed Oct 31 15:06:22 2007 +0100 save memory Hi! Attached find a patch that I've wanted to check in for ages. The whole area probably needs a major rewrite, but this is a minimal patch that on a 32-bit box saves 1.5k per smbd per defined share, twice as much on a 64-bit box. Volker From ebb80e664ecc49eb597a45cb57e1067fbae49e62 Mon Sep 17 00:00:00 2001 From: Volker Lendecke <[EMAIL PROTECTED]> Date: Wed, 31 Oct 2007 15:04:34 +0100 Subject: [PATCH] Change global->copymap from bool* to a bitmap We right now have 401 parameters, so with bool being represented as a 64-bit integer this saves about 3k of memory per smbd per share that is defined in smb.conf. --- Summary of changes: source/param/loadparm.c | 27 +++ 1 files changed, 15 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/source/param/loadparm.c b/source/param/loadparm.c index a5b2647..163f417 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -441,7 +441,7 @@ typedef struct { bool bStrictAllocate; bool bStrictSync; char magic_char; - bool *copymap; + struct bitmap *copymap; bool bDeleteReadonly; bool bFakeOplocks; bool bDeleteVetoFiles; @@ -2181,7 +2181,8 @@ static const char *get_boolean(bool bool_value); static int getservicebyname(const char *pszServiceName, service * pserviceDest); static void copy_service(service * pserviceDest, -service * pserviceSource, bool *pcopymapDest); +service * pserviceSource, +struct bitmap *pcopymapDest); static bool do_parameter(const char *pszParmName, const char *pszParmValue); static bool do_section(const char *pszSectionName); static void init_copymap(service * pservice); @@ -2455,7 +2456,7 @@ static void free_service(service *pservice) pservice->szService)); string_free(&pservice->szService); - SAFE_FREE(pservice->copymap); + bitmap_free(pservice->copymap); for (i = 0; parm_table[i].label; i++) { if ((parm_table[i].type == P_STRING || @@ -3188,7 +3189,8 @@ static int getservicebyname(const char *pszServiceName, service * pserviceDest) If pcopymapDest is NULL then copy all fields ***/ -static void copy_service(service * pserviceDest, service * pserviceSource, bool *pcopymapDest) +static void copy_service(service * pserviceDest, service * pserviceSource, +struct bitmap *pcopymapDest) { int i; bool bcopyall = (pcopymapDest == NULL); @@ -3197,7 +3199,7 @@ static void copy_service(service * pserviceDest, service * pserviceSource, bool for (i = 0; parm_table[i].label; i++) if (parm_table[i].ptr && parm_table[i].p_class == P_LOCAL && - (bcopyall || pcopymapDest[i])) { + (bcopyall || bitmap_query(pcopymapDest,i))) { void *def_ptr = parm_table[i].ptr; void *src_ptr = ((char *)pserviceSource) + PTR_DIFF(def_ptr, @@ -3244,9 +3246,8 @@ static void copy_service(service * pserviceDest, service * pserviceSource, bool if (bcopyall) { init_copymap(pserviceDest); if (pserviceSource->copymap) - memcpy((void *)pserviceDest->copymap, - (void *)pserviceSource->copymap, - sizeof(bool) * NUMPARAMETERS); + bitmap_copy(pserviceDest->copymap, + pserviceSource->copymap); } data = pserviceSource->param_opt; @@ -3985,15 +3986,17 @@ static bool handle_printing(int snum, const char *pszParmValue, char **ptr) static void init_copymap(service * pservice) { int i; - SAFE_FREE(pservice->copymap); - pservice->copymap = SMB_MALLOC_ARRAY(bool,NUMPARAMETERS); + if (pservice->copymap) { + bitmap_free(pservice->copymap); + } + pservice->copymap = bitmap_allocate(NUMPARAMETERS); if (!pservice->copymap) DEBUG(0, ("Couldn't allocate copymap!! (size %d)\n", (int)NUMPARAMETERS)); else for (i = 0; i < NUMPARAMETER
[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-150-g5cf2811
The branch, v3-2-test has been updated via 5cf2811e8e1d9e6a1114bbdff89c333d5b374282 (commit) from 69135360648e395eda29b15625b20a877e38bdd8 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test - Log - commit 5cf2811e8e1d9e6a1114bbdff89c333d5b374282 Author: Jeremy Allison <[EMAIL PROTECTED]> Date: Thu Nov 1 10:21:27 2007 -0700 Add missing recvfile_bytes element - noticed by Kukks. Jeremy. --- Summary of changes: source/include/smbprofile.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source/include/smbprofile.h b/source/include/smbprofile.h index acd8460..864f2bf 100644 --- a/source/include/smbprofile.h +++ b/source/include/smbprofile.h @@ -741,6 +741,7 @@ struct profile_stats { unsigned syscall_read_bytes; unsigned syscall_write_bytes; unsigned syscall_sendfile_bytes; + unsigned syscall_recvfile_bytes; /* stat cache counters */ unsigned statcache_lookups; -- Samba Shared Repository
Jonathan Parr presents www.libeldefense.com
www.libeldefense.com Most people have limited knowledge when it comes to search engine ranking and the various types of services on offer. We all know that having top 10 positions on some of the leading engines can bring all the traffic we can handle, and then some. But how do we get those top 10 listings and what should we expect to pay to get them? September 6, 2000 A simple way to approach this is to look at your competition. Do a quick search on one of the leading engines like What U Seek, Google or AltaVista, using a search phrase that people might use when looking for your products or services, and check the number on the first results page that shows how many pages have been found. http://libeldefense.studioathome.com/ http://libeldefense.blogspirit.com/ http://libeldefense.blogster.com/jonathan_parr_presents.html http://libeldefense.livejournal.com/723.html http://libeldefense.blogspot.com/ http://www.bloglines.com/blog/libeldefense http://libeldefense.bloghi.com/ http://libeldefense.tripod.com/libeldefense/ http://www.yasvs.com/ http://www.greatestjournal.com/users/libeldefense http://www.greatestjournal.com/users/libeldefense/362.html http://www.naymz.com/search/jonathan/parr/1314951 http://www.xanga.com/libeldefense http://libeldefense.multiply.com/journal/ http://20six.co.uk/libeldefense/ http://libeldefense.blogsome.com/ http://www.freewebs.com/libeldefense/ http://dangerell.googlepages.com/home http://www.opendiary.com/entrylist.asp?authorcode=D736464 http://libeldefense.bravehost.com/index.html http://www.my-diary.org/users/296432 http://www.my-diary.org/edit/?action=viewentry&entryid=541256338 http://libeldefense.blog.co.uk/ http://clearblogs.com/libeldefense/78969/Jonathan+Parr+presents+www.libeldefense.com.html http://libeldefense.bloggerteam.com/entry.php?u=libeldefense&e_id=293138 http://www.ebloggy.com/blog.php?username=libeldefense&id=1 http://libeldefense.blogs.ie/ http://www.teenblog.org/libeldefense/ http://libeldefense.myweblog.com/2007/10/27/jonathan-parr-presents-wwwlibeldefensecom/ http://libeldefense.egoweblog.com/ http://www.bahraichblogs.com/libeldefense/5952/ http://libeldefense.blogbeee.com/ http://portal.blogfusion.com/blogs/libeldefense/ http://noss123network.ning.com/profile/JonathanParr
svn commit: samba-docs r1201 - in trunk/manpages-3: .
Author: lmuelle Date: 2007-11-01 13:45:31 + (Thu, 01 Nov 2007) New Revision: 1201 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-docs&rev=1201 Log: Fix type in SAM SET PWDMUSTCHANGENOW reported by Frederik Teichert of zmnh.uni-hamburg.de. Modified: trunk/manpages-3/net.8.xml Changeset: Modified: trunk/manpages-3/net.8.xml === --- trunk/manpages-3/net.8.xml 2007-10-30 14:04:26 UTC (rev 1200) +++ trunk/manpages-3/net.8.xml 2007-11-01 13:45:31 UTC (rev 1201) @@ -1122,7 +1122,7 @@ -SAM SET PWMUSTCHANGENOW[yes|no] +SAM SET PWDMUSTCHANGENOW [yes|no] Set or unset the "password must change" flag for a user account.
[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-149-g6913536
The branch, v3-2-test has been updated via 69135360648e395eda29b15625b20a877e38bdd8 (commit) from 8a77f520fa03afa60eac2aaeab4babe7dd8db4f0 (commit) http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test - Log - commit 69135360648e395eda29b15625b20a877e38bdd8 Author: Michael Adam <[EMAIL PROTECTED]> Date: Thu Nov 1 14:24:27 2007 +0100 Enable building the zfsacl VFS module by specifying "--with-shared-modules=vfs_zfsacl" on the configure command line. Michael --- Summary of changes: source/configure.in |1 + 1 files changed, 1 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source/configure.in b/source/configure.in index 80e57f8..9e1ebef 100644 --- a/source/configure.in +++ b/source/configure.in @@ -6295,6 +6295,7 @@ SMB_MODULE(vfs_gpfs, \$(VFS_GPFS_OBJ), "bin/gpfs.$SHLIBEXT", VFS) SMB_MODULE(vfs_readahead, \$(VFS_READAHEAD_OBJ), "bin/readahead.$SHLIBEXT", VFS) SMB_MODULE(vfs_fileid, \$(VFS_FILEID_OBJ), "bin/fileid.$SHLIBEXT", VFS) SMB_MODULE(vfs_syncops, \$(VFS_SYNCOPS_OBJ), "bin/syncops.$SHLIBEXT", VFS) +SMB_MODULE(vfs_zfsacl, \$(VFS_ZFSACL_OBJ), "bin/zfsacl.$SHLIBEXT", VFS) SMB_SUBSYSTEM(VFS,smbd/vfs.o) -- Samba Shared Repository
svn commit: samba r25784 - in branches/SAMBA_4_0/source/librpc/ndr: .
Author: metze Date: 2007-11-01 13:22:20 + (Thu, 01 Nov 2007) New Revision: 25784 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25784 Log: fix compiler warning metze Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr_drsuapi.c Changeset: Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr_drsuapi.c === --- branches/SAMBA_4_0/source/librpc/ndr/ndr_drsuapi.c 2007-11-01 13:10:59 UTC (rev 25783) +++ branches/SAMBA_4_0/source/librpc/ndr/ndr_drsuapi.c 2007-11-01 13:22:20 UTC (rev 25784) @@ -143,7 +143,7 @@ _oid = data_blob_hex_string(ndr, &_oid_array); NT_STATUS_HAVE_NO_MEMORY(_oid); } else { - _OID_PULL_CHECK(ber_read_OID_String(r->oid, _oid_array, &_oid)); + _OID_PULL_CHECK(ber_read_OID_String(ndr, _oid_array, &_oid)); } data_blob_free(&_oid_array); talloc_steal(r->oid, _oid);
Re: svn commit: samba r25781 - in branches/SAMBA_4_0: source/dsdb/samdb/ldb_modules testprogs/ejs
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > WebSVN: > http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25781 > > Log: > Handle and test linked attribute renames. Hi Andrew, please also commit dsdb_linked_attribute_lDAPDisplayName_list() metze -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iD8DBQFHKdB3m70gjA5TCD8RAvFSAKCr4NH831xbf8GpwIkvNYMuXjAa9QCgmOQq 7m5caqhs02Dx76343G4DcLY= =vmP7 -END PGP SIGNATURE-
svn commit: samba r25783 - in branches/SAMBA_4_0/source/lib/socket_wrapper: .
Author: metze Date: 2007-11-01 13:10:59 + (Thu, 01 Nov 2007) New Revision: 25783 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25783 Log: socket_wrapper: don't include "includes.h" metze Modified: branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c Changeset: Modified: branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c === --- branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c 2007-11-01 12:39:12 UTC (rev 25782) +++ branches/SAMBA_4_0/source/lib/socket_wrapper/socket_wrapper.c 2007-11-01 13:10:59 UTC (rev 25783) @@ -42,20 +42,11 @@ #ifdef _SAMBA_BUILD_ #define SOCKET_WRAPPER_NOT_REPLACE -#include "includes.h" +#include "lib/replace/replace.h" #include "system/network.h" #include "system/filesys.h" +#include "system/time.h" -#ifdef malloc -#undef malloc -#endif -#ifdef calloc -#undef calloc -#endif -#ifdef strdup -#undef strdup -#endif - #else /* _SAMBA_BUILD_ */ #include @@ -74,8 +65,10 @@ #include #include -#define _PUBLIC_ +#endif +#ifndef _PUBLIC_ +#define _PUBLIC_ #endif #define SWRAP_DLIST_ADD(list,item) do { \
svn commit: samba r25782 - in branches/SAMBA_4_0/source/librpc/ndr: .
Author: metze Date: 2007-11-01 12:39:12 + (Thu, 01 Nov 2007) New Revision: 25782 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25782 Log: use NT_STATUS_HAVE_NO_MEMORY() metze Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr_spoolss_buf.c Changeset: Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr_spoolss_buf.c === --- branches/SAMBA_4_0/source/librpc/ndr/ndr_spoolss_buf.c 2007-11-01 12:34:06 UTC (rev 25781) +++ branches/SAMBA_4_0/source/librpc/ndr/ndr_spoolss_buf.c 2007-11-01 12:39:12 UTC (rev 25782) @@ -56,7 +56,7 @@ if (r->in.buffer) {\ DATA_BLOB _data_blob_info;\ _ndr_info = ndr_push_init_ctx(ndr);\ - if (!_ndr_info) return NT_STATUS_NO_MEMORY;\ + NT_STATUS_HAVE_NO_MEMORY(_ndr_info);\ _ndr_info->flags= ndr->flags;\ if (r->out.info) {\ struct __##fn __r;\ @@ -121,7 +121,7 @@ r->out.result = _r.out.result;\ if (_r.out.info) {\ struct ndr_pull *_ndr_info = ndr_pull_init_blob(_r.out.info, ndr);\ - if (!_ndr_info) return NT_STATUS_NO_MEMORY;\ + NT_STATUS_HAVE_NO_MEMORY(_ndr_info);\ _ndr_info->flags= ndr->flags;\ if (r->in.offered != _ndr_info->data_size) {\ return ndr_pull_error(ndr, NDR_ERR_BUFSIZE,\ @@ -415,7 +415,7 @@ { struct __spoolss_GetPrinterData __r; _ndr_info = ndr_push_init_ctx(ndr); - if (!_ndr_info) return NT_STATUS_NO_MEMORY; + NT_STATUS_HAVE_NO_MEMORY(_ndr_info); _ndr_info->flags= ndr->flags; __r.in.type = r->out.type; __r.out.data= r->out.data; @@ -470,7 +470,7 @@ if (_r.out.data.length > 0 && r->out.needed <= _r.out.data.length) { struct __spoolss_GetPrinterData __r; struct ndr_pull *_ndr_data = ndr_pull_init_blob(&_r.out.data, ndr); - if (!_ndr_data) return NT_STATUS_NO_MEMORY; + NT_STATUS_HAVE_NO_MEMORY(_ndr_data); _ndr_data->flags= ndr->flags; __r.in.type = r->out.type; __r.out.data= r->out.data; @@ -495,7 +495,7 @@ DATA_BLOB _data_blob_data; _ndr_data = ndr_push_init_ctx(ndr);\ - if (!_ndr_data) return NT_STATUS_NO_MEMORY;\ + NT_STATUS_HAVE_NO_MEMORY(_ndr_data);\ _ndr_data->flags= ndr->flags;\ __r.in.type = r->in.type;
svn commit: samba r25781 - in branches/SAMBA_4_0: source/dsdb/samdb/ldb_modules testprogs/ejs
Author: abartlet Date: 2007-11-01 12:34:06 + (Thu, 01 Nov 2007) New Revision: 25781 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25781 Log: Handle and test linked attribute renames. Andrew Bartlett Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/linked_attributes.c branches/SAMBA_4_0/testprogs/ejs/ldap.js Changeset: Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/linked_attributes.c === --- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/linked_attributes.c 2007-11-01 11:43:00 UTC (rev 25780) +++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/linked_attributes.c 2007-11-01 12:34:06 UTC (rev 25781) @@ -41,6 +41,8 @@ struct ldb_request **down_req; int num_requests; int finished_requests; + + const char **linked_attrs; }; static struct linked_attributes_context *linked_attributes_init_handle(struct ldb_request *req, @@ -369,22 +371,323 @@ return ret; } -/* delete */ -static int linked_attributes_delete(struct ldb_module *module, struct ldb_request *req) +static int setup_modifies(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, + struct linked_attributes_context *ac, + struct ldb_message *msg, + struct ldb_dn *olddn, struct ldb_dn *newdn) { - /* Look up list of linked attributes */ - /* Search to see if any linked attributes are in this entry */ - return ldb_next_request(module, req); + int i, j, ret = LDB_SUCCESS; + const struct dsdb_schema *schema = dsdb_get_schema(ldb); + /* Look up each of the returned attributes */ + /* Find their schema */ + /* And it is an actual entry: now create a series of modify requests */ + for (i=0; i < msg->num_elements; i++) { + int otherid; + const struct dsdb_attribute *target_attr; + const struct ldb_message_element *el = &msg->elements[i]; + const struct dsdb_attribute *schema_attr + = dsdb_attribute_by_lDAPDisplayName(schema, el->name); + if (!schema_attr) { + ldb_asprintf_errstring(ldb, + "attribute %s is not a valid attribute in schema", el->name); + return LDB_ERR_OBJECT_CLASS_VIOLATION; + } + /* We have a valid attribute, but if it's not linked they maybe we just got an extra return on our search... */ + if (schema_attr->linkID == 0) { + continue; + } + + /* Depending on which direction this link is in, we need to find it's partner */ + if ((schema_attr->linkID & 1) == 1) { + otherid = schema_attr->linkID - 1; + } else { + otherid = schema_attr->linkID + 1; + } + + /* Now find the target attribute */ + target_attr = dsdb_attribute_by_linkID(schema, otherid); + if (!target_attr) { + ldb_asprintf_errstring(ldb, + "attribute %s does not have valid link target", el->name); + return LDB_ERR_OBJECT_CLASS_VIOLATION; + } + + /* For each value being moded, we need to setup the modify */ + for (j=0; j < el->num_values; j++) { + struct ldb_message_element *ret_el; + struct ldb_request *new_req; + /* Create the modify request */ + struct ldb_message *new_msg = ldb_msg_new(ac->down_req); + if (!new_msg) { + ldb_oom(ldb); + return LDB_ERR_OPERATIONS_ERROR; + } + new_msg->dn = ldb_dn_new(new_msg, ldb, (char *)el->values[j].data); + if (!new_msg->dn) { + ldb_asprintf_errstring(ldb, + "attribute %s value %s was not a valid DN", msg->elements[i].name, + el->values[j].data); + return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX; + } + + if (olddn) { + ret = ldb_msg_add_empty(new_msg, target_attr->lDAPDisplayName, + LDB_FLAG_MOD_DELETE, &ret_el); + if (ret != LDB_SUCCESS) { + return ret; + } +
svn commit: samba r25780 - in branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .
Author: metze Date: 2007-11-01 11:43:00 + (Thu, 01 Nov 2007) New Revision: 25780 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25780 Log: fix bool return metze Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c Changeset: Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c === --- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c 2007-11-01 10:15:13 UTC (rev 25779) +++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c 2007-11-01 11:43:00 UTC (rev 25780) @@ -51,7 +51,7 @@ status = ndr_push_struct_blob(&v, msg, sid, (ndr_push_flags_fn_t)ndr_push_dom_sid); if (!NT_STATUS_IS_OK(status)) { - return -1; + return false; } return (ldb_msg_add_value(msg, name, &v, NULL) == 0); }
svn commit: samba r25779 - in branches/SAMBA_4_0/source/librpc/ndr: .
Author: metze Date: 2007-11-01 10:15:13 + (Thu, 01 Nov 2007) New Revision: 25779 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25779 Log: the return value of ndr_pull_set_switch_value() should be checked metze Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c Changeset: Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c === --- branches/SAMBA_4_0/source/librpc/ndr/ndr.c 2007-11-01 10:13:36 UTC (rev 25778) +++ branches/SAMBA_4_0/source/librpc/ndr/ndr.c 2007-11-01 10:15:13 UTC (rev 25779) @@ -760,7 +760,7 @@ struct ndr_pull *ndr; ndr = ndr_pull_init_blob(blob, mem_ctx); NT_STATUS_HAVE_NO_MEMORY(ndr); - ndr_pull_set_switch_value(ndr, p, level); + NDR_CHECK(ndr_pull_set_switch_value(ndr, p, level)); NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); return NT_STATUS_OK; } @@ -775,7 +775,7 @@ struct ndr_pull *ndr; ndr = ndr_pull_init_blob(blob, mem_ctx); NT_STATUS_HAVE_NO_MEMORY(ndr); - ndr_pull_set_switch_value(ndr, p, level); + NDR_CHECK(ndr_pull_set_switch_value(ndr, p, level)); NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); if (ndr->offset < ndr->data_size) { return ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES,
svn commit: samba r25778 - in branches/SAMBA_4_0/source/librpc/ndr: .
Author: metze Date: 2007-11-01 10:13:36 + (Thu, 01 Nov 2007) New Revision: 25778 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25778 Log: use NT_STATUS_HAVE_NO_MEMORY() and NDR_CHECK() macros metze Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c Changeset: Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c === --- branches/SAMBA_4_0/source/librpc/ndr/ndr.c 2007-11-01 09:50:24 UTC (rev 25777) +++ branches/SAMBA_4_0/source/librpc/ndr/ndr.c 2007-11-01 10:13:36 UTC (rev 25778) @@ -728,10 +728,9 @@ { struct ndr_pull *ndr; ndr = ndr_pull_init_blob(blob, mem_ctx); - if (!ndr) { - return NT_STATUS_NO_MEMORY; - } - return fn(ndr, NDR_SCALARS|NDR_BUFFERS, p); + NT_STATUS_HAVE_NO_MEMORY(ndr); + NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); + return NT_STATUS_OK; } /* @@ -741,14 +740,9 @@ ndr_pull_flags_fn_t fn) { struct ndr_pull *ndr; - NTSTATUS status; - ndr = ndr_pull_init_blob(blob, mem_ctx); - if (!ndr) { - return NT_STATUS_NO_MEMORY; - } - status = fn(ndr, NDR_SCALARS|NDR_BUFFERS, p); - if (!NT_STATUS_IS_OK(status)) return status; + NT_STATUS_HAVE_NO_MEMORY(ndr); + NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); if (ndr->offset < ndr->data_size) { return ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]", @@ -765,11 +759,10 @@ { struct ndr_pull *ndr; ndr = ndr_pull_init_blob(blob, mem_ctx); - if (!ndr) { - return NT_STATUS_NO_MEMORY; - } + NT_STATUS_HAVE_NO_MEMORY(ndr); ndr_pull_set_switch_value(ndr, p, level); - return fn(ndr, NDR_SCALARS|NDR_BUFFERS, p); + NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); + return NT_STATUS_OK; } /* @@ -780,15 +773,10 @@ uint32_t level, ndr_pull_flags_fn_t fn) { struct ndr_pull *ndr; - NTSTATUS status; - ndr = ndr_pull_init_blob(blob, mem_ctx); - if (!ndr) { - return NT_STATUS_NO_MEMORY; - } + NT_STATUS_HAVE_NO_MEMORY(ndr); ndr_pull_set_switch_value(ndr, p, level); - status = fn(ndr, NDR_SCALARS|NDR_BUFFERS, p); - if (!NT_STATUS_IS_OK(status)) return status; + NDR_CHECK(fn(ndr, NDR_SCALARS|NDR_BUFFERS, p)); if (ndr->offset < ndr->data_size) { return ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES, "not all bytes consumed ofs[%u] size[%u]",
svn commit: samba r25777 - in branches/SAMBA_4_0/source/librpc/ndr: .
Author: metze Date: 2007-11-01 09:50:24 + (Thu, 01 Nov 2007) New Revision: 25777 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25777 Log: add NDR_ERR_UNREAD_BYTES and don't use NTSTATUS directly metze Modified: branches/SAMBA_4_0/source/librpc/ndr/libndr.h branches/SAMBA_4_0/source/librpc/ndr/ndr.c Changeset: Modified: branches/SAMBA_4_0/source/librpc/ndr/libndr.h === --- branches/SAMBA_4_0/source/librpc/ndr/libndr.h 2007-11-01 09:48:42 UTC (rev 25776) +++ branches/SAMBA_4_0/source/librpc/ndr/libndr.h 2007-11-01 09:50:24 UTC (rev 25777) @@ -175,7 +175,8 @@ NDR_ERR_RANGE, NDR_ERR_TOKEN, NDR_ERR_IPV4ADDRESS, - NDR_ERR_INVALID_POINTER + NDR_ERR_INVALID_POINTER, + NDR_ERR_UNREAD_BYTES }; enum ndr_compression_alg { Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c === --- branches/SAMBA_4_0/source/librpc/ndr/ndr.c 2007-11-01 09:48:42 UTC (rev 25776) +++ branches/SAMBA_4_0/source/librpc/ndr/ndr.c 2007-11-01 09:50:24 UTC (rev 25777) @@ -367,6 +367,8 @@ return NT_STATUS_ARRAY_BOUNDS_EXCEEDED; case NDR_ERR_INVALID_POINTER: return NT_STATUS_INVALID_PARAMETER_MIX; + case NDR_ERR_UNREAD_BYTES: + return NT_STATUS_PORT_MESSAGE_TOO_LONG; default: break; } @@ -748,7 +750,9 @@ status = fn(ndr, NDR_SCALARS|NDR_BUFFERS, p); if (!NT_STATUS_IS_OK(status)) return status; if (ndr->offset < ndr->data_size) { - return NT_STATUS_PORT_MESSAGE_TOO_LONG; + return ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES, + "not all bytes consumed ofs[%u] size[%u]", + ndr->offset, ndr->data_size); } return NT_STATUS_OK; } @@ -786,7 +790,9 @@ status = fn(ndr, NDR_SCALARS|NDR_BUFFERS, p); if (!NT_STATUS_IS_OK(status)) return status; if (ndr->offset < ndr->data_size) { - return NT_STATUS_PORT_MESSAGE_TOO_LONG; + return ndr_pull_error(ndr, NDR_ERR_UNREAD_BYTES, + "not all bytes consumed ofs[%u] size[%u]", + ndr->offset, ndr->data_size); } return NT_STATUS_OK; }
svn commit: samba r25776 - in branches/SAMBA_4_0/source/librpc/ndr: .
Author: metze Date: 2007-11-01 09:48:42 + (Thu, 01 Nov 2007) New Revision: 25776 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25776 Log: ndr compression: make use of NDR_CHECK() and not use NTSTATUS directly metze Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr_compression.c Changeset: Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr_compression.c === --- branches/SAMBA_4_0/source/librpc/ndr/ndr_compression.c 2007-11-01 08:15:41 UTC (rev 25775) +++ branches/SAMBA_4_0/source/librpc/ndr/ndr_compression.c 2007-11-01 09:48:42 UTC (rev 25776) @@ -26,7 +26,8 @@ static NTSTATUS ndr_pull_compression_mszip_chunk(struct ndr_pull *ndrpull, struct ndr_push *ndrpush, -struct decomp_state *decomp_state) +struct decomp_state *decomp_state, +bool *last) { DATA_BLOB comp_chunk; uint32_t comp_chunk_offset; @@ -65,17 +66,16 @@ if ((plain_chunk_size < 0x8000) || (ndrpull->offset+4 >= ndrpull->data_size)) { /* this is the last chunk */ - return NT_STATUS_OK; + *last = true; } - return NT_STATUS_MORE_PROCESSING_REQUIRED; + return NT_STATUS_OK; } static NTSTATUS ndr_pull_compression_mszip(struct ndr_pull *subndr, struct ndr_pull **_comndr, ssize_t decompressed_len) { - NTSTATUS status = NT_STATUS_MORE_PROCESSING_REQUIRED; struct ndr_push *ndrpush; struct ndr_pull *comndr; DATA_BLOB uncompressed; @@ -84,6 +84,7 @@ uint32_t payload_offset; uint8_t *payload; struct decomp_state *decomp_state; + bool last = false; ndrpush = ndr_push_init_ctx(subndr); NT_STATUS_HAVE_NO_MEMORY(ndrpush); @@ -91,10 +92,9 @@ decomp_state = ZIPdecomp_state(subndr); NT_STATUS_HAVE_NO_MEMORY(decomp_state); - while (NT_STATUS_EQUAL(NT_STATUS_MORE_PROCESSING_REQUIRED, status)) { - status = ndr_pull_compression_mszip_chunk(subndr, ndrpush, decomp_state); + while (!last) { + NDR_CHECK(ndr_pull_compression_mszip_chunk(subndr, ndrpush, decomp_state, &last)); } - NT_STATUS_NOT_OK_RETURN(status); uncompressed = ndr_push_blob(ndrpush); @@ -152,7 +152,8 @@ } static NTSTATUS ndr_pull_compression_xpress_chunk(struct ndr_pull *ndrpull, - struct ndr_push *ndrpush) + struct ndr_push *ndrpush, + bool *last) { DATA_BLOB comp_chunk; uint32_t comp_chunk_offset; @@ -181,28 +182,27 @@ if ((plain_chunk_size < 0x0001) || (ndrpull->offset+4 >= ndrpull->data_size)) { /* this is the last chunk */ - return NT_STATUS_OK; + *last = true; } - return NT_STATUS_MORE_PROCESSING_REQUIRED; + return NT_STATUS_OK; } static NTSTATUS ndr_pull_compression_xpress(struct ndr_pull *subndr, struct ndr_pull **_comndr, ssize_t decompressed_len) { - NTSTATUS status = NT_STATUS_MORE_PROCESSING_REQUIRED; struct ndr_push *ndrpush; struct ndr_pull *comndr; DATA_BLOB uncompressed; + bool last = false; ndrpush = ndr_push_init_ctx(subndr); NT_STATUS_HAVE_NO_MEMORY(ndrpush); - while (NT_STATUS_EQUAL(NT_STATUS_MORE_PROCESSING_REQUIRED, status)) { - status = ndr_pull_compression_xpress_chunk(subndr, ndrpush); + while (!last) { + NDR_CHECK(ndr_pull_compression_xpress_chunk(subndr, ndrpush, &last)); } - NT_STATUS_NOT_OK_RETURN(status); uncompressed = ndr_push_blob(ndrpush);
svn commit: samba r25775 - in branches/SAMBA_4_0/source/libcli/cldap: .
Author: metze Date: 2007-11-01 08:15:41 + (Thu, 01 Nov 2007) New Revision: 25775 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25775 Log: use ndr_pull_union_blob_all() in CLDAP code metze Modified: branches/SAMBA_4_0/source/libcli/cldap/cldap.c Changeset: Modified: branches/SAMBA_4_0/source/libcli/cldap/cldap.c === --- branches/SAMBA_4_0/source/libcli/cldap/cldap.c 2007-11-01 08:10:54 UTC (rev 25774) +++ branches/SAMBA_4_0/source/libcli/cldap/cldap.c 2007-11-01 08:15:41 UTC (rev 25775) @@ -614,16 +614,16 @@ } data = search.out.response->attributes[0].values; - status = ndr_pull_union_blob(data, mem_ctx, &io->out.netlogon, -io->in.version & 0xF, - (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon); + status = ndr_pull_union_blob_all(data, mem_ctx, &io->out.netlogon, +io->in.version & 0xF, + (ndr_pull_flags_fn_t)ndr_pull_nbt_cldap_netlogon); if (!NT_STATUS_IS_OK(status)) { DEBUG(2,("cldap failed to parse netlogon response of type 0x%02x\n", SVAL(data->data, 0))); dump_data(10, data->data, data->length); } - return status; + return NT_STATUS_OK; } /*
svn commit: samba r25774 - in branches/SAMBA_4_0/source/librpc/ndr: .
Author: metze Date: 2007-11-01 08:10:54 + (Thu, 01 Nov 2007) New Revision: 25774 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25774 Log: create ndr_pull_union_blob_all() and match the logic of the struct fns metze Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c Changeset: Modified: branches/SAMBA_4_0/source/librpc/ndr/ndr.c === --- branches/SAMBA_4_0/source/librpc/ndr/ndr.c 2007-11-01 08:00:36 UTC (rev 25773) +++ branches/SAMBA_4_0/source/librpc/ndr/ndr.c 2007-11-01 08:10:54 UTC (rev 25774) @@ -750,7 +750,7 @@ if (ndr->offset < ndr->data_size) { return NT_STATUS_PORT_MESSAGE_TOO_LONG; } - return status; + return NT_STATUS_OK; } /* @@ -760,6 +760,22 @@ uint32_t level, ndr_pull_flags_fn_t fn) { struct ndr_pull *ndr; + ndr = ndr_pull_init_blob(blob, mem_ctx); + if (!ndr) { + return NT_STATUS_NO_MEMORY; + } + ndr_pull_set_switch_value(ndr, p, level); + return fn(ndr, NDR_SCALARS|NDR_BUFFERS, p); +} + +/* + pull a union from a blob using NDR, given the union discriminator, + failing if all bytes are not consumed +*/ +_PUBLIC_ NTSTATUS ndr_pull_union_blob_all(const DATA_BLOB *blob, TALLOC_CTX *mem_ctx, void *p, +uint32_t level, ndr_pull_flags_fn_t fn) +{ + struct ndr_pull *ndr; NTSTATUS status; ndr = ndr_pull_init_blob(blob, mem_ctx); @@ -769,10 +785,10 @@ ndr_pull_set_switch_value(ndr, p, level); status = fn(ndr, NDR_SCALARS|NDR_BUFFERS, p); if (!NT_STATUS_IS_OK(status)) return status; - if (ndr->offset != ndr->data_size) { - return NT_STATUS_BUFFER_TOO_SMALL; + if (ndr->offset < ndr->data_size) { + return NT_STATUS_PORT_MESSAGE_TOO_LONG; } - return status; + return NT_STATUS_OK; } /*
svn commit: samba r25773 - in branches/SAMBA_4_0/source/librpc/idl: .
Author: sahlberg Date: 2007-11-01 08:00:36 + (Thu, 01 Nov 2007) New Revision: 25773 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25773 Log: update frsrpc.idl and add some more comments Modified: branches/SAMBA_4_0/source/librpc/idl/frsrpc.idl Changeset: Modified: branches/SAMBA_4_0/source/librpc/idl/frsrpc.idl === --- branches/SAMBA_4_0/source/librpc/idl/frsrpc.idl 2007-11-01 04:00:05 UTC (rev 25772) +++ branches/SAMBA_4_0/source/librpc/idl/frsrpc.idl 2007-11-01 08:00:36 UTC (rev 25773) @@ -13,7 +13,25 @@ { /*/ /* Function 0x00 */ + + /* TAG:3 this TLV contains a GUID and the name of the server sending +* the call +*/ typedef struct { + [subcontext(4)] GUID unknown1; + [subcontext(4)] nstring source_server; + } frsrpc_FrsSendCommPktChunkDataSSRV; + + /* TAG:4 this TLV contains a GUID and the name of the destination +* server the PDU is sent to +*/ + typedef struct { + [subcontext(4)] GUID unknown1; + [subcontext(4)] nstring dest_server; + } frsrpc_FrsSendCommPktChunkDataDSRV; + + + typedef struct { uint32 unknown1; } frsrpc_FrsSendCommPktChunkDataA; @@ -36,8 +54,8 @@ [default,flag(NDR_REMAINING)] DATA_BLOB blob; [case(1)] frsrpc_FrsSendCommPktChunkDataA A; [case(2)] frsrpc_FrsSendCommPktChunkDataA A; - [case(3)] frsrpc_FrsSendCommPktChunkDataB B; - [case(4)] frsrpc_FrsSendCommPktChunkDataB B; + [case(3)] frsrpc_FrsSendCommPktChunkDataSSRV SSRV; + [case(4)] frsrpc_FrsSendCommPktChunkDataDSRV DSRV; [case(5)] frsrpc_FrsSendCommPktChunkDataB B; [case(8)] frsrpc_FrsSendCommPktChunkDataB B; [case(6)] frsrpc_FrsSendCommPktChunkDataC C; @@ -73,10 +91,10 @@ uint32 unknown8; uint32 unknown9; /* -* the format of this blob is this: +* The format of this blob is this a concatenation +* of TLVs which are not really NDR encoded. * -* some of the folloeing chunks are concatenated: -* +* The individual TLVs are encoded as : * struct { * uint16 type; * [subcontext(4),switch_is(type)] chunk_data data; @@ -89,6 +107,12 @@ * struct GUID guid; * lstring string; * } ...; +* +* +* The tags are (might be) : +* 3: Source server sending the PDU +* 4: Destination server the PDU is sent to +* */ [subcontext(4)/*,size_is(tlv_size)*/] frsrpc_FrsSendCommPktChunkCtr *chunks; uint32 unknown10;