svn commit: samba r23720 - in branches/SAMBA_4_0/source: scripting/libjs selftest setup

2007-07-05 Thread abartlet
Author: abartlet
Date: 2007-07-05 06:15:40 + (Thu, 05 Jul 2007)
New Revision: 23720

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23720

Log:
Allow the member server to work against an LDAP Backend.  Another case
where LDB isn't as strict as OpenLDAP, the self join record contains
duplicate servicePrincipalNames once the DNS name and domain name are
made equal.  (Easier to just skip the useless self-join).

Andrew Bartlett

Added:
   branches/SAMBA_4_0/source/setup/provision_self_join.ldif
Modified:
   branches/SAMBA_4_0/source/scripting/libjs/provision.js
   branches/SAMBA_4_0/source/selftest/Samba4.pm
   branches/SAMBA_4_0/source/setup/provision_users.ldif


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/libjs/provision.js
===
--- branches/SAMBA_4_0/source/scripting/libjs/provision.js  2007-07-05 
03:30:46 UTC (rev 23719)
+++ branches/SAMBA_4_0/source/scripting/libjs/provision.js  2007-07-05 
06:15:40 UTC (rev 23720)
@@ -700,6 +700,11 @@
message(Setting up sam.ldb users and groups\n);
setup_add_ldif(provision_users.ldif, info, samdb, false);
 
+   if (lp.get(server role) == domain controller) {
+   message(Setting up self join\n);
+   setup_add_ldif(provision_self_join.ldif, info, samdb, false);
+   }
+
if (setup_name_mappings(info, samdb) == false) {
return false;
}
@@ -769,6 +774,11 @@
 /* Write out a DNS zone file, from the info in the current database */
 function provision_dns(subobj, message, paths, session_info, credentials)
 {
+   var lp = loadparm_init();
+   if (lp.get(server role) != domain controller) {
+   message(No DNS zone required for role %s\n, lp.get(server 
role));
+   return;
+   }
message(Setting up DNS zone:  + subobj.DNSDOMAIN +  \n);
var ldb = ldb_init();
ldb.session_info = session_info;

Modified: branches/SAMBA_4_0/source/selftest/Samba4.pm
===
--- branches/SAMBA_4_0/source/selftest/Samba4.pm2007-07-05 03:30:46 UTC 
(rev 23719)
+++ branches/SAMBA_4_0/source/selftest/Samba4.pm2007-07-05 06:15:40 UTC 
(rev 23720)
@@ -281,6 +281,8 @@
$localdomain = $netbiosname if $server_role eq member server;
my $localrealm = $realm;
$localrealm = $netbiosname if $server_role eq member server;
+   my $localbasedn = $basedn;
+   $localbasedn = DC=$netbiosname if $server_role eq member server;
 
open(CONFFILE, $conffile);
print CONFFILE 
@@ -400,7 +402,7 @@
push (@provision_options, --krbtgtpass=krbtgt$password);
push (@provision_options, --machinepass=machine$password);
push (@provision_options, --root=$root);
-   push (@provision_options, --simple-bind-dn=cn=Manager,$basedn);
+   push (@provision_options, --simple-bind-dn=cn=Manager,$localbasedn);
push (@provision_options, --password=$password);
push (@provision_options, --root=$root);
 
@@ -430,7 +432,7 @@
if (defined($self-{ldap})) {
 
 push (@provision_options, --ldap-backend=$ldap_uri);
-   system($self-{bindir}/smbscript 
$self-{setupdir}/provision-backend $configuration 
--ldap-manager-pass=$password --root=$root --realm=$dnsname 
--host-name=$netbiosname --ldap-backend-type=$self-{ldap}2) == 0 or 
die(backend provision failed);
+   system($self-{bindir}/smbscript 
$self-{setupdir}/provision-backend $configuration 
--ldap-manager-pass=$password --root=$root --realm=$localrealm 
--host-name=$netbiosname --ldap-backend-type=$self-{ldap}2) == 0 or 
die(backend provision failed);
 
if ($self-{ldap} eq openldap) {
   ($ret-{SLAPD_CONF}, $ret-{OPENLDAP_PIDFILE}) = 
$self-mk_openldap($ldapdir, $configuration) or die(Unable to create openldap 
directories);

Added: branches/SAMBA_4_0/source/setup/provision_self_join.ldif
===
--- branches/SAMBA_4_0/source/setup/provision_self_join.ldif2007-07-05 
03:30:46 UTC (rev 23719)
+++ branches/SAMBA_4_0/source/setup/provision_self_join.ldif2007-07-05 
06:15:40 UTC (rev 23720)
@@ -0,0 +1,23 @@
+#Join the DC to itself by default
+
+dn: CN=${NETBIOSNAME},CN=Domain Controllers,${DOMAINDN}
+objectClass: computer
+cn: ${NETBIOSNAME}
+userAccountControl: 532480
+localPolicyFlags: 0
+primaryGroupID: 516
+accountExpires: 9223372036854775807
+sAMAccountName: ${NETBIOSNAME}$
+sAMAccountType: 805306369
+operatingSystem: Samba
+operatingSystemVersion: 4.0
+dNSHostName: ${DNSNAME}
+isCriticalSystemObject: TRUE
+sambaPassword: ${MACHINEPASS}
+servicePrincipalName: HOST/${DNSNAME}
+servicePrincipalName: HOST/${NETBIOSNAME}
+servicePrincipalName: HOST/${DNSNAME}/${REALM}
+servicePrincipalName: HOST/${NETBIOSNAME}/${REALM}
+servicePrincipalName: 

svn commit: samba r23721 - in branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Wireshark: .

2007-07-05 Thread sahlberg
Author: sahlberg
Date: 2007-07-05 07:19:14 + (Thu, 05 Jul 2007)
New Revision: 23721

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23721

Log:
For unions, The TAG and the ARM are aligned independently.

Move emitting ALIGN_TO_x_BYTES to after the tag has been dissected so the 
alignment only affects the ARM.



Modified:
   branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Wireshark/NDR.pm


Changeset:
Modified: branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Wireshark/NDR.pm
===
--- branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Wireshark/NDR.pm  
2007-07-05 06:15:40 UTC (rev 23720)
+++ branches/SAMBA_4_0/source/pidl/lib/Parse/Pidl/Wireshark/NDR.pm  
2007-07-05 07:19:14 UTC (rev 23721)
@@ -614,12 +614,6 @@
$self-pidl_code($switch_type level;);
$self-pidl_code();
 
-   if ($e-{ALIGN}  1) {
-   $self-pidl_code(ALIGN_TO_$e-{ALIGN}_BYTES;);
-   }
-
-   $self-pidl_code();
-
$self-pidl_code(old_offset = offset;);
$self-pidl_code(if (parent_tree) {);
$self-indent;
@@ -632,6 +626,12 @@
 
$self-pidl_code(offset = $switch_dissect(tvb, offset, pinfo, tree, 
drep, hf_index, level););
 
+   if ($e-{ALIGN}  1) {
+   $self-pidl_code(ALIGN_TO_$e-{ALIGN}_BYTES;);
+   $self-pidl_code();
+   }
+
+
$self-pidl_code(switch(level) {$res\t});
$self-pidl_code(proto_item_set_len(item, offset-old_offset);\n);
$self-pidl_code(return offset;);



svn commit: samba r23722 - in branches: SAMBA_3_0/source/modules SAMBA_3_0_26/source/modules

2007-07-05 Thread vlendec
Author: vlendec
Date: 2007-07-05 10:32:51 + (Thu, 05 Jul 2007)
New Revision: 23722

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23722

Log:
Fix the build of the catia module
Modified:
   branches/SAMBA_3_0/source/modules/vfs_catia.c
   branches/SAMBA_3_0_26/source/modules/vfs_catia.c


Changeset:
Modified: branches/SAMBA_3_0/source/modules/vfs_catia.c
===
--- branches/SAMBA_3_0/source/modules/vfs_catia.c   2007-07-05 07:19:14 UTC 
(rev 23721)
+++ branches/SAMBA_3_0/source/modules/vfs_catia.c   2007-07-05 10:32:51 UTC 
(rev 23722)
@@ -232,7 +232,7 @@
 
 static size_t catia_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
   const char *name, uint32 security_info,
-  struct  security_descriptor_info **ppdesc)
+  struct  security_descriptor **ppdesc)
 {
 return SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info,
   ppdesc);
@@ -240,7 +240,7 @@
 
 static NTSTATUS catia_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, 
 const char *name, uint32 security_info_sent,
-struct security_descriptor_info *psd)
+struct security_descriptor *psd)
 {
 return SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent,
   psd);

Modified: branches/SAMBA_3_0_26/source/modules/vfs_catia.c
===
--- branches/SAMBA_3_0_26/source/modules/vfs_catia.c2007-07-05 07:19:14 UTC 
(rev 23721)
+++ branches/SAMBA_3_0_26/source/modules/vfs_catia.c2007-07-05 10:32:51 UTC 
(rev 23722)
@@ -232,7 +232,7 @@
 
 static size_t catia_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
   const char *name, uint32 security_info,
-  struct  security_descriptor_info **ppdesc)
+  struct  security_descriptor **ppdesc)
 {
 return SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info,
   ppdesc);
@@ -240,7 +240,7 @@
 
 static NTSTATUS catia_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, 
 const char *name, uint32 security_info_sent,
-struct security_descriptor_info *psd)
+struct security_descriptor *psd)
 {
 return SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent,
   psd);



Re: svn commit: samba r23718 - in branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .

2007-07-05 Thread Stefan (metze) Metzmacher
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] schrieb:
 Author: abartlet
 Date: 2007-07-05 03:06:59 + (Thu, 05 Jul 2007)
 New Revision: 23718
 
 WebSVN: 
 http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23718
 
 Log:
 Make Samba4 work against the LDAP backend again. 
 
 When we set up the schema, we don't have a partitions container yet.
 The LDAP error differs from that given by LDB, so I think we still
 have some conformance work to do.

yes, the problem is that ldb_tdb returns just 0 search results, but
success when the basedn isn't present. And it realy should return
LDB_ERR_NO_SUCH_OBJECT in this case, but we have too many code not
checking for LDB_ERR_NO_SUCH_OBJECT, so that we would break a lot
if we would let ldb_tdb return LDB_ERR_NO_SUCH_OBJECT.

metze
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFGjJedm70gjA5TCD8RAvtzAKCCgnVcVwcFP3V1pz+wjU2bINpinQCfbEsR
3KRfSGvVt6vZLGomR1TCy3E=
=F/Na
-END PGP SIGNATURE-



svn commit: samba r23723 - in branches: SAMBA_3_0/source/libsmb SAMBA_3_0_26/source/libsmb

2007-07-05 Thread idra
Author: idra
Date: 2007-07-05 13:46:47 + (Thu, 05 Jul 2007)
New Revision: 23723

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23723

Log:

Alexander Larsson pointed me at a missing mapping in clierror.c
When renaming a file across 2 filesystem a samba server returns
NT_STATUS_NOT_SAME_DEVICE but thius is not translated to EXDEV,
and the generic EINVAL is returned instead.
This should fix it, Jeremy or Derrel please check if this is ok.


Modified:
   branches/SAMBA_3_0/source/libsmb/clierror.c
   branches/SAMBA_3_0_26/source/libsmb/clierror.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/clierror.c
===
--- branches/SAMBA_3_0/source/libsmb/clierror.c 2007-07-05 10:32:51 UTC (rev 
23722)
+++ branches/SAMBA_3_0/source/libsmb/clierror.c 2007-07-05 13:46:47 UTC (rev 
23723)
@@ -336,7 +336,9 @@
 #ifdef ECOMM
{NT_STATUS_NET_WRITE_FAULT, ECOMM},
 #endif
-
+#ifdef EXDEV
+   {NT_STATUS_NOT_SAME_DEVICE, EXDEV},
+#endif
{NT_STATUS(0), 0}
 };
 

Modified: branches/SAMBA_3_0_26/source/libsmb/clierror.c
===
--- branches/SAMBA_3_0_26/source/libsmb/clierror.c  2007-07-05 10:32:51 UTC 
(rev 23722)
+++ branches/SAMBA_3_0_26/source/libsmb/clierror.c  2007-07-05 13:46:47 UTC 
(rev 23723)
@@ -331,7 +331,9 @@
 #ifdef ECOMM
{NT_STATUS_NET_WRITE_FAULT, ECOMM},
 #endif
-
+#ifdef EXDEV
+   {NT_STATUS_NOT_SAME_DEVICE, EXDEV},
+#endif
{NT_STATUS(0), 0}
 };
 



svn commit: samba r23724 - in branches/SAMBA_3_0/source: include printing rpc_server smbd

2007-07-05 Thread vlendec
Author: vlendec
Date: 2007-07-05 16:26:27 + (Thu, 05 Jul 2007)
New Revision: 23724

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23724

Log:
Reduce access to the global inbuf a tiny bit. Add a struct smb_request
that contains some of the fields from the SMB header, removing the need
to access inbuf directly. This right now is used only in the open file
code  friends, and creating that header is only done when needed. This
needs more work, but it is a start.

Jeremy, I'm only checking this into 3_0, please review before I merge it
to _26.

Volker


Modified:
   branches/SAMBA_3_0/source/include/smb.h
   branches/SAMBA_3_0/source/printing/nt_printing.c
   branches/SAMBA_3_0/source/rpc_server/srv_srvsvc_nt.c
   branches/SAMBA_3_0/source/smbd/dir.c
   branches/SAMBA_3_0/source/smbd/nttrans.c
   branches/SAMBA_3_0/source/smbd/open.c
   branches/SAMBA_3_0/source/smbd/posix_acls.c
   branches/SAMBA_3_0/source/smbd/process.c
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_3_0/source/smbd/trans2.c


Changeset:
Sorry, the patch is too large (1197 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23724


svn commit: samba r23725 - in branches/SAMBA_3_0/source/smbd: .

2007-07-05 Thread vlendec
Author: vlendec
Date: 2007-07-05 16:27:47 + (Thu, 05 Jul 2007)
New Revision: 23725

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23725

Log:
Remove get_current_mid()

Jeremy, next one to review :-)


Modified:
   branches/SAMBA_3_0/source/smbd/open.c
   branches/SAMBA_3_0/source/smbd/process.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/open.c
===
--- branches/SAMBA_3_0/source/smbd/open.c   2007-07-05 16:26:27 UTC (rev 
23724)
+++ branches/SAMBA_3_0/source/smbd/open.c   2007-07-05 16:27:47 UTC (rev 
23725)
@@ -644,6 +644,7 @@
 
 static BOOL delay_for_oplocks(struct share_mode_lock *lck,
  files_struct *fsp,
+ uint16 mid,
  int pass_number,
  int oplock_request)
 {
@@ -728,7 +729,7 @@
 
DEBUG(10, (Sending break request to PID %s\n,
   procid_str_static(exclusive-pid)));
-   exclusive-op_mid = get_current_mid();
+   exclusive-op_mid = mid;
 
/* Create the message. */
share_mode_entry_to_message(msg, exclusive);
@@ -768,9 +769,9 @@
 static void defer_open(struct share_mode_lock *lck,
   struct timeval request_time,
   struct timeval timeout,
+  uint16 mid,
   struct deferred_open_record *state)
 {
-   uint16 mid = get_current_mid();
int i;
 
/* Paranoia check */
@@ -1065,7 +1066,9 @@
 
 }
 
-static void schedule_defer_open(struct share_mode_lock *lck, struct timeval 
request_time)
+static void schedule_defer_open(struct share_mode_lock *lck,
+   struct timeval request_time,
+   uint16 mid)
 {
struct deferred_open_record state;
 
@@ -1096,7 +1099,7 @@
state.id = lck-id;
 
if (!request_timed_out(request_time, timeout)) {
-   defer_open(lck, request_time, timeout, state);
+   defer_open(lck, request_time, timeout, mid, state);
}
 }
 
@@ -1443,8 +1446,10 @@
}
 
/* First pass - send break only on batch oplocks. */
-   if (delay_for_oplocks(lck, fsp, 1, oplock_request)) {
-   schedule_defer_open(lck, request_time);
+   if ((req != NULL)
+delay_for_oplocks(lck, fsp, req-mid, 1,
+oplock_request)) {
+   schedule_defer_open(lck, request_time, req-mid);
TALLOC_FREE(lck);
file_free(fsp);
return NT_STATUS_SHARING_VIOLATION;
@@ -1461,8 +1466,11 @@
 * status again. */
/* Second pass - send break for both batch or
 * exclusive oplocks. */
-   if (delay_for_oplocks(lck, fsp, 2, oplock_request)) {
-   schedule_defer_open(lck, request_time);
+   if ((req != NULL)
+ delay_for_oplocks(lck, fsp, req-mid, 2,
+ oplock_request)) {
+   schedule_defer_open(lck, request_time,
+   req-mid);
TALLOC_FREE(lck);
file_free(fsp);
return NT_STATUS_SHARING_VIOLATION;
@@ -1576,10 +1584,11 @@
state.delayed_for_oplocks = False;
state.id = id;
 
-   if (!request_timed_out(request_time,
-  timeout)) {
+   if ((req != NULL)
+!request_timed_out(request_time,
+ timeout)) {
defer_open(lck, request_time, timeout,
-  state);
+  req-mid, state);
}
}
 
@@ -1667,8 +1676,10 @@
}
 
/* First pass - send break only on batch oplocks. */
-   if (delay_for_oplocks(lck, fsp, 1, oplock_request)) {
-   schedule_defer_open(lck, request_time);
+   if ((req != NULL)
+delay_for_oplocks(lck, fsp, req-mid, 1,
+oplock_request)) {
+   schedule_defer_open(lck, request_time, req-mid);
TALLOC_FREE(lck);
fd_close(conn, fsp);
file_free(fsp);
@@ -1684,8 +1695,11 @@
 * status again. */
 

Re: svn commit: samba r23718 - in branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .

2007-07-05 Thread simo
On Thu, 2007-07-05 at 09:02 +0200, Stefan (metze) Metzmacher wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 [EMAIL PROTECTED] schrieb:
  Author: abartlet
  Date: 2007-07-05 03:06:59 + (Thu, 05 Jul 2007)
  New Revision: 23718
  
  WebSVN: 
  http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23718
  
  Log:
  Make Samba4 work against the LDAP backend again. 
  
  When we set up the schema, we don't have a partitions container yet.
  The LDAP error differs from that given by LDB, so I think we still
  have some conformance work to do.
 
 yes, the problem is that ldb_tdb returns just 0 search results, but
 success when the basedn isn't present. And it realy should return
 LDB_ERR_NO_SUCH_OBJECT in this case, but we have too many code not
 checking for LDB_ERR_NO_SUCH_OBJECT, so that we would break a lot
 if we would let ldb_tdb return LDB_ERR_NO_SUCH_OBJECT.

I think it is reasonable to change tdb to throw an error if the base
does not exists.
We need to deal with LDB_ERR_NO_SUCH_OBJECT as ldap backends can happily
return that. I will look into this as soon as I can carve some time for
it.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: [EMAIL PROTECTED]
http://samba.org



Re: svn commit: samba r23724 - in branches/SAMBA_3_0/source: include printing rpc_server smbd

2007-07-05 Thread Jeremy Allison
On Thu, Jul 05, 2007 at 04:26:29PM +, [EMAIL PROTECTED] wrote:
 Jeremy, I'm only checking this into 3_0, please review before I merge it
 to _26.

Not a good day for reviews today I'm afraid. This might have
to wait until the weekend, sorry.

Jeremy.


svn commit: samba r23727 - in branches/SAMBA_3_0/source/smbd: .

2007-07-05 Thread vlendec
Author: vlendec
Date: 2007-07-05 16:36:15 + (Thu, 05 Jul 2007)
New Revision: 23727

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23727

Log:
Explicitly pass down FLAGS2 to srvstr_get_path.

Next step is to remove the bug that in the trans2 code we use the inbuf
as the base pointer to decide whether we need ucs2 alignment where we
need to use the beginning of the params buffer

Jeremy, last one for today to reviw :-)


Modified:
   branches/SAMBA_3_0/source/smbd/nttrans.c
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_3_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/nttrans.c
===
--- branches/SAMBA_3_0/source/smbd/nttrans.c2007-07-05 16:33:37 UTC (rev 
23726)
+++ branches/SAMBA_3_0/source/smbd/nttrans.c2007-07-05 16:36:15 UTC (rev 
23727)
@@ -562,7 +562,9 @@
 
if(!dir_fsp-is_directory) {
 
-   srvstr_get_path(inbuf, fname, smb_buf(inbuf), 
sizeof(fname), 0, STR_TERMINATE, status);
+   srvstr_get_path(inbuf, SVAL(inbuf,smb_flg2), fname,
+   smb_buf(inbuf), sizeof(fname), 0,
+   STR_TERMINATE, status);
if (!NT_STATUS_IS_OK(status)) {
END_PROFILE(SMBntcreateX);
return ERROR_NT(status);
@@ -604,14 +606,18 @@
dir_name_len++;
}
 
-   srvstr_get_path(inbuf, rel_fname, smb_buf(inbuf), 
sizeof(rel_fname), 0, STR_TERMINATE, status);
+   srvstr_get_path(inbuf, SVAL(inbuf,smb_flg2), rel_fname,
+   smb_buf(inbuf), sizeof(rel_fname), 0,
+   STR_TERMINATE, status);
if (!NT_STATUS_IS_OK(status)) {
END_PROFILE(SMBntcreateX);
return ERROR_NT(status);
}
pstrcat(fname, rel_fname);
} else {
-   srvstr_get_path(inbuf, fname, smb_buf(inbuf), sizeof(fname), 0, 
STR_TERMINATE, status);
+   srvstr_get_path(inbuf, SVAL(inbuf,smb_flg2), fname,
+   smb_buf(inbuf), sizeof(fname), 0,
+   STR_TERMINATE, status);
if (!NT_STATUS_IS_OK(status)) {
END_PROFILE(SMBntcreateX);
return ERROR_NT(status);
@@ -1011,7 +1017,9 @@
 
flags = IVAL(params,0);
 
-   srvstr_get_path(inbuf, fname, params+53, sizeof(fname), 
parameter_count-53, STR_TERMINATE, status);
+   srvstr_get_path(inbuf, SVAL(inbuf,smb_flg2), fname, params+53,
+   sizeof(fname), parameter_count-53, STR_TERMINATE,
+   status);
if (!NT_STATUS_IS_OK(status)) {
return ERROR_NT(status);
}
@@ -1288,7 +1296,10 @@
}
 
if(!dir_fsp-is_directory) {
-   srvstr_get_path(inbuf, fname, params+53, sizeof(fname), 
parameter_count-53, STR_TERMINATE, status);
+   srvstr_get_path(inbuf, SVAL(inbuf,smb_flg2), fname,
+   params+53, sizeof(fname),
+   parameter_count-53, STR_TERMINATE,
+   status);
if (!NT_STATUS_IS_OK(status)) {
return ERROR_NT(status);
}
@@ -1322,14 +1333,19 @@
 
{
pstring tmpname;
-   srvstr_get_path(inbuf, tmpname, params+53, 
sizeof(tmpname), parameter_count-53, STR_TERMINATE, status);
+   srvstr_get_path(inbuf, SVAL(inbuf,smb_flg2), tmpname,
+   params+53, sizeof(tmpname),
+   parameter_count-53, STR_TERMINATE,
+   status);
if (!NT_STATUS_IS_OK(status)) {
return ERROR_NT(status);
}
pstrcat(fname, tmpname);
}
} else {
-   srvstr_get_path(inbuf, fname, params+53, sizeof(fname), 
parameter_count-53, STR_TERMINATE, status);
+   srvstr_get_path(inbuf, SVAL(inbuf,smb_flg2), fname, params+53,
+   sizeof(fname), parameter_count-53,
+   STR_TERMINATE, status);
if (!NT_STATUS_IS_OK(status)) {
return ERROR_NT(status);
}
@@ -1842,7 +1858,9 @@
init_smb_request(req, (uint8 *)inbuf);
 
p = smb_buf(inbuf) + 1;
-   p += srvstr_get_path_wcard(inbuf, oldname, p, sizeof(oldname), 0, 
STR_TERMINATE, status, src_has_wcard);
+   p += srvstr_get_path_wcard(inbuf, 

svn commit: samba r23726 - in branches/SAMBA_3_0/source: include lib libsmb smbd

2007-07-05 Thread vlendec
Author: vlendec
Date: 2007-07-05 16:33:37 + (Thu, 05 Jul 2007)
New Revision: 23726

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23726

Log:
Explicitly pass down the FLAGS2 field to srvstr_pull_buf. The next
checkin will pull this up to srvstr_get_path. At that point we can get more
independent of the inbuf, the base_ptr in pull_string will only be used
to satisfy UCS2 alignment constraints.


Modified:
   branches/SAMBA_3_0/source/include/safe_string.h
   branches/SAMBA_3_0/source/include/srvstr.h
   branches/SAMBA_3_0/source/lib/charcnv.c
   branches/SAMBA_3_0/source/libsmb/clistr.c
   branches/SAMBA_3_0/source/libsmb/ntlmssp_parse.c
   branches/SAMBA_3_0/source/libsmb/smbencrypt.c
   branches/SAMBA_3_0/source/smbd/ipc.c
   branches/SAMBA_3_0/source/smbd/message.c
   branches/SAMBA_3_0/source/smbd/nttrans.c
   branches/SAMBA_3_0/source/smbd/pipes.c
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_3_0/source/smbd/sesssetup.c
   branches/SAMBA_3_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_0/source/include/safe_string.h
===
--- branches/SAMBA_3_0/source/include/safe_string.h 2007-07-05 16:27:47 UTC 
(rev 23725)
+++ branches/SAMBA_3_0/source/include/safe_string.h 2007-07-05 16:33:37 UTC 
(rev 23726)
@@ -164,7 +164,7 @@
 #define safe_strcpy(dest,src,maxlength)
safe_strcpy_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE,dest,src,maxlength)
 #define safe_strcat(dest,src,maxlength)
safe_strcat_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE,dest,src,maxlength)
 #define push_string(base_ptr, dest, src, dest_len, flags) 
push_string_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, dest, 
src, dest_len, flags)
-#define pull_string(base_ptr, dest, src, dest_len, src_len, flags) 
pull_string_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, dest, 
src, dest_len, src_len, flags)
+#define pull_string(base_ptr, smb_flags2, dest, src, dest_len, src_len, flags) 
pull_string_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, 
smb_flags2, dest, src, dest_len, src_len, flags)
 #define clistr_push(cli, dest, src, dest_len, flags) 
clistr_push_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, cli, dest, src, 
dest_len, flags)
 #define clistr_pull(cli, dest, src, dest_len, src_len, flags) 
clistr_pull_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, cli, dest, src, 
dest_len, src_len, flags)
 #define srvstr_push(base_ptr, dest, src, dest_len, flags) 
srvstr_push_fn2(SAFE_STRING_FUNCTION_NAME, SAFE_STRING_LINE, base_ptr, dest, 
src, dest_len, flags)
@@ -193,10 +193,10 @@
 ? __unsafe_string_function_usage_here_size_t__() \
 : push_string_fn(fn_name, fn_line, base_ptr, dest, src, dest_len, flags))
 
-#define pull_string_fn2(fn_name, fn_line, base_ptr, dest, src, dest_len, 
src_len, flags) \
+#define pull_string_fn2(fn_name, fn_line, base_ptr, smb_flags2, dest, src, 
dest_len, src_len, flags) \
 (CHECK_STRING_SIZE(dest, dest_len) \
 ? __unsafe_string_function_usage_here_size_t__() \
-: pull_string_fn(fn_name, fn_line, base_ptr, dest, src, dest_len, src_len, 
flags))
+: pull_string_fn(fn_name, fn_line, base_ptr, smb_flags2, dest, src, 
dest_len, src_len, flags))
 
 #define clistr_push_fn2(fn_name, fn_line, cli, dest, src, dest_len, flags) \
 (CHECK_STRING_SIZE(dest, dest_len) \

Modified: branches/SAMBA_3_0/source/include/srvstr.h
===
--- branches/SAMBA_3_0/source/include/srvstr.h  2007-07-05 16:27:47 UTC (rev 
23725)
+++ branches/SAMBA_3_0/source/include/srvstr.h  2007-07-05 16:33:37 UTC (rev 
23726)
@@ -18,14 +18,14 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#define srvstr_pull(base_ptr, dest, src, dest_len, src_len, flags) \
-pull_string(base_ptr, dest, src, dest_len, src_len, flags)
+#define srvstr_pull(base_ptr, smb_flags2, dest, src, dest_len, src_len, flags) 
\
+pull_string(base_ptr, smb_flags2, dest, src, dest_len, src_len, flags)
 
 /* pull a string from the smb_buf part of a packet. In this case the
string can either be null terminated or it can be terminated by the
end of the smbbuf area 
 */
 
-#define srvstr_pull_buf(inbuf, dest, src, dest_len, flags) \
-pull_string(inbuf, dest, src, dest_len, smb_bufrem(inbuf, src), flags)
+#define srvstr_pull_buf(inbuf, smb_flags2, dest, src, dest_len, flags) \
+pull_string(inbuf, smb_flags2, dest, src, dest_len, smb_bufrem(inbuf, 
src), flags)
 

Modified: branches/SAMBA_3_0/source/lib/charcnv.c
===
--- branches/SAMBA_3_0/source/lib/charcnv.c 2007-07-05 16:27:47 UTC (rev 
23725)
+++ branches/SAMBA_3_0/source/lib/charcnv.c 2007-07-05 16:33:37 UTC (rev 
23726)
@@ -1376,16 +1376,24 @@
  The resulting string in dest is always null terminated.
 **/
 
-size_t pull_string_fn(const char *function, 

svn commit: samba r23728 - in branches: SAMBA_3_0/source/smbd SAMBA_3_0_25/source/smbd SAMBA_3_0_26/source/smbd

2007-07-05 Thread jra
Author: jra
Date: 2007-07-05 18:28:18 + (Thu, 05 Jul 2007)
New Revision: 23728

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23728

Log:
First part of bugfix for #4763. Limit notify responses
to client max buf size.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/smbd/notify.c
   branches/SAMBA_3_0_25/source/smbd/notify.c
   branches/SAMBA_3_0_26/source/smbd/notify.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/notify.c
===
--- branches/SAMBA_3_0/source/smbd/notify.c 2007-07-05 16:36:15 UTC (rev 
23727)
+++ branches/SAMBA_3_0/source/smbd/notify.c 2007-07-05 18:28:18 UTC (rev 
23728)
@@ -22,6 +22,9 @@
 
 #include includes.h
 
+/* Max size we can send to client in a notify response. */
+extern int max_send;
+
 struct notify_change_request {
struct notify_change_request *prev, *next;
struct files_struct *fsp;   /* backpointer for cancel by mid */
@@ -147,6 +150,15 @@
 
buflen = smb_size+38+prs_offset(ps) + 4 /* padding */;
 
+   if (buflen  max_send) {
+   /*
+* We exceed what the client is willing to accept. Send
+* nothing.
+*/
+   change_notify_reply_packet(request_buf, NT_STATUS_OK);
+   goto done;
+   }
+
if (!(outbuf = SMB_MALLOC_ARRAY(char, buflen))) {
change_notify_reply_packet(request_buf, NT_STATUS_NO_MEMORY);
goto done;

Modified: branches/SAMBA_3_0_25/source/smbd/notify.c
===
--- branches/SAMBA_3_0_25/source/smbd/notify.c  2007-07-05 16:36:15 UTC (rev 
23727)
+++ branches/SAMBA_3_0_25/source/smbd/notify.c  2007-07-05 18:28:18 UTC (rev 
23728)
@@ -22,6 +22,9 @@
 
 #include includes.h
 
+/* Max size we can send to client in a notify response. */
+extern int max_send;
+
 struct notify_change_request {
struct notify_change_request *prev, *next;
struct files_struct *fsp;   /* backpointer for cancel by mid */
@@ -146,6 +149,15 @@
 
buflen = smb_size+38+prs_offset(ps) + 4 /* padding */;
 
+   if (buflen  max_send) {
+   /*
+* We exceed what the client is willing to accept. Send
+* nothing.
+*/
+   change_notify_reply_packet(request_buf, NT_STATUS_OK);
+   goto done;
+   }
+
if (!(outbuf = SMB_MALLOC_ARRAY(char, buflen))) {
change_notify_reply_packet(request_buf, NT_STATUS_NO_MEMORY);
goto done;

Modified: branches/SAMBA_3_0_26/source/smbd/notify.c
===
--- branches/SAMBA_3_0_26/source/smbd/notify.c  2007-07-05 16:36:15 UTC (rev 
23727)
+++ branches/SAMBA_3_0_26/source/smbd/notify.c  2007-07-05 18:28:18 UTC (rev 
23728)
@@ -22,6 +22,9 @@
 
 #include includes.h
 
+/* Max size we can send to client in a notify response. */
+extern int max_send;
+
 struct notify_change_request {
struct notify_change_request *prev, *next;
struct files_struct *fsp;   /* backpointer for cancel by mid */
@@ -146,6 +149,15 @@
 
buflen = smb_size+38+prs_offset(ps) + 4 /* padding */;
 
+   if (buflen  max_send) {
+   /*
+* We exceed what the client is willing to accept. Send
+* nothing.
+*/
+   change_notify_reply_packet(request_buf, NT_STATUS_OK);
+   goto done;
+   }
+
if (!(outbuf = SMB_MALLOC_ARRAY(char, buflen))) {
change_notify_reply_packet(request_buf, NT_STATUS_NO_MEMORY);
goto done;



svn commit: samba r23729 - in branches/SAMBA_3_0_26/source/nsswitch: .

2007-07-05 Thread jerry
Author: jerry
Date: 2007-07-05 19:55:25 + (Thu, 05 Jul 2007)
New Revision: 23729

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23729

Log:
Squashed commit of the following:

commit 3941269fa01038fca242a197e8d7c1f234d45ea7
Author: Gerald (Jerry) Carter [EMAIL PROTECTED]
Date:   Thu Jul 5 14:52:03 2007 -0500

Two fixes for winbind expand groups.

(a) Update the counter for the number of new groups to resolve else
we'll only expand one group member per level and drop the rest.
(b) Don't reset the num_names counter in winbindd_ads.c:lookup_groupmem()
or we'll drop the SIDs resolved to names via cache from the resulting
list.

Modified:
   branches/SAMBA_3_0_26/source/nsswitch/winbindd_ads.c
   branches/SAMBA_3_0_26/source/nsswitch/winbindd_group.c


Changeset:
Modified: branches/SAMBA_3_0_26/source/nsswitch/winbindd_ads.c
===
--- branches/SAMBA_3_0_26/source/nsswitch/winbindd_ads.c2007-07-05 
18:28:18 UTC (rev 23728)
+++ branches/SAMBA_3_0_26/source/nsswitch/winbindd_ads.c2007-07-05 
19:55:25 UTC (rev 23729)
@@ -1017,7 +1017,11 @@
DEBUG(10,(ads: lookup_groupmem: got sid %s from 
cache\n,
 sid_string_static(sid)));
sid_copy((*sid_mem)[*num_names], sid);
-   (*names)[*num_names] = CONST_DISCARD(char *,name);
+   (*names)[*num_names] = talloc_asprintf(*names, %s%c%s,
+  domain_name,
+  
*lp_winbind_separator(),
+  name );
+
(*name_types)[*num_names] = name_type;
(*num_names)++;
}
@@ -1055,7 +1059,6 @@
/* Copy the entries over from the _nocache arrays 
 * to the result arrays, skipping the gaps the 
 * lookup_sids call left. */
-   *num_names = 0;
for (i=0; i  num_nocache; i++) {
if (((names_nocache)[i] != NULL)  
((name_types_nocache)[i] != 
SID_NAME_UNKNOWN)) 

Modified: branches/SAMBA_3_0_26/source/nsswitch/winbindd_group.c
===
--- branches/SAMBA_3_0_26/source/nsswitch/winbindd_group.c  2007-07-05 
18:28:18 UTC (rev 23728)
+++ branches/SAMBA_3_0_26/source/nsswitch/winbindd_group.c  2007-07-05 
19:55:25 UTC (rev 23729)
@@ -576,6 +576,7 @@
/* One more round */
TALLOC_FREE(glist);
glist = new_glist;
+   n_glist = n_new_glist;
}
TALLOC_FREE( glist );   
 



svn commit: samba r23730 - in branches/SAMBA_3_0/source/nsswitch: .

2007-07-05 Thread jerry
Author: jerry
Date: 2007-07-05 19:55:40 + (Thu, 05 Jul 2007)
New Revision: 23730

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=23730

Log:
Squashed commit of the following:

commit 3941269fa01038fca242a197e8d7c1f234d45ea7
Author: Gerald (Jerry) Carter [EMAIL PROTECTED]
Date:   Thu Jul 5 14:52:03 2007 -0500

Two fixes for winbind expand groups.

(a) Update the counter for the number of new groups to resolve else
we'll only expand one group member per level and drop the rest.
(b) Don't reset the num_names counter in winbindd_ads.c:lookup_groupmem()
or we'll drop the SIDs resolved to names via cache from the resulting
list.

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_group.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c   2007-07-05 19:55:25 UTC 
(rev 23729)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_ads.c   2007-07-05 19:55:40 UTC 
(rev 23730)
@@ -1017,7 +1017,11 @@
DEBUG(10,(ads: lookup_groupmem: got sid %s from 
cache\n,
 sid_string_static(sid)));
sid_copy((*sid_mem)[*num_names], sid);
-   (*names)[*num_names] = CONST_DISCARD(char *,name);
+   (*names)[*num_names] = talloc_asprintf(*names, %s%c%s,
+  domain_name,
+  
*lp_winbind_separator(),
+  name );
+
(*name_types)[*num_names] = name_type;
(*num_names)++;
}
@@ -1055,7 +1059,6 @@
/* Copy the entries over from the _nocache arrays 
 * to the result arrays, skipping the gaps the 
 * lookup_sids call left. */
-   *num_names = 0;
for (i=0; i  num_nocache; i++) {
if (((names_nocache)[i] != NULL)  
((name_types_nocache)[i] != 
SID_NAME_UNKNOWN)) 

Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_group.c
===
--- branches/SAMBA_3_0/source/nsswitch/winbindd_group.c 2007-07-05 19:55:25 UTC 
(rev 23729)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_group.c 2007-07-05 19:55:40 UTC 
(rev 23730)
@@ -576,6 +576,7 @@
/* One more round */
TALLOC_FREE(glist);
glist = new_glist;
+   n_glist = n_new_glist;
}
TALLOC_FREE( glist );   
 



Build status as of Fri Jul 6 00:00:03 2007

2007-07-05 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-07-05 
00:00:30.0 +
+++ /home/build/master/cache/broken_results.txt 2007-07-06 00:01:12.0 
+
@@ -1,4 +1,4 @@
-Build status as of Thu Jul  5 00:00:01 2007
+Build status as of Fri Jul  6 00:00:03 2007
 
 Build counts:
 Tree Total  Broken Panic 
@@ -7,18 +7,18 @@
 ccache   35 8  0 
 ctdb 0  0  0 
 distcc   2  0  0 
-ldb  34 3  0 
+ldb  33 3  0 
 libreplace   33 10 0 
 lorikeet-heimdal 30 13 0 
 pidl 18 4  0 
 ppp  15 10 0 
 python   0  0  0 
-rsync34 12 0 
+rsync35 12 0 
 samba0  0  0 
 samba-docs   0  0  0 
 samba-gtk4  4  0 
-samba4   32 21 8 
-samba_3_035 18 0 
+samba4   32 22 9 
+samba_3_035 19 0 
 smb-build32 32 0 
 talloc   35 8  0 
 tdb  34 1  0