svn commit: samba-web r1409 - in trunk/security: .

2010-03-08 Thread vlendec
Author: vlendec
Date: 2010-03-08 15:00:48 -0700 (Mon, 08 Mar 2010)
New Revision: 1409

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

Log:
Mention the bug reporter

Modified:
   trunk/security/CVE-2010-0728.html


Changeset:
Modified: trunk/security/CVE-2010-0728.html
===
--- trunk/security/CVE-2010-0728.html   2010-03-08 21:36:30 UTC (rev 1408)
+++ trunk/security/CVE-2010-0728.html   2010-03-08 22:00:48 UTC (rev 1409)
@@ -59,7 +59,14 @@
 
 None available
 
+===
+Credits
+===
 
+The problem was was reported as
+https://bugzilla.samba.org/show_bug.cgi?id=7222
+by Andreas Matthus andreas.matt...@tu-dresden.de.
+
 ==
 == Our Code, Our Bugs, Our Responsibility.
 == The Samba Team



svn commit: samba-web r1399 - in trunk/support: .

2010-02-24 Thread vlendec
Author: vlendec
Date: 2010-02-24 05:23:51 -0700 (Wed, 24 Feb 2010)
New Revision: 1399

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

Log:
Fix umlauts for s+c

Modified:
   trunk/support/germany.html


Changeset:
Modified: trunk/support/germany.html
===
--- trunk/support/germany.html  2010-02-24 12:06:07 UTC (rev 1398)
+++ trunk/support/germany.html  2010-02-24 12:23:51 UTC (rev 1399)
@@ -11,16 +11,16 @@
 presmall
 science + computing ag
 Hagellocher Weg 73
-D-72070 Tübingen
+D-72070 Tuuml;bingen
 
 http://www.science-computing.de
 sa...@science-computing.de
 Support
 /small/pre
 p
-science + computing betreibt und unterstützt verschiedene z.T. sehr grosse 
Computer-Netzwerke im eher technischen Umfeld. Vor allem, aber nicht 
ausschließlich, in der Automobil- und Halbleiterindustrie. Wir übernehmen auch 
die Programmierung von Individualsoftware und erstellen und vertreiben eigene 
Softwareprodukte. In Linux-Migrations-Projekten setzen wir samba und OpenLDAP 
ein. Art des Supports für Samba: Vor Ort, Remote, Beratung, Installation. Wir 
unterstützen mit Dienstleistungen und Software Unix-, Linux- und 
Windows-Plattformen.
+science + computing betreibt und unterstuuml;tzt verschiedene z.T. sehr 
grosse Computer-Netzwerke im eher technischen Umfeld. Vor allem, aber nicht 
ausschlieszlig;lich, in der Automobil- und Halbleiterindustrie. Wir 
uuml;bernehmen auch die Programmierung von Individualsoftware und erstellen 
und vertreiben eigene Softwareprodukte. In Linux-Migrations-Projekten setzen 
wir samba und OpenLDAP ein. Art des Supports fuuml;r Samba: Vor Ort, Remote, 
Beratung, Installation. Wir unterstuuml;tzen mit Dienstleistungen und Software 
Unix-, Linux- und Windows-Plattformen.
 /pp
-Specialty samba capabilities: Consulting zu samba mit Active Directory, LDAP, 
TSM. samba auf AIX, HP-UX, Solaris und Linux. Wir portieren und erstellen 
Patches für Spezialanwendungen.
+Specialty samba capabilities: Consulting zu samba mit Active Directory, LDAP, 
TSM. samba auf AIX, HP-UX, Solaris und Linux. Wir portieren und erstellen 
Patches fuuml;r Spezialanwendungen.
 /pp
 Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. 
Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the 
Supervisory Board: Michel Lepert Sitz/Registered Office: Tuebingen 
Registergericht/Registration Court: Stuttgart Registernummer/Commercial 
Register No.: HRB 382196
 /p



svn commit: samba-web r1310 - in trunk: .

2009-07-17 Thread vlendec
Author: vlendec
Date: 2009-07-17 09:19:28 -0600 (Fri, 17 Jul 2009)
New Revision: 1310

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

Log:
Make our intro on www.samba.org a bit more friendly

Modified:
   trunk/index.html


Changeset:
Modified: trunk/index.html
===
--- trunk/index.html2009-07-03 12:55:45 UTC (rev 1309)
+++ trunk/index.html2009-07-17 15:19:28 UTC (rev 1310)
@@ -2,18 +2,25 @@
   titleSamba - opening windows to a wider world/title
 !--#include virtual=/samba/header_columns.html --
 
-pSamba is an a href=http://www.opensource.org/;Open Source/a/a
-   href=http://www.gnu.org/philosophy/free-sw.html;Free Software/a
-   suite that has, a href=/samba/docs/10years.htmlsince 1992/a,
-   provided file and print services to all manner of SMB/CIFS clients,
-   including the numerous versions of Microsoft Windows operating
-   systems.  Samba is freely available under the
-   a href=/samba/docs/GPL.htmlGNU General Public License/a./p
+pSamba is the standard Windows interoperability suite of programs
+  for Linux and Unix./p
 
-pThe Samba project is a member of the
-a href=http://conservancy.softwarefreedom.org/;Software Freedom
+pSamba is a href=http://www.gnu.org/philosophy/free-sw.html;Free
+Software/a licensed under the a href=/samba/docs/GPL.htmlGNU
+General Public License/a, the Samba project is a member of the
+  a href=http://conservancy.softwarefreedom.org/;Software Freedom
 Conservancy/a./p
 
+pSince a href=/samba/docs/10years.html1992/a, Samba has
+provided secure, stable and fast file and print services
+for emall/em clients using the SMB/CIFS protocol, such as all
+versions of DOS and Windows, OS/2, Linux and many others./p
+
+pSamba is an important component to seamlessly integrate Linux/Unix
+Servers and Desktops into Active Directory environments using the
+winbind daemon./p
+
+
 h2Latest News/h2
 !--#include virtual=/samba/news/headlines.html --
 



svn commit: samba-web r1244 - in trunk/devel: .

2008-10-05 Thread vlendec
Author: vlendec
Date: 2008-10-05 08:24:09 + (Sun, 05 Oct 2008)
New Revision: 1244

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

Log:
Fix a typo
Modified:
   trunk/devel/index.html


Changeset:
Modified: trunk/devel/index.html
===
--- trunk/devel/index.html  2008-10-02 11:14:53 UTC (rev 1243)
+++ trunk/devel/index.html  2008-10-05 08:24:09 UTC (rev 1244)
@@ -14,7 +14,7 @@
 
 pOn 4 April 2004, the Samba Team converted from CVS to Subversion for
 maintaining the Samba source code, and on 10 January 2008 we completed the
-switch to Git for all development barnches.
+switch to Git for all development branches.
 With the transition to Git we also recovered in the main tree the CVS history.
 All older code is in the original Subversion and CVS trees; this would include
 3.0.x and 2.2.x versions of Samba, which are no longer in active development.



svn commit: samba-web r1179 - in trunk/devel: .

2008-03-29 Thread vlendec
Author: vlendec
Date: 2008-03-29 10:30:27 + (Sat, 29 Mar 2008)
New Revision: 1179

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

Log:
Refer to the wiki for development projects

Modified:
   trunk/devel/TODO.html


Changeset:
Modified: trunk/devel/TODO.html
===
--- trunk/devel/TODO.html   2008-03-13 18:05:24 UTC (rev 1178)
+++ trunk/devel/TODO.html   2008-03-29 10:30:27 UTC (rev 1179)
@@ -7,6 +7,9 @@
 pSamba is developed by hard work from a world-wide team of volunteers.  This 
page provides a list of on-going projects within Samba development, and offers 
information about how to get involved.  Be sure to read the a 
href=/samba/devel/development page/a regarding responsibly submitting 
patches./p  
 br /
 
+pMost project ideas these days are listed on the Wiki pages for a
+href=http://wiki.samba.org/index.php/Samba3;Samba3/a and a
+href=http://wiki.samba.org/index.php/Samba4;Samba4/a./pbr /
 
 h3Documentation/h3
 



svn commit: samba-docs r1247 - in trunk/smbdotconf/browse: .

2008-02-29 Thread vlendec
Author: vlendec
Date: 2008-02-29 12:06:34 + (Fri, 29 Feb 2008)
New Revision: 1247

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

Log:
hidden-administrative share

Added:
   trunk/smbdotconf/browse/administrative_share.xml
Removed:
   trunk/smbdotconf/browse/hidden.xml


Changeset:
Added: trunk/smbdotconf/browse/administrative_share.xml
===
--- trunk/smbdotconf/browse/administrative_share.xml2008-02-28 10:07:40 UTC 
(rev 1246)
+++ trunk/smbdotconf/browse/administrative_share.xml2008-02-29 12:06:34 UTC 
(rev 1247)
@@ -0,0 +1,15 @@
+samba:parameter name=administrative share
+ context=S
+ type=boolean
+ xmlns:samba=http://www.samba.org/samba/DTD/samba-doc;
+description
+paraIf this parameter is set to constantyes/constant for
+  a share, then the share will be an administrative share. The 
Administrative
+  Shares are the default network shares created by all Windows NT-based
+  operating systems. These are shares like C$, D$ or ADMIN$. The type of 
these
+  shares is STYPE_DISKTREE_HIDDEN.
+
+paraSee the section below on smbconfoption name=security/ for more 
information about this option.
+/description
+value type=defaultno/value
+/samba:parameter

Deleted: trunk/smbdotconf/browse/hidden.xml
===
--- trunk/smbdotconf/browse/hidden.xml  2008-02-28 10:07:40 UTC (rev 1246)
+++ trunk/smbdotconf/browse/hidden.xml  2008-02-29 12:06:34 UTC (rev 1247)
@@ -1,12 +0,0 @@
-samba:parameter name=hidden
- context=S
- type=boolean
- xmlns:samba=http://www.samba.org/samba/DTD/samba-doc;
-description
-paraIf this parameter is set to constantyes/constant for 
-a service, then the share will be hidden and can't be administrated 
(STYPE_DISKTREE_HIDDEN).
-
-paraSee the section below on smbconfoption name=security/ for more 
information about this option.
-/description
-value type=defaultno/value
-/samba:parameter



svn commit: samba-docs r1244 - in trunk/smbdotconf/browse: .

2008-02-26 Thread vlendec
Author: vlendec
Date: 2008-02-26 20:34:33 + (Tue, 26 Feb 2008)
New Revision: 1244

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

Log:
Add docs for hidden parameter

Thanks to Andreas Schneider [EMAIL PROTECTED]

Added:
   trunk/smbdotconf/browse/hidden.xml


Changeset:
Added: trunk/smbdotconf/browse/hidden.xml
===
--- trunk/smbdotconf/browse/hidden.xml  2008-02-21 19:02:50 UTC (rev 1243)
+++ trunk/smbdotconf/browse/hidden.xml  2008-02-26 20:34:33 UTC (rev 1244)
@@ -0,0 +1,12 @@
+samba:parameter name=hidden
+ context=S
+ type=boolean
+ xmlns:samba=http://www.samba.org/samba/DTD/samba-doc;
+description
+paraIf this parameter is set to constantyes/constant for 
+a service, then the share will be hidden and can't be administrated 
(STYPE_DISKTREE_HIDDEN).
+
+paraSee the section below on smbconfoption name=security/ for more 
information about this option.
+/description
+value type=defaultno/value
+/samba:parameter



svn commit: samba-docs r1222 - in trunk/smbdotconf/filename: .

2008-01-09 Thread vlendec
Author: vlendec
Date: 2008-01-09 10:24:03 + (Wed, 09 Jan 2008)
New Revision: 1222

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

Log:
document changed default
Modified:
   trunk/smbdotconf/filename/maxstatcachesize.xml


Changeset:
Modified: trunk/smbdotconf/filename/maxstatcachesize.xml
===
--- trunk/smbdotconf/filename/maxstatcachesize.xml  2008-01-08 10:30:33 UTC 
(rev 1221)
+++ trunk/smbdotconf/filename/maxstatcachesize.xml  2008-01-09 10:24:03 UTC 
(rev 1222)
@@ -13,6 +13,6 @@
You should not need to change this parameter./para
 /description
 relatedstat cache/related
-value type=default1024/value
+value type=default256/value
 value type=example100/value
 /samba:parameter



svn commit: samba r26568 - in branches/SAMBA_4_0/source/lib/ldb: .

2007-12-23 Thread vlendec
Author: vlendec
Date: 2007-12-23 15:57:58 + (Sun, 23 Dec 2007)
New Revision: 26568

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

Log:
Revert r26482

Next attempt to fix the Samba3 torture breakage

Jelmer, can you please review this?

Thanks,

Volker

Modified:
   branches/SAMBA_4_0/source/lib/ldb/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/config.mk
===
--- branches/SAMBA_4_0/source/lib/ldb/config.mk 2007-12-22 14:28:45 UTC (rev 
26567)
+++ branches/SAMBA_4_0/source/lib/ldb/config.mk 2007-12-23 15:57:58 UTC (rev 
26568)
@@ -128,7 +128,6 @@
 [LIBRARY::LIBLDB]
 VERSION = 0.0.1
 SO_VERSION = 0
-OUTPUT_TYPE = SHARED_LIBRARY
 CFLAGS = -Ilib/ldb/include
 DESCRIPTION = LDAP-like embedded database library
 INIT_FUNCTION_TYPE = int (*) (void)



svn commit: samba r26569 - in branches/SAMBA_4_0/source/lib/ldb: .

2007-12-23 Thread vlendec
Author: vlendec
Date: 2007-12-23 16:05:05 + (Sun, 23 Dec 2007)
New Revision: 26569

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

Log:
Jelmer tells me that ldb must inevitably be build as a shared library,
otherwise it will break.

Sorry for breaking Samba4.

I will have to look how we can fix Samba3 :-(((


Modified:
   branches/SAMBA_4_0/source/lib/ldb/config.mk


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/config.mk
===
--- branches/SAMBA_4_0/source/lib/ldb/config.mk 2007-12-23 15:57:58 UTC (rev 
26568)
+++ branches/SAMBA_4_0/source/lib/ldb/config.mk 2007-12-23 16:05:05 UTC (rev 
26569)
@@ -128,6 +128,7 @@
 [LIBRARY::LIBLDB]
 VERSION = 0.0.1
 SO_VERSION = 0
+OUTPUT_TYPE = SHARED_LIBRARY
 CFLAGS = -Ilib/ldb/include
 DESCRIPTION = LDAP-like embedded database library
 INIT_FUNCTION_TYPE = int (*) (void)



svn commit: samba r26184 - in branches/SAMBA_4_0/source/torture/raw: .

2007-11-28 Thread vlendec
Author: vlendec
Date: 2007-11-28 15:59:11 + (Wed, 28 Nov 2007)
New Revision: 26184

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

Log:
Streams are tricky
Modified:
   branches/SAMBA_4_0/source/torture/raw/streams.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/streams.c
===
--- branches/SAMBA_4_0/source/torture/raw/streams.c 2007-11-28 05:24:59 UTC 
(rev 26183)
+++ branches/SAMBA_4_0/source/torture/raw/streams.c 2007-11-28 15:59:11 UTC 
(rev 26184)
@@ -172,7 +172,8 @@
 /*
   test basic io on streams
 */
-static bool test_stream_io(struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
+static bool test_stream_io(struct torture_context *tctx,
+  struct smbcli_state *cli, TALLOC_CTX *mem_ctx)
 {
NTSTATUS status;
union smb_open io;
@@ -261,6 +262,10 @@
ret = check_stream(cli, __location__, mem_ctx, fname, Stream 
One:$DATA, test MORE DATA );
ret = check_stream(cli, __location__, mem_ctx, fname, Stream One:, 
NULL);
ret = check_stream(cli, __location__, mem_ctx, fname, Second Stream, 
SECOND STREAM);
+   if (!torture_setting_bool(tctx, samba4, false)) {
+   ret = check_stream(cli, __location__, mem_ctx, fname,
+   SECOND STREAM:$DATA, SECOND STREAM);
+   }
ret = check_stream(cli, __location__, mem_ctx, fname, Second 
Stream:$DATA, SECOND STREAM);
ret = check_stream(cli, __location__, mem_ctx, fname, Second 
Stream:, NULL);
ret = check_stream(cli, __location__, mem_ctx, fname, Second 
Stream:$FOO, NULL);
@@ -290,6 +295,18 @@
 
check_stream_list(cli, fname, 1, one);
 
+   if (!torture_setting_bool(tctx, samba4, false)) {
+   io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
+   io.ntcreatex.in.fname = sname1;
+   status = smb_raw_open(cli-tree, mem_ctx, io);
+   CHECK_STATUS(status, NT_STATUS_OK);
+   smbcli_close(cli-tree, io.ntcreatex.out.file.fnum);
+   io.ntcreatex.in.fname = sname2;
+   status = smb_raw_open(cli-tree, mem_ctx, io);
+   CHECK_STATUS(status, NT_STATUS_OK);
+   smbcli_close(cli-tree, io.ntcreatex.out.file.fnum);
+   }
+
printf((%s) deleting file\n, __location__);
status = smbcli_unlink(cli-tree, fname);
CHECK_STATUS(status, NT_STATUS_OK);
@@ -299,7 +316,229 @@
return ret;
 }
 
+/*
+  test stream sharemodes
+*/
+static bool test_stream_sharemodes(struct torture_context *tctx,
+  struct smbcli_state *cli,
+  TALLOC_CTX *mem_ctx)
+{
+   NTSTATUS status;
+   union smb_open io;
+   const char *fname = BASEDIR \\stream.txt;
+   const char *sname1, *sname2;
+   bool ret = true;
+   int fnum1 = -1;
+   int fnum2 = -1;
+
+   sname1 = talloc_asprintf(mem_ctx, %s:%s, fname, Stream One);
+   sname2 = talloc_asprintf(mem_ctx, %s:%s:$DaTa, fname, Second 
Stream);
+
+   printf((%s) testing stream share mode conflicts\n, __location__);
+   io.generic.level = RAW_OPEN_NTCREATEX;
+   io.ntcreatex.in.root_fid = 0;
+   io.ntcreatex.in.flags = 0;
+   io.ntcreatex.in.access_mask = SEC_FILE_WRITE_DATA;
+   io.ntcreatex.in.create_options = 0;
+   io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
+   io.ntcreatex.in.share_access = 0;
+   io.ntcreatex.in.alloc_size = 0;
+   io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
+   io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
+   io.ntcreatex.in.security_flags = 0;
+   io.ntcreatex.in.fname = sname1;
+
+   status = smb_raw_open(cli-tree, mem_ctx, io);
+   CHECK_STATUS(status, NT_STATUS_OK);
+   fnum1 = io.ntcreatex.out.file.fnum;
+
+   /*
+* A different stream does not give a sharing violation
+*/
+
+   CHECK_STATUS(status, NT_STATUS_OK);
+   fnum1 = io.ntcreatex.out.file.fnum;
+
+   /*
+* ... whereas the same stream does with unchanged access/share_access
+* flags
+*/
+
+   io.ntcreatex.in.open_disposition = 0;
+   status = smb_raw_open(cli-tree, mem_ctx, io);
+   CHECK_STATUS(status, NT_STATUS_SHARING_VIOLATION);
+
+   io.ntcreatex.in.fname = sname2;
+   status = smb_raw_open(cli-tree, mem_ctx, io);
+   CHECK_STATUS(status, NT_STATUS_OK);
+   fnum2 = io.ntcreatex.out.file.fnum;
+
+done:
+   if (fnum1 != -1) smbcli_close(cli-tree, fnum1);
+   if (fnum2 != -1) smbcli_close(cli-tree, fnum2);
+   status = smbcli_unlink(cli-tree, fname);
+   return ret;
+}
+
 /* 
+ *  Test FILE_SHARE_DELETE on streams
+ *
+ * A stream opened with !FILE_SHARE_DELETE prevents the main file to be opened
+ * with SEC_STD_DELETE.
+ *
+ * The main file opened with !FILE_SHARE_DELETE does

svn commit: samba r26111 - in branches/SAMBA_4_0/source/torture/rpc: .

2007-11-25 Thread vlendec
Author: vlendec
Date: 2007-11-25 13:38:07 + (Sun, 25 Nov 2007)
New Revision: 26111

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

Log:
Fix an uninitialized variable
Modified:
   branches/SAMBA_4_0/source/torture/rpc/dfs.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/dfs.c
===
--- branches/SAMBA_4_0/source/torture/rpc/dfs.c 2007-11-25 04:53:54 UTC (rev 
26110)
+++ branches/SAMBA_4_0/source/torture/rpc/dfs.c 2007-11-25 13:38:07 UTC (rev 
26111)
@@ -503,7 +503,7 @@
const char *dir = SMBTORTURE_DFS_DIRNAME;
const char *path = SMBTORTURE_DFS_PATHNAME;
struct smbcli_state *cli;
-   bool ret;
+   bool ret = true;
 
printf(Testing StdRoot\n);
 



svn commit: samba r26104 - in branches/SAMBA_4_0/source/torture/raw: .

2007-11-23 Thread vlendec
Author: vlendec
Date: 2007-11-23 16:02:27 + (Fri, 23 Nov 2007)
New Revision: 26104

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

Log:
Revert 26103 -- breaks make test
Modified:
   branches/SAMBA_4_0/source/torture/raw/streams.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/streams.c
===
--- branches/SAMBA_4_0/source/torture/raw/streams.c 2007-11-23 15:29:22 UTC 
(rev 26103)
+++ branches/SAMBA_4_0/source/torture/raw/streams.c 2007-11-23 16:02:27 UTC 
(rev 26104)
@@ -261,8 +261,6 @@
ret = check_stream(cli, __location__, mem_ctx, fname, Stream 
One:$DATA, test MORE DATA );
ret = check_stream(cli, __location__, mem_ctx, fname, Stream One:, 
NULL);
ret = check_stream(cli, __location__, mem_ctx, fname, Second Stream, 
SECOND STREAM);
-   ret = check_stream(cli, __location__, mem_ctx, fname,
-   SECOND STREAM:$DATA, SECOND STREAM);
ret = check_stream(cli, __location__, mem_ctx, fname, Second 
Stream:$DATA, SECOND STREAM);
ret = check_stream(cli, __location__, mem_ctx, fname, Second 
Stream:, NULL);
ret = check_stream(cli, __location__, mem_ctx, fname, Second 
Stream:$FOO, NULL);
@@ -292,16 +290,6 @@
 
check_stream_list(cli, fname, 1, one);
 
-   io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
-   io.ntcreatex.in.fname = sname1;
-   status = smb_raw_open(cli-tree, mem_ctx, io);
-   CHECK_STATUS(status, NT_STATUS_OK);
-   smbcli_close(cli-tree, io.ntcreatex.out.file.fnum);
-   io.ntcreatex.in.fname = sname2;
-   status = smb_raw_open(cli-tree, mem_ctx, io);
-   CHECK_STATUS(status, NT_STATUS_OK);
-   smbcli_close(cli-tree, io.ntcreatex.out.file.fnum);
-
printf((%s) deleting file\n, __location__);
status = smbcli_unlink(cli-tree, fname);
CHECK_STATUS(status, NT_STATUS_OK);



svn commit: samba r26103 - in branches/SAMBA_4_0/source/torture/raw: .

2007-11-23 Thread vlendec
Author: vlendec
Date: 2007-11-23 15:29:22 + (Fri, 23 Nov 2007)
New Revision: 26103

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

Log:
Leave streams around to unlink
Add test case for stream name case insensitity

Modified:
   branches/SAMBA_4_0/source/torture/raw/streams.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/streams.c
===
--- branches/SAMBA_4_0/source/torture/raw/streams.c 2007-11-22 14:42:14 UTC 
(rev 26102)
+++ branches/SAMBA_4_0/source/torture/raw/streams.c 2007-11-23 15:29:22 UTC 
(rev 26103)
@@ -261,6 +261,8 @@
ret = check_stream(cli, __location__, mem_ctx, fname, Stream 
One:$DATA, test MORE DATA );
ret = check_stream(cli, __location__, mem_ctx, fname, Stream One:, 
NULL);
ret = check_stream(cli, __location__, mem_ctx, fname, Second Stream, 
SECOND STREAM);
+   ret = check_stream(cli, __location__, mem_ctx, fname,
+   SECOND STREAM:$DATA, SECOND STREAM);
ret = check_stream(cli, __location__, mem_ctx, fname, Second 
Stream:$DATA, SECOND STREAM);
ret = check_stream(cli, __location__, mem_ctx, fname, Second 
Stream:, NULL);
ret = check_stream(cli, __location__, mem_ctx, fname, Second 
Stream:$FOO, NULL);
@@ -290,6 +292,16 @@
 
check_stream_list(cli, fname, 1, one);
 
+   io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
+   io.ntcreatex.in.fname = sname1;
+   status = smb_raw_open(cli-tree, mem_ctx, io);
+   CHECK_STATUS(status, NT_STATUS_OK);
+   smbcli_close(cli-tree, io.ntcreatex.out.file.fnum);
+   io.ntcreatex.in.fname = sname2;
+   status = smb_raw_open(cli-tree, mem_ctx, io);
+   CHECK_STATUS(status, NT_STATUS_OK);
+   smbcli_close(cli-tree, io.ntcreatex.out.file.fnum);
+
printf((%s) deleting file\n, __location__);
status = smbcli_unlink(cli-tree, fname);
CHECK_STATUS(status, NT_STATUS_OK);



svn commit: samba r26029 - in branches/SAMBA_4_0/source/torture/raw: .

2007-11-19 Thread vlendec
Author: vlendec
Date: 2007-11-19 15:01:03 + (Mon, 19 Nov 2007)
New Revision: 26029

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

Log:
In RAW-STREAMS test listing of streams
Modified:
   branches/SAMBA_4_0/source/torture/raw/streams.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/streams.c
===
--- branches/SAMBA_4_0/source/torture/raw/streams.c 2007-11-19 12:57:38 UTC 
(rev 26028)
+++ branches/SAMBA_4_0/source/torture/raw/streams.c 2007-11-19 15:01:03 UTC 
(rev 26029)
@@ -46,7 +46,8 @@
 /*
   check that a stream has the right contents
 */
-static bool check_stream(struct smbcli_state *cli, TALLOC_CTX *mem_ctx,
+static bool check_stream(struct smbcli_state *cli, const char *location,
+TALLOC_CTX *mem_ctx,
 const char *fname, const char *sname, 
 const char *value)
 {
@@ -61,15 +62,16 @@
 
if (value == NULL) {
if (fnum != -1) {
-   printf(should have failed stream open of %s\n, 
full_name);
+   printf((%s) should have failed stream open of %s\n,
+  location, full_name);
return false;
}
return true;
}

if (fnum == -1) {
-   printf(Failed to open stream '%s' - %s\n, 
-  full_name, smbcli_errstr(cli-tree));
+   printf((%s) Failed to open stream '%s' - %s\n,
+  location, full_name, smbcli_errstr(cli-tree));
return false;
}
 
@@ -77,13 +79,13 @@

ret = smbcli_read(cli-tree, fnum, buf, 0, strlen(value)+11);
if (ret != strlen(value)) {
-   printf(Failed to read %lu bytes from stream '%s' - got %d\n,
-  (long)strlen(value), full_name, (int)ret);
+   printf((%s) Failed to read %lu bytes from stream '%s' - got 
%d\n,
+  location, (long)strlen(value), full_name, (int)ret);
return false;
}
 
if (memcmp(buf, value, strlen(value)) != 0) {
-   printf(Bad data in stream\n);
+   printf((%s) Bad data in stream\n, location);
return false;
}
 
@@ -91,6 +93,82 @@
return true;
 }
 
+static int qsort_string(const void *v1, const void *v2)
+{
+   char * const *s1 = v1;
+   char * const *s2 = v2;
+   return strcmp(*s1, *s2);
+}
+
+static int qsort_stream(const void *v1, const void *v2)
+{
+   const struct stream_struct * s1 = v1;
+   const struct stream_struct * s2 = v2;
+   return strcmp(s1-stream_name.s, s2-stream_name.s);
+}
+
+static bool check_stream_list(struct smbcli_state *cli, const char *fname,
+ int num_exp, const char **exp)
+{
+   union smb_fileinfo finfo;
+   NTSTATUS status;
+   int i;
+   TALLOC_CTX *tmp_ctx = talloc_new(cli);
+   char **exp_sort;
+   struct stream_struct *stream_sort;
+   bool ret = false;
+
+   finfo.generic.level = RAW_FILEINFO_STREAM_INFO;
+   finfo.generic.in.file.path = fname;
+
+   status = smb_raw_pathinfo(cli-tree, tmp_ctx, finfo);
+   if (!NT_STATUS_IS_OK(status)) {
+   d_fprintf(stderr, (%s) smb_raw_pathinfo failed: %s\n,
+ __location__, nt_errstr(status));
+   goto fail;
+   }
+
+   if (finfo.stream_info.out.num_streams != num_exp) {
+   d_fprintf(stderr, (%s) expected %d streams, got %d\n,
+ __location__, num_exp,
+ finfo.stream_info.out.num_streams);
+   goto fail;
+   }
+
+   exp_sort = talloc_memdup(tmp_ctx, exp, num_exp * sizeof(*exp));
+
+   if (exp_sort == NULL) {
+   goto fail;
+   }
+
+   qsort(exp_sort, num_exp, sizeof(*exp_sort), qsort_string);
+
+   stream_sort = talloc_memdup(tmp_ctx, finfo.stream_info.out.streams,
+   finfo.stream_info.out.num_streams *
+   sizeof(*stream_sort));
+
+   if (stream_sort == NULL) {
+   goto fail;
+   }
+
+   qsort(stream_sort, finfo.stream_info.out.num_streams,
+ sizeof(*stream_sort), qsort_stream);
+
+   for (i=0; inum_exp; i++) {
+   if (strcmp(exp_sort[i], stream_sort[i].stream_name.s) != 0) {
+   d_fprintf(stderr, (%s) expected stream name %s, got 
+ %s\n, __location__, exp_sort[i],
+ stream_sort[i].stream_name.s);
+   goto fail;
+   }
+   }
+
+   ret = true;
+ fail:
+   talloc_free(tmp_ctx);
+   return ret;
+}
+
 /*
   test basic io on streams
 */
@@ -104,10 +182,15 @@
int fnum = -1;
ssize_t

svn commit: samba r25827 - in branches/SAMBA_4_0/source/torture/rpc: .

2007-11-04 Thread vlendec
Author: vlendec
Date: 2007-11-05 02:33:30 + (Mon, 05 Nov 2007)
New Revision: 25827

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

Log:
Start of samba3-regconfig test

Modified:
   branches/SAMBA_4_0/source/torture/rpc/rpc.c
   branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/rpc.c
===
--- branches/SAMBA_4_0/source/torture/rpc/rpc.c 2007-11-05 02:29:17 UTC (rev 
25826)
+++ branches/SAMBA_4_0/source/torture/rpc/rpc.c 2007-11-05 02:33:30 UTC (rev 
25827)
@@ -428,6 +428,7 @@
torture_suite_add_simple_test(suite, DRSUAPI, torture_rpc_drsuapi);
torture_suite_add_simple_test(suite, CRACKNAMES, 
torture_rpc_drsuapi_cracknames);
torture_suite_add_suite(suite, torture_rpc_dssetup(suite));
+   torture_suite_add_simple_test(suite, SAMBA3-REGCONFIG, 
torture_samba3_regconfig);
torture_suite_add_simple_test(suite, ALTERCONTEXT, 
torture_rpc_alter_context);
torture_suite_add_simple_test(suite, JOIN, torture_rpc_join);
torture_suite_add_simple_test(suite, DSSYNC, torture_rpc_dssync);

Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c
===
--- branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c   2007-11-05 02:29:17 UTC 
(rev 25826)
+++ branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c   2007-11-05 02:33:30 UTC 
(rev 25827)
@@ -49,6 +49,7 @@
 #include lib/crypto/crypto.h
 #include libcli/security/proto.h
 #include param/param.h
+#include lib/registry/registry.h
 
 static struct cli_credentials *create_anon_creds(TALLOC_CTX *mem_ctx)
 {
@@ -1529,6 +1530,12 @@
return result;
 }
 
+static int destroy_tree(struct smbcli_tree *tree)
+{
+   smb_tree_disconnect(tree);
+   return 0;
+}
+
 /*
  * Do a tcon, given a session
  */
@@ -1568,6 +1575,7 @@
 
result-tid = tcon.tconx.out.tid;
result = talloc_steal(mem_ctx, result);
+   talloc_set_destructor(result, destroy_tree);
talloc_free(tmp_ctx);
*res = result;
return NT_STATUS_OK;
@@ -2959,3 +2967,334 @@
 
return ret;
 }
+
+static NTSTATUS get_shareinfo(TALLOC_CTX *mem_ctx,
+ struct smbcli_state *cli,
+ const char *share,
+ struct srvsvc_NetShareInfo502 **info)
+{
+   struct smbcli_tree *ipc;
+   struct dcerpc_pipe *p;
+   struct srvsvc_NetShareGetInfo r;
+   NTSTATUS status;
+
+   if (!(p = dcerpc_pipe_init(cli,
+  cli-transport-socket-event.ctx))) {
+   status = NT_STATUS_NO_MEMORY;
+   goto fail;
+   }
+
+   status = secondary_tcon(p, cli-session, IPC$, ipc);
+   if (!NT_STATUS_IS_OK(status)) {
+   goto fail;
+   }
+
+   status = dcerpc_pipe_open_smb(p, ipc, \\pipe\\srvsvc);
+   if (!NT_STATUS_IS_OK(status)) {
+   d_printf(dcerpc_pipe_open_smb failed: %s\n,
+nt_errstr(status));
+   goto fail;
+   }
+
+   status = dcerpc_bind_auth_none(p, ndr_table_srvsvc);
+   if (!NT_STATUS_IS_OK(status)) {
+   d_printf(dcerpc_bind_auth_none failed: %s\n,
+nt_errstr(status));
+   goto fail;
+   }
+
+   r.in.server_unc = talloc_asprintf(mem_ctx, %s,
+ dcerpc_server_name(p));
+   r.in.share_name = share;
+   r.in.level = 502;
+
+   status = dcerpc_srvsvc_NetShareGetInfo(p, p, r);
+   if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
+   d_printf((%s) OpenHKLM failed: %s, %s\n, __location__,
+nt_errstr(status), win_errstr(r.out.result));
+   goto fail;
+   }
+
+   *info = talloc_move(mem_ctx, r.out.info.info502);
+   return NT_STATUS_OK;
+
+ fail:
+   talloc_free(p);
+   return status;
+}
+
+/*
+ * Get us a handle on HKLM\
+ */
+
+static NTSTATUS get_hklm_handle(TALLOC_CTX *mem_ctx,
+   struct smbcli_state *cli,
+   struct dcerpc_pipe **pipe_p,
+   struct policy_handle **handle)
+{
+   struct smbcli_tree *ipc;
+   struct dcerpc_pipe *p;
+   struct winreg_OpenHKLM r;
+   NTSTATUS status;
+   struct policy_handle *result;
+
+   result = talloc(mem_ctx, struct policy_handle);
+
+   if (result == NULL) {
+   return NT_STATUS_NO_MEMORY;
+   }
+
+   if (!(p = dcerpc_pipe_init(result,
+  cli-transport-socket-event.ctx))) {
+   status = NT_STATUS_NO_MEMORY;
+   goto fail;
+   }
+
+   status = secondary_tcon(p, cli-session, IPC$, ipc);
+   if (!NT_STATUS_IS_OK(status)) {
+   goto fail

svn commit: samba r25688 - in branches/SAMBA_4_0/source/torture/rpc: .

2007-10-17 Thread vlendec
Author: vlendec
Date: 2007-10-17 18:26:40 + (Wed, 17 Oct 2007)
New Revision: 25688

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

Log:
Add a simple test for a samba3 regression

When trying an reqchal/auth2 for an unknown workstation account, we have
to return NT_STATUS_NO_TRUST_SAM_ACCOUNT to the auth2. v3-2-test right
now returns NT_STATUS_ACCESS_DENIED, which seems to prevent XP from
joining a Samba3 PDC.

Modified:
   branches/SAMBA_4_0/source/torture/rpc/rpc.c
   branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/rpc.c
===
--- branches/SAMBA_4_0/source/torture/rpc/rpc.c 2007-10-17 14:02:33 UTC (rev 
25687)
+++ branches/SAMBA_4_0/source/torture/rpc/rpc.c 2007-10-17 18:26:40 UTC (rev 
25688)
@@ -419,6 +419,8 @@
torture_samba3_rpc_sharesec);
torture_suite_add_simple_test(suite, SAMBA3-GETUSERNAME,
torture_samba3_rpc_getusername);
+   torture_suite_add_simple_test(suite, SAMBA3-RANDOMAUTH2,
+ torture_samba3_rpc_randomauth2);
torture_suite_add_simple_test(suite, SAMBA3-LSA, 
torture_samba3_rpc_lsa);
torture_suite_add_simple_test(suite, SAMBA3-SPOOLSS, 
torture_samba3_rpc_spoolss);
torture_suite_add_simple_test(suite, SAMBA3-WKSSVC, 
torture_samba3_rpc_wkssvc);

Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c
===
--- branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c   2007-10-17 14:02:33 UTC 
(rev 25687)
+++ branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c   2007-10-17 18:26:40 UTC 
(rev 25688)
@@ -1859,6 +1859,120 @@
return ret;
 }
 
+/*
+ * Do a ReqChallenge/Auth2 with a random wks name, make sure it returns
+ * NT_STATUS_NO_SAM_ACCOUNT
+ */
+
+bool torture_samba3_rpc_randomauth2(struct torture_context *torture)
+{
+   TALLOC_CTX *mem_ctx;
+   struct dcerpc_pipe *net_pipe;
+   char *wksname;
+   bool result = false;
+   NTSTATUS status;
+   struct netr_ServerReqChallenge r;
+   struct netr_Credential netr_cli_creds;
+   struct netr_Credential netr_srv_creds;
+   uint32_t negotiate_flags;
+   struct netr_ServerAuthenticate2 a;
+   struct creds_CredentialState *creds_state;
+   struct netr_Credential netr_cred;
+   struct samr_Password mach_pw;
+   struct smbcli_state *cli;
+
+   if (!(mem_ctx = talloc_new(torture))) {
+   d_printf(talloc_new failed\n);
+   return false;
+   }
+
+   if (!(wksname = generate_random_str_list(
+ mem_ctx, 14, ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789))) {
+   d_printf(generate_random_str_list failed\n);
+   goto done;
+   }
+
+   if (!(torture_open_connection_share(
+ mem_ctx, cli,
+ torture_setting_string(torture, host, NULL),
+ IPC$, NULL))) {
+   d_printf(IPC$ connection failed\n);
+   goto done;
+   }
+
+   if (!(net_pipe = dcerpc_pipe_init(
+ mem_ctx, cli-transport-socket-event.ctx))) {
+   d_printf(dcerpc_pipe_init failed\n);
+   goto done;
+   }
+
+   status = dcerpc_pipe_open_smb(net_pipe, cli-tree, \\netlogon);
+   if (!NT_STATUS_IS_OK(status)) {
+   d_printf(dcerpc_pipe_open_smb failed: %s\n,
+nt_errstr(status));
+   goto done;
+   }
+
+   status = dcerpc_bind_auth_none(net_pipe, ndr_table_netlogon);
+   if (!NT_STATUS_IS_OK(status)) {
+   d_printf(dcerpc_bind_auth_none failed: %s\n,
+nt_errstr(status));
+   goto done;
+   }
+
+   r.in.computer_name = wksname;
+   r.in.server_name = talloc_asprintf(
+   mem_ctx, %s, dcerpc_server_name(net_pipe));
+   if (r.in.server_name == NULL) {
+   d_printf(talloc_asprintf failed\n);
+   goto done;
+   }
+   generate_random_buffer(netr_cli_creds.data,
+  sizeof(netr_cli_creds.data));
+   r.in.credentials = netr_cli_creds;
+   r.out.credentials = netr_srv_creds;
+
+   status = dcerpc_netr_ServerReqChallenge(net_pipe, mem_ctx, r);
+   if (!NT_STATUS_IS_OK(status)) {
+   d_printf(netr_ServerReqChallenge failed: %s\n,
+nt_errstr(status));
+   goto done;
+   }
+
+   negotiate_flags = NETLOGON_NEG_AUTH2_FLAGS;
+   E_md4hash(foobar, mach_pw.hash);
+
+   creds_state = talloc(mem_ctx, struct creds_CredentialState);
+   creds_client_init(creds_state, r.in.credentials,
+ r.out.credentials, mach_pw,
+ netr_cred, negotiate_flags);
+
+   a.in.server_name

svn commit: samba r25561 - in branches: SAMBA_3_2/source/lib SAMBA_3_2/source/rpc_parse SAMBA_3_2/source/services SAMBA_3_2_0/source/lib SAMBA_3_2_0/source/rpc_parse SAMBA_3_2_0/source/services

2007-10-07 Thread vlendec
Author: vlendec
Date: 2007-10-07 12:56:43 + (Sun, 07 Oct 2007)
New Revision: 25561

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

Log:
Make use of [un]marshall_sec_desc

Minor cleanup only

Modified:
   branches/SAMBA_3_2/source/lib/sharesec.c
   branches/SAMBA_3_2/source/rpc_parse/parse_prs.c
   branches/SAMBA_3_2/source/services/services_db.c
   branches/SAMBA_3_2_0/source/lib/sharesec.c
   branches/SAMBA_3_2_0/source/rpc_parse/parse_prs.c
   branches/SAMBA_3_2_0/source/services/services_db.c


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


svn commit: samba r25563 - in branches: SAMBA_3_2/source/torture SAMBA_3_2_0/source/torture

2007-10-07 Thread vlendec
Author: vlendec
Date: 2007-10-07 13:36:56 + (Sun, 07 Oct 2007)
New Revision: 25563

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

Log:
Show which local-substitute subtest fails

Modified:
   branches/SAMBA_3_2/source/torture/torture.c
   branches/SAMBA_3_2_0/source/torture/torture.c


Changeset:
Modified: branches/SAMBA_3_2/source/torture/torture.c
===
--- branches/SAMBA_3_2/source/torture/torture.c 2007-10-07 13:10:39 UTC (rev 
25562)
+++ branches/SAMBA_3_2/source/torture/torture.c 2007-10-07 13:36:56 UTC (rev 
25563)
@@ -4780,40 +4780,44 @@
return True;
 }
 
-static BOOL run_local_substitute(int dummy)
+static bool subst_test(const char *str, const char *user, const char *domain,
+  uid_t uid, gid_t gid, const char *expected)
 {
-   TALLOC_CTX *mem_ctx;
-   int diff = 0;
+   char *subst;
+   bool result = true;
 
-   if ((mem_ctx = talloc_init(run_local_subst)) == NULL) {
-   printf(talloc_init failed\n);
-   return False;
+   subst = talloc_sub_specified(talloc_tos(), str, user, domain, uid, gid);
+
+   if (strcmp(subst, expected) != 0) {
+   printf(sub_specified(%s, %s, %s, %d, %d) returned [%s], 
expected 
+  [%s]\n, str, user, domain, (int)uid, (int)gid, subst,
+  expected);
+   result = false;
}
 
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %U, bla, , -1, -1),
-  bla);
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %u%U, bla, , -1, -1),
-  blabla);
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %g, , , -1, -1),
-  NO_GROUP);
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %G, , , -1, -1),
-  NO_GROUP);
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %g, , , -1, 0),
-  gidtoname(0));
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %G, , , -1, 0),
-  gidtoname(0));
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %D%u, u, dom, -1, 0),
-  domu);
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %i %I, , , -1, -1),
-  0.0.0.0 0.0.0.0);
+   TALLOC_FREE(subst);
+   return result;
+}
 
+static BOOL run_local_substitute(int dummy)
+{
+   bool ok = true;
+
+   ok = subst_test(%U, bla, , -1, -1, bla);
+   ok = subst_test(%u%U, bla, , -1, -1, blabla);
+   ok = subst_test(%g, , , -1, -1, NO_GROUP);
+   ok = subst_test(%G, , , -1, -1, NO_GROUP);
+   ok = subst_test(%g, , , -1, 0, gidtoname(0));
+   ok = subst_test(%G, , , -1, 0, gidtoname(0));
+   ok = subst_test(%D%u, u, dom, -1, 0, domu);
+   ok = subst_test(%i %I, , , -1, -1, 0.0.0.0 0.0.0.0);
+
/* Different captialization rules in sub_basic... */
 
-   diff |= strcmp(talloc_sub_basic(mem_ctx, BLA, dom, %U%D),
-  blaDOM);
+   ok =  (strcmp(talloc_sub_basic(talloc_tos(), BLA, dom, %U%D),
+  blaDOM) == 0);
 
-   TALLOC_FREE(mem_ctx);
-   return (diff == 0);
+   return ok;
 }
 
 static BOOL run_local_gencache(int dummy)

Modified: branches/SAMBA_3_2_0/source/torture/torture.c
===
--- branches/SAMBA_3_2_0/source/torture/torture.c   2007-10-07 13:10:39 UTC 
(rev 25562)
+++ branches/SAMBA_3_2_0/source/torture/torture.c   2007-10-07 13:36:56 UTC 
(rev 25563)
@@ -4780,40 +4780,44 @@
return True;
 }
 
-static BOOL run_local_substitute(int dummy)
+static bool subst_test(const char *str, const char *user, const char *domain,
+  uid_t uid, gid_t gid, const char *expected)
 {
-   TALLOC_CTX *mem_ctx;
-   int diff = 0;
+   char *subst;
+   bool result = true;
 
-   if ((mem_ctx = talloc_init(run_local_subst)) == NULL) {
-   printf(talloc_init failed\n);
-   return False;
+   subst = talloc_sub_specified(talloc_tos(), str, user, domain, uid, gid);
+
+   if (strcmp(subst, expected) != 0) {
+   printf(sub_specified(%s, %s, %s, %d, %d) returned [%s], 
expected 
+  [%s]\n, str, user, domain, (int)uid, (int)gid, subst,
+  expected);
+   result = false;
}
 
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %U, bla, , -1, -1),
-  bla);
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %u%U, bla, , -1, -1),
-  blabla);
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %g, , , -1, -1),
-  NO_GROUP);
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %G, , , -1, -1),
-  NO_GROUP);
-   diff |= strcmp(talloc_sub_specified(mem_ctx, %g, , , -1, 0),
-  gidtoname(0));
-   diff |= strcmp

svn commit: samba r25564 - in branches: SAMBA_3_2/source/lib SAMBA_3_2/source/param SAMBA_3_2/source/rpc_server SAMBA_3_2_0/source/lib SAMBA_3_2_0/source/param SAMBA_3_2_0/source/rpc_server

2007-10-07 Thread vlendec
Author: vlendec
Date: 2007-10-07 17:58:48 + (Sun, 07 Oct 2007)
New Revision: 25564

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

Log:
Pass sharename to delete_share_security()
Modified:
   branches/SAMBA_3_2/source/lib/sharesec.c
   branches/SAMBA_3_2/source/param/loadparm.c
   branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c
   branches/SAMBA_3_2_0/source/lib/sharesec.c
   branches/SAMBA_3_2_0/source/param/loadparm.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/sharesec.c
===
--- branches/SAMBA_3_2/source/lib/sharesec.c2007-10-07 13:36:56 UTC (rev 
25563)
+++ branches/SAMBA_3_2/source/lib/sharesec.c2007-10-07 17:58:48 UTC (rev 
25564)
@@ -197,18 +197,20 @@
  Delete a security descriptor.
 /
 
-BOOL delete_share_security(const struct share_params *params)
+BOOL delete_share_security(const char *servicename)
 {
TDB_DATA kbuf;
-   fstring key;
+   char *key;
 
-   slprintf(key, sizeof(key)-1, SECDESC/%s,
-lp_servicename(params-service));
+   if (!(key = talloc_asprintf(talloc_tos(), SECDESC/%s,
+   servicename))) {
+   return False;
+   }
kbuf = string_term_tdb_data(key);
 
if (tdb_trans_delete(share_tdb, kbuf) != 0) {
-   DEBUG(0,(delete_share_security: Failed to delete entry for 
share %s\n,
-lp_servicename(params-service) ));
+   DEBUG(0, (delete_share_security: Failed to delete entry for 
+ share %s\n, servicename));
return False;
}
 

Modified: branches/SAMBA_3_2/source/param/loadparm.c
===
--- branches/SAMBA_3_2/source/param/loadparm.c  2007-10-07 13:36:56 UTC (rev 
25563)
+++ branches/SAMBA_3_2/source/param/loadparm.c  2007-10-07 17:58:48 UTC (rev 
25564)
@@ -5517,7 +5517,7 @@
/* Remove from the share ACL db. */
DEBUG(10,(load_usershare_shares: Removing deleted 
usershare %s\n,
lp_servicename(iService) ));
-   delete_share_security(snum2params_static(iService));
+   delete_share_security(lp_servicename(iService));
free_service_byindex(iService);
}
}
@@ -5749,7 +5749,7 @@
 
if (!usershare_exists(iService, last_mod)) {
/* Remove the share security tdb entry for it. */
-   delete_share_security(snum2params_static(iService));
+   delete_share_security(lp_servicename(iService));
/* Remove it from the array. */
free_service_byindex(iService);
/* Doesn't exist anymore. */

Modified: branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c
===
--- branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c2007-10-07 
13:36:56 UTC (rev 25563)
+++ branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c2007-10-07 
17:58:48 UTC (rev 25564)
@@ -1994,7 +1994,7 @@
}
 
/* Delete the SD in the database. */
-   delete_share_security(params);
+   delete_share_security(lp_servicename(params-service));
 
lp_killservice(params-service);
 

Modified: branches/SAMBA_3_2_0/source/lib/sharesec.c
===
--- branches/SAMBA_3_2_0/source/lib/sharesec.c  2007-10-07 13:36:56 UTC (rev 
25563)
+++ branches/SAMBA_3_2_0/source/lib/sharesec.c  2007-10-07 17:58:48 UTC (rev 
25564)
@@ -197,18 +197,20 @@
  Delete a security descriptor.
 /
 
-BOOL delete_share_security(const struct share_params *params)
+BOOL delete_share_security(const char *servicename)
 {
TDB_DATA kbuf;
-   fstring key;
+   char *key;
 
-   slprintf(key, sizeof(key)-1, SECDESC/%s,
-lp_servicename(params-service));
+   if (!(key = talloc_asprintf(talloc_tos(), SECDESC/%s,
+   servicename))) {
+   return False;
+   }
kbuf = string_term_tdb_data(key);
 
if (tdb_trans_delete(share_tdb, kbuf) != 0) {
-   DEBUG(0,(delete_share_security: Failed to delete entry for 
share %s\n,
-lp_servicename(params-service) ));
+   DEBUG(0, (delete_share_security: Failed to delete entry for 
+ share %s\n, servicename));
return False;
}
 

Modified: branches/SAMBA_3_2_0/source/param/loadparm.c

svn commit: samba r25528 - in branches: SAMBA_3_2/source/registry SAMBA_3_2_0/source/registry

2007-10-05 Thread vlendec
Author: vlendec
Date: 2007-10-05 20:42:14 + (Fri, 05 Oct 2007)
New Revision: 25528

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

Log:
Only do transactions on registry.tdb if anything changes

I got annoyed by the fsync calls clobbering my harddrive when smbd started up
for debugging.

... things you do on a plane without internet



Modified:
   branches/SAMBA_3_2/source/registry/reg_db.c
   branches/SAMBA_3_2_0/source/registry/reg_db.c


Changeset:
Modified: branches/SAMBA_3_2/source/registry/reg_db.c
===
--- branches/SAMBA_3_2/source/registry/reg_db.c 2007-10-05 20:33:55 UTC (rev 
25527)
+++ branches/SAMBA_3_2/source/registry/reg_db.c 2007-10-05 20:42:14 UTC (rev 
25528)
@@ -399,14 +399,47 @@
REGSUBKEY_CTR *subkeys = NULL, *old_subkeys = NULL;
char *oldkeyname;

+   /*
+* fetch a list of the old subkeys so we can determine if anything has
+* changed
+*/
+
+   if ( !(old_subkeys = TALLOC_ZERO_P( ctr, REGSUBKEY_CTR )) ) {
+   DEBUG(0,(regdb_store_keys: talloc() failure!\n));
+   goto fail;
+   }
+
+   regdb_fetch_keys( key, old_subkeys );
+
+   if (ctr-num_subkeys == old_subkeys-num_subkeys) {
+
+   for (i = 0; ictr-num_subkeys; i++) {
+   if (strcmp(ctr-subkeys[i],
+  old_subkeys-subkeys[i]) != 0) {
+   break;
+   }
+   }
+   if (i == ctr-num_subkeys) {
+   /*
+* Nothing changed, no point to even start a tdb
+* transaction
+*/
+   TALLOC_FREE(old_subkeys);
+   return True;
+   }
+   }
+
if ( tdb_transaction_start( tdb_reg-tdb ) == -1 ) {
DEBUG(0, (regdb_store_keys: tdb_transaction_start failed\n));
return False;
}
 
-   /* fetch a list of the old subkeys so we can determine if any were
-* deleted */
-   
+   /*
+* Re-fetch the old keys inside the transaction
+*/
+
+   TALLOC_FREE(old_subkeys);
+
if ( !(old_subkeys = TALLOC_ZERO_P( ctr, REGSUBKEY_CTR )) ) {
DEBUG(0,(regdb_store_keys: talloc() failure!\n));
goto fail;
@@ -660,7 +693,7 @@
 
 BOOL regdb_store_values( const char *key, REGVAL_CTR *values )
 {
-   TDB_DATA data;
+   TDB_DATA old_data, data;
pstring keystr;
int len, ret;

@@ -684,8 +717,19 @@
pstr_sprintf( keystr, %s/%s, REG_VALUE_PREFIX, key );
normalize_reg_path( keystr );

+   old_data = tdb_fetch_bystring(tdb_reg-tdb, keystr);
+
+   if ((old_data.dptr != NULL)
+(old_data.dsize == data.dsize)
+(memcmp(old_data.dptr, data.dptr, data.dsize) == 0)) {
+   SAFE_FREE(old_data.dptr);
+   SAFE_FREE(data.dptr);
+   return True;
+   }
+
ret = tdb_trans_store_bystring(tdb_reg-tdb, keystr, data, TDB_REPLACE);

+   SAFE_FREE( old_data.dptr );
SAFE_FREE( data.dptr );

return ret != -1 ;

Modified: branches/SAMBA_3_2_0/source/registry/reg_db.c
===
--- branches/SAMBA_3_2_0/source/registry/reg_db.c   2007-10-05 20:33:55 UTC 
(rev 25527)
+++ branches/SAMBA_3_2_0/source/registry/reg_db.c   2007-10-05 20:42:14 UTC 
(rev 25528)
@@ -399,14 +399,47 @@
REGSUBKEY_CTR *subkeys = NULL, *old_subkeys = NULL;
char *oldkeyname;

+   /*
+* fetch a list of the old subkeys so we can determine if anything has
+* changed
+*/
+
+   if ( !(old_subkeys = TALLOC_ZERO_P( ctr, REGSUBKEY_CTR )) ) {
+   DEBUG(0,(regdb_store_keys: talloc() failure!\n));
+   goto fail;
+   }
+
+   regdb_fetch_keys( key, old_subkeys );
+
+   if (ctr-num_subkeys == old_subkeys-num_subkeys) {
+
+   for (i = 0; ictr-num_subkeys; i++) {
+   if (strcmp(ctr-subkeys[i],
+  old_subkeys-subkeys[i]) != 0) {
+   break;
+   }
+   }
+   if (i == ctr-num_subkeys) {
+   /*
+* Nothing changed, no point to even start a tdb
+* transaction
+*/
+   TALLOC_FREE(old_subkeys);
+   return True;
+   }
+   }
+
if ( tdb_transaction_start( tdb_reg-tdb ) == -1 ) {
DEBUG(0, (regdb_store_keys: tdb_transaction_start failed\n));
return False;
}
 
-   /* fetch a list of the old subkeys so we can determine if any were

svn commit: samba r25533 - in branches: SAMBA_3_2/source/libsmb SAMBA_3_2/source/torture SAMBA_3_2_0/source/libsmb SAMBA_3_2_0/source/torture

2007-10-05 Thread vlendec
Author: vlendec
Date: 2007-10-05 21:28:54 + (Fri, 05 Oct 2007)
New Revision: 25533

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

Log:
remove a pstring
Modified:
   branches/SAMBA_3_2/source/libsmb/nterr.c
   branches/SAMBA_3_2/source/torture/torture.c
   branches/SAMBA_3_2_0/source/libsmb/nterr.c
   branches/SAMBA_3_2_0/source/torture/torture.c


Changeset:
Modified: branches/SAMBA_3_2/source/libsmb/nterr.c
===
--- branches/SAMBA_3_2/source/libsmb/nterr.c2007-10-05 21:22:07 UTC (rev 
25532)
+++ branches/SAMBA_3_2/source/libsmb/nterr.c2007-10-05 21:28:54 UTC (rev 
25533)
@@ -647,7 +647,6 @@
 
 const char *nt_errstr(NTSTATUS nt_code)
 {
-static pstring msg;
 int idx = 0;
 
 #ifdef HAVE_LDAP
@@ -656,8 +655,6 @@
}
 #endif
 
-   slprintf(msg, sizeof(msg), NT code 0x%08x, NT_STATUS_V(nt_code));
-
while (nt_errs[idx].nt_errstr != NULL) {
if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) {
 return nt_errs[idx].nt_errstr;
@@ -665,7 +662,8 @@
idx++;
}
 
-return msg;
+   return talloc_asprintf(talloc_tos(), NT code 0x%08x,
+  NT_STATUS_V(nt_code));
 }
 
 /
@@ -689,28 +687,6 @@
 }
 
 /*
- Returns an NT_STATUS constant as a string for inclusion in autogen C code.
- */
-
-const char *get_nt_error_c_code(NTSTATUS nt_code)
-{
-static pstring out;
-int idx = 0;
-
-   while (nt_errs[idx].nt_errstr != NULL) {
-   if (NT_STATUS_V(nt_errs[idx].nt_errcode) == 
-NT_STATUS_V(nt_code)) {
-return nt_errs[idx].nt_errstr;
-   }
-   idx++;
-   }
-
-   slprintf(out, sizeof(out), NT_STATUS(0x%08x), NT_STATUS_V(nt_code));
-
-return out;
-}
-
-/*
  Returns the NT_STATUS constant matching the string supplied (as an NTSTATUS)
  */
 

Modified: branches/SAMBA_3_2/source/torture/torture.c
===
--- branches/SAMBA_3_2/source/torture/torture.c 2007-10-05 21:22:07 UTC (rev 
25532)
+++ branches/SAMBA_3_2/source/torture/torture.c 2007-10-05 21:28:54 UTC (rev 
25533)
@@ -4768,14 +4768,14 @@
 
if (NT_STATUS_V(nt_status) != error) { 
printf(/*\t{ This NT error code was 'sqashed'\n\t from 
%s to %s \n\t during the session setup }\n*/\n, 
-  get_nt_error_c_code(NT_STATUS(error)), 
-  get_nt_error_c_code(nt_status));
+  nt_errstr(NT_STATUS(error)),
+  nt_errstr(nt_status));
}

printf(\t{%s,\t%s,\t%s},\n, 
   smb_dos_err_class(errclass), 
   smb_dos_err_name(errclass, errnum), 
-  get_nt_error_c_code(NT_STATUS(error)));
+  nt_errstr(NT_STATUS(error)));
}
return True;
 }

Modified: branches/SAMBA_3_2_0/source/libsmb/nterr.c
===
--- branches/SAMBA_3_2_0/source/libsmb/nterr.c  2007-10-05 21:22:07 UTC (rev 
25532)
+++ branches/SAMBA_3_2_0/source/libsmb/nterr.c  2007-10-05 21:28:54 UTC (rev 
25533)
@@ -647,7 +647,6 @@
 
 const char *nt_errstr(NTSTATUS nt_code)
 {
-static pstring msg;
 int idx = 0;
 
 #ifdef HAVE_LDAP
@@ -656,8 +655,6 @@
}
 #endif
 
-   slprintf(msg, sizeof(msg), NT code 0x%08x, NT_STATUS_V(nt_code));
-
while (nt_errs[idx].nt_errstr != NULL) {
if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) {
 return nt_errs[idx].nt_errstr;
@@ -665,7 +662,8 @@
idx++;
}
 
-return msg;
+   return talloc_asprintf(talloc_tos(), NT code 0x%08x,
+  NT_STATUS_V(nt_code));
 }
 
 /
@@ -689,28 +687,6 @@
 }
 
 /*
- Returns an NT_STATUS constant as a string for inclusion in autogen C code.
- */
-
-const char *get_nt_error_c_code(NTSTATUS nt_code)
-{
-static pstring out;
-int idx = 0;
-
-   while (nt_errs[idx].nt_errstr != NULL) {
-   if (NT_STATUS_V(nt_errs[idx].nt_errcode) == 
-NT_STATUS_V(nt_code

svn commit: samba r25534 - in branches: SAMBA_3_2/source/include SAMBA_3_2/source/lib SAMBA_3_2/source/printing SAMBA_3_2/source/registry SAMBA_3_2/source/rpc_server SAMBA_3_2/source/smbd SAMBA_3_2_0/

2007-10-05 Thread vlendec
Author: vlendec
Date: 2007-10-05 21:41:17 + (Fri, 05 Oct 2007)
New Revision: 25534

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

Log:
Apply some const

Why? It moves these structs from the data into the text segment, so they
will never been copy-on-write copied. Not much, but as in German you say
Kleinvieh macht auch Mist

Modified:
   branches/SAMBA_3_2/source/include/rpc_secdes.h
   branches/SAMBA_3_2/source/lib/secdesc.c
   branches/SAMBA_3_2/source/lib/sharesec.c
   branches/SAMBA_3_2/source/lib/util_seaccess.c
   branches/SAMBA_3_2/source/printing/nt_printing.c
   branches/SAMBA_3_2/source/registry/reg_frontend_hilvl.c
   branches/SAMBA_3_2/source/rpc_server/srv_lsa_nt.c
   branches/SAMBA_3_2/source/rpc_server/srv_samr_nt.c
   branches/SAMBA_3_2/source/rpc_server/srv_spoolss_nt.c
   branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c
   branches/SAMBA_3_2/source/rpc_server/srv_svcctl_nt.c
   branches/SAMBA_3_2/source/rpc_server/srv_winreg_nt.c
   branches/SAMBA_3_2/source/smbd/open.c
   branches/SAMBA_3_2/source/smbd/posix_acls.c
   branches/SAMBA_3_2_0/source/include/rpc_secdes.h
   branches/SAMBA_3_2_0/source/lib/secdesc.c
   branches/SAMBA_3_2_0/source/lib/sharesec.c
   branches/SAMBA_3_2_0/source/lib/util_seaccess.c
   branches/SAMBA_3_2_0/source/printing/nt_printing.c
   branches/SAMBA_3_2_0/source/registry/reg_frontend_hilvl.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_lsa_nt.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_samr_nt.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_spoolss_nt.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_svcctl_nt.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_winreg_nt.c
   branches/SAMBA_3_2_0/source/smbd/open.c
   branches/SAMBA_3_2_0/source/smbd/posix_acls.c


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


svn commit: samba r25538 - in branches: SAMBA_3_2/source/libsmb SAMBA_3_2/source/torture SAMBA_3_2_0/source/libsmb SAMBA_3_2_0/source/torture

2007-10-05 Thread vlendec
Author: vlendec
Date: 2007-10-05 22:06:24 + (Fri, 05 Oct 2007)
New Revision: 25538

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

Log:
Revert r25533
Modified:
   branches/SAMBA_3_2/source/libsmb/nterr.c
   branches/SAMBA_3_2/source/torture/torture.c
   branches/SAMBA_3_2_0/source/libsmb/nterr.c
   branches/SAMBA_3_2_0/source/torture/torture.c


Changeset:
Modified: branches/SAMBA_3_2/source/libsmb/nterr.c
===
--- branches/SAMBA_3_2/source/libsmb/nterr.c2007-10-05 21:58:26 UTC (rev 
25537)
+++ branches/SAMBA_3_2/source/libsmb/nterr.c2007-10-05 22:06:24 UTC (rev 
25538)
@@ -647,6 +647,7 @@
 
 const char *nt_errstr(NTSTATUS nt_code)
 {
+static pstring msg;
 int idx = 0;
 
 #ifdef HAVE_LDAP
@@ -655,6 +656,8 @@
}
 #endif
 
+   slprintf(msg, sizeof(msg), NT code 0x%08x, NT_STATUS_V(nt_code));
+
while (nt_errs[idx].nt_errstr != NULL) {
if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) {
 return nt_errs[idx].nt_errstr;
@@ -662,8 +665,7 @@
idx++;
}
 
-   return talloc_asprintf(talloc_tos(), NT code 0x%08x,
-  NT_STATUS_V(nt_code));
+return msg;
 }
 
 /
@@ -687,6 +689,28 @@
 }
 
 /*
+ Returns an NT_STATUS constant as a string for inclusion in autogen C code.
+ */
+
+const char *get_nt_error_c_code(NTSTATUS nt_code)
+{
+static pstring out;
+int idx = 0;
+
+   while (nt_errs[idx].nt_errstr != NULL) {
+   if (NT_STATUS_V(nt_errs[idx].nt_errcode) == 
+NT_STATUS_V(nt_code)) {
+return nt_errs[idx].nt_errstr;
+   }
+   idx++;
+   }
+
+   slprintf(out, sizeof(out), NT_STATUS(0x%08x), NT_STATUS_V(nt_code));
+
+return out;
+}
+
+/*
  Returns the NT_STATUS constant matching the string supplied (as an NTSTATUS)
  */
 

Modified: branches/SAMBA_3_2/source/torture/torture.c
===
--- branches/SAMBA_3_2/source/torture/torture.c 2007-10-05 21:58:26 UTC (rev 
25537)
+++ branches/SAMBA_3_2/source/torture/torture.c 2007-10-05 22:06:24 UTC (rev 
25538)
@@ -4768,14 +4768,14 @@
 
if (NT_STATUS_V(nt_status) != error) { 
printf(/*\t{ This NT error code was 'sqashed'\n\t from 
%s to %s \n\t during the session setup }\n*/\n, 
-  nt_errstr(NT_STATUS(error)),
-  nt_errstr(nt_status));
+  get_nt_error_c_code(NT_STATUS(error)), 
+  get_nt_error_c_code(nt_status));
}

printf(\t{%s,\t%s,\t%s},\n, 
   smb_dos_err_class(errclass), 
   smb_dos_err_name(errclass, errnum), 
-  nt_errstr(NT_STATUS(error)));
+  get_nt_error_c_code(NT_STATUS(error)));
}
return True;
 }

Modified: branches/SAMBA_3_2_0/source/libsmb/nterr.c
===
--- branches/SAMBA_3_2_0/source/libsmb/nterr.c  2007-10-05 21:58:26 UTC (rev 
25537)
+++ branches/SAMBA_3_2_0/source/libsmb/nterr.c  2007-10-05 22:06:24 UTC (rev 
25538)
@@ -647,6 +647,7 @@
 
 const char *nt_errstr(NTSTATUS nt_code)
 {
+static pstring msg;
 int idx = 0;
 
 #ifdef HAVE_LDAP
@@ -655,6 +656,8 @@
}
 #endif
 
+   slprintf(msg, sizeof(msg), NT code 0x%08x, NT_STATUS_V(nt_code));
+
while (nt_errs[idx].nt_errstr != NULL) {
if (NT_STATUS_EQUAL(nt_errs[idx].nt_errcode, nt_code)) {
 return nt_errs[idx].nt_errstr;
@@ -662,8 +665,7 @@
idx++;
}
 
-   return talloc_asprintf(talloc_tos(), NT code 0x%08x,
-  NT_STATUS_V(nt_code));
+return msg;
 }
 
 /
@@ -687,6 +689,28 @@
 }
 
 /*
+ Returns an NT_STATUS constant as a string for inclusion in autogen C code.
+ */
+
+const char *get_nt_error_c_code(NTSTATUS nt_code)
+{
+static pstring out;
+int idx = 0;
+
+   while (nt_errs[idx].nt_errstr != NULL) {
+   if (NT_STATUS_V(nt_errs[idx].nt_errcode) == 
+NT_STATUS_V(nt_code

svn commit: samba r25502 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

2007-10-04 Thread vlendec
Author: vlendec
Date: 2007-10-04 13:13:16 + (Thu, 04 Oct 2007)
New Revision: 25502

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

Log:
Fix bug 5006

Thanks to Joerg.Bernau at web.de

Modified:
   branches/SAMBA_3_2/source/smbd/reply.c
   branches/SAMBA_3_2_0/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/reply.c
===
--- branches/SAMBA_3_2/source/smbd/reply.c  2007-10-04 00:29:29 UTC (rev 
25501)
+++ branches/SAMBA_3_2/source/smbd/reply.c  2007-10-04 13:13:16 UTC (rev 
25502)
@@ -3923,7 +3923,7 @@
if(IVAL(req-inbuf,smb_vwv12) != 0) {
DEBUG(0,(reply_write_and_X - large offset (%x  32) 
 used and we don't support 64 bit offsets.\n,
-(unsigned int)IVAL(inbuf,smb_vwv12) ));
+(unsigned int)IVAL(req-inbuf,smb_vwv12) ));
reply_doserror(req, ERRDOS, ERRbadaccess);
END_PROFILE(SMBwriteX);
return;

Modified: branches/SAMBA_3_2_0/source/smbd/reply.c
===
--- branches/SAMBA_3_2_0/source/smbd/reply.c2007-10-04 00:29:29 UTC (rev 
25501)
+++ branches/SAMBA_3_2_0/source/smbd/reply.c2007-10-04 13:13:16 UTC (rev 
25502)
@@ -3921,7 +3921,7 @@
if(IVAL(req-inbuf,smb_vwv12) != 0) {
DEBUG(0,(reply_write_and_X - large offset (%x  32) 
 used and we don't support 64 bit offsets.\n,
-(unsigned int)IVAL(inbuf,smb_vwv12) ));
+(unsigned int)IVAL(req-inbuf,smb_vwv12) ));
reply_doserror(req, ERRDOS, ERRbadaccess);
END_PROFILE(SMBwriteX);
return;



svn commit: samba r25480 - in branches: SAMBA_3_2/source/rpc_server SAMBA_3_2_0/source/rpc_server

2007-10-03 Thread vlendec
Author: vlendec
Date: 2007-10-03 12:51:36 + (Wed, 03 Oct 2007)
New Revision: 25480

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

Log:
Fix a segfault
Modified:
   branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c


Changeset:
Modified: branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c
===
--- branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c2007-10-03 
10:23:29 UTC (rev 25479)
+++ branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c2007-10-03 
12:51:36 UTC (rev 25480)
@@ -128,7 +128,7 @@
  void *private_data )
 {
struct file_enum_count *fenum =
-   (struct file_enum_count *)private_data;
+   (struct file_enum_count *)private_data;
  
/* If the pid was not found delete the entry from connections.tdb */
 

Modified: branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c
===
--- branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c  2007-10-03 
10:23:29 UTC (rev 25479)
+++ branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c  2007-10-03 
12:51:36 UTC (rev 25480)
@@ -117,7 +117,7 @@
  void *private_data )
 {
struct file_enum_count *fenum =
-   (struct file_enum_count *)private_data;
+   (struct file_enum_count *)private_data;
  
/* If the pid was not found delete the entry from connections.tdb */
 



svn commit: samba r25481 - in branches: SAMBA_3_2/source/utils SAMBA_3_2_0/source/utils

2007-10-03 Thread vlendec
Author: vlendec
Date: 2007-10-03 12:55:45 + (Wed, 03 Oct 2007)
New Revision: 25481

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

Log:
Fix some typos, don't panic as non-root on net getdomainsid

Thanks to Karolin Seeger [EMAIL PROTECTED]

Modified:
   branches/SAMBA_3_2/source/utils/net.c
   branches/SAMBA_3_2/source/utils/net_rpc.c
   branches/SAMBA_3_2_0/source/utils/net.c
   branches/SAMBA_3_2_0/source/utils/net_rpc.c


Changeset:
Modified: branches/SAMBA_3_2/source/utils/net.c
===
--- branches/SAMBA_3_2/source/utils/net.c   2007-10-03 12:51:36 UTC (rev 
25480)
+++ branches/SAMBA_3_2/source/utils/net.c   2007-10-03 12:55:45 UTC (rev 
25481)
@@ -625,7 +625,7 @@
 
if(!initialize_password_db(False, NULL)) {
DEBUG(0, (WARNING: Could not open passdb - local sid may not 
reflect passdb\n
- backend knowlege (such as the sid stored in 
LDAP)\n));
+ backend knowledge (such as the sid stored in 
LDAP)\n));
}
 
/* first check to see if we can even access secrets, so we don't
@@ -695,9 +695,18 @@
 
if(!initialize_password_db(False, NULL)) {
DEBUG(0, (WARNING: Could not open passdb - domain sid may not 
reflect passdb\n
- backend knowlege (such as the sid stored in 
LDAP)\n));
+ backend knowledge (such as the sid stored in 
LDAP)\n));
}
 
+   /* first check to see if we can even access secrets, so we don't
+  panic when we can't. */
+
+   if (!secrets_init()) {
+   d_fprintf(stderr, Unable to open secrets.tdb.  Can't fetch 
domain
+ SID for name: %s\n, get_global_sam_name());
+   return 1;
+   }
+
/* Generate one, if it doesn't exist */
get_global_sam_sid();
 

Modified: branches/SAMBA_3_2/source/utils/net_rpc.c
===
--- branches/SAMBA_3_2/source/utils/net_rpc.c   2007-10-03 12:51:36 UTC (rev 
25480)
+++ branches/SAMBA_3_2/source/utils/net_rpc.c   2007-10-03 12:55:45 UTC (rev 
25481)
@@ -6621,7 +6621,7 @@
 {
d_printf(  net rpc info \t\t\tshow basic info about a domain \n);
d_printf(  net rpc join \t\t\tto join a domain \n);
-   d_printf(  net rpc oldjoin \t\t\tto join a domain created in server 
manager\n);
+   d_printf(  net rpc oldjoin \t\tto join a domain created in server 
manager\n);
d_printf(  net rpc testjoin \t\ttests that a join is valid\n);
d_printf(  net rpc user \t\t\tto add, delete and list users\n);
d_printf(  net rpc password username [password] 
-Uadmin_username%%admin_pass\n);
@@ -6632,7 +6632,7 @@
d_printf(  net rpc changetrustpw \tto change the trust account 
password\n);
d_printf(  net rpc getsid \t\tfetch the domain sid into the local 
secrets.tdb\n);
d_printf(  net rpc vampire \t\tsyncronise an NT PDC's users and groups 
into the local passdb\n);
-   d_printf(  net rpc samdump \t\tdiplay an NT PDC's users, groups and 
other data\n);
+   d_printf(  net rpc samdump \t\tdisplay an NT PDC's users, groups and 
other data\n);
d_printf(  net rpc trustdom \t\tto create trusting domain's account or 
establish trust\n);
d_printf(  net rpc abortshutdown \tto abort the shutdown of a remote 
server\n);
d_printf(  net rpc shutdown \t\tto shutdown a remote server\n);

Modified: branches/SAMBA_3_2_0/source/utils/net.c
===
--- branches/SAMBA_3_2_0/source/utils/net.c 2007-10-03 12:51:36 UTC (rev 
25480)
+++ branches/SAMBA_3_2_0/source/utils/net.c 2007-10-03 12:55:45 UTC (rev 
25481)
@@ -625,7 +625,7 @@
 
if(!initialize_password_db(False, NULL)) {
DEBUG(0, (WARNING: Could not open passdb - local sid may not 
reflect passdb\n
- backend knowlege (such as the sid stored in 
LDAP)\n));
+ backend knowledge (such as the sid stored in 
LDAP)\n));
}
 
/* first check to see if we can even access secrets, so we don't
@@ -695,9 +695,18 @@
 
if(!initialize_password_db(False, NULL)) {
DEBUG(0, (WARNING: Could not open passdb - domain sid may not 
reflect passdb\n
- backend knowlege (such as the sid stored in 
LDAP)\n));
+ backend knowledge (such as the sid stored in 
LDAP)\n));
}
 
+   /* first check to see if we can even access secrets, so we don't
+  panic when we can't. */
+
+   if (!secrets_init()) {
+   d_fprintf(stderr, Unable to open secrets.tdb.  Can't fetch 
domain
+ SID for name: %s\n, get_global_sam_name());
+   return 1;
+   }
+
/* Generate one, if it doesn't exist

svn commit: samba r25482 - in branches: SAMBA_3_2/source/rpc_server SAMBA_3_2_0/source/rpc_server

2007-10-03 Thread vlendec
Author: vlendec
Date: 2007-10-03 13:13:02 + (Wed, 03 Oct 2007)
New Revision: 25482

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

Log:
Slightly simplify logic

Instead of one big if-branch for if (process_exists(..)) return if
(!process_exists(..))

Modified:
   branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c


Changeset:
Modified: branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c
===
--- branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c2007-10-03 
12:55:45 UTC (rev 25481)
+++ branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c2007-10-03 
13:13:02 UTC (rev 25482)
@@ -129,64 +129,64 @@
 {
struct file_enum_count *fenum =
(struct file_enum_count *)private_data;
+
+   struct srvsvc_NetFileInfo3 *f;
+   int i = fenum-count;
+   files_struct fsp;
+   struct byte_range_lock *brl;
+   int num_locks = 0;
+   pstring fullpath;
+   uint32 permissions;
  
/* If the pid was not found delete the entry from connections.tdb */
 
-   if ( process_exists(e-pid) ) {
-   struct srvsvc_NetFileInfo3 *f;
-   int i = fenum-count;
-   files_struct fsp;
-   struct byte_range_lock *brl;
-   int num_locks = 0;
-   pstring fullpath;
-   uint32 permissions;
+   if (!process_exists(e-pid)) {
+   return;
+   }

-   f = TALLOC_REALLOC_ARRAY( fenum-ctx, fenum-info, struct 
srvsvc_NetFileInfo3, i+1 );   
-   if ( !f ) {
-   DEBUG(0,(conn_enum_fn: realloc failed for %d items\n, 
i+1));
-   return;
-   }
-   fenum-info = f;
+   f = TALLOC_REALLOC_ARRAY( fenum-ctx, fenum-info,
+ struct srvsvc_NetFileInfo3, i+1 );
+   if ( !f ) {
+   DEBUG(0,(conn_enum_fn: realloc failed for %d items\n, i+1));
+   return;
+   }
+   fenum-info = f;
 
-   /* need to count the number of locks on a file */
+   /* need to count the number of locks on a file */

-   ZERO_STRUCT( fsp ); 
-   fsp.file_id = e-id;
+   ZERO_STRUCT( fsp ); 
+   fsp.file_id = e-id;

-   if ( (brl = brl_get_locks_readonly(NULL,fsp)) != NULL ) {
-   num_locks = brl-num_locks;
-   TALLOC_FREE( brl );
-   }
+   if ( (brl = brl_get_locks_readonly(NULL,fsp)) != NULL ) {
+   num_locks = brl-num_locks;
+   TALLOC_FREE( brl );
+   }

-   if ( strcmp( fname, . ) == 0 ) {
-   pstr_sprintf( fullpath, C:%s, sharepath );
-   } else {
-   pstr_sprintf( fullpath, C:%s/%s, sharepath, fname );
-   }
-   string_replace( fullpath, '/', '\\' );
+   if ( strcmp( fname, . ) == 0 ) {
+   pstr_sprintf( fullpath, C:%s, sharepath );
+   } else {
+   pstr_sprintf( fullpath, C:%s/%s, sharepath, fname );
+   }
+   string_replace( fullpath, '/', '\\' );

-   /* mask out create (what ever that is) */
-   permissions = e-share_access  
(FILE_READ_DATA|FILE_WRITE_DATA);
+   /* mask out create (what ever that is) */
+   permissions = e-share_access  (FILE_READ_DATA|FILE_WRITE_DATA);
 
-   fenum-info[i].fid = e-share_file_id;
-   fenum-info[i].permissions = permissions;
-   fenum-info[i].num_locks = num_locks;
-   if (!(fenum-info[i].user = talloc_strdup(
- fenum-ctx, uidtoname(e-uid {
-   /* There's not much we can do here. */
-   fenum-info[i].user = ;
-   }
-   if (!(fenum-info[i].path = talloc_strdup(
- fenum-ctx, fullpath))) {
-   /* There's not much we can do here. */
-   fenum-info[i].path = ;
-   }
+   fenum-info[i].fid = e-share_file_id;
+   fenum-info[i].permissions = permissions;
+   fenum-info[i].num_locks = num_locks;
+   if (!(fenum-info[i].user = talloc_strdup(
+ fenum-ctx, uidtoname(e-uid {
+   /* There's not much we can do here. */
+   fenum-info[i].user = ;
+   }
+   if (!(fenum-info[i].path = talloc_strdup(
+ fenum-ctx, fullpath))) {
+   /* There's not much we can do here. */
+   fenum-info[i].path = ;
+   }

-   fenum-count++;
-   }
-
-   return;
-
+   fenum-count

svn commit: samba r25484 - in branches: SAMBA_3_2/source/rpc_server SAMBA_3_2_0/source/rpc_server

2007-10-03 Thread vlendec
Author: vlendec
Date: 2007-10-03 18:37:57 + (Wed, 03 Oct 2007)
New Revision: 25484

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

Log:
Fix srvsrc_NetFileEnum listing only for one user
Modified:
   branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c


Changeset:
Modified: branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c
===
--- branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c2007-10-03 
13:34:44 UTC (rev 25483)
+++ branches/SAMBA_3_2/source/rpc_server/srv_srvsvc_nt.c2007-10-03 
18:37:57 UTC (rev 25484)
@@ -37,6 +37,7 @@
 
 struct file_enum_count {
TALLOC_CTX *ctx;
+   const char *username;
uint32 count;
struct srvsvc_NetFileInfo3 *info;
 };
@@ -55,56 +56,64 @@
 {
struct pipe_open_rec prec;
struct file_enum_count *fenum = (struct file_enum_count *)p;
+   struct srvsvc_NetFileInfo3 *f;
+   int i = fenum-count;
+   pstring fullpath;
+   const char *username;
  
if (rec-value.dsize != sizeof(struct pipe_open_rec))
return 0;
 
memcpy(prec, rec-value.dptr, sizeof(struct pipe_open_rec));
  
-   if ( process_exists(prec.pid) ) {
-   struct srvsvc_NetFileInfo3 *f;
-   int i = fenum-count;
-   pstring fullpath;
+   if ( !process_exists(prec.pid) ) {
+   return 0;
+   }
+
+   username = uidtoname(prec.uid);
+
+   if ((fenum-username != NULL)
+!strequal(username, fenum-username)) {
+   return 0;
+   }

-   snprintf( fullpath, sizeof(fullpath), \\PIPE\\%s, prec.name );
+   snprintf( fullpath, sizeof(fullpath), \\PIPE\\%s, prec.name );

-   f = TALLOC_REALLOC_ARRAY( fenum-ctx, fenum-info, struct 
srvsvc_NetFileInfo3, i+1 );
-   if ( !f ) {
-   DEBUG(0,(conn_enum_fn: realloc failed for %d items\n, 
i+1));
-   return 1;
-   }
+   f = TALLOC_REALLOC_ARRAY( fenum-ctx, fenum-info,
+ struct srvsvc_NetFileInfo3, i+1 );
+   if ( !f ) {
+   DEBUG(0,(conn_enum_fn: realloc failed for %d items\n, i+1));
+   return 1;
+   }
 
-   fenum-info = f;
+   fenum-info = f;

-   fenum-info[i].fid = (uint32)((procid_to_pid(prec.pid)16)  
prec.pnum);
-   fenum-info[i].permissions = (FILE_READ_DATA|FILE_WRITE_DATA);
-   fenum-info[i].num_locks = 0;
-   if (!(fenum-info[i].user = talloc_strdup(
- fenum-ctx, uidtoname(prec.uid {
-   /* There's not much we can do here. */
-   fenum-info[i].user = ;
-   }
-   if (!(fenum-info[i].path = talloc_strdup(
- fenum-ctx, fullpath))) {
-   /* There's not much we can do here. */
-   fenum-info[i].path = ;
-   }
-   
-   fenum-count++;
+   fenum-info[i].fid = (uint32)((procid_to_pid(prec.pid)16)  
prec.pnum);
+   fenum-info[i].permissions = (FILE_READ_DATA|FILE_WRITE_DATA);
+   fenum-info[i].num_locks = 0;
+   fenum-info[i].user = talloc_move(fenum-ctx, username);
+   if (!(fenum-info[i].path = talloc_strdup(
+ fenum-ctx, fullpath))) {
+   /* There's not much we can do here. */
+   fenum-info[i].path = ;
}
 
+   fenum-count++;
+
return 0;
 }
 
 /***
 /
 
-static WERROR net_enum_pipes( TALLOC_CTX *ctx, struct srvsvc_NetFileInfo3 
**info, 
+static WERROR net_enum_pipes( TALLOC_CTX *ctx, const char *username,
+ struct srvsvc_NetFileInfo3 **info,
   uint32 *count, uint32 *resume )
 {
struct file_enum_count fenum;
 
fenum.ctx = ctx;
+   fenum.username = username;
fenum.info = *info;
fenum.count = *count;
 
@@ -137,12 +146,20 @@
int num_locks = 0;
pstring fullpath;
uint32 permissions;
+   const char *username;
  
/* If the pid was not found delete the entry from connections.tdb */
 
if (!process_exists(e-pid)) {
return;
}
+
+   username = uidtoname(e-uid);
+
+   if ((fenum-username != NULL)
+!strequal(username, fenum-username)) {
+   return;
+   }

f = TALLOC_REALLOC_ARRAY( fenum-ctx, fenum-info,
  struct srvsvc_NetFileInfo3, i+1 );
@@ -175,11 +192,7 @@
fenum-info[i].fid = e-share_file_id;
fenum-info[i

svn commit: samba r25500 - in branches/SAMBA_3_2_0/source/rpc_server: .

2007-10-03 Thread vlendec
Author: vlendec
Date: 2007-10-04 00:19:40 + (Thu, 04 Oct 2007)
New Revision: 25500

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

Log:
I remember having tested *something*, not sure what...
Modified:
   branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c
===
--- branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c  2007-10-04 
00:10:54 UTC (rev 25499)
+++ branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc_nt.c  2007-10-04 
00:19:40 UTC (rev 25500)
@@ -192,7 +192,7 @@
 /***
 /
 
-static WERROR net_enum_files( TALLOC_CTX *ctx, const char **username,
+static WERROR net_enum_files( TALLOC_CTX *ctx, const char *username,
  FILE_INFO_3 **info, 
   uint32 *count, uint32 resume )
 {
@@ -1175,9 +1175,16 @@
 WERROR _srv_net_file_enum(pipes_struct *p, SRV_Q_NET_FILE_ENUM *q_u, 
SRV_R_NET_FILE_ENUM *r_u)
 {
switch ( q_u-level ) {
-   case 3:
-   return net_file_enum_3( q_u-username, r_u,
-   get_enum_hnd(q_u-enum_hnd) );
+   case 3: {
+   char *username;
+   if (!(username = rpcstr_pull_unistr2_talloc(
+ p-mem_ctx, q_u-username))) {
+   return WERR_NOMEM;
+   }
+
+   return net_file_enum_3(username, r_u,
+  get_enum_hnd(q_u-enum_hnd));
+   }
default:
return WERR_UNKNOWN_LEVEL;
}



svn commit: samba r25499 - in branches/SAMBA_3_2/source/utils: .

2007-10-03 Thread vlendec
Author: vlendec
Date: 2007-10-04 00:10:54 + (Thu, 04 Oct 2007)
New Revision: 25499

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

Log:
Fix rpc_file_list_internals
Modified:
   branches/SAMBA_3_2/source/utils/net_rpc.c


Changeset:
Modified: branches/SAMBA_3_2/source/utils/net_rpc.c
===
--- branches/SAMBA_3_2/source/utils/net_rpc.c   2007-10-03 22:23:37 UTC (rev 
25498)
+++ branches/SAMBA_3_2/source/utils/net_rpc.c   2007-10-04 00:10:54 UTC (rev 
25499)
@@ -4887,6 +4887,7 @@
int argc,
const char **argv)
 {
+   struct srvsvc_NetFileCtr3 ctr3;
union srvsvc_NetFileCtr ctr;
NTSTATUS result;
uint32 hnd;
@@ -4900,6 +4901,8 @@
/* if argc  0, must be user command */
if (argc  0)
username = smb_xstrdup(argv[0]);
+
+   ctr.ctr3 = ctr3;

result = rpccli_srvsvc_NetFileEnum(pipe_hnd, mem_ctx, NULL, NULL,
   username, level, ctr,



svn commit: samba r25317 - in branches: SAMBA_3_2/source/script/tests SAMBA_3_2_0/source/script/tests

2007-09-25 Thread vlendec
Author: vlendec
Date: 2007-09-25 16:42:53 + (Tue, 25 Sep 2007)
New Revision: 25317

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

Log:
Activate raw-samba3rootdirfid

Modified:
   branches/SAMBA_3_2/source/script/tests/test_posix_s3.sh
   branches/SAMBA_3_2_0/source/script/tests/test_posix_s3.sh


Changeset:
Modified: branches/SAMBA_3_2/source/script/tests/test_posix_s3.sh
===
--- branches/SAMBA_3_2/source/script/tests/test_posix_s3.sh 2007-09-25 
16:05:08 UTC (rev 25316)
+++ branches/SAMBA_3_2/source/script/tests/test_posix_s3.sh 2007-09-25 
16:42:53 UTC (rev 25317)
@@ -33,6 +33,7 @@
 raw=$raw RAW-SFILEINFO RAW-SFILEINFO-BUG RAW-STREAMS RAW-UNLINK RAW-WRITE
 raw=$raw RAW-SAMBA3HIDE RAW-SAMBA3BADPATH RAW-SFILEINFO-RENAME
 raw=$raw RAW-SAMBA3CASEINSENSITIVE RAW-SAMBA3POSIXTIMEDLOCK
+raw=$raw RAW-SAMBA3ROOTDIRFID
 
 rpc=RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-SAMBA3-SRVSVC RPC-SAMBA3-SHARESEC
 rpc=$rpc RPC-UNIXINFO RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC

Modified: branches/SAMBA_3_2_0/source/script/tests/test_posix_s3.sh
===
--- branches/SAMBA_3_2_0/source/script/tests/test_posix_s3.sh   2007-09-25 
16:05:08 UTC (rev 25316)
+++ branches/SAMBA_3_2_0/source/script/tests/test_posix_s3.sh   2007-09-25 
16:42:53 UTC (rev 25317)
@@ -33,6 +33,7 @@
 raw=$raw RAW-SFILEINFO RAW-SFILEINFO-BUG RAW-STREAMS RAW-UNLINK RAW-WRITE
 raw=$raw RAW-SAMBA3HIDE RAW-SAMBA3BADPATH RAW-SFILEINFO-RENAME
 raw=$raw RAW-SAMBA3CASEINSENSITIVE RAW-SAMBA3POSIXTIMEDLOCK
+raw=$raw RAW-SAMBA3ROOTDIRFID
 
 rpc=RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-SAMBA3-SRVSVC RPC-SAMBA3-SHARESEC
 rpc=$rpc RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC



svn commit: samba r25323 - in branches: SAMBA_3_2/source/lib SAMBA_3_2_0/source/lib

2007-09-25 Thread vlendec
Author: vlendec
Date: 2007-09-25 21:32:49 + (Tue, 25 Sep 2007)
New Revision: 25323

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

Log:
Fix the build
Modified:
   branches/SAMBA_3_2/source/lib/ctdbd_conn.c
   branches/SAMBA_3_2_0/source/lib/ctdbd_conn.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/ctdbd_conn.c
===
--- branches/SAMBA_3_2/source/lib/ctdbd_conn.c  2007-09-25 18:02:17 UTC (rev 
25322)
+++ branches/SAMBA_3_2/source/lib/ctdbd_conn.c  2007-09-25 21:32:49 UTC (rev 
25323)
@@ -95,7 +95,7 @@
int32_t cstatus=-1;
NTSTATUS status;
status = ctdbd_control(conn,
-  CTDB_CURRENT_NODE, CTDB_CONTROL_GET_VNN, 0,
+  CTDB_CURRENT_NODE, CTDB_CONTROL_GET_PNN, 0,
   tdb_null, NULL, NULL, cstatus);
if (!NT_STATUS_IS_OK(status)) {
cluster_fatal(ctdbd_control failed\n);

Modified: branches/SAMBA_3_2_0/source/lib/ctdbd_conn.c
===
--- branches/SAMBA_3_2_0/source/lib/ctdbd_conn.c2007-09-25 18:02:17 UTC 
(rev 25322)
+++ branches/SAMBA_3_2_0/source/lib/ctdbd_conn.c2007-09-25 21:32:49 UTC 
(rev 25323)
@@ -95,7 +95,7 @@
int32_t cstatus=-1;
NTSTATUS status;
status = ctdbd_control(conn,
-  CTDB_CURRENT_NODE, CTDB_CONTROL_GET_VNN, 0,
+  CTDB_CURRENT_NODE, CTDB_CONTROL_GET_PNN, 0,
   tdb_null, NULL, NULL, cstatus);
if (!NT_STATUS_IS_OK(status)) {
cluster_fatal(ctdbd_control failed\n);



svn commit: samba r25324 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

2007-09-25 Thread vlendec
Author: vlendec
Date: 2007-09-25 21:41:39 + (Tue, 25 Sep 2007)
New Revision: 25324

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

Log:
Fix msdfs proxy

Jeremy, please check!

Modified:
   branches/SAMBA_3_2/source/smbd/msdfs.c
   branches/SAMBA_3_2_0/source/smbd/msdfs.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/msdfs.c
===
--- branches/SAMBA_3_2/source/smbd/msdfs.c  2007-09-25 21:32:49 UTC (rev 
25323)
+++ branches/SAMBA_3_2/source/smbd/msdfs.c  2007-09-25 21:41:39 UTC (rev 
25324)
@@ -771,7 +771,7 @@
}
}
 
-   if (!lp_msdfs_root(snum)) {
+   if (!lp_msdfs_root(snum)  (*lp_msdfs_proxy(snum) == '\0')) {
DEBUG(3,(get_referred_path: |%s| in dfs path %s is not 
a dfs root.\n,
pdp-servicename, dfs_path));

Modified: branches/SAMBA_3_2_0/source/smbd/msdfs.c
===
--- branches/SAMBA_3_2_0/source/smbd/msdfs.c2007-09-25 21:32:49 UTC (rev 
25323)
+++ branches/SAMBA_3_2_0/source/smbd/msdfs.c2007-09-25 21:41:39 UTC (rev 
25324)
@@ -771,7 +771,7 @@
}
}
 
-   if (!lp_msdfs_root(snum)) {
+   if (!lp_msdfs_root(snum)  (*lp_msdfs_proxy(snum) == '\0')) {
DEBUG(3,(get_referred_path: |%s| in dfs path %s is not 
a dfs root.\n,
pdp-servicename, dfs_path));



svn commit: samba r25327 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

2007-09-25 Thread vlendec
Author: vlendec
Date: 2007-09-25 23:26:05 + (Tue, 25 Sep 2007)
New Revision: 25327

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

Log:
Normalize the path we return for 'msdfs proxy'

We now accept both \\server\tmp and \server\tmp. There are other places
where this might be necessary, but at least the functionality is a bit
easier now.

Modified:
   branches/SAMBA_3_2/source/smbd/msdfs.c
   branches/SAMBA_3_2_0/source/smbd/msdfs.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/msdfs.c
===
--- branches/SAMBA_3_2/source/smbd/msdfs.c  2007-09-25 22:43:42 UTC (rev 
25326)
+++ branches/SAMBA_3_2/source/smbd/msdfs.c  2007-09-25 23:26:05 UTC (rev 
25327)
@@ -788,6 +788,7 @@
 */
 
if (pdp-reqpath[0] == '\0') {
+   char *tmp;
struct referral *ref;
 
if (*lp_msdfs_proxy(snum) == '\0') {
@@ -810,7 +811,16 @@
return NT_STATUS_NO_MEMORY;
}
 
-   ref-alternate_path = talloc_strdup(ctx, lp_msdfs_proxy(snum));
+   if (!(tmp = talloc_strdup(ctx, lp_msdfs_proxy(snum {
+   TALLOC_FREE(pdp);
+   return NT_STATUS_NO_MEMORY;
+   }
+
+   trim_string(tmp, \\, 0);
+
+   ref-alternate_path = talloc_asprintf(ctx, \\%s, tmp);
+   TALLOC_FREE(tmp);
+
if (!ref-alternate_path) {
TALLOC_FREE(pdp);
return NT_STATUS_NO_MEMORY;

Modified: branches/SAMBA_3_2_0/source/smbd/msdfs.c
===
--- branches/SAMBA_3_2_0/source/smbd/msdfs.c2007-09-25 22:43:42 UTC (rev 
25326)
+++ branches/SAMBA_3_2_0/source/smbd/msdfs.c2007-09-25 23:26:05 UTC (rev 
25327)
@@ -788,6 +788,7 @@
 */
 
if (pdp-reqpath[0] == '\0') {
+   char *tmp;
struct referral *ref;
 
if (*lp_msdfs_proxy(snum) == '\0') {
@@ -810,7 +811,16 @@
return NT_STATUS_NO_MEMORY;
}
 
-   ref-alternate_path = talloc_strdup(ctx, lp_msdfs_proxy(snum));
+   if (!(tmp = talloc_strdup(ctx, lp_msdfs_proxy(snum {
+   TALLOC_FREE(pdp);
+   return NT_STATUS_NO_MEMORY;
+   }
+
+   trim_string(tmp, \\, 0);
+
+   ref-alternate_path = talloc_asprintf(ctx, \\%s, tmp);
+   TALLOC_FREE(tmp);
+
if (!ref-alternate_path) {
TALLOC_FREE(pdp);
return NT_STATUS_NO_MEMORY;



svn commit: samba r25310 - in branches/SAMBA_4_0/source/torture/raw: .

2007-09-24 Thread vlendec
Author: vlendec
Date: 2007-09-24 19:48:10 + (Mon, 24 Sep 2007)
New Revision: 25310

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

Log:
Make sure we do not regress on r25309
Modified:
   branches/SAMBA_4_0/source/torture/raw/raw.c
   branches/SAMBA_4_0/source/torture/raw/samba3misc.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/raw.c
===
--- branches/SAMBA_4_0/source/torture/raw/raw.c 2007-09-24 19:11:42 UTC (rev 
25309)
+++ branches/SAMBA_4_0/source/torture/raw/raw.c 2007-09-24 19:48:10 UTC (rev 
25310)
@@ -63,6 +63,8 @@
torture_suite_add_1smb_test(suite, COMPOSITE, torture_raw_composite);
torture_suite_add_simple_test(suite, SAMBA3HIDE, torture_samba3_hide);
torture_suite_add_simple_test(suite, SAMBA3CLOSEERR, 
torture_samba3_closeerr);
+   torture_suite_add_simple_test(suite, SAMBA3ROOTDIRFID,
+ torture_samba3_rootdirfid);
torture_suite_add_simple_test(suite, SAMBA3CHECKFSP, 
torture_samba3_checkfsp);
torture_suite_add_simple_test(suite, SAMBA3BADPATH, 
torture_samba3_badpath);
torture_suite_add_simple_test(suite, SAMBA3CASEINSENSITIVE,

Modified: branches/SAMBA_4_0/source/torture/raw/samba3misc.c
===
--- branches/SAMBA_4_0/source/torture/raw/samba3misc.c  2007-09-24 19:11:42 UTC 
(rev 25309)
+++ branches/SAMBA_4_0/source/torture/raw/samba3misc.c  2007-09-24 19:48:10 UTC 
(rev 25310)
@@ -817,3 +817,73 @@
smbcli_deltree(cli-tree, dirname);
return ret;
 }
+
+bool torture_samba3_rootdirfid(struct torture_context *tctx)
+{
+   struct smbcli_state *cli;
+   NTSTATUS status;
+   uint16_t dnum;
+   union smb_open io;
+   const char *fname = testfile;
+   bool ret = false;
+
+   if (!torture_open_connection(cli, 0)) {
+   ret = false;
+   goto done;
+   }
+
+   smbcli_unlink(cli-tree, fname);
+
+   io.generic.level = RAW_OPEN_NTCREATEX;
+   io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED;
+   io.ntcreatex.in.root_fid = 0;
+   io.ntcreatex.in.security_flags = 0;
+   io.ntcreatex.in.access_mask =
+   SEC_STD_SYNCHRONIZE | SEC_FILE_EXECUTE;
+   io.ntcreatex.in.alloc_size = 0;
+   io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_DIRECTORY;
+   io.ntcreatex.in.share_access =
+   NTCREATEX_SHARE_ACCESS_READ
+   | NTCREATEX_SHARE_ACCESS_READ;
+   io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
+   io.ntcreatex.in.create_options = 0;
+   io.ntcreatex.in.fname = \\;
+   status = smb_raw_open(cli-tree, tctx, io);
+   if (!NT_STATUS_IS_OK(status)) {
+   d_printf(smb_open on the directory failed: %s\n,
+nt_errstr(status));
+   ret = false;
+   goto done;
+   }
+   dnum = io.ntcreatex.out.file.fnum;
+
+   io.ntcreatex.in.flags =
+   NTCREATEX_FLAGS_REQUEST_OPLOCK
+   | NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK;
+   io.ntcreatex.in.root_fid = dnum;
+   io.ntcreatex.in.security_flags = 0;
+   io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OVERWRITE_IF;
+   io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
+   io.ntcreatex.in.alloc_size = 0;
+   io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
+   io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_NONE;
+   io.ntcreatex.in.create_options = 0;
+   io.ntcreatex.in.fname = fname;
+
+   status = smb_raw_open(cli-tree, tctx, io);
+   if (!NT_STATUS_IS_OK(status)) {
+   d_printf(smb_open on the file %s failed: %s\n,
+fname, nt_errstr(status));
+   ret = false;
+   goto done;
+   }
+
+   smbcli_close(cli-tree, io.ntcreatex.out.file.fnum);
+   smbcli_close(cli-tree, dnum);
+   smbcli_unlink(cli-tree, fname);
+
+   ret = true;
+ done:
+   return ret;
+}
+



svn commit: samba r25311 - in branches: SAMBA_3_0_MAINT/source/smbd SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

2007-09-24 Thread vlendec
Author: vlendec
Date: 2007-09-24 21:43:54 + (Mon, 24 Sep 2007)
New Revision: 25311

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

Log:
Patch from Heinrich Mislik [EMAIL PROTECTED] to fix AIX
quotas.

Heinrich, I trust you on that, I don't even have compiled this :-)

Volker

Modified:
   branches/SAMBA_3_0_MAINT/source/smbd/quotas.c
   branches/SAMBA_3_2/source/smbd/quotas.c
   branches/SAMBA_3_2_0/source/smbd/quotas.c


Changeset:
Modified: branches/SAMBA_3_0_MAINT/source/smbd/quotas.c
===
--- branches/SAMBA_3_0_MAINT/source/smbd/quotas.c   2007-09-24 19:48:10 UTC 
(rev 25310)
+++ branches/SAMBA_3_0_MAINT/source/smbd/quotas.c   2007-09-24 21:43:54 UTC 
(rev 25311)
@@ -1225,6 +1225,9 @@
   D.dqb_curblocks  = user_quota.bused;
   D.dqb_bsoftlimit = user_quota.bsoft;
   D.dqb_bhardlimit = user_quota.bhard;
+  D.dqb_curfiles   = user_quota.iused;
+  D.dqb_fsoftlimit = user_quota.isoft;
+  D.dqb_fhardlimit = user_quota.ihard;
 }
 else if(statbuf.f_vfstype == MNT_JFS)
 {

Modified: branches/SAMBA_3_2/source/smbd/quotas.c
===
--- branches/SAMBA_3_2/source/smbd/quotas.c 2007-09-24 19:48:10 UTC (rev 
25310)
+++ branches/SAMBA_3_2/source/smbd/quotas.c 2007-09-24 21:43:54 UTC (rev 
25311)
@@ -1236,6 +1236,9 @@
   D.dqb_curblocks  = user_quota.bused;
   D.dqb_bsoftlimit = user_quota.bsoft;
   D.dqb_bhardlimit = user_quota.bhard;
+  D.dqb_curfiles   = user_quota.iused;
+  D.dqb_fsoftlimit = user_quota.isoft;
+  D.dqb_fhardlimit = user_quota.ihard;
 }
 else if(statbuf.f_vfstype == MNT_JFS)
 {

Modified: branches/SAMBA_3_2_0/source/smbd/quotas.c
===
--- branches/SAMBA_3_2_0/source/smbd/quotas.c   2007-09-24 19:48:10 UTC (rev 
25310)
+++ branches/SAMBA_3_2_0/source/smbd/quotas.c   2007-09-24 21:43:54 UTC (rev 
25311)
@@ -1236,6 +1236,9 @@
   D.dqb_curblocks  = user_quota.bused;
   D.dqb_bsoftlimit = user_quota.bsoft;
   D.dqb_bhardlimit = user_quota.bhard;
+  D.dqb_curfiles   = user_quota.iused;
+  D.dqb_fsoftlimit = user_quota.isoft;
+  D.dqb_fhardlimit = user_quota.ihard;
 }
 else if(statbuf.f_vfstype == MNT_JFS)
 {



svn commit: samba r25296 - in branches/SAMBA_4_0/source/torture/raw: .

2007-09-22 Thread vlendec
Author: vlendec
Date: 2007-09-22 09:22:58 + (Sat, 22 Sep 2007)
New Revision: 25296

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

Log:
Apply patch by Elrond [EMAIL PROTECTED]: Put
__location__ into a few printfs.

Thanks,

Volker

Modified:
   branches/SAMBA_4_0/source/torture/raw/composite.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/composite.c
===
--- branches/SAMBA_4_0/source/torture/raw/composite.c   2007-09-21 16:15:47 UTC 
(rev 25295)
+++ branches/SAMBA_4_0/source/torture/raw/composite.c   2007-09-22 09:22:58 UTC 
(rev 25296)
@@ -68,7 +68,7 @@
 
status = smb_composite_savefile(cli-tree, io1);
if (!NT_STATUS_IS_OK(status)) {
-   printf(savefile failed: %s\n, nt_errstr(status));
+   printf((%s) savefile failed: %s\n, 
__location__,nt_errstr(status));
return False;
}
 
@@ -88,7 +88,7 @@
while (*count != num_ops) {
event_loop_once(cli-transport-socket-event.ctx);
if (lp_parm_bool(NULL, torture, progress, true)) {
-   printf(count=%d\r, *count);
+   printf((%s) count=%d\r, __location__, *count);
fflush(stdout);
}
}
@@ -97,18 +97,18 @@
for (i=0;inum_ops;i++) {
status = smb_composite_loadfile_recv(c[i], mem_ctx);
if (!NT_STATUS_IS_OK(status)) {
-   printf(loadfile[%d] failed - %s\n, i, 
nt_errstr(status));
+   printf((%s) loadfile[%d] failed - %s\n, __location__, 
i, nt_errstr(status));
return False;
}
 
if (io2.out.size != len) {
-   printf(wrong length in returned data - %d should be 
%d\n,
+   printf((%s) wrong length in returned data - %d should 
be %d\n,__location__,
   io2.out.size, (int)len);
return False;
}

if (memcmp(io2.out.data, data, len) != 0) {
-   printf(wrong data in loadfile!\n);
+   printf((%s) wrong data in loadfile!\n,__location__);
return False;
}
}
@@ -148,7 +148,7 @@
 
status = smb_composite_savefile(cli-tree, io1);
if (!NT_STATUS_IS_OK(status)) {
-   printf(savefile failed: %s\n, nt_errstr(status));
+   printf((%s) savefile failed: %s\n,__location__, 
nt_errstr(status));
return False;
}
 
@@ -178,7 +178,7 @@
while (*count != torture_numops) {
event_loop_once(event_ctx);
if (lp_parm_bool(NULL, torture, progress, true)) {
-   printf(count=%d\r, *count);
+   printf((%s) count=%d\r, __location__, *count);
fflush(stdout);
}
}
@@ -187,22 +187,22 @@
for (i=0;itorture_numops;i++) {
status = smb_composite_fetchfile_recv(c[i], mem_ctx);
if (!NT_STATUS_IS_OK(status)) {
-   printf(loadfile[%d] failed - %s\n, i,
+   printf((%s) loadfile[%d] failed - %s\n, __location__, 
i,
   nt_errstr(status));
ret = False;
continue;
}
 
if (io2.out.size != len) {
-   printf(wrong length in returned data - %d 
-  should be %d\n,
+   printf((%s) wrong length in returned data - %d 
+  should be %d\n, __location__,
   io2.out.size, (int)len);
ret = False;
continue;
}

if (memcmp(io2.out.data, data, len) != 0) {
-   printf(wrong data in loadfile!\n);
+   printf((%s) wrong data in loadfile!\n, __location__);
ret = False;
continue;
}
@@ -243,7 +243,7 @@
  
status = smb_composite_savefile(cli-tree, io1);
if (!NT_STATUS_IS_OK(status)) {
-   printf(savefile failed: %s\n, nt_errstr(status));
+   printf((%s) savefile failed: %s\n, __location__, 
nt_errstr(status));
return False;
}
 
@@ -252,7 +252,7 @@
io_orig[i]-in.sd = security_descriptor_initialise(io_orig[i]);
status = smb_composite_appendacl(cli-tree, io_orig[i], 
io_orig[i]);
if (!NT_STATUS_IS_OK(status)) {
-   printf(appendacl failed: %s\n, nt_errstr(status));
+   printf((%s) appendacl failed: %s\n

svn commit: samba r25274 - in branches: SAMBA_3_2/source/lib SAMBA_3_2_0/source/lib

2007-09-21 Thread vlendec
Author: vlendec
Date: 2007-09-21 10:23:35 + (Fri, 21 Sep 2007)
New Revision: 25274

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

Log:
Attempt to fix RPC-SAMBA3-GETUSERNAME
Modified:
   branches/SAMBA_3_2/source/lib/util_unistr.c
   branches/SAMBA_3_2_0/source/lib/util_unistr.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/util_unistr.c
===
--- branches/SAMBA_3_2/source/lib/util_unistr.c 2007-09-21 09:58:36 UTC (rev 
25273)
+++ branches/SAMBA_3_2/source/lib/util_unistr.c 2007-09-21 10:23:35 UTC (rev 
25274)
@@ -361,7 +361,7 @@
 
 void unistr2_to_ascii(char *dest, const UNISTR2 *str, size_t maxlen)
 {
-   if (str == NULL) {
+   if ((str == NULL) || (str-uni_str_len == 0)) {
*dest='\0';
return;
}
@@ -374,7 +374,7 @@
 
 void unistr3_to_ascii(char *dest, const UNISTR3 *str, size_t maxlen)
 {
-   if (str == NULL) {
+   if ((str == NULL) || (str-uni_str_len == 0)) {
*dest='\0';
return;
}

Modified: branches/SAMBA_3_2_0/source/lib/util_unistr.c
===
--- branches/SAMBA_3_2_0/source/lib/util_unistr.c   2007-09-21 09:58:36 UTC 
(rev 25273)
+++ branches/SAMBA_3_2_0/source/lib/util_unistr.c   2007-09-21 10:23:35 UTC 
(rev 25274)
@@ -361,7 +361,7 @@
 
 void unistr2_to_ascii(char *dest, const UNISTR2 *str, size_t maxlen)
 {
-   if (str == NULL) {
+   if ((str == NULL) || (str-uni_str_len == 0)) {
*dest='\0';
return;
}
@@ -374,7 +374,7 @@
 
 void unistr3_to_ascii(char *dest, const UNISTR3 *str, size_t maxlen)
 {
-   if (str == NULL) {
+   if ((str == NULL) || (str-uni_str_len == 0)) {
*dest='\0';
return;
}



svn commit: samba r25255 - in branches/SAMBA_3_0_MAINT/source/lib/talloc: .

2007-09-20 Thread vlendec
Author: vlendec
Date: 2007-09-20 09:47:18 + (Thu, 20 Sep 2007)
New Revision: 25255

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

Log:
Revert -r25116 in 3_0_MAINT on behalf of Jeremy

Modified:
   branches/SAMBA_3_0_MAINT/source/lib/talloc/talloc.c


Changeset:
Modified: branches/SAMBA_3_0_MAINT/source/lib/talloc/talloc.c
===
--- branches/SAMBA_3_0_MAINT/source/lib/talloc/talloc.c 2007-09-20 09:15:26 UTC 
(rev 25254)
+++ branches/SAMBA_3_0_MAINT/source/lib/talloc/talloc.c 2007-09-20 09:47:18 UTC 
(rev 25255)
@@ -1215,7 +1215,8 @@
  * accumulating output into a string buffer.
  **/
 char *talloc_vasprintf_append(char *s, const char *fmt, va_list ap)
-{
+{  
+   struct talloc_chunk *tc;
int len, s_len;
va_list ap2;
char c;
@@ -1224,8 +1225,10 @@
return talloc_vasprintf(NULL, fmt, ap);
}
 
-   s_len = strlen(s);
+   tc = talloc_chunk_from_ptr(s);
 
+   s_len = tc-size - 1;
+
va_copy(ap2, ap);
len = vsnprintf(c, 1, fmt, ap2);
va_end(ap2);



svn commit: samba r25186 - in branches/SAMBA_4_0/source/torture/basic: .

2007-09-16 Thread vlendec
Author: vlendec
Date: 2007-09-16 10:30:31 + (Sun, 16 Sep 2007)
New Revision: 25186

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

Log:
Fix a memory corruption in base-mangle
Modified:
   branches/SAMBA_4_0/source/torture/basic/mangle_test.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/basic/mangle_test.c
===
--- branches/SAMBA_4_0/source/torture/basic/mangle_test.c   2007-09-15 
23:03:34 UTC (rev 25185)
+++ branches/SAMBA_4_0/source/torture/basic/mangle_test.c   2007-09-16 
10:30:31 UTC (rev 25186)
@@ -144,7 +144,7 @@
}
 
/* and a medium probability of a common lead string */
-   if (random() % 10 == 0) {
+   if ((len  5)  (random() % 10 == 0)) {
strncpy(p, ABCDE, 5);
}
 



svn commit: samba r25176 - in branches/SAMBA_3_0_MAINT/source/client: .

2007-09-15 Thread vlendec
Author: vlendec
Date: 2007-09-15 15:31:54 + (Sat, 15 Sep 2007)
New Revision: 25176

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

Log:
Merge fix for bug 4028
Modified:
   branches/SAMBA_3_0_MAINT/source/client/client.c


Changeset:
Modified: branches/SAMBA_3_0_MAINT/source/client/client.c
===
--- branches/SAMBA_3_0_MAINT/source/client/client.c 2007-09-14 23:21:00 UTC 
(rev 25175)
+++ branches/SAMBA_3_0_MAINT/source/client/client.c 2007-09-15 15:31:54 UTC 
(rev 25176)
@@ -194,6 +194,10 @@
msg[l] = c;   
}
 
+   if ((total_len  0)  (strlen(msg) == 0)) {
+   break;
+   }
+
if (!cli_message_text(cli, msg, l, grp_id)) {
d_printf(SMBsendtxt failed (%s)\n,cli_errstr(cli));
return;



svn commit: samba r25184 - in branches: SAMBA_3_2/source/lib SAMBA_3_2/source/smbd SAMBA_3_2_0/source/lib SAMBA_3_2_0/source/smbd

2007-09-15 Thread vlendec
Author: vlendec
Date: 2007-09-15 20:24:35 + (Sat, 15 Sep 2007)
New Revision: 25184

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

Log:
Fix some C++ warnings and an uninitialized variable

Modified:
   branches/SAMBA_3_2/source/lib/charcnv.c
   branches/SAMBA_3_2/source/lib/util_str.c
   branches/SAMBA_3_2/source/smbd/msdfs.c
   branches/SAMBA_3_2/source/smbd/nttrans.c
   branches/SAMBA_3_2/source/smbd/trans2.c
   branches/SAMBA_3_2_0/source/lib/charcnv.c
   branches/SAMBA_3_2_0/source/lib/util_str.c
   branches/SAMBA_3_2_0/source/smbd/msdfs.c
   branches/SAMBA_3_2_0/source/smbd/nttrans.c
   branches/SAMBA_3_2_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/charcnv.c
===
--- branches/SAMBA_3_2/source/lib/charcnv.c 2007-09-15 20:14:17 UTC (rev 
25183)
+++ branches/SAMBA_3_2/source/lib/charcnv.c 2007-09-15 20:24:35 UTC (rev 
25184)
@@ -1493,7 +1493,7 @@
/* Have we got space to append the '\0' ? */
if (size = dest_len) {
/* No, realloc. */
-   dest = TALLOC_REALLOC(ctx, dest,
+   dest = TALLOC_REALLOC_ARRAY(ctx, dest, char,
dest_len+1);
if (!dest) {
/* talloc fail. */

Modified: branches/SAMBA_3_2/source/lib/util_str.c
===
--- branches/SAMBA_3_2/source/lib/util_str.c2007-09-15 20:14:17 UTC (rev 
25183)
+++ branches/SAMBA_3_2/source/lib/util_str.c2007-09-15 20:24:35 UTC (rev 
25184)
@@ -995,7 +995,7 @@
/* We know a token can't be larger
 * than the entire list. */
 
-   tok = SMB_MALLOC(bufsize+1);
+   tok = SMB_MALLOC_ARRAY(char, bufsize+1);
if (!tok) {
return False;
}

Modified: branches/SAMBA_3_2/source/smbd/msdfs.c
===
--- branches/SAMBA_3_2/source/smbd/msdfs.c  2007-09-15 20:14:17 UTC (rev 
25183)
+++ branches/SAMBA_3_2/source/smbd/msdfs.c  2007-09-15 20:24:35 UTC (rev 
25184)
@@ -1549,7 +1549,7 @@
 {
struct junction_map *jn = NULL;
int i=0;
-   size_t jn_count;
+   size_t jn_count = 0;
int sharecount = 0;
 
*p_num_jn = 0;

Modified: branches/SAMBA_3_2/source/smbd/nttrans.c
===
--- branches/SAMBA_3_2/source/smbd/nttrans.c2007-09-15 20:14:17 UTC (rev 
25183)
+++ branches/SAMBA_3_2/source/smbd/nttrans.c2007-09-15 20:24:35 UTC (rev 
25184)
@@ -634,7 +634,7 @@
 */
 
dir_name_len = strlen(dir_fsp-fsp_name);
-   fname = TALLOC_SIZE(ctx, dir_name_len+2);
+   fname = TALLOC_ARRAY(ctx, char, dir_name_len+2);
if (!fname) {
reply_nterror(
req, NT_STATUS_NO_MEMORY);
@@ -1392,7 +1392,7 @@
 */
 
dir_name_len = strlen(dir_fsp-fsp_name);
-   fname = TALLOC_SIZE(ctx, dir_name_len+2);
+   fname = TALLOC_ARRAY(ctx, char, dir_name_len+2);
if (!fname) {
reply_nterror(
req, NT_STATUS_NO_MEMORY);

Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===
--- branches/SAMBA_3_2/source/smbd/trans2.c 2007-09-15 20:14:17 UTC (rev 
25183)
+++ branches/SAMBA_3_2/source/smbd/trans2.c 2007-09-15 20:24:35 UTC (rev 
25184)
@@ -4209,7 +4209,7 @@
 
case SMB_QUERY_FILE_UNIX_LINK:
{
-   char *buffer = TALLOC_SIZE(ctx, 1024);
+   char *buffer = TALLOC_ARRAY(ctx, char, 1024);
 
if (!buffer) {
reply_nterror(req, NT_STATUS_NO_MEMORY);

Modified: branches/SAMBA_3_2_0/source/lib/charcnv.c
===
--- branches/SAMBA_3_2_0/source/lib/charcnv.c   2007-09-15 20:14:17 UTC (rev 
25183)
+++ branches/SAMBA_3_2_0/source/lib/charcnv.c   2007-09-15 20:24:35 UTC (rev 
25184)
@@ -1493,7 +1493,7 @@
/* Have we got space to append the '\0' ? */
if (size = dest_len) {
/* No, realloc. */
-   dest = TALLOC_REALLOC(ctx, dest,
+   dest = TALLOC_REALLOC_ARRAY(ctx, dest, char,
dest_len+1);
if (!dest) {
/* talloc fail. */

Modified: branches/SAMBA_3_2_0/source/lib/util_str.c

svn commit: samba r25169 - in branches: SAMBA_3_2/source/client SAMBA_3_2_0/source/client

2007-09-14 Thread vlendec
Author: vlendec
Date: 2007-09-14 18:31:33 + (Fri, 14 Sep 2007)
New Revision: 25169

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

Log:
Fix bug 4028
Modified:
   branches/SAMBA_3_2/source/client/client.c
   branches/SAMBA_3_2_0/source/client/client.c


Changeset:
Modified: branches/SAMBA_3_2/source/client/client.c
===
--- branches/SAMBA_3_2/source/client/client.c   2007-09-14 18:26:23 UTC (rev 
25168)
+++ branches/SAMBA_3_2/source/client/client.c   2007-09-14 18:31:33 UTC (rev 
25169)
@@ -193,6 +193,10 @@
msg[l] = c;   
}
 
+   if ((total_len  0)  (strlen(msg) == 0)) {
+   break;
+   }
+
if (!cli_message_text(cli, msg, l, grp_id)) {
d_printf(SMBsendtxt failed (%s)\n,cli_errstr(cli));
return;

Modified: branches/SAMBA_3_2_0/source/client/client.c
===
--- branches/SAMBA_3_2_0/source/client/client.c 2007-09-14 18:26:23 UTC (rev 
25168)
+++ branches/SAMBA_3_2_0/source/client/client.c 2007-09-14 18:31:33 UTC (rev 
25169)
@@ -193,6 +193,10 @@
msg[l] = c;   
}
 
+   if ((total_len  0)  (strlen(msg) == 0)) {
+   break;
+   }
+
if (!cli_message_text(cli, msg, l, grp_id)) {
d_printf(SMBsendtxt failed (%s)\n,cli_errstr(cli));
return;



svn commit: samba-docs r1180 - in trunk/manpages-3: .

2007-09-12 Thread vlendec
Author: vlendec
Date: 2007-09-12 11:56:02 + (Wed, 12 Sep 2007)
New Revision: 1180

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

Log:
Fix sample for base_rid parameter

base_rid = 1000 does not work reliably because it turns domain users
(513) into an illegal rid.

Modified:
   trunk/manpages-3/idmap_rid.8.xml


Changeset:
Modified: trunk/manpages-3/idmap_rid.8.xml
===
--- trunk/manpages-3/idmap_rid.8.xml2007-09-12 05:31:44 UTC (rev 1179)
+++ trunk/manpages-3/idmap_rid.8.xml2007-09-12 11:56:02 UTC (rev 1180)
@@ -58,7 +58,7 @@
idmap domains = MAIN TRUSTED1
 
idmap config MAIN:backend  = rid
-   idmap config MAIN:base_rid = 1000
+   idmap config MAIN:base_rid = 0
idmap config MAIN:range= 1 - 4
 
idmap config TRUSTED1:backend  = rid



svn commit: samba-docs r1181 - in trunk/manpages-3: .

2007-09-12 Thread vlendec
Author: vlendec
Date: 2007-09-12 12:16:36 + (Wed, 12 Sep 2007)
New Revision: 1181

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

Log:
Fix typo
Modified:
   trunk/manpages-3/idmap_ad.8.xml


Changeset:
Modified: trunk/manpages-3/idmap_ad.8.xml
===
--- trunk/manpages-3/idmap_ad.8.xml 2007-09-12 11:56:02 UTC (rev 1180)
+++ trunk/manpages-3/idmap_ad.8.xml 2007-09-12 12:16:36 UTC (rev 1181)
@@ -57,7 +57,7 @@
The following example shows how to retrieve idmappings from our 
principal and
and trusted AD domains. All is needed is to set default to yes. If 
trusted
domains are present id conflicts must be resolved beforehand, there is 
no
-   guarantee on the order confliting mappings would be resolved at this 
point.
+   guarantee on the order conflicting mappings would be resolved at this 
point.
 
This example also shows how to leave a small non conflicting range for 
local
id allocation that may be used in internal backends like BULTIN.



svn commit: samba r25061 - in branches: SAMBA_3_2/source/lib SAMBA_3_2_0/source/lib

2007-09-10 Thread vlendec
Author: vlendec
Date: 2007-09-10 17:49:51 + (Mon, 10 Sep 2007)
New Revision: 25061

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

Log:
Pro-actively shut up Coverity :-)

Modified:
   branches/SAMBA_3_2/source/lib/file_id.c
   branches/SAMBA_3_2_0/source/lib/file_id.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/file_id.c
===
--- branches/SAMBA_3_2/source/lib/file_id.c 2007-09-10 16:56:51 UTC (rev 
25060)
+++ branches/SAMBA_3_2/source/lib/file_id.c 2007-09-10 17:49:51 UTC (rev 
25061)
@@ -57,9 +57,11 @@
  */
 const char *file_id_string_tos(const struct file_id *id)
 {
-   return talloc_asprintf(talloc_tos(), %llx:%llx, 
-  (unsigned long long)id-devid, 
-  (unsigned long long)id-inode);
+   char *result = talloc_asprintf(talloc_tos(), %llx:%llx, 
+  (unsigned long long)id-devid, 
+  (unsigned long long)id-inode);
+   SMB_ASSERT(result != NULL);
+   return result;
 }
 
 /*

Modified: branches/SAMBA_3_2_0/source/lib/file_id.c
===
--- branches/SAMBA_3_2_0/source/lib/file_id.c   2007-09-10 16:56:51 UTC (rev 
25060)
+++ branches/SAMBA_3_2_0/source/lib/file_id.c   2007-09-10 17:49:51 UTC (rev 
25061)
@@ -57,9 +57,11 @@
  */
 const char *file_id_string_tos(const struct file_id *id)
 {
-   return talloc_asprintf(talloc_tos(), %llx:%llx, 
-  (unsigned long long)id-devid, 
-  (unsigned long long)id-inode);
+   char *result = talloc_asprintf(talloc_tos(), %llx:%llx, 
+  (unsigned long long)id-devid, 
+  (unsigned long long)id-inode);
+   SMB_ASSERT(result != NULL);
+   return result;
 }
 
 /*



svn commit: samba r25024 - in branches: SAMBA_3_0_25/source/groupdb SAMBA_3_2/source/groupdb SAMBA_3_2_0/source/groupdb

2007-09-08 Thread vlendec
Author: vlendec
Date: 2007-09-08 09:15:08 + (Sat, 08 Sep 2007)
New Revision: 25024

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

Log:
Fix a whole bunch of Coverity bugs

The callers of get_domain_group_from_sid() with some justification
expected map-gid to be initialized when get_domain_group_from_sid
returned True.

Modified:
   branches/SAMBA_3_0_25/source/groupdb/mapping.c
   branches/SAMBA_3_2/source/groupdb/mapping.c
   branches/SAMBA_3_2_0/source/groupdb/mapping.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/groupdb/mapping.c
===
--- branches/SAMBA_3_0_25/source/groupdb/mapping.c  2007-09-08 05:35:10 UTC 
(rev 25023)
+++ branches/SAMBA_3_0_25/source/groupdb/mapping.c  2007-09-08 09:15:08 UTC 
(rev 25024)
@@ -179,6 +179,7 @@
fstrcpy( map-comment, Ordinary Users );
sid_copy( map-sid, sid );
map-sid_name_use = SID_NAME_DOM_GRP;
+   map-gid = (gid_t)-1;

return True;
}

Modified: branches/SAMBA_3_2/source/groupdb/mapping.c
===
--- branches/SAMBA_3_2/source/groupdb/mapping.c 2007-09-08 05:35:10 UTC (rev 
25023)
+++ branches/SAMBA_3_2/source/groupdb/mapping.c 2007-09-08 09:15:08 UTC (rev 
25024)
@@ -145,6 +145,7 @@
fstrcpy( map-comment, Ordinary Users );
sid_copy( map-sid, sid );
map-sid_name_use = SID_NAME_DOM_GRP;
+   map-gid = (gid_t)-1;

return True;
}

Modified: branches/SAMBA_3_2_0/source/groupdb/mapping.c
===
--- branches/SAMBA_3_2_0/source/groupdb/mapping.c   2007-09-08 05:35:10 UTC 
(rev 25023)
+++ branches/SAMBA_3_2_0/source/groupdb/mapping.c   2007-09-08 09:15:08 UTC 
(rev 25024)
@@ -145,6 +145,7 @@
fstrcpy( map-comment, Ordinary Users );
sid_copy( map-sid, sid );
map-sid_name_use = SID_NAME_DOM_GRP;
+   map-gid = (gid_t)-1;

return True;
}



svn commit: samba r25025 - in branches: SAMBA_3_2/source/lib SAMBA_3_2_0/source/lib

2007-09-08 Thread vlendec
Author: vlendec
Date: 2007-09-08 10:30:11 + (Sat, 08 Sep 2007)
New Revision: 25025

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

Log:
Remove an unused function
Modified:
   branches/SAMBA_3_2/source/lib/substitute.c
   branches/SAMBA_3_2_0/source/lib/substitute.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/substitute.c
===
--- branches/SAMBA_3_2/source/lib/substitute.c  2007-09-08 09:15:08 UTC (rev 
25024)
+++ branches/SAMBA_3_2/source/lib/substitute.c  2007-09-08 10:30:11 UTC (rev 
25025)
@@ -140,11 +140,6 @@
}
 }
 
-char* sub_get_smb_name( void )
-{
-   return smb_user_name;
-}
-
 /***
  Setup the strings used by substitutions. Called per packet. Ensure
  %U name is set correctly also.

Modified: branches/SAMBA_3_2_0/source/lib/substitute.c
===
--- branches/SAMBA_3_2_0/source/lib/substitute.c2007-09-08 09:15:08 UTC 
(rev 25024)
+++ branches/SAMBA_3_2_0/source/lib/substitute.c2007-09-08 10:30:11 UTC 
(rev 25025)
@@ -140,11 +140,6 @@
}
 }
 
-char* sub_get_smb_name( void )
-{
-   return smb_user_name;
-}
-
 /***
  Setup the strings used by substitutions. Called per packet. Ensure
  %U name is set correctly also.



svn commit: samba r25036 - in branches: SAMBA_3_2/source/param SAMBA_3_2_0/source/param

2007-09-08 Thread vlendec
Author: vlendec
Date: 2007-09-08 17:08:59 + (Sat, 08 Sep 2007)
New Revision: 25036

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

Log:
Fix a become/unbecome_root() pair
Modified:
   branches/SAMBA_3_2/source/param/loadparm.c
   branches/SAMBA_3_2_0/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_3_2/source/param/loadparm.c
===
--- branches/SAMBA_3_2/source/param/loadparm.c  2007-09-08 16:46:30 UTC (rev 
25035)
+++ branches/SAMBA_3_2/source/param/loadparm.c  2007-09-08 17:08:59 UTC (rev 
25036)
@@ -3330,6 +3330,7 @@
become_root();
reg_tdb = tdb_wrap_open(NULL, lock_path(registry.tdb), 0, 
REG_TDB_FLAGS, O_RDWR, 0600);
+   unbecome_root();
if (!reg_tdb) {
DEBUG(1, (lp_regdb_open: failed to open %s: %s\n,
 lock_path(registry.tdb), strerror(errno)));
@@ -3338,7 +3339,6 @@
else {
DEBUG(10, (lp_regdb_open: reg tdb opened.\n));
}
-   unbecome_root();
 
vers_id = tdb_fetch_int32(reg_tdb-tdb, vstring);
if (vers_id != REGVER_V1) {

Modified: branches/SAMBA_3_2_0/source/param/loadparm.c
===
--- branches/SAMBA_3_2_0/source/param/loadparm.c2007-09-08 16:46:30 UTC 
(rev 25035)
+++ branches/SAMBA_3_2_0/source/param/loadparm.c2007-09-08 17:08:59 UTC 
(rev 25036)
@@ -3338,6 +3338,7 @@
become_root();
reg_tdb = tdb_wrap_open(NULL, lock_path(registry.tdb), 0, 
REG_TDB_FLAGS, O_RDWR, 0600);
+   unbecome_root();
if (!reg_tdb) {
DEBUG(1, (lp_regdb_open: failed to open %s: %s\n,
 lock_path(registry.tdb), strerror(errno)));
@@ -3346,7 +3347,6 @@
else {
DEBUG(10, (lp_regdb_open: reg tdb opened.\n));
}
-   unbecome_root();
 
vers_id = tdb_fetch_int32(reg_tdb-tdb, vstring);
if (vers_id != REGVER_V1) {



svn commit: samba r24993 - in branches: SAMBA_3_2/source/lib SAMBA_3_2/source/rpc_parse SAMBA_3_2_0/source/lib SAMBA_3_2_0/source/rpc_parse

2007-09-07 Thread vlendec
Author: vlendec
Date: 2007-09-07 12:13:16 + (Fri, 07 Sep 2007)
New Revision: 24993

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

Log:
Apply some const

Modified:
   branches/SAMBA_3_2/source/lib/hmacmd5.c
   branches/SAMBA_3_2/source/rpc_parse/parse_prs.c
   branches/SAMBA_3_2_0/source/lib/hmacmd5.c
   branches/SAMBA_3_2_0/source/rpc_parse/parse_prs.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/hmacmd5.c
===
--- branches/SAMBA_3_2/source/lib/hmacmd5.c 2007-09-07 11:47:03 UTC (rev 
24992)
+++ branches/SAMBA_3_2/source/lib/hmacmd5.c 2007-09-07 12:13:16 UTC (rev 
24993)
@@ -121,7 +121,8 @@
  use the microsoft hmacmd5 init method because the key is 16 bytes.
 /
 
-void hmac_md5( unsigned char key[16], unsigned char *data, int data_len, 
unsigned char *digest)
+void hmac_md5( unsigned char key[16], const unsigned char *data, int data_len,
+  unsigned char *digest)
 {
HMACMD5Context ctx;
hmac_md5_init_limK_to_64(key, 16, ctx);

Modified: branches/SAMBA_3_2/source/rpc_parse/parse_prs.c
===
--- branches/SAMBA_3_2/source/rpc_parse/parse_prs.c 2007-09-07 11:47:03 UTC 
(rev 24992)
+++ branches/SAMBA_3_2/source/rpc_parse/parse_prs.c 2007-09-07 12:13:16 UTC 
(rev 24993)
@@ -1551,7 +1551,7 @@
  uchar digest_final[16]) 
 {
uchar whole_packet_digest[16];
-   static uchar zeros[4];
+   static const uchar zeros[4] = { 0, };
struct MD5Context ctx3;

/* verfiy the signature on the packet by MD5 over various bits */
@@ -1580,7 +1580,7 @@
   RPC_AUTH_SCHANNEL_CHK *verf,
   uchar sealing_key[16]) 
 {
-   static uchar zeros[4];
+   static const uchar zeros[4] = { 0, };
uchar digest2[16];
uchar sess_kf0[16];
int i;
@@ -1607,7 +1607,7 @@
 static void schannel_deal_with_seq_num(struct schannel_auth_struct *a,
 RPC_AUTH_SCHANNEL_CHK *verf)
 {
-   static uchar zeros[4];
+   static const uchar zeros[4] = { 0, };
uchar sequence_key[16];
uchar digest1[16];
 

Modified: branches/SAMBA_3_2_0/source/lib/hmacmd5.c
===
--- branches/SAMBA_3_2_0/source/lib/hmacmd5.c   2007-09-07 11:47:03 UTC (rev 
24992)
+++ branches/SAMBA_3_2_0/source/lib/hmacmd5.c   2007-09-07 12:13:16 UTC (rev 
24993)
@@ -121,7 +121,8 @@
  use the microsoft hmacmd5 init method because the key is 16 bytes.
 /
 
-void hmac_md5( unsigned char key[16], unsigned char *data, int data_len, 
unsigned char *digest)
+void hmac_md5( unsigned char key[16], const unsigned char *data, int data_len,
+  unsigned char *digest)
 {
HMACMD5Context ctx;
hmac_md5_init_limK_to_64(key, 16, ctx);

Modified: branches/SAMBA_3_2_0/source/rpc_parse/parse_prs.c
===
--- branches/SAMBA_3_2_0/source/rpc_parse/parse_prs.c   2007-09-07 11:47:03 UTC 
(rev 24992)
+++ branches/SAMBA_3_2_0/source/rpc_parse/parse_prs.c   2007-09-07 12:13:16 UTC 
(rev 24993)
@@ -1551,7 +1551,7 @@
  uchar digest_final[16]) 
 {
uchar whole_packet_digest[16];
-   static uchar zeros[4];
+   static const uchar zeros[4] = { 0, };
struct MD5Context ctx3;

/* verfiy the signature on the packet by MD5 over various bits */
@@ -1580,7 +1580,7 @@
   RPC_AUTH_SCHANNEL_CHK *verf,
   uchar sealing_key[16]) 
 {
-   static uchar zeros[4];
+   static const uchar zeros[4] = { 0, };
uchar digest2[16];
uchar sess_kf0[16];
int i;
@@ -1607,7 +1607,7 @@
 static void schannel_deal_with_seq_num(struct schannel_auth_struct *a,
 RPC_AUTH_SCHANNEL_CHK *verf)
 {
-   static uchar zeros[4];
+   static const uchar zeros[4] = { 0, };
uchar sequence_key[16];
uchar digest1[16];
 



svn commit: samba r24948 - in branches/SAMBA_3_2_0/source/script/tests: .

2007-09-04 Thread vlendec
Author: vlendec
Date: 2007-09-04 10:03:31 + (Tue, 04 Sep 2007)
New Revision: 24948

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

Log:
There is no point testing UNIXINFO -- 3.2.0 does not do it
Modified:
   branches/SAMBA_3_2_0/source/script/tests/test_posix_s3.sh


Changeset:
Modified: branches/SAMBA_3_2_0/source/script/tests/test_posix_s3.sh
===
--- branches/SAMBA_3_2_0/source/script/tests/test_posix_s3.sh   2007-09-04 
09:15:16 UTC (rev 24947)
+++ branches/SAMBA_3_2_0/source/script/tests/test_posix_s3.sh   2007-09-04 
10:03:31 UTC (rev 24948)
@@ -35,7 +35,7 @@
 raw=$raw RAW-SAMBA3CASEINSENSITIVE RAW-SAMBA3POSIXTIMEDLOCK
 
 rpc=RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-SAMBA3-SRVSVC RPC-SAMBA3-SHARESEC
-rpc=$rpc RPC-UNIXINFO RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC
+rpc=$rpc RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC
 
 # NOTE: to enable the UNIX-WHOAMI test, we need to change the default share
 # config to allow guest access. I'm not sure whether this would break other



svn commit: samba r24950 - in branches/SAMBA_3_2_0/source: include lib nsswitch passdb rpc_server smbd utils web

2007-09-04 Thread vlendec
Author: vlendec
Date: 2007-09-04 11:21:42 + (Tue, 04 Sep 2007)
New Revision: 24950

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

Log:
Merge r21784

Replace smb_register_idle_event() with event_add_timed(). This fixes winbind
which did not run the idle events to drop ldap connections.

Volker


Modified:
   branches/SAMBA_3_2_0/source/include/smbldap.h
   branches/SAMBA_3_2_0/source/lib/module.c
   branches/SAMBA_3_2_0/source/lib/smbldap.c
   branches/SAMBA_3_2_0/source/nsswitch/idmap_ldap.c
   branches/SAMBA_3_2_0/source/passdb/pdb_interface.c
   branches/SAMBA_3_2_0/source/passdb/pdb_ldap.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_samr_nt.c
   branches/SAMBA_3_2_0/source/smbd/process.c
   branches/SAMBA_3_2_0/source/smbd/server.c
   branches/SAMBA_3_2_0/source/utils/net.c
   branches/SAMBA_3_2_0/source/utils/net_sam.c
   branches/SAMBA_3_2_0/source/utils/pdbedit.c
   branches/SAMBA_3_2_0/source/utils/smbpasswd.c
   branches/SAMBA_3_2_0/source/web/swat.c


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


svn commit: samba r24951 - in branches: SAMBA_3_2/source/utils SAMBA_3_2_0/source/utils

2007-09-04 Thread vlendec
Author: vlendec
Date: 2007-09-04 13:21:24 + (Tue, 04 Sep 2007)
New Revision: 24951

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

Log:
Warn if os level  255

Thanks to Karolin Seeger [EMAIL PROTECTED]

Modified:
   branches/SAMBA_3_2/source/utils/testparm.c
   branches/SAMBA_3_2_0/source/utils/testparm.c


Changeset:
Modified: branches/SAMBA_3_2/source/utils/testparm.c
===
--- branches/SAMBA_3_2/source/utils/testparm.c  2007-09-04 11:21:42 UTC (rev 
24950)
+++ branches/SAMBA_3_2/source/utils/testparm.c  2007-09-04 13:21:24 UTC (rev 
24951)
@@ -187,6 +187,10 @@
if (!lp_passdb_backend()) {
fprintf(stderr,ERROR: passdb backend must have a value or be 
left out\n);
}
+   
+   if (lp_os_level()  255) {
+   fprintf(stderr,WARNING: Maximum value for 'os level' is 
255!\n);  
+   }
 
return ret;
 }   

Modified: branches/SAMBA_3_2_0/source/utils/testparm.c
===
--- branches/SAMBA_3_2_0/source/utils/testparm.c2007-09-04 11:21:42 UTC 
(rev 24950)
+++ branches/SAMBA_3_2_0/source/utils/testparm.c2007-09-04 13:21:24 UTC 
(rev 24951)
@@ -187,6 +187,10 @@
if (!lp_passdb_backend()) {
fprintf(stderr,ERROR: passdb backend must have a value or be 
left out\n);
}
+   
+   if (lp_os_level()  255) {
+   fprintf(stderr,WARNING: Maximum value for 'os level' is 
255!\n);  
+   }
 
return ret;
 }   



svn commit: samba r24953 - in branches/SAMBA_3_2_0/source: lib pam_smbpass

2007-09-04 Thread vlendec
Author: vlendec
Date: 2007-09-04 14:10:23 + (Tue, 04 Sep 2007)
New Revision: 24953

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

Log:
Merge r21785 and r23121:

Avoid an unnecessary gettimeofday() call

Volker

Fix Bug #2727 and let pam_smbpass at least link and dlopen correctly again.

Thanks to Bartlomiej Solarz-Niesluchowski [EMAIL PROTECTED].

Guenther



Modified:
   branches/SAMBA_3_2_0/source/lib/smbldap.c
   branches/SAMBA_3_2_0/source/pam_smbpass/pam_smb_acct.c
   branches/SAMBA_3_2_0/source/pam_smbpass/pam_smb_auth.c
   branches/SAMBA_3_2_0/source/pam_smbpass/pam_smb_passwd.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/lib/smbldap.c
===
--- branches/SAMBA_3_2_0/source/lib/smbldap.c   2007-09-04 14:06:33 UTC (rev 
24952)
+++ branches/SAMBA_3_2_0/source/lib/smbldap.c   2007-09-04 14:10:23 UTC (rev 
24953)
@@ -1574,7 +1574,7 @@
 
state-idle_event = event_add_timed(
event_ctx, NULL,
-   timeval_current_ofs(SMBLDAP_IDLE_TIME, 0),
+   timeval_add(now, SMBLDAP_IDLE_TIME, 0),
smbldap_idle_fn, smbldap_idle_fn,
private_data);
return;

Modified: branches/SAMBA_3_2_0/source/pam_smbpass/pam_smb_acct.c
===
--- branches/SAMBA_3_2_0/source/pam_smbpass/pam_smb_acct.c  2007-09-04 
14:06:33 UTC (rev 24952)
+++ branches/SAMBA_3_2_0/source/pam_smbpass/pam_smb_acct.c  2007-09-04 
14:10:23 UTC (rev 24953)
@@ -80,7 +80,7 @@
/* Getting into places that might use LDAP -- protect the app
from a SIGPIPE it's not expecting */
oldsig_handler = CatchSignal(SIGPIPE, SIGNAL_CAST SIG_IGN);
-   if (!initialize_password_db(True)) {
+   if (!initialize_password_db(True, NULL)) {
_log_err( LOG_ALERT, Cannot access samba password database );
CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
return PAM_AUTHINFO_UNAVAIL;

Modified: branches/SAMBA_3_2_0/source/pam_smbpass/pam_smb_auth.c
===
--- branches/SAMBA_3_2_0/source/pam_smbpass/pam_smb_auth.c  2007-09-04 
14:06:33 UTC (rev 24952)
+++ branches/SAMBA_3_2_0/source/pam_smbpass/pam_smb_auth.c  2007-09-04 
14:10:23 UTC (rev 24953)
@@ -108,7 +108,7 @@
_log_err( LOG_DEBUG, username [%s] obtained, name );
}
 
-   if (!initialize_password_db(True)) {
+   if (!initialize_password_db(True, NULL)) {
_log_err( LOG_ALERT, Cannot access samba password database );
retval = PAM_AUTHINFO_UNAVAIL;
AUTH_RETURN;

Modified: branches/SAMBA_3_2_0/source/pam_smbpass/pam_smb_passwd.c
===
--- branches/SAMBA_3_2_0/source/pam_smbpass/pam_smb_passwd.c2007-09-04 
14:06:33 UTC (rev 24952)
+++ branches/SAMBA_3_2_0/source/pam_smbpass/pam_smb_passwd.c2007-09-04 
14:10:23 UTC (rev 24953)
@@ -136,7 +136,7 @@
from a SIGPIPE it's not expecting */
 oldsig_handler = CatchSignal(SIGPIPE, SIGNAL_CAST SIG_IGN);
 
-if (!initialize_password_db(False)) {
+if (!initialize_password_db(False, NULL)) {
 _log_err( LOG_ALERT, Cannot access samba password database );
 CatchSignal(SIGPIPE, SIGNAL_CAST oldsig_handler);
 return PAM_AUTHINFO_UNAVAIL;



svn commit: samba r24956 - in branches/SAMBA_3_2_0/source/smbd: .

2007-09-04 Thread vlendec
Author: vlendec
Date: 2007-09-04 15:01:57 + (Tue, 04 Sep 2007)
New Revision: 24956

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

Log:
Merge r21879:

Move process_blocking_lock_queue to a timed event.

The idea is that we have blocking.c:brl_timeout as a timed
event that is present whenever we do have a blocking lock
pending. It fires brl_timeout_fn() which calls
process_blocking_lock_queue().

Whenever we make changes to blocking_lock_queue, we trigger
a recalc_brl_timeout() which sets a new brl_timout event if
necessary. This makes the call to
blocking_locks_timeout_ms() in setup_select_timeout()
unnecessary, this is implicitly done in
event_add_to_select_args() from the timed events.

Volker



Modified:
   branches/SAMBA_3_2_0/source/smbd/blocking.c
   branches/SAMBA_3_2_0/source/smbd/process.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/smbd/blocking.c
===
--- branches/SAMBA_3_2_0/source/smbd/blocking.c 2007-09-04 14:54:00 UTC (rev 
24955)
+++ branches/SAMBA_3_2_0/source/smbd/blocking.c 2007-09-04 15:01:57 UTC (rev 
24956)
@@ -49,6 +49,9 @@
 /* dlink list we move cancelled lock records onto. */
 static blocking_lock_record *blocking_lock_cancelled_queue;
 
+/* The event that makes us process our blocking lock queue */
+static struct timed_event *brl_timeout;
+
 /
  Destructor for the above structure.
 /
@@ -73,8 +76,75 @@
uint32_t msg_type,
struct server_id server_id,
DATA_BLOB *data);
+static void process_blocking_lock_queue(void);
 
+static void brl_timeout_fn(struct event_context *event_ctx,
+  struct timed_event *te,
+  const struct timeval *now,
+  void *private_data)
+{
+   SMB_ASSERT(brl_timeout == te);
+   TALLOC_FREE(brl_timeout);
+
+   change_to_root_user();  /* TODO: Possibly run all timed events as
+* root */
+
+   process_blocking_lock_queue();
+}
+
 /
+ After a change to blocking_lock_queue, recalculate the timed_event for the
+ next processing.
+/
+
+static BOOL recalc_brl_timeout(void)
+{
+   blocking_lock_record *brl;
+   struct timeval next_timeout;
+
+   TALLOC_FREE(brl_timeout);
+
+   next_timeout = timeval_zero();  
+
+   for (brl = blocking_lock_queue; brl; brl = brl-next) {
+   if (timeval_is_zero(brl-expire_time)) {
+   /*
+* If we're blocked on pid 0x this is
+* a POSIX lock, so calculate a timeout of
+* 10 seconds into the future.
+*/
+if (brl-blocking_pid == 0x) {
+   struct timeval psx_to = timeval_current_ofs(10, 
0);
+   next_timeout = timeval_min(next_timeout, 
psx_to);
+}
+
+   continue;
+   }
+
+   if (timeval_is_zero(next_timeout)) {
+   next_timeout = brl-expire_time;
+   }
+   else {
+   next_timeout = timeval_min(next_timeout,
+  brl-expire_time);
+   }
+   }
+
+   if (timeval_is_zero(next_timeout)) {
+   return True;
+   }
+
+   if (!(brl_timeout = event_add_timed(smbd_event_context(), NULL,
+   next_timeout, brl_timeout,
+   brl_timeout_fn, NULL))) {
+   return False;
+   }
+
+   return True;
+}
+
+
+/
  Function to push a blocking lock request onto the lock queue.
 /
 
@@ -156,6 +226,7 @@
}
 
DLIST_ADD_END(blocking_lock_queue, blr, blocking_lock_record *);
+   recalc_brl_timeout();
 
/* Ensure we'll receive messages when this is unlocked. */
if (!set_lock_msg) {
@@ -596,66 +667,14 @@
 }
 
 /
- Return the number of milliseconds to the next blocking locks timeout, or 
default_timeout
-*/
-
-unsigned int blocking_locks_timeout_ms(unsigned int default_timeout_ms)
-{
-   unsigned int timeout_ms

svn commit: samba r24957 - in branches/SAMBA_3_2_0/source: auth include param smbd

2007-09-04 Thread vlendec
Author: vlendec
Date: 2007-09-04 19:52:59 + (Tue, 04 Sep 2007)
New Revision: 24957

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

Log:
Merge 21867, 21869, 21870 and 21871:

Simplify calling convention of timeout_processing. lp_deadtime is only
referenced in conn_idle_all().

Move sending keepalives out of the main processing loop into idle event.
On the way, make lp_keepalive() a proper parameter.

Move sending auth_server keepalives out of the main loop into an idle event.

Move deadtime processing into an idle event. While there, simplify
conn_idle_all() a bit.


Modified:
   branches/SAMBA_3_2_0/source/auth/auth.c
   branches/SAMBA_3_2_0/source/auth/auth_server.c
   branches/SAMBA_3_2_0/source/include/auth.h
   branches/SAMBA_3_2_0/source/param/loadparm.c
   branches/SAMBA_3_2_0/source/smbd/conn.c
   branches/SAMBA_3_2_0/source/smbd/process.c
   branches/SAMBA_3_2_0/source/smbd/server.c


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


svn commit: samba r24943 - in branches: SAMBA_3_2/source/utils SAMBA_3_2_0/source/utils

2007-09-03 Thread vlendec
Author: vlendec
Date: 2007-09-04 05:39:06 + (Tue, 04 Sep 2007)
New Revision: 24943

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

Log:
Some stackframes
Modified:
   branches/SAMBA_3_2/source/utils/nmblookup.c
   branches/SAMBA_3_2/source/utils/pdbedit.c
   branches/SAMBA_3_2/source/utils/sharesec.c
   branches/SAMBA_3_2/source/utils/smbcacls.c
   branches/SAMBA_3_2/source/utils/smbcquotas.c
   branches/SAMBA_3_2/source/utils/smbfilter.c
   branches/SAMBA_3_2/source/utils/smbget.c
   branches/SAMBA_3_2/source/utils/smbpasswd.c
   branches/SAMBA_3_2/source/utils/smbtree.c
   branches/SAMBA_3_2_0/source/utils/nmblookup.c
   branches/SAMBA_3_2_0/source/utils/pdbedit.c
   branches/SAMBA_3_2_0/source/utils/sharesec.c
   branches/SAMBA_3_2_0/source/utils/smbcacls.c
   branches/SAMBA_3_2_0/source/utils/smbcquotas.c
   branches/SAMBA_3_2_0/source/utils/smbfilter.c
   branches/SAMBA_3_2_0/source/utils/smbget.c
   branches/SAMBA_3_2_0/source/utils/smbpasswd.c
   branches/SAMBA_3_2_0/source/utils/smbtree.c


Changeset:
Modified: branches/SAMBA_3_2/source/utils/nmblookup.c
===
--- branches/SAMBA_3_2/source/utils/nmblookup.c 2007-09-04 02:22:04 UTC (rev 
24942)
+++ branches/SAMBA_3_2/source/utils/nmblookup.c 2007-09-04 05:39:06 UTC (rev 
24943)
@@ -193,6 +193,7 @@
   static BOOL find_master=False;
   static BOOL lookup_by_ip = False;
   poptContext pc;
+  TALLOC_CTX *frame = talloc_stackframe();
 
   struct poptOption long_options[] = {
  POPT_AUTOHELP
@@ -292,6 +293,6 @@
   }
 
   poptFreeContext(pc);
-
+  TALLOC_FREE(frame);
   return(0);
 }

Modified: branches/SAMBA_3_2/source/utils/pdbedit.c
===
--- branches/SAMBA_3_2/source/utils/pdbedit.c   2007-09-04 02:22:04 UTC (rev 
24942)
+++ branches/SAMBA_3_2/source/utils/pdbedit.c   2007-09-04 05:39:06 UTC (rev 
24943)
@@ -758,6 +758,7 @@
static BOOL pw_from_stdin = False;
struct pdb_methods *bin, *bout, *bdef;
char *configfile = NULL;
+   TALLOC_CTX *frame = talloc_stackframe();
poptContext pc;
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -798,6 +799,7 @@
/* we shouldn't have silly checks like this */
if (getuid() != 0) {
d_fprintf(stderr, You must be root to use pdbedit\n);
+   TALLOC_FREE(frame);
return -1;
}

@@ -1050,5 +1052,6 @@
}
poptPrintHelp(pc, stderr, 0);
 
+   TALLOC_FREE(frame);
return 1;
 }

Modified: branches/SAMBA_3_2/source/utils/sharesec.c
===
--- branches/SAMBA_3_2/source/utils/sharesec.c  2007-09-04 02:22:04 UTC (rev 
24942)
+++ branches/SAMBA_3_2/source/utils/sharesec.c  2007-09-04 05:39:06 UTC (rev 
24943)
@@ -507,7 +507,7 @@
{ NULL }
};
 
-   if ( !(ctx = talloc_init(main)) ) {
+   if ( !(ctx = talloc_stackframe()) ) {
fprintf( stderr, Failed to initialize talloc context!\n);
return -1;
}

Modified: branches/SAMBA_3_2/source/utils/smbcacls.c
===
--- branches/SAMBA_3_2/source/utils/smbcacls.c  2007-09-04 02:22:04 UTC (rev 
24942)
+++ branches/SAMBA_3_2/source/utils/smbcacls.c  2007-09-04 05:39:06 UTC (rev 
24943)
@@ -824,7 +824,7 @@
 
load_case_tables();
 
-   ctx=talloc_init(main);
+   ctx=talloc_stackframe();
 
/* set default debug level to 1 regardless of what smb.conf sets */
setup_logging( smbcacls, True );

Modified: branches/SAMBA_3_2/source/utils/smbcquotas.c
===
--- branches/SAMBA_3_2/source/utils/smbcquotas.c2007-09-04 02:22:04 UTC 
(rev 24942)
+++ branches/SAMBA_3_2/source/utils/smbcquotas.c2007-09-04 05:39:06 UTC 
(rev 24943)
@@ -401,6 +401,7 @@
struct cli_state *cli;
BOOL fix_user = False;
SMB_NTQUOTA_STRUCT qt;
+   TALLOC_CTX *frame = talloc_stackframe();
poptContext pc;
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -544,6 +545,8 @@
break;
}
 
+   talloc_free(frame);
+
return result;
 }
 

Modified: branches/SAMBA_3_2/source/utils/smbfilter.c
===
--- branches/SAMBA_3_2/source/utils/smbfilter.c 2007-09-04 02:22:04 UTC (rev 
24942)
+++ branches/SAMBA_3_2/source/utils/smbfilter.c 2007-09-04 05:39:06 UTC (rev 
24943)
@@ -220,6 +220,7 @@
 {
char *desthost;
pstring configfile;
+   TALLOC_CTX *frame = talloc_stackframe();
 
setup_logging(argv[0],True);
   
@@ -240,5 +241,6 @@
}
 
start_filter(desthost);
+   TALLOC_FREE(frame);
return 0;
 }

Modified: branches

svn commit: samba r24902 - in branches: SAMBA_3_2/source/lib SAMBA_3_2_0/source/lib

2007-09-02 Thread vlendec
Author: vlendec
Date: 2007-09-02 17:48:01 + (Sun, 02 Sep 2007)
New Revision: 24902

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

Log:
DEBUG might use talloc_tos() itself...
Modified:
   branches/SAMBA_3_2/source/lib/talloc_stack.c
   branches/SAMBA_3_2_0/source/lib/talloc_stack.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/talloc_stack.c
===
--- branches/SAMBA_3_2/source/lib/talloc_stack.c2007-09-02 17:47:35 UTC 
(rev 24901)
+++ branches/SAMBA_3_2/source/lib/talloc_stack.c2007-09-02 17:48:01 UTC 
(rev 24902)
@@ -100,8 +100,8 @@
 TALLOC_CTX *talloc_tos(void)
 {
if (talloc_stacksize == 0) {
+   talloc_stackframe();
DEBUG(0, (no talloc stackframe around, leaking memory\n));
-   talloc_stackframe();
}
 
return talloc_stack[talloc_stacksize-1];

Modified: branches/SAMBA_3_2_0/source/lib/talloc_stack.c
===
--- branches/SAMBA_3_2_0/source/lib/talloc_stack.c  2007-09-02 17:47:35 UTC 
(rev 24901)
+++ branches/SAMBA_3_2_0/source/lib/talloc_stack.c  2007-09-02 17:48:01 UTC 
(rev 24902)
@@ -100,8 +100,8 @@
 TALLOC_CTX *talloc_tos(void)
 {
if (talloc_stacksize == 0) {
+   talloc_stackframe();
DEBUG(0, (no talloc stackframe around, leaking memory\n));
-   talloc_stackframe();
}
 
return talloc_stack[talloc_stacksize-1];



svn commit: samba r24903 - in branches: SAMBA_3_2/source/lib SAMBA_3_2_0/source/lib

2007-09-02 Thread vlendec
Author: vlendec
Date: 2007-09-02 17:50:05 + (Sun, 02 Sep 2007)
New Revision: 24903

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

Log:
One more tick in #if 0 code
Modified:
   branches/SAMBA_3_2/source/lib/util.c
   branches/SAMBA_3_2_0/source/lib/util.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/util.c
===
--- branches/SAMBA_3_2/source/lib/util.c2007-09-02 17:48:01 UTC (rev 
24902)
+++ branches/SAMBA_3_2/source/lib/util.c2007-09-02 17:50:05 UTC (rev 
24903)
@@ -3316,7 +3316,7 @@
 
 #if 0
 
-Disable these now we've checked all code paths and ensured
+Disable these now we have checked all code paths and ensured
 NULL returns on zero request. JRA.
 
 /

Modified: branches/SAMBA_3_2_0/source/lib/util.c
===
--- branches/SAMBA_3_2_0/source/lib/util.c  2007-09-02 17:48:01 UTC (rev 
24902)
+++ branches/SAMBA_3_2_0/source/lib/util.c  2007-09-02 17:50:05 UTC (rev 
24903)
@@ -3296,7 +3296,7 @@
 
 #if 0
 
-Disable these now we've checked all code paths and ensured
+Disable these now we have checked all code paths and ensured
 NULL returns on zero request. JRA.
 
 /



svn commit: samba r24826 - in branches: SAMBA_3_0_25/source/nsswitch SAMBA_3_2/source/nsswitch SAMBA_3_2_0/source/nsswitch

2007-08-31 Thread vlendec
Author: vlendec
Date: 2007-08-31 09:39:11 + (Fri, 31 Aug 2007)
New Revision: 24826

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

Log:
Fix two memleaks in idmap_cache.c, bug 4917

Thanks again to Patrick Rynhart for persisting :-)

Simo, please check!

Modified:
   branches/SAMBA_3_0_25/source/nsswitch/idmap_cache.c
   branches/SAMBA_3_2/source/nsswitch/idmap_cache.c
   branches/SAMBA_3_2_0/source/nsswitch/idmap_cache.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/nsswitch/idmap_cache.c
===
--- branches/SAMBA_3_0_25/source/nsswitch/idmap_cache.c 2007-08-31 09:15:57 UTC 
(rev 24825)
+++ branches/SAMBA_3_0_25/source/nsswitch/idmap_cache.c 2007-08-31 09:39:11 UTC 
(rev 24826)
@@ -399,7 +399,8 @@
 
if (databuf.dptr == NULL) {
DEBUG(10, (Cache entry with key = %s couldn't be found\n, 
sidkey));
-   return NT_STATUS_NONE_MAPPED;
+   ret = NT_STATUS_NONE_MAPPED;
+   goto done;
}
 
t = strtol(databuf.dptr, endptr, 10);
@@ -496,7 +497,8 @@
 
if (databuf.dptr == NULL) {
DEBUG(10, (Cache entry with key = %s couldn't be found\n, 
idkey));
-   return NT_STATUS_NONE_MAPPED;
+   ret = NT_STATUS_NONE_MAPPED;
+   goto done;
}
 
t = strtol(databuf.dptr, endptr, 10);

Modified: branches/SAMBA_3_2/source/nsswitch/idmap_cache.c
===
--- branches/SAMBA_3_2/source/nsswitch/idmap_cache.c2007-08-31 09:15:57 UTC 
(rev 24825)
+++ branches/SAMBA_3_2/source/nsswitch/idmap_cache.c2007-08-31 09:39:11 UTC 
(rev 24826)
@@ -344,7 +344,8 @@
 
if (databuf.dptr == NULL) {
DEBUG(10, (Cache entry with key = %s couldn't be found\n, 
sidkey));
-   return NT_STATUS_NONE_MAPPED;
+   ret = NT_STATUS_NONE_MAPPED;
+   goto done;
}
 
t = strtol((const char *)databuf.dptr, endptr, 10);
@@ -452,7 +453,8 @@
 
if (databuf.dptr == NULL) {
DEBUG(10, (Cache entry with key = %s couldn't be found\n, 
idkey));
-   return NT_STATUS_NONE_MAPPED;
+   ret = NT_STATUS_NONE_MAPPED;
+   goto done;
}
 
t = strtol((const char *)databuf.dptr, endptr, 10);

Modified: branches/SAMBA_3_2_0/source/nsswitch/idmap_cache.c
===
--- branches/SAMBA_3_2_0/source/nsswitch/idmap_cache.c  2007-08-31 09:15:57 UTC 
(rev 24825)
+++ branches/SAMBA_3_2_0/source/nsswitch/idmap_cache.c  2007-08-31 09:39:11 UTC 
(rev 24826)
@@ -344,7 +344,8 @@
 
if (databuf.dptr == NULL) {
DEBUG(10, (Cache entry with key = %s couldn't be found\n, 
sidkey));
-   return NT_STATUS_NONE_MAPPED;
+   ret = NT_STATUS_NONE_MAPPED;
+   goto done;
}
 
t = strtol((const char *)databuf.dptr, endptr, 10);
@@ -452,7 +453,8 @@
 
if (databuf.dptr == NULL) {
DEBUG(10, (Cache entry with key = %s couldn't be found\n, 
idkey));
-   return NT_STATUS_NONE_MAPPED;
+   ret = NT_STATUS_NONE_MAPPED;
+   goto done;
}
 
t = strtol((const char *)databuf.dptr, endptr, 10);



svn commit: samba r24798 - in branches/SAMBA_4_0/source: . torture/raw

2007-08-30 Thread vlendec
Author: vlendec
Date: 2007-08-30 09:51:33 + (Thu, 30 Aug 2007)
New Revision: 24798

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

Log:
RAW-SAMBA3POSIXTIMEDLOCK

This adds the torture:localdir option, smbtorture expects the share to actually
reside in this directory. This might open up more solid posix vs cifs tests.


Modified:
   branches/SAMBA_4_0/source/samba4-knownfail
   branches/SAMBA_4_0/source/torture/raw/raw.c
   branches/SAMBA_4_0/source/torture/raw/samba3misc.c


Changeset:
Modified: branches/SAMBA_4_0/source/samba4-knownfail
===
--- branches/SAMBA_4_0/source/samba4-knownfail  2007-08-30 09:15:07 UTC (rev 
24797)
+++ branches/SAMBA_4_0/source/samba4-knownfail  2007-08-30 09:51:33 UTC (rev 
24798)
@@ -13,3 +13,4 @@
 RPC-EPMAPPER.*/Insert
 RPC-EPMAPPER.*/InqObject
 RPC-DFS.*
+RAW-SAMBA3POSIXTIMEDLOCK

Modified: branches/SAMBA_4_0/source/torture/raw/raw.c
===
--- branches/SAMBA_4_0/source/torture/raw/raw.c 2007-08-30 09:15:07 UTC (rev 
24797)
+++ branches/SAMBA_4_0/source/torture/raw/raw.c 2007-08-30 09:51:33 UTC (rev 
24798)
@@ -67,6 +67,8 @@
torture_suite_add_simple_test(suite, SAMBA3BADPATH, 
torture_samba3_badpath);
torture_suite_add_simple_test(suite, SAMBA3CASEINSENSITIVE,
  torture_samba3_caseinsensitive);
+   torture_suite_add_simple_test(suite, SAMBA3POSIXTIMEDLOCK,
+ torture_samba3_posixtimedlock);
torture_suite_add_simple_test(suite, SCAN-EAMAX, torture_max_eas);
 
suite-description = talloc_strdup(suite, 

Modified: branches/SAMBA_4_0/source/torture/raw/samba3misc.c
===
--- branches/SAMBA_4_0/source/torture/raw/samba3misc.c  2007-08-30 09:15:07 UTC 
(rev 24797)
+++ branches/SAMBA_4_0/source/torture/raw/samba3misc.c  2007-08-30 09:51:33 UTC 
(rev 24798)
@@ -24,6 +24,7 @@
 #include system/filesys.h
 #include libcli/libcli.h
 #include torture/util.h
+#include lib/events/events.h
 
 #define CHECK_STATUS(status, correct) do { \
if (!NT_STATUS_EQUAL(status, correct)) { \
@@ -665,3 +666,153 @@
talloc_free(mem_ctx);
return ret;
 }
+
+/*
+ * Check that Samba3 correctly deals with conflicting posix byte range locks
+ * on an underlying file
+ */
+
+BOOL torture_samba3_posixtimedlock(struct torture_context *tctx)
+{
+   struct smbcli_state *cli;
+   NTSTATUS status;
+   BOOL ret = True;
+   const char *dirname = posixlock;
+   const char *fname = locked;
+   const char *fpath;
+   const char *localdir;
+   const char *localname;
+   int fnum = -1;
+
+   int fd = -1;
+   struct flock posix_lock;
+
+   union smb_lock io;
+   struct smb_lock_entry lock_entry;
+   struct smbcli_request *req;
+
+   if (!torture_open_connection(cli, 0)) {
+   ret = False;
+   goto done;
+   }
+
+   smbcli_deltree(cli-tree, dirname);
+
+   status = smbcli_mkdir(cli-tree, dirname);
+   if (!NT_STATUS_IS_OK(status)) {
+   torture_warning(tctx, smbcli_mkdir failed: %s\n,
+   nt_errstr(status));
+   ret = False;
+   goto done;
+   }
+
+   if (!(fpath = talloc_asprintf(tctx, %s\\%s, dirname, fname))) {
+   torture_warning(tctx, talloc failed\n);
+   ret = False;
+   goto done;
+   }
+   fnum = smbcli_open(cli-tree, fpath, O_RDWR | O_CREAT, DENY_NONE);
+   if (fnum == -1) {
+   torture_warning(tctx, Could not create file %s: %s\n, fpath,
+   smbcli_errstr(cli-tree));
+   ret = False;
+   goto done;
+   }
+
+   if (!(localdir = torture_setting_string(tctx, localdir, NULL))) {
+   torture_warning(tctx, Need 'localdir' setting\n);
+   ret = False;
+   goto done;
+   }
+
+   if (!(localname = talloc_asprintf(tctx, %s/%s/%s, localdir, dirname,
+ fname))) {
+   torture_warning(tctx, talloc failed\n);
+   ret = False;
+   goto done;
+   }
+
+   /*
+* Lock a byte range from posix
+*/
+
+   fd = open(localname, O_RDWR);
+   if (fd == -1) {
+   torture_warning(tctx, open(%s) failed: %s\n,
+   localname, strerror(errno));
+   goto done;
+   }
+
+   posix_lock.l_type = F_WRLCK;
+   posix_lock.l_whence = SEEK_SET;
+   posix_lock.l_start = 0;
+   posix_lock.l_len = 1;
+
+   if (fcntl(fd, F_SETLK, posix_lock) == -1) {
+   torture_warning(tctx, fcntl failed: %s\n, strerror(errno));
+   ret = False;
+   goto done

svn commit: samba r24800 - in branches/SAMBA_4_0/source: .

2007-08-30 Thread vlendec
Author: vlendec
Date: 2007-08-30 10:32:22 + (Thu, 30 Aug 2007)
New Revision: 24800

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

Log:
Don't execute RAW-SAMBA3POSIXTIMEDLOCK

Thanks jelmer, I was not aware of the difference between knownfail and
skip

Modified:
   branches/SAMBA_4_0/source/samba4-knownfail
   branches/SAMBA_4_0/source/samba4-skip


Changeset:
Modified: branches/SAMBA_4_0/source/samba4-knownfail
===
--- branches/SAMBA_4_0/source/samba4-knownfail  2007-08-30 09:52:21 UTC (rev 
24799)
+++ branches/SAMBA_4_0/source/samba4-knownfail  2007-08-30 10:32:22 UTC (rev 
24800)
@@ -13,4 +13,3 @@
 RPC-EPMAPPER.*/Insert
 RPC-EPMAPPER.*/InqObject
 RPC-DFS.*
-RAW-SAMBA3POSIXTIMEDLOCK

Modified: branches/SAMBA_4_0/source/samba4-skip
===
--- branches/SAMBA_4_0/source/samba4-skip   2007-08-30 09:52:21 UTC (rev 
24799)
+++ branches/SAMBA_4_0/source/samba4-skip   2007-08-30 10:32:22 UTC (rev 
24800)
@@ -47,3 +47,4 @@
 RPC-DSSYNC
 RPC-SAMSYNC
 LDAP-UPTODATEVECTOR
+RAW-SAMBA3POSIXTIMEDLOCK



svn commit: samba r24802 - in branches: SAMBA_3_2/source/script/tests SAMBA_3_2_0/source/script/tests

2007-08-30 Thread vlendec
Author: vlendec
Date: 2007-08-30 14:16:20 + (Thu, 30 Aug 2007)
New Revision: 24802

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

Log:
Activate new tests

RAW-SAMBA3CASEINSENSITIVE and RAW-SAMBA3POSIXTIMEDLOCK

Modified:
   branches/SAMBA_3_2/source/script/tests/selftest.sh
   branches/SAMBA_3_2/source/script/tests/test_posix_s3.sh
   branches/SAMBA_3_2_0/source/script/tests/selftest.sh
   branches/SAMBA_3_2_0/source/script/tests/test_posix_s3.sh


Changeset:
Modified: branches/SAMBA_3_2/source/script/tests/selftest.sh
===
--- branches/SAMBA_3_2/source/script/tests/selftest.sh  2007-08-30 11:26:17 UTC 
(rev 24801)
+++ branches/SAMBA_3_2/source/script/tests/selftest.sh  2007-08-30 14:16:20 UTC 
(rev 24802)
@@ -200,6 +200,7 @@
 TORTURE4_OPTIONS=$SAMBA4CONFIGURATION
 TORTURE4_OPTIONS=$TORTURE4_OPTIONS --maximum-runtime=$TORTURE_MAXTIME
 TORTURE4_OPTIONS=$TORTURE4_OPTIONS --target=samba3
+TORTURE4_OPTIONS=$TORTURE4_OPTIONS --option=torture:localdir=$PREFIX_ABS/tmp
 export TORTURE4_OPTIONS
 
 if [ x$RUN_FROM_BUILD_FARM = xyes ];then

Modified: branches/SAMBA_3_2/source/script/tests/test_posix_s3.sh
===
--- branches/SAMBA_3_2/source/script/tests/test_posix_s3.sh 2007-08-30 
11:26:17 UTC (rev 24801)
+++ branches/SAMBA_3_2/source/script/tests/test_posix_s3.sh 2007-08-30 
14:16:20 UTC (rev 24802)
@@ -32,6 +32,7 @@
 raw=$raw RAW-QFILEINFO RAW-QFSINFO RAW-READ RAW-RENAME RAW-SEARCH RAW-SEEK
 raw=$raw RAW-SFILEINFO RAW-SFILEINFO-BUG RAW-STREAMS RAW-UNLINK RAW-WRITE
 raw=$raw RAW-SAMBA3HIDE RAW-SAMBA3BADPATH RAW-SFILEINFO-RENAME
+raw=$raw RAW-SAMBA3CASEINSENSITIVE RAW-SAMBA3POSIXTIMEDLOCK
 
 rpc=RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-SAMBA3-SRVSVC RPC-SAMBA3-SHARESEC
 rpc=$rpc RPC-UNIXINFO RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC

Modified: branches/SAMBA_3_2_0/source/script/tests/selftest.sh
===
--- branches/SAMBA_3_2_0/source/script/tests/selftest.sh2007-08-30 
11:26:17 UTC (rev 24801)
+++ branches/SAMBA_3_2_0/source/script/tests/selftest.sh2007-08-30 
14:16:20 UTC (rev 24802)
@@ -200,6 +200,7 @@
 TORTURE4_OPTIONS=$SAMBA4CONFIGURATION
 TORTURE4_OPTIONS=$TORTURE4_OPTIONS --maximum-runtime=$TORTURE_MAXTIME
 TORTURE4_OPTIONS=$TORTURE4_OPTIONS --target=samba3
+TORTURE4_OPTIONS=$TORTURE4_OPTIONS --option=torture:localdir=$PREFIX_ABS/tmp
 export TORTURE4_OPTIONS
 
 if [ x$RUN_FROM_BUILD_FARM = xyes ];then

Modified: branches/SAMBA_3_2_0/source/script/tests/test_posix_s3.sh
===
--- branches/SAMBA_3_2_0/source/script/tests/test_posix_s3.sh   2007-08-30 
11:26:17 UTC (rev 24801)
+++ branches/SAMBA_3_2_0/source/script/tests/test_posix_s3.sh   2007-08-30 
14:16:20 UTC (rev 24802)
@@ -32,6 +32,7 @@
 raw=$raw RAW-QFILEINFO RAW-QFSINFO RAW-READ RAW-RENAME RAW-SEARCH RAW-SEEK
 raw=$raw RAW-SFILEINFO RAW-SFILEINFO-BUG RAW-STREAMS RAW-UNLINK RAW-WRITE
 raw=$raw RAW-SAMBA3HIDE RAW-SAMBA3BADPATH RAW-SFILEINFO-RENAME
+raw=$raw RAW-SAMBA3CASEINSENSITIVE RAW-SAMBA3POSIXTIMEDLOCK
 
 rpc=RPC-AUTHCONTEXT RPC-BINDSAMBA3 RPC-SAMBA3-SRVSVC RPC-SAMBA3-SHARESEC
 rpc=$rpc RPC-UNIXINFO RPC-SAMBA3-SPOOLSS RPC-SAMBA3-WKSSVC



svn commit: samba r24803 - in branches: SAMBA_3_2/source/include SAMBA_3_2_0/source/include

2007-08-30 Thread vlendec
Author: vlendec
Date: 2007-08-30 14:55:32 + (Thu, 30 Aug 2007)
New Revision: 24803

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

Log:
For some funny reason us4/gcc seems to fall over the '

Modified:
   branches/SAMBA_3_2/source/include/smb_macros.h
   branches/SAMBA_3_2_0/source/include/smb_macros.h


Changeset:
Modified: branches/SAMBA_3_2/source/include/smb_macros.h
===
--- branches/SAMBA_3_2/source/include/smb_macros.h  2007-08-30 14:16:20 UTC 
(rev 24802)
+++ branches/SAMBA_3_2/source/include/smb_macros.h  2007-08-30 14:55:32 UTC 
(rev 24803)
@@ -277,7 +277,7 @@
 
 #if 0
 
-Disable these now we've checked all code paths and ensured
+Disable these now we have checked all code paths and ensured
 NULL returns on zero request. JRA.
 
 #define TALLOC(ctx, size) talloc_zeronull(ctx, size, __location__)

Modified: branches/SAMBA_3_2_0/source/include/smb_macros.h
===
--- branches/SAMBA_3_2_0/source/include/smb_macros.h2007-08-30 14:16:20 UTC 
(rev 24802)
+++ branches/SAMBA_3_2_0/source/include/smb_macros.h2007-08-30 14:55:32 UTC 
(rev 24803)
@@ -278,7 +278,7 @@
 
 #if 0
 
-Disable these now we've checked all code paths and ensured
+Disable these now we have checked all code paths and ensured
 NULL returns on zero request. JRA.
 
 #define TALLOC(ctx, size) talloc_zeronull(ctx, size, __location__)



svn commit: samba r24773 - in branches: SAMBA_3_2/source/lib SAMBA_3_2_0/source/lib

2007-08-29 Thread vlendec
Author: vlendec
Date: 2007-08-29 11:46:44 + (Wed, 29 Aug 2007)
New Revision: 24773

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

Log:
Fix a ctdb connection lockup

The lockup could happen when packet_read_sync() gets two packets in a row, the
first one being an async message, and the second one being the response to a
ctdb request.

Also add some debug msg to ctdb_conn.c, and cut off the locking key messages
to only dump 20 hex chars at debug level 10. 10 will dump everything.
Modified:
   branches/SAMBA_3_2/source/lib/ctdbd_conn.c
   branches/SAMBA_3_2/source/lib/dbwrap_ctdb.c
   branches/SAMBA_3_2/source/lib/dbwrap_tdb.c
   branches/SAMBA_3_2_0/source/lib/ctdbd_conn.c
   branches/SAMBA_3_2_0/source/lib/dbwrap_ctdb.c
   branches/SAMBA_3_2_0/source/lib/dbwrap_tdb.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/ctdbd_conn.c
===
--- branches/SAMBA_3_2/source/lib/ctdbd_conn.c  2007-08-29 11:04:49 UTC (rev 
24772)
+++ branches/SAMBA_3_2/source/lib/ctdbd_conn.c  2007-08-29 11:46:44 UTC (rev 
24773)
@@ -61,6 +61,20 @@
 }
 
 /*
+ *
+ */
+static void ctdb_packet_dump(struct ctdb_req_header *hdr)
+{
+   if (DEBUGLEVEL  10) {
+   return;
+   }
+   DEBUGADD(10, (len=%d, magic=%x, vers=%d, gen=%d, op=%d, reqid=%d\n,
+ (int)hdr-length, (int)hdr-ctdb_magic,
+ (int)hdr-ctdb_version, (int)hdr-generation,
+ (int)hdr-operation, (int)hdr-reqid));
+}
+
+/*
  * Register a srvid with ctdbd
  */
 static NTSTATUS register_with_ctdbd(struct ctdbd_connection *conn,
@@ -249,6 +263,11 @@
blob, result, result,
(ndr_pull_flags_fn_t)ndr_pull_messaging_rec);
 
+   if (DEBUGLEVEL = 10) {
+   DEBUG(10, (ctdb_pull_messaging_rec:\n));
+   NDR_PRINT_DEBUG(messaging_rec, result);
+   }
+
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, (ndr_pull_struct_blob failed: %s\n,
  nt_errstr(status)));
@@ -288,6 +307,8 @@
cluster_fatal(ctdbd died\n);
}
 
+ next_pkt:
+
ZERO_STRUCT(state);
state.mem_ctx = mem_ctx;
 
@@ -296,6 +317,7 @@
/*
 * Not enough data
 */
+   DEBUG(10, (not enough data from ctdb socket, retrying\n));
goto again;
}
 
@@ -306,6 +328,9 @@
 
hdr = (struct ctdb_req_header *)state.req.data;
 
+   DEBUG(10, (Received ctdb packet\n));
+   ctdb_packet_dump(hdr);
+
if (hdr-operation == CTDB_REQ_MESSAGE) {
struct timed_event *evt;
struct deferred_msg_state *msg_state;
@@ -315,7 +340,7 @@
DEBUG(1, (Got a message without having a msg ctx, 
  dropping msg %llu\n,
  (long long unsigned)msg-srvid));
-   goto again;
+   goto next_pkt;
}

if ((conn-release_ip_handler != NULL)
@@ -325,13 +350,13 @@
conn-release_ip_handler((const char *)msg-data,
 conn-release_ip_priv);
TALLOC_FREE(hdr);
-   goto again;
+   goto next_pkt;
}
 
if (!(msg_state = TALLOC_P(NULL, struct deferred_msg_state))) {
DEBUG(0, (talloc failed\n));
TALLOC_FREE(hdr);
-   goto again;
+   goto next_pkt;
}
 
if (!(msg_state-rec = ctdb_pull_messaging_rec(
@@ -339,7 +364,7 @@
DEBUG(0, (ctdbd_pull_messaging_rec failed\n));
TALLOC_FREE(msg_state);
TALLOC_FREE(hdr);
-   goto again;
+   goto next_pkt;
}
 
TALLOC_FREE(hdr);
@@ -360,10 +385,10 @@
DEBUG(0, (event_add_timed failed\n));
TALLOC_FREE(msg_state);
TALLOC_FREE(hdr);
-   goto again;
+   goto next_pkt;
}

-   goto again;
+   goto next_pkt;
}
 
if (hdr-reqid != reqid) {
@@ -622,6 +647,9 @@
r.srvid  = dst_srvid;
r.datalen= blob.length;
 
+   DEBUG(10, (ctdbd_messaging_send: Sending ctdb packet\n));
+   ctdb_packet_dump(r.hdr);
+
status = packet_send(
conn-pkt, 2,
data_blob_const(r, offsetof(struct ctdb_req_message, data)),
@@ -682,6 +710,9 @@
req.srvid= srvid;
req.datalen  = data.dsize;
 
+   DEBUG(10, (ctdbd_control: Sending ctdb packet\n));
+   ctdb_packet_dump

svn commit: samba r24782 - in branches: SAMBA_3_2/source/libsmb SAMBA_3_2_0/source/libsmb

2007-08-29 Thread vlendec
Author: vlendec
Date: 2007-08-29 13:56:52 + (Wed, 29 Aug 2007)
New Revision: 24782

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

Log:
Fix C++ warnings
Modified:
   branches/SAMBA_3_2/source/libsmb/dsgetdcname.c
   branches/SAMBA_3_2_0/source/libsmb/dsgetdcname.c


Changeset:
Modified: branches/SAMBA_3_2/source/libsmb/dsgetdcname.c
===
--- branches/SAMBA_3_2/source/libsmb/dsgetdcname.c  2007-08-29 13:52:07 UTC 
(rev 24781)
+++ branches/SAMBA_3_2/source/libsmb/dsgetdcname.c  2007-08-29 13:56:52 UTC 
(rev 24782)
@@ -235,7 +235,8 @@
memcpy(guid_flat.info, guid_buf, guid_len);
smb_uuid_unpack(guid_flat, guid);
 
-   info-domain_guid = talloc_memdup(mem_ctx, guid, sizeof(guid));
+   info-domain_guid = (struct GUID *)talloc_memdup(
+   mem_ctx, guid, sizeof(guid));
if (!info-domain_guid) {
goto failed;
}
@@ -694,8 +695,8 @@
info-domain_controller_address_type = domain_controller_address_type;
 
if (domain_guid) {
-   info-domain_guid = talloc_memdup(mem_ctx, domain_guid,
- sizeof(*domain_guid));
+   info-domain_guid = (struct GUID *)talloc_memdup(
+   mem_ctx, domain_guid, sizeof(*domain_guid));
NT_STATUS_HAVE_NO_MEMORY(info-domain_guid);
}
 

Modified: branches/SAMBA_3_2_0/source/libsmb/dsgetdcname.c
===
--- branches/SAMBA_3_2_0/source/libsmb/dsgetdcname.c2007-08-29 13:52:07 UTC 
(rev 24781)
+++ branches/SAMBA_3_2_0/source/libsmb/dsgetdcname.c2007-08-29 13:56:52 UTC 
(rev 24782)
@@ -235,7 +235,8 @@
memcpy(guid_flat.info, guid_buf, guid_len);
smb_uuid_unpack(guid_flat, guid);
 
-   info-domain_guid = talloc_memdup(mem_ctx, guid, sizeof(guid));
+   info-domain_guid = (struct GUID *)talloc_memdup(
+   mem_ctx, guid, sizeof(guid));
if (!info-domain_guid) {
goto failed;
}
@@ -694,8 +695,8 @@
info-domain_controller_address_type = domain_controller_address_type;
 
if (domain_guid) {
-   info-domain_guid = talloc_memdup(mem_ctx, domain_guid,
- sizeof(*domain_guid));
+   info-domain_guid = (struct GUID *)talloc_memdup(
+   mem_ctx, domain_guid, sizeof(*domain_guid));
NT_STATUS_HAVE_NO_MEMORY(info-domain_guid);
}
 



svn commit: samba r24744 - in branches: SAMBA_3_2/source/lib SAMBA_3_2_0/source/lib

2007-08-28 Thread vlendec
Author: vlendec
Date: 2007-08-28 15:09:47 + (Tue, 28 Aug 2007)
New Revision: 24744

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

Log:
Increase length by what we got from recv, not from ioctl

Modified:
   branches/SAMBA_3_2/source/lib/packet.c
   branches/SAMBA_3_2_0/source/lib/packet.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/packet.c
===
--- branches/SAMBA_3_2/source/lib/packet.c  2007-08-28 15:07:13 UTC (rev 
24743)
+++ branches/SAMBA_3_2/source/lib/packet.c  2007-08-28 15:09:47 UTC (rev 
24744)
@@ -83,6 +83,8 @@
return NT_STATUS_NO_MEMORY;
}
 
+   ctx-in.data = in;
+
res = recv(ctx-fd, in + ctx-in.length, available, 0);
 
if (res  0) {
@@ -94,8 +96,7 @@
return NT_STATUS_END_OF_FILE;
}
 
-   ctx-in.data = in;
-   ctx-in.length += available;
+   ctx-in.length += res;
 
return NT_STATUS_OK;
 }

Modified: branches/SAMBA_3_2_0/source/lib/packet.c
===
--- branches/SAMBA_3_2_0/source/lib/packet.c2007-08-28 15:07:13 UTC (rev 
24743)
+++ branches/SAMBA_3_2_0/source/lib/packet.c2007-08-28 15:09:47 UTC (rev 
24744)
@@ -83,6 +83,8 @@
return NT_STATUS_NO_MEMORY;
}
 
+   ctx-in.data = in;
+
res = recv(ctx-fd, in + ctx-in.length, available, 0);
 
if (res  0) {
@@ -94,8 +96,7 @@
return NT_STATUS_END_OF_FILE;
}
 
-   ctx-in.data = in;
-   ctx-in.length += available;
+   ctx-in.length += res;
 
return NT_STATUS_OK;
 }



svn commit: samba r24702 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

2007-08-27 Thread vlendec
Author: vlendec
Date: 2007-08-27 12:04:09 + (Mon, 27 Aug 2007)
New Revision: 24702

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

Log:
Remove the old API pointers

Modified:
   branches/SAMBA_3_2/source/smbd/blocking.c
   branches/SAMBA_3_2/source/smbd/nttrans.c
   branches/SAMBA_3_2/source/smbd/open.c
   branches/SAMBA_3_2/source/smbd/pipes.c
   branches/SAMBA_3_2/source/smbd/process.c
   branches/SAMBA_3_2/source/smbd/reply.c
   branches/SAMBA_3_2/source/smbd/server.c
   branches/SAMBA_3_2/source/smbd/sesssetup.c
   branches/SAMBA_3_2_0/source/smbd/blocking.c
   branches/SAMBA_3_2_0/source/smbd/nttrans.c
   branches/SAMBA_3_2_0/source/smbd/open.c
   branches/SAMBA_3_2_0/source/smbd/pipes.c
   branches/SAMBA_3_2_0/source/smbd/process.c
   branches/SAMBA_3_2_0/source/smbd/reply.c
   branches/SAMBA_3_2_0/source/smbd/server.c
   branches/SAMBA_3_2_0/source/smbd/sesssetup.c


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


svn commit: samba r24661 - in branches/SAMBA_3_2/source/smbd: .

2007-08-26 Thread vlendec
Author: vlendec
Date: 2007-08-26 10:50:39 + (Sun, 26 Aug 2007)
New Revision: 24661

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

Log:
Fix some obvious diffs between 3_2 and 3_2_0

Jeremy, there are two remaining diffs in sesssetup.c which I don't really
know which one is right. Can you take a look?

Thanks,

Volker

Modified:
   branches/SAMBA_3_2/source/smbd/sesssetup.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/sesssetup.c
===
--- branches/SAMBA_3_2/source/smbd/sesssetup.c  2007-08-25 20:10:15 UTC (rev 
24660)
+++ branches/SAMBA_3_2/source/smbd/sesssetup.c  2007-08-26 10:50:39 UTC (rev 
24661)
@@ -259,7 +259,7 @@
fstring netbios_domain_name;
struct passwd *pw;
fstring user;
-   int sess_vuid = SVAL(req-inbuf, smb_uid);
+   int sess_vuid = req-vuid;
NTSTATUS ret = NT_STATUS_OK;
PAC_DATA *pac_data;
DATA_BLOB ap_rep, ap_rep_wrapped, response;
@@ -680,7 +680,8 @@
SSVAL(req-outbuf,smb_vwv2,1);
}
 
-   sessionsetup_start_signing_engine(server_info, req-inbuf);
+   sessionsetup_start_signing_engine(server_info,
+ (uint8 *)req-inbuf);
}
 
   out:
@@ -1720,9 +1721,10 @@
data_blob_free(nt_resp);
data_blob_free(lm_resp);
data_blob_free(session_key);
-   END_PROFILE(SMBsesssetupX);
reply_nterror(req, nt_status_squash(
  NT_STATUS_LOGON_FAILURE));
+   END_PROFILE(SMBsesssetupX);
+   return;
}
/* register_existing_vuid keeps the server info */
sess_vuid = register_existing_vuid(sess_vuid,



svn commit: samba r24656 - in branches/SAMBA_3_2_0/source/smbd: .

2007-08-25 Thread vlendec
Author: vlendec
Date: 2007-08-25 15:28:53 + (Sat, 25 Aug 2007)
New Revision: 24656

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

Log:
Janitor for metze:

try to fix the build on irix...

metze


Modified:
   branches/SAMBA_3_2_0/source/smbd/oplock_irix.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/smbd/oplock_irix.c
===
--- branches/SAMBA_3_2_0/source/smbd/oplock_irix.c  2007-08-24 22:58:29 UTC 
(rev 24655)
+++ branches/SAMBA_3_2_0/source/smbd/oplock_irix.c  2007-08-25 15:28:53 UTC 
(rev 24656)
@@ -96,6 +96,7 @@
extern int smb_read_error;
oplock_stat_t os;
char dummy;
+   struct file_id fileid;
files_struct *fsp;
 
/* Ensure we only get one call per select fd set. */
@@ -137,11 +138,14 @@
/*
 * We only have device and inode info here - we have to guess that this
 * is the first fsp open with this dev,ino pair.
+*
+* NOTE: this doesn't work if any VFS modules overloads
+*   the file_id_create() hook!
 */
 
-   if ((fsp = file_find_di_first(
-file_id_create((SMB_DEV_T)os.os_dev,
-   (SMB_INO_T)os.os_ino))) == NULL) {
+   fileid = file_id_create_dev((SMB_DEV_T)os.os_dev,
+   (SMB_INO_T)os.os_ino);
+   if ((fsp = file_find_di_first(fileid)) == NULL) {
DEBUG(0,(irix_oplock_receive_message: unable to find open 
 file with dev = %x, inode = %.0f\n,
 (unsigned int)os.os_dev, (double)os.os_ino ));



svn commit: samba r24659 - in branches/SAMBA_3_2/source/smbd: .

2007-08-25 Thread vlendec
Author: vlendec
Date: 2007-08-25 19:47:57 + (Sat, 25 Aug 2007)
New Revision: 24659

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

Log:
Some formatting changes helping to minimize the 3_2_0 diff
Modified:
   branches/SAMBA_3_2/source/smbd/negprot.c
   branches/SAMBA_3_2/source/smbd/nttrans.c
   branches/SAMBA_3_2/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/negprot.c
===
--- branches/SAMBA_3_2/source/smbd/negprot.c2007-08-25 16:48:35 UTC (rev 
24658)
+++ branches/SAMBA_3_2/source/smbd/negprot.c2007-08-25 19:47:57 UTC (rev 
24659)
@@ -229,10 +229,9 @@
char *host_princ_s = NULL;
name_to_fqdn(myname, global_myname());
strlower_m(myname);
-   asprintf(host_princ_s, cifs/[EMAIL PROTECTED], myname, 
lp_realm());
-   if (host_princ_s == NULL) {
-   blob = data_blob_null;
-   return blob;
+   if (asprintf(host_princ_s, cifs/[EMAIL PROTECTED], myname, 
lp_realm())
+   == -1) {
+   return data_blob_null;
}
blob = spnego_gen_negTokenInit(guid, OIDs_krb5, host_princ_s);
SAFE_FREE(host_princ_s);
@@ -540,7 +539,7 @@
num_cliprotos = 0;
cliprotos = NULL;
 
-   while (p  (smb_buf(req-inbuf) + bcc)) { 
+   while (p  (smb_buf(req-inbuf) + bcc)) {
 
char **tmp;
 

Modified: branches/SAMBA_3_2/source/smbd/nttrans.c
===
--- branches/SAMBA_3_2/source/smbd/nttrans.c2007-08-25 16:48:35 UTC (rev 
24658)
+++ branches/SAMBA_3_2/source/smbd/nttrans.c2007-08-25 19:47:57 UTC (rev 
24659)
@@ -859,19 +859,19 @@
create_options,
file_attributes,
info, fsp);
-
}
}
 
TALLOC_FREE(case_state);
 
-if (!NT_STATUS_IS_OK(status)) {
-   END_PROFILE(SMBntcreateX);
+   if (!NT_STATUS_IS_OK(status)) {
if (open_was_deferred(req-mid)) {
/* We have re-scheduled this call. */
+   END_PROFILE(SMBntcreateX);
return;
}
reply_openerror(req, status);
+   END_PROFILE(SMBntcreateX);
return;
}
 

Modified: branches/SAMBA_3_2/source/smbd/reply.c
===
--- branches/SAMBA_3_2/source/smbd/reply.c  2007-08-25 16:48:35 UTC (rev 
24658)
+++ branches/SAMBA_3_2/source/smbd/reply.c  2007-08-25 19:47:57 UTC (rev 
24659)
@@ -486,7 +486,7 @@
SSVAL(req-outbuf,smb_vwv1,conn-cnum);
SSVAL(req-outbuf,smb_tid,conn-cnum);
 
-   DEBUG(3,(tcon service=%s cnum=%d\n, 
+   DEBUG(3,(tcon service=%s cnum=%d\n,
 service, conn-cnum));
 
END_PROFILE(SMBtcon);
@@ -1550,12 +1550,13 @@
info, fsp);
 
if (!NT_STATUS_IS_OK(status)) {
-   END_PROFILE(SMBopen);
if (open_was_deferred(req-mid)) {
+   END_PROFILE(SMBopen);
/* We have re-scheduled this call. */
return;
}
reply_openerror(req, status);
+   END_PROFILE(SMBopen);
return;
}
 
@@ -1876,7 +1877,7 @@
 
srvstr_get_path((char *)req-inbuf, req-flags2, fname,
 smb_buf(req-inbuf) + 1, sizeof(fname), 0,
-   STR_TERMINATE, status);
+   STR_TERMINATE, status);
if (!NT_STATUS_IS_OK(status)) {
reply_nterror(req, status);
END_PROFILE(SMBcreate);
@@ -1947,7 +1948,6 @@
file_ntimes(conn, fname, ts);
 
reply_outbuf(req, 1, 0);
-
SSVAL(req-outbuf,smb_vwv0,fsp-fnum);
 
if (oplock_request  lp_fake_oplocks(SNUM(conn))) {
@@ -2059,12 +2059,13 @@
close(tmpfd);
 
if (!NT_STATUS_IS_OK(status)) {
-   END_PROFILE(SMBctemp);
if (open_was_deferred(req-mid)) {
/* We have re-scheduled this call. */
+   END_PROFILE(SMBctemp);
return;
}
reply_openerror(req, status);
+   END_PROFILE(SMBctemp);
return;
}
 
@@ -2668,7 +2669,7 @@
 
fsp = file_fsp(SVAL(req-inbuf,smb_vwv0));
 
-   /* 
+   /*
 * We have to do a check_fsp by hand here, as
 * we must always return 4 zero bytes on error,
 * not a NTSTATUS.
@@ -2760,7 +2761,7 @@
if (startpos = size) {
nread = 0;
} else {
-   nread

svn commit: samba r24660 - in branches/SAMBA_3_2_0/source: client include lib libsmb param printing rpc_server smbd

2007-08-25 Thread vlendec
Author: vlendec
Date: 2007-08-25 20:10:15 + (Sat, 25 Aug 2007)
New Revision: 24660

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

Log:
Merge the inbuf/outbuf changes
Modified:
   branches/SAMBA_3_2_0/source/client/client.c
   branches/SAMBA_3_2_0/source/include/safe_string.h
   branches/SAMBA_3_2_0/source/include/smb.h
   branches/SAMBA_3_2_0/source/include/smb_macros.h
   branches/SAMBA_3_2_0/source/lib/charcnv.c
   branches/SAMBA_3_2_0/source/lib/util.c
   branches/SAMBA_3_2_0/source/lib/util_sock.c
   branches/SAMBA_3_2_0/source/libsmb/clientgen.c
   branches/SAMBA_3_2_0/source/libsmb/clistr.c
   branches/SAMBA_3_2_0/source/param/loadparm.c
   branches/SAMBA_3_2_0/source/printing/printfsp.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_pipe_hnd.c
   branches/SAMBA_3_2_0/source/smbd/aio.c
   branches/SAMBA_3_2_0/source/smbd/blocking.c
   branches/SAMBA_3_2_0/source/smbd/close.c
   branches/SAMBA_3_2_0/source/smbd/connection.c
   branches/SAMBA_3_2_0/source/smbd/error.c
   branches/SAMBA_3_2_0/source/smbd/files.c
   branches/SAMBA_3_2_0/source/smbd/ipc.c
   branches/SAMBA_3_2_0/source/smbd/lanman.c
   branches/SAMBA_3_2_0/source/smbd/message.c
   branches/SAMBA_3_2_0/source/smbd/negprot.c
   branches/SAMBA_3_2_0/source/smbd/notify.c
   branches/SAMBA_3_2_0/source/smbd/nttrans.c
   branches/SAMBA_3_2_0/source/smbd/pipes.c
   branches/SAMBA_3_2_0/source/smbd/process.c
   branches/SAMBA_3_2_0/source/smbd/reply.c
   branches/SAMBA_3_2_0/source/smbd/sesssetup.c
   branches/SAMBA_3_2_0/source/smbd/srvstr.c
   branches/SAMBA_3_2_0/source/smbd/trans2.c


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


svn commit: samba r24649 - in branches: SAMBA_3_0_25/source/nsswitch SAMBA_3_2/source/nsswitch SAMBA_3_2_0/source/nsswitch

2007-08-24 Thread vlendec
Author: vlendec
Date: 2007-08-24 11:25:38 + (Fri, 24 Aug 2007)
New Revision: 24649

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

Log:
Attempt to fix bug 4917. Simo, please check!

Thanks Patrick Rynhart for reporting this.

Modified:
   branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c
   branches/SAMBA_3_2/source/nsswitch/idmap_ldap.c
   branches/SAMBA_3_2_0/source/nsswitch/idmap_ldap.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c
===
--- branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c  2007-08-24 06:29:20 UTC 
(rev 24648)
+++ branches/SAMBA_3_0_25/source/nsswitch/idmap_ldap.c  2007-08-24 11:25:38 UTC 
(rev 24649)
@@ -894,7 +894,7 @@
uidNumber = get_attr_key2string(idpool_attr_list, LDAP_ATTR_UIDNUMBER);
gidNumber = get_attr_key2string(idpool_attr_list, LDAP_ATTR_GIDNUMBER);
 
-   attr_list = get_attr_list(ctx, sidmap_attr_list);
+   attr_list = get_attr_list(memctx, sidmap_attr_list);
 
if ( ! ids[1]) {
/* if we are requested just one mapping use the simple filter */
@@ -,7 +,7 @@
uidNumber = get_attr_key2string(idpool_attr_list, LDAP_ATTR_UIDNUMBER);
gidNumber = get_attr_key2string(idpool_attr_list, LDAP_ATTR_GIDNUMBER);
 
-   attr_list = get_attr_list(ctx, sidmap_attr_list);
+   attr_list = get_attr_list(memctx, sidmap_attr_list);
 
if ( ! ids[1]) {
/* if we are requested just one mapping use the simple filter */

Modified: branches/SAMBA_3_2/source/nsswitch/idmap_ldap.c
===
--- branches/SAMBA_3_2/source/nsswitch/idmap_ldap.c 2007-08-24 06:29:20 UTC 
(rev 24648)
+++ branches/SAMBA_3_2/source/nsswitch/idmap_ldap.c 2007-08-24 11:25:38 UTC 
(rev 24649)
@@ -896,7 +896,7 @@
uidNumber = get_attr_key2string(idpool_attr_list, LDAP_ATTR_UIDNUMBER);
gidNumber = get_attr_key2string(idpool_attr_list, LDAP_ATTR_GIDNUMBER);
 
-   attr_list = get_attr_list(ctx, sidmap_attr_list);
+   attr_list = get_attr_list(memctx, sidmap_attr_list);
 
if ( ! ids[1]) {
/* if we are requested just one mapping use the simple filter */
@@ -1113,7 +1113,7 @@
uidNumber = get_attr_key2string(idpool_attr_list, LDAP_ATTR_UIDNUMBER);
gidNumber = get_attr_key2string(idpool_attr_list, LDAP_ATTR_GIDNUMBER);
 
-   attr_list = get_attr_list(ctx, sidmap_attr_list);
+   attr_list = get_attr_list(memctx, sidmap_attr_list);
 
if ( ! ids[1]) {
/* if we are requested just one mapping use the simple filter */

Modified: branches/SAMBA_3_2_0/source/nsswitch/idmap_ldap.c
===
--- branches/SAMBA_3_2_0/source/nsswitch/idmap_ldap.c   2007-08-24 06:29:20 UTC 
(rev 24648)
+++ branches/SAMBA_3_2_0/source/nsswitch/idmap_ldap.c   2007-08-24 11:25:38 UTC 
(rev 24649)
@@ -893,7 +893,7 @@
uidNumber = get_attr_key2string(idpool_attr_list, LDAP_ATTR_UIDNUMBER);
gidNumber = get_attr_key2string(idpool_attr_list, LDAP_ATTR_GIDNUMBER);
 
-   attr_list = get_attr_list(ctx, sidmap_attr_list);
+   attr_list = get_attr_list(memctx, sidmap_attr_list);
 
if ( ! ids[1]) {
/* if we are requested just one mapping use the simple filter */
@@ -1110,7 +1110,7 @@
uidNumber = get_attr_key2string(idpool_attr_list, LDAP_ATTR_UIDNUMBER);
gidNumber = get_attr_key2string(idpool_attr_list, LDAP_ATTR_GIDNUMBER);
 
-   attr_list = get_attr_list(ctx, sidmap_attr_list);
+   attr_list = get_attr_list(memctx, sidmap_attr_list);
 
if ( ! ids[1]) {
/* if we are requested just one mapping use the simple filter */



svn commit: samba r24652 - in branches/SAMBA_3_2_0/source/lib/tdb/common: .

2007-08-24 Thread vlendec
Author: vlendec
Date: 2007-08-24 14:36:13 + (Fri, 24 Aug 2007)
New Revision: 24652

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

Log:
Janitor for jelmer, merge r24340:

Use standard data type uint32_t rather than tdb-specific u32.

Modified:
   branches/SAMBA_3_2_0/source/lib/tdb/common/error.c
   branches/SAMBA_3_2_0/source/lib/tdb/common/io.c
   branches/SAMBA_3_2_0/source/lib/tdb/common/lock.c
   branches/SAMBA_3_2_0/source/lib/tdb/common/open.c
   branches/SAMBA_3_2_0/source/lib/tdb/common/tdb.c
   branches/SAMBA_3_2_0/source/lib/tdb/common/tdb_private.h
   branches/SAMBA_3_2_0/source/lib/tdb/common/transaction.c
   branches/SAMBA_3_2_0/source/lib/tdb/common/traverse.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/lib/tdb/common/error.c
===
--- branches/SAMBA_3_2_0/source/lib/tdb/common/error.c  2007-08-24 13:31:05 UTC 
(rev 24651)
+++ branches/SAMBA_3_2_0/source/lib/tdb/common/error.c  2007-08-24 14:36:13 UTC 
(rev 24652)
@@ -48,7 +48,7 @@
 /* Error string for the last tdb error */
 const char *tdb_errorstr(struct tdb_context *tdb)
 {
-   u32 i;
+   uint32_t i;
for (i = 0; i  sizeof(emap) / sizeof(struct tdb_errname); i++)
if (tdb-ecode == emap[i].ecode)
return emap[i].estring;

Modified: branches/SAMBA_3_2_0/source/lib/tdb/common/io.c
===
--- branches/SAMBA_3_2_0/source/lib/tdb/common/io.c 2007-08-24 13:31:05 UTC 
(rev 24651)
+++ branches/SAMBA_3_2_0/source/lib/tdb/common/io.c 2007-08-24 14:36:13 UTC 
(rev 24652)
@@ -99,9 +99,9 @@
 }
 
 /* Endian conversion: we only ever deal with 4 byte quantities */
-void *tdb_convert(void *buf, u32 size)
+void *tdb_convert(void *buf, uint32_t size)
 {
-   u32 i, *p = (u32 *)buf;
+   uint32_t i, *p = (uint32_t *)buf;
for (i = 0; i  size / 4; i++)
p[i] = TDB_BYTEREV(p[i]);
return buf;
@@ -142,17 +142,17 @@
   do an unlocked scan of the hash table heads to find the next non-zero head. 
The value
   will then be confirmed with the lock held
 */ 
-static void tdb_next_hash_chain(struct tdb_context *tdb, u32 *chain)
+static void tdb_next_hash_chain(struct tdb_context *tdb, uint32_t *chain)
 {
-   u32 h = *chain;
+   uint32_t h = *chain;
if (tdb-map_ptr) {
for (;h  tdb-header.hash_size;h++) {
-   if (0 != *(u32 *)(TDB_HASH_TOP(h) + (unsigned char 
*)tdb-map_ptr)) {
+   if (0 != *(uint32_t *)(TDB_HASH_TOP(h) + (unsigned char 
*)tdb-map_ptr)) {
break;
}
}
} else {
-   u32 off=0;
+   uint32_t off=0;
for (;h  tdb-header.hash_size;h++) {
if (tdb_ofs_read(tdb, TDB_HASH_TOP(h), off) != 0 || 
off != 0) {
break;

Modified: branches/SAMBA_3_2_0/source/lib/tdb/common/lock.c
===
--- branches/SAMBA_3_2_0/source/lib/tdb/common/lock.c   2007-08-24 13:31:05 UTC 
(rev 24651)
+++ branches/SAMBA_3_2_0/source/lib/tdb/common/lock.c   2007-08-24 14:36:13 UTC 
(rev 24652)
@@ -400,7 +400,7 @@
 int tdb_unlock_record(struct tdb_context *tdb, tdb_off_t off)
 {
struct tdb_traverse_lock *i;
-   u32 count = 0;
+   uint32_t count = 0;
 
if (off == 0)
return 0;

Modified: branches/SAMBA_3_2_0/source/lib/tdb/common/open.c
===
--- branches/SAMBA_3_2_0/source/lib/tdb/common/open.c   2007-08-24 13:31:05 UTC 
(rev 24651)
+++ branches/SAMBA_3_2_0/source/lib/tdb/common/open.c   2007-08-24 14:36:13 UTC 
(rev 24652)
@@ -34,8 +34,8 @@
 /* This is based on the hash algorithm from gdbm */
 static unsigned int default_tdb_hash(TDB_DATA *key)
 {
-   u32 value;  /* Used to compute the hash value.  */
-   u32   i;/* Used to cycle through random values. */
+   uint32_t value; /* Used to compute the hash value.  */
+   uint32_t i; /* Used to cycle through random values. */
 
/* Set the initial value from the key size. */
for (value = 0x238F13AF * key-dsize, i=0; i  key-dsize; i++)
@@ -151,7 +151,7 @@
struct stat st;
int rev = 0, locked = 0;
unsigned char *vp;
-   u32 vertest;
+   uint32_t vertest;
 
if (!(tdb = (struct tdb_context *)calloc(1, sizeof *tdb))) {
/* Can't log this */
@@ -249,8 +249,8 @@
rev = (tdb-flags  TDB_CONVERT);
}
vp = (unsigned char *)tdb-header.version;
-   vertest = (((u32)vp[0])  24) | (((u32)vp[1])  16) |
- (((u32)vp[2])  8) | (u32)vp[3];
+   vertest = (((uint32_t)vp[0])  24) | (((uint32_t)vp[1])  16) |
+ (((uint32_t)vp[2])  8

svn commit: samba r24653 - in branches/SAMBA_3_2_0/source: include lib libads libsmb rpc_client smbd

2007-08-24 Thread vlendec
Author: vlendec
Date: 2007-08-24 15:00:26 + (Fri, 24 Aug 2007)
New Revision: 24653

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

Log:
Some trivial 3_2-3_2_0 merges
Modified:
   branches/SAMBA_3_2_0/source/include/client.h
   branches/SAMBA_3_2_0/source/include/ntdomain.h
   branches/SAMBA_3_2_0/source/include/rpc_samr.h
   branches/SAMBA_3_2_0/source/include/trans2.h
   branches/SAMBA_3_2_0/source/lib/dbwrap_tdb.c
   branches/SAMBA_3_2_0/source/lib/util_sock.c
   branches/SAMBA_3_2_0/source/libads/ads_status.c
   branches/SAMBA_3_2_0/source/libsmb/clispnego.c
   branches/SAMBA_3_2_0/source/libsmb/smb_signing.c
   branches/SAMBA_3_2_0/source/rpc_client/cli_pipe.c
   branches/SAMBA_3_2_0/source/smbd/lanman.c
   branches/SAMBA_3_2_0/source/smbd/msdfs.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/include/client.h
===
--- branches/SAMBA_3_2_0/source/include/client.h2007-08-24 14:36:13 UTC 
(rev 24652)
+++ branches/SAMBA_3_2_0/source/include/client.h2007-08-24 15:00:26 UTC 
(rev 24653)
@@ -34,8 +34,7 @@
  * These definitions depend on smb.h
  */
 
-struct print_job_info
-{
+struct print_job_info {
uint16 id;
uint16 priority;
size_t size;

Modified: branches/SAMBA_3_2_0/source/include/ntdomain.h
===
--- branches/SAMBA_3_2_0/source/include/ntdomain.h  2007-08-24 14:36:13 UTC 
(rev 24652)
+++ branches/SAMBA_3_2_0/source/include/ntdomain.h  2007-08-24 15:00:26 UTC 
(rev 24653)
@@ -264,7 +264,7 @@
 */
 
BOOL bad_handle_fault_state;
-   
+
/*
 * Set to true when the backend does not support a call.
 */

Modified: branches/SAMBA_3_2_0/source/include/rpc_samr.h
===
--- branches/SAMBA_3_2_0/source/include/rpc_samr.h  2007-08-24 14:36:13 UTC 
(rev 24652)
+++ branches/SAMBA_3_2_0/source/include/rpc_samr.h  2007-08-24 15:00:26 UTC 
(rev 24653)
@@ -288,7 +288,6 @@
UNISTR2 uni_comment;
UNISTR2 uni_munged_dial ; /* munged path name and dial-back tel no */
LOGON_HRS logon_hrs;
-
 } SAM_USER_INFO_25;
 
 /* SAM_USER_INFO_26 */

Modified: branches/SAMBA_3_2_0/source/include/trans2.h
===
--- branches/SAMBA_3_2_0/source/include/trans2.h2007-08-24 14:36:13 UTC 
(rev 24652)
+++ branches/SAMBA_3_2_0/source/include/trans2.h2007-08-24 15:00:26 UTC 
(rev 24653)
@@ -552,6 +552,21 @@
(NB statfs field flags can come from FILE_SYSTEM_DEVICE_INFO call)  
 */
 
+#define SMB_QUERY_POSIX_WHO_AM_I  0x202 /* QFS Info */
+/* returns:
+__u32 flags;  0 = Authenticated user 1 = GUEST 
+__u32 mask;  which flags bits server understands ie 0x0001 
+__u64 unix_user_id;
+__u64 unix_user_gid;
+__u32 number_of_supplementary_gids;  may be zero 
+__u32 number_of_sids;  may be zero
+__u32 length_of_sid_array;  in bytes - may be zero 
+__u32 pad;  reserved - MBZ 
+__u64 gid_array[0];  may be empty 
+__u8 * psid_list  may be empty
+*/
+
+
 /* ... more as we think of them :-). */
 
 /* SMB POSIX ACL definitions. */

Modified: branches/SAMBA_3_2_0/source/lib/dbwrap_tdb.c
===
--- branches/SAMBA_3_2_0/source/lib/dbwrap_tdb.c2007-08-24 14:36:13 UTC 
(rev 24652)
+++ branches/SAMBA_3_2_0/source/lib/dbwrap_tdb.c2007-08-24 15:00:26 UTC 
(rev 24653)
@@ -57,8 +57,7 @@
}
 
result-key.dsize = key.dsize;
-   result-key.dptr = (unsigned char *)talloc_memdup(result, key.dptr,
- key.dsize);
+   result-key.dptr = (uint8 *)talloc_memdup(result, key.dptr, key.dsize);
if (result-key.dptr == NULL) {
DEBUG(0, (talloc failed\n));
TALLOC_FREE(result);
@@ -92,8 +91,8 @@
}
 
result-value.dsize = value.dsize;
-   result-value.dptr = (unsigned char *)talloc_memdup(result, value.dptr,
-   value.dsize);
+   result-value.dptr = (uint8 *)talloc_memdup(result, value.dptr,
+   value.dsize);
if (result-value.dptr == NULL) {
DEBUG(3, (talloc failed\n));
TALLOC_FREE(result);

Modified: branches/SAMBA_3_2_0/source/lib/util_sock.c
===
--- branches/SAMBA_3_2_0/source/lib/util_sock.c 2007-08-24 14:36:13 UTC (rev 
24652)
+++ branches/SAMBA_3_2_0/source/lib/util_sock.c 2007-08-24 15:00:26 UTC (rev 
24653)
@@ -744,12 +744,13 @@
/* Check the incoming SMB signature. */
if (!srv_check_sign_mac(buffer, True)) {
DEBUG(0, (receive_smb: SMB

svn commit: samba r24634 - in branches/SAMBA_3_0_25/source/smbd: .

2007-08-23 Thread vlendec
Author: vlendec
Date: 2007-08-23 12:23:19 + (Thu, 23 Aug 2007)
New Revision: 24634

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

Log:
Fix the Tru64 build -- 3_2[_0] is already fixed
Modified:
   branches/SAMBA_3_0_25/source/smbd/posix_acls.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/smbd/posix_acls.c
===
--- branches/SAMBA_3_0_25/source/smbd/posix_acls.c  2007-08-23 11:52:54 UTC 
(rev 24633)
+++ branches/SAMBA_3_0_25/source/smbd/posix_acls.c  2007-08-23 12:23:19 UTC 
(rev 24634)
@@ -3107,7 +3107,7 @@
 {
mode_t perms;
SEC_ACCESS acc;
-   int acl_type;
+   int nt_acl_type; /* Tru64 has acl_type as a macro.. */
DOM_SID trustee;
 
switch (ugw) {
@@ -3136,13 +3136,13 @@
return NT_STATUS_INVALID_PARAMETER;
}
acc = map_canon_ace_perms(SNUM(fsp-conn),
-   acl_type,
+   nt_acl_type,
perms,
fsp-is_directory);
 
init_sec_ace(se,
trustee,
-   acl_type,
+   nt_acl_type,
acc,
0);
return NT_STATUS_OK;



svn commit: samba r24617 - in branches/SAMBA_3_0_25/source/modules: .

2007-08-22 Thread vlendec
Author: vlendec
Date: 2007-08-22 11:23:24 + (Wed, 22 Aug 2007)
New Revision: 24617

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

Log:
Revert -r24035. No idea what this was. Sorry for breaking the build of
the aixacl2 module.

Modified:
   branches/SAMBA_3_0_25/source/modules/nfs4_acls.h


Changeset:
Modified: branches/SAMBA_3_0_25/source/modules/nfs4_acls.h
===
--- branches/SAMBA_3_0_25/source/modules/nfs4_acls.h2007-08-22 10:47:32 UTC 
(rev 24616)
+++ branches/SAMBA_3_0_25/source/modules/nfs4_acls.h2007-08-22 11:23:24 UTC 
(rev 24617)
@@ -138,7 +138,7 @@
  * when applicable */
 typedef BOOL (*set_nfs4acl_native_fn_t)(files_struct *, SMB4ACL_T *);
 
-NTSTATUS smb_set_nt_acl_nfs4(files_struct *fsp,
+BOOL smb_set_nt_acl_nfs4(files_struct *fsp,
uint32 security_info_sent,
SEC_DESC *psd,
set_nfs4acl_native_fn_t set_nfs4_native);



svn commit: samba r24595 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

2007-08-21 Thread vlendec
Author: vlendec
Date: 2007-08-21 12:58:10 + (Tue, 21 Aug 2007)
New Revision: 24595

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

Log:
Fix Coverity ID 393

In this error case we would have used start not having it initialized

Modified:
   branches/SAMBA_3_2/source/smbd/filename.c
   branches/SAMBA_3_2_0/source/smbd/filename.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/filename.c
===
--- branches/SAMBA_3_2/source/smbd/filename.c   2007-08-21 12:20:33 UTC (rev 
24594)
+++ branches/SAMBA_3_2/source/smbd/filename.c   2007-08-21 12:58:10 UTC (rev 
24595)
@@ -155,8 +155,7 @@
 
if (!*orig_path) {
if (!(name = SMB_STRDUP(.))) {
-   result = NT_STATUS_NO_MEMORY;
-   goto fail;
+   return NT_STATUS_NO_MEMORY;
}
if (SMB_VFS_STAT(conn,name,st) == 0) {
*pst = st;

Modified: branches/SAMBA_3_2_0/source/smbd/filename.c
===
--- branches/SAMBA_3_2_0/source/smbd/filename.c 2007-08-21 12:20:33 UTC (rev 
24594)
+++ branches/SAMBA_3_2_0/source/smbd/filename.c 2007-08-21 12:58:10 UTC (rev 
24595)
@@ -155,8 +155,7 @@
 
if (!*orig_path) {
if (!(name = SMB_STRDUP(.))) {
-   result = NT_STATUS_NO_MEMORY;
-   goto fail;
+   return NT_STATUS_NO_MEMORY;
}
if (SMB_VFS_STAT(conn,name,st) == 0) {
*pst = st;



svn commit: samba r24570 - in branches/SAMBA_4_0/source: . torture/raw

2007-08-20 Thread vlendec
Author: vlendec
Date: 2007-08-20 07:30:59 + (Mon, 20 Aug 2007)
New Revision: 24570

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

Log:
Attempt to fix make test

Samba4 seems not to survive the newly added tests

Modified:
   branches/SAMBA_4_0/source/samba4-knownfail
   branches/SAMBA_4_0/source/torture/raw/rename.c


Changeset:
Modified: branches/SAMBA_4_0/source/samba4-knownfail
===
--- branches/SAMBA_4_0/source/samba4-knownfail  2007-08-20 05:24:19 UTC (rev 
24569)
+++ branches/SAMBA_4_0/source/samba4-knownfail  2007-08-20 07:30:59 UTC (rev 
24570)
@@ -9,3 +9,4 @@
 RPC-WKSSVC.*NetWkstaGetInfo
 RPC-WKSSVC.*NetWkstaTransportEnum
 blackbox.smbclient.*USER.*PASSWD
+RAW-SAMBA3CASEINSENSITIVE

Modified: branches/SAMBA_4_0/source/torture/raw/rename.c
===
--- branches/SAMBA_4_0/source/torture/raw/rename.c  2007-08-20 05:24:19 UTC 
(rev 24569)
+++ branches/SAMBA_4_0/source/torture/raw/rename.c  2007-08-20 07:30:59 UTC 
(rev 24570)
@@ -125,8 +125,14 @@
printf((%s) Incorrect filename [%s] after case-changing 
   rename, should be [%s]\n, __location__,
   finfo.all_info.out.fname.s, Fname1);
-   ret = False;
-   goto done;
+   /*
+* Samba4 apparently does not do this. Leave the error
+* message, but don't fail make test over this.
+*/
+   if (!lp_parm_bool(-1, torture, samba4, False)) {
+   ret = False;
+   goto done;
+   }
}
 
io.rename.in.pattern1 = fname1;



svn commit: samba r24571 - in branches: SAMBA_3_0_25/source/locking SAMBA_3_2/source/locking SAMBA_3_2_0/source/locking

2007-08-20 Thread vlendec
Author: vlendec
Date: 2007-08-20 07:59:22 + (Mon, 20 Aug 2007)
New Revision: 24571

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

Log:
Only look at errno if the close call actually failed

Patch from Ofir Azoulay [EMAIL PROTECTED] -- thanks

Modified:
   branches/SAMBA_3_0_25/source/locking/posix.c
   branches/SAMBA_3_2/source/locking/posix.c
   branches/SAMBA_3_2_0/source/locking/posix.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/locking/posix.c
===
--- branches/SAMBA_3_0_25/source/locking/posix.c2007-08-20 07:30:59 UTC 
(rev 24570)
+++ branches/SAMBA_3_0_25/source/locking/posix.c2007-08-20 07:59:22 UTC 
(rev 24571)
@@ -651,7 +651,10 @@
 */
ret = SMB_VFS_CLOSE(fsp,fsp-fh-fd);
fsp-fh-fd = -1;
-   return map_nt_error_from_unix(errno);
+   if (ret == -1) {
+   return map_nt_error_from_unix(errno);
+   }
+   return NT_STATUS_OK;
}
 
if (get_windows_lock_ref_count(fsp)) {

Modified: branches/SAMBA_3_2/source/locking/posix.c
===
--- branches/SAMBA_3_2/source/locking/posix.c   2007-08-20 07:30:59 UTC (rev 
24570)
+++ branches/SAMBA_3_2/source/locking/posix.c   2007-08-20 07:59:22 UTC (rev 
24571)
@@ -640,7 +640,10 @@
 */
ret = SMB_VFS_CLOSE(fsp,fsp-fh-fd);
fsp-fh-fd = -1;
-   return map_nt_error_from_unix(errno);
+   if (ret == -1) {
+   return map_nt_error_from_unix(errno);
+   }
+   return NT_STATUS_OK;
}
 
if (get_windows_lock_ref_count(fsp)) {

Modified: branches/SAMBA_3_2_0/source/locking/posix.c
===
--- branches/SAMBA_3_2_0/source/locking/posix.c 2007-08-20 07:30:59 UTC (rev 
24570)
+++ branches/SAMBA_3_2_0/source/locking/posix.c 2007-08-20 07:59:22 UTC (rev 
24571)
@@ -640,7 +640,10 @@
 */
ret = SMB_VFS_CLOSE(fsp,fsp-fh-fd);
fsp-fh-fd = -1;
-   return map_nt_error_from_unix(errno);
+   if (ret == -1) {
+   return map_nt_error_from_unix(errno);
+   }
+   return NT_STATUS_OK;
}
 
if (get_windows_lock_ref_count(fsp)) {



svn commit: samba r24581 - in branches/SAMBA_3_2_0/source/rpc_server: .

2007-08-20 Thread vlendec
Author: vlendec
Date: 2007-08-20 12:56:56 + (Mon, 20 Aug 2007)
New Revision: 24581

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

Log:
Fix the build

Modified:
   branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc.c
   branches/SAMBA_3_2_0/source/rpc_server/srv_winreg.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc.c
===
--- branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc.c 2007-08-20 12:56:31 UTC 
(rev 24580)
+++ branches/SAMBA_3_2_0/source/rpc_server/srv_srvsvc.c 2007-08-20 12:56:56 UTC 
(rev 24581)
@@ -572,7 +572,7 @@
 
 static BOOL api_srv_net_file_close(pipes_struct *p)
 {
-   return proxy_srvsvc_call( p, DCERPC_SRVSVC_NETFILECLOSE );
+   return proxy_srvsvc_call( p, NDR_SRVSVC_NETFILECLOSE );
 }
 
 /***

Modified: branches/SAMBA_3_2_0/source/rpc_server/srv_winreg.c
===
--- branches/SAMBA_3_2_0/source/rpc_server/srv_winreg.c 2007-08-20 12:56:31 UTC 
(rev 24580)
+++ branches/SAMBA_3_2_0/source/rpc_server/srv_winreg.c 2007-08-20 12:56:56 UTC 
(rev 24581)
@@ -53,7 +53,7 @@
 
 static BOOL api_reg_close(pipes_struct *p)
 {
-   return proxy_winreg_call( p, DCERPC_WINREG_CLOSEKEY );
+   return proxy_winreg_call( p, NDR_WINREG_CLOSEKEY );
 }
 
 /***



svn commit: samba r24546 - in branches/SAMBA_3_2_0/source: lib libsmb passdb rpc_parse smbd

2007-08-19 Thread vlendec
Author: vlendec
Date: 2007-08-19 19:39:14 + (Sun, 19 Aug 2007)
New Revision: 24546

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

Log:
Fix some C++ and type-punned warnings

Modified:
   branches/SAMBA_3_2_0/source/lib/dbwrap_tdb.c
   branches/SAMBA_3_2_0/source/libsmb/clikrb5.c
   branches/SAMBA_3_2_0/source/passdb/secrets.c
   branches/SAMBA_3_2_0/source/rpc_parse/parse_reg.c
   branches/SAMBA_3_2_0/source/rpc_parse/parse_srv.c
   branches/SAMBA_3_2_0/source/smbd/sesssetup.c


Changeset:
Modified: branches/SAMBA_3_2_0/source/lib/dbwrap_tdb.c
===
--- branches/SAMBA_3_2_0/source/lib/dbwrap_tdb.c2007-08-18 18:09:25 UTC 
(rev 24545)
+++ branches/SAMBA_3_2_0/source/lib/dbwrap_tdb.c2007-08-19 19:39:14 UTC 
(rev 24546)
@@ -57,7 +57,8 @@
}
 
result-key.dsize = key.dsize;
-   result-key.dptr = talloc_memdup(result, key.dptr, key.dsize);
+   result-key.dptr = (unsigned char *)talloc_memdup(result, key.dptr,
+ key.dsize);
if (result-key.dptr == NULL) {
DEBUG(0, (talloc failed\n));
TALLOC_FREE(result);
@@ -91,7 +92,8 @@
}
 
result-value.dsize = value.dsize;
-   result-value.dptr = talloc_memdup(result, value.dptr, value.dsize);
+   result-value.dptr = (unsigned char *)talloc_memdup(result, value.dptr,
+   value.dsize);
if (result-value.dptr == NULL) {
DEBUG(3, (talloc failed\n));
TALLOC_FREE(result);

Modified: branches/SAMBA_3_2_0/source/libsmb/clikrb5.c
===
--- branches/SAMBA_3_2_0/source/libsmb/clikrb5.c2007-08-18 18:09:25 UTC 
(rev 24545)
+++ branches/SAMBA_3_2_0/source/libsmb/clikrb5.c2007-08-19 19:39:14 UTC 
(rev 24546)
@@ -1440,7 +1440,7 @@
 
*opt = NULL;
 
-   if ((my_opt = SMB_MALLOC(sizeof(krb5_get_init_creds_opt))) == NULL) {
+   if ((my_opt = SMB_MALLOC_P(krb5_get_init_creds_opt)) == NULL) {
return ENOMEM;
}
 

Modified: branches/SAMBA_3_2_0/source/passdb/secrets.c
===
--- branches/SAMBA_3_2_0/source/passdb/secrets.c2007-08-18 18:09:25 UTC 
(rev 24545)
+++ branches/SAMBA_3_2_0/source/passdb/secrets.c2007-08-19 19:39:14 UTC 
(rev 24546)
@@ -104,7 +104,7 @@
if (!tdb)
return False;
return tdb_trans_store(tdb, string_tdb_data(key),
-  make_tdb_data(data, size),
+  make_tdb_data((const uint8 *)data, size),
   TDB_REPLACE) == 0;
 }
 

Modified: branches/SAMBA_3_2_0/source/rpc_parse/parse_reg.c
===
--- branches/SAMBA_3_2_0/source/rpc_parse/parse_reg.c   2007-08-18 18:09:25 UTC 
(rev 24545)
+++ branches/SAMBA_3_2_0/source/rpc_parse/parse_reg.c   2007-08-19 19:39:14 UTC 
(rev 24546)
@@ -75,7 +75,8 @@
if(!prs_align(ps))
return False;
 
-   if(!prs_pointer(server, ps, depth, (void**)q_u-server, 
sizeof(uint16), (PRS_POINTER_CAST)prs_uint16))
+   if(!prs_pointer(server, ps, depth, (void*)q_u-server,
+   sizeof(uint16), (PRS_POINTER_CAST)prs_uint16))
return False;
 
if(!prs_align(ps))
@@ -275,7 +276,8 @@
if(!prs_uint32(access, ps, depth, q_u-access))
return False;
 
-   if(!prs_pointer(sec_info, ps, depth, (void**)q_u-sec_info, 
sizeof(uint32), (PRS_POINTER_CAST)prs_uint32))
+   if(!prs_pointer(sec_info, ps, depth, (void*)q_u-sec_info,
+   sizeof(uint32), (PRS_POINTER_CAST)prs_uint32))
return False;
 
if ( q_u-sec_info ) {
@@ -285,7 +287,8 @@
return False;
}
 
-   if(!prs_pointer(disposition, ps, depth, (void**)q_u-disposition, 
sizeof(uint32), (PRS_POINTER_CAST)prs_uint32))
+   if(!prs_pointer(disposition, ps, depth, (void*)q_u-disposition,
+   sizeof(uint32), (PRS_POINTER_CAST)prs_uint32))
return False;
 
return True;
@@ -999,17 +1002,21 @@
if(!prs_align(ps))
return False;

-   if ( !prs_pointer(type, ps, depth, (void**)r_u-type, 
sizeof(uint32), (PRS_POINTER_CAST)prs_uint32))
+   if ( !prs_pointer(type, ps, depth, (void*)r_u-type,
+ sizeof(uint32), (PRS_POINTER_CAST)prs_uint32))
return False;
 
-   if ( !prs_pointer(value, ps, depth, (void**)r_u-value, 
sizeof(REGVAL_BUFFER), (PRS_POINTER_CAST)smb_io_regval_buffer))
+   if ( !prs_pointer(value, ps, depth, (void*)r_u-value,
+ sizeof(REGVAL_BUFFER), 
(PRS_POINTER_CAST)smb_io_regval_buffer

svn commit: samba r24547 - in branches: SAMBA_3_0_25/source/lib SAMBA_3_2/source/lib SAMBA_3_2_0/source/lib

2007-08-19 Thread vlendec
Author: vlendec
Date: 2007-08-19 19:52:18 + (Sun, 19 Aug 2007)
New Revision: 24547

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

Log:
Fix #4897, patch from David S. Collier-Brown [EMAIL PROTECTED] -- Thanks!
Modified:
   branches/SAMBA_3_0_25/source/lib/system.c
   branches/SAMBA_3_2/source/lib/system.c
   branches/SAMBA_3_2_0/source/lib/system.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/lib/system.c
===
--- branches/SAMBA_3_0_25/source/lib/system.c   2007-08-19 19:39:14 UTC (rev 
24546)
+++ branches/SAMBA_3_0_25/source/lib/system.c   2007-08-19 19:52:18 UTC (rev 
24547)
@@ -1565,12 +1565,12 @@
 / Solaris EA helper function prototypes /
 #ifdef HAVE_ATTROPEN
 #define SOLARIS_ATTRMODE S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP
-int solaris_write_xattr(int attrfd, const char *value, size_t size);
-ssize_t solaris_read_xattr(int attrfd, void *value, size_t size);
-ssize_t solaris_list_xattr(int attrdirfd, char *list, size_t size);
-int solaris_unlinkat(int attrdirfd, const char *name);
-int solaris_attropen(const char *path, const char *attrpath, int oflag, mode_t 
mode);
-int solaris_openat(int fildes, const char *path, int oflag, mode_t mode);
+static int solaris_write_xattr(int attrfd, const char *value, size_t size);
+static ssize_t solaris_read_xattr(int attrfd, void *value, size_t size);
+static ssize_t solaris_list_xattr(int attrdirfd, char *list, size_t size);
+static int solaris_unlinkat(int attrdirfd, const char *name);
+static int solaris_attropen(const char *path, const char *attrpath, int oflag, 
mode_t mode);
+static int solaris_openat(int fildes, const char *path, int oflag, mode_t 
mode);
 #endif
 
 /**

Modified: branches/SAMBA_3_2/source/lib/system.c
===
--- branches/SAMBA_3_2/source/lib/system.c  2007-08-19 19:39:14 UTC (rev 
24546)
+++ branches/SAMBA_3_2/source/lib/system.c  2007-08-19 19:52:18 UTC (rev 
24547)
@@ -1686,12 +1686,12 @@
 / Solaris EA helper function prototypes /
 #ifdef HAVE_ATTROPEN
 #define SOLARIS_ATTRMODE S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP
-int solaris_write_xattr(int attrfd, const char *value, size_t size);
-ssize_t solaris_read_xattr(int attrfd, void *value, size_t size);
-ssize_t solaris_list_xattr(int attrdirfd, char *list, size_t size);
-int solaris_unlinkat(int attrdirfd, const char *name);
-int solaris_attropen(const char *path, const char *attrpath, int oflag, mode_t 
mode);
-int solaris_openat(int fildes, const char *path, int oflag, mode_t mode);
+static int solaris_write_xattr(int attrfd, const char *value, size_t size);
+static ssize_t solaris_read_xattr(int attrfd, void *value, size_t size);
+static ssize_t solaris_list_xattr(int attrdirfd, char *list, size_t size);
+static int solaris_unlinkat(int attrdirfd, const char *name);
+static int solaris_attropen(const char *path, const char *attrpath, int oflag, 
mode_t mode);
+static int solaris_openat(int fildes, const char *path, int oflag, mode_t 
mode);
 #endif
 
 /**

Modified: branches/SAMBA_3_2_0/source/lib/system.c
===
--- branches/SAMBA_3_2_0/source/lib/system.c2007-08-19 19:39:14 UTC (rev 
24546)
+++ branches/SAMBA_3_2_0/source/lib/system.c2007-08-19 19:52:18 UTC (rev 
24547)
@@ -1686,12 +1686,12 @@
 / Solaris EA helper function prototypes /
 #ifdef HAVE_ATTROPEN
 #define SOLARIS_ATTRMODE S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP
-int solaris_write_xattr(int attrfd, const char *value, size_t size);
-ssize_t solaris_read_xattr(int attrfd, void *value, size_t size);
-ssize_t solaris_list_xattr(int attrdirfd, char *list, size_t size);
-int solaris_unlinkat(int attrdirfd, const char *name);
-int solaris_attropen(const char *path, const char *attrpath, int oflag, mode_t 
mode);
-int solaris_openat(int fildes, const char *path, int oflag, mode_t mode);
+static int solaris_write_xattr(int attrfd, const char *value, size_t size);
+static ssize_t solaris_read_xattr(int attrfd, void *value, size_t size);
+static ssize_t solaris_list_xattr(int attrdirfd, char *list, size_t size);
+static int solaris_unlinkat(int attrdirfd, const char *name);
+static int solaris_attropen(const char *path, const char *attrpath, int oflag, 
mode_t mode);
+static int solaris_openat(int fildes, const char *path, int oflag, mode_t 
mode);
 #endif
 
 /**



svn commit: samba r24548 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

2007-08-19 Thread vlendec
Author: vlendec
Date: 2007-08-19 19:57:55 + (Sun, 19 Aug 2007)
New Revision: 24548

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

Log:
Fix the case-changing renames

This was broken when I changed reply_mv to wrap in a open_file_ntcreate
call, unix_convert on the destination was called twice

Modified:
   branches/SAMBA_3_2/source/smbd/reply.c
   branches/SAMBA_3_2/source/smbd/trans2.c
   branches/SAMBA_3_2_0/source/smbd/reply.c
   branches/SAMBA_3_2_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/reply.c
===
--- branches/SAMBA_3_2/source/smbd/reply.c  2007-08-19 19:52:18 UTC (rev 
24547)
+++ branches/SAMBA_3_2/source/smbd/reply.c  2007-08-19 19:57:55 UTC (rev 
24548)
@@ -5111,24 +5111,18 @@
  Rename an open file - given an fsp.
 /
 
-NTSTATUS rename_internals_fsp(connection_struct *conn, files_struct *fsp, 
pstring newname, uint32 attrs, BOOL replace_if_exists)
+NTSTATUS rename_internals_fsp(connection_struct *conn, files_struct *fsp,
+ pstring newname,
+ const char *newname_last_component,
+ uint32 attrs, BOOL replace_if_exists)
 {
SMB_STRUCT_STAT sbuf, sbuf1;
-   pstring newname_last_component;
NTSTATUS status = NT_STATUS_OK;
struct share_mode_lock *lck = NULL;
BOOL dst_exists;
 
ZERO_STRUCT(sbuf);
 
-   status = unix_convert(conn, newname, False, newname_last_component, 
sbuf);
-
-   /* If an error we expect this to be NT_STATUS_OBJECT_PATH_NOT_FOUND */
-
-   if (!NT_STATUS_IS_OK(status)  
!NT_STATUS_EQUAL(NT_STATUS_OBJECT_PATH_NOT_FOUND, status)) {
-   return status;
-   }
-
status = check_name(conn, newname);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -5420,8 +5414,9 @@
return status;
}
 
-   status = rename_internals_fsp(conn, fsp, newname, attrs,
- replace_if_exists);
+   status = rename_internals_fsp(conn, fsp, newname,
+ last_component_dest,
+ attrs, replace_if_exists);
 
close_file(fsp, NORMAL_CLOSE);
 
@@ -5517,8 +5512,8 @@
break;
}
 
-   status = rename_internals_fsp(conn, fsp, destname, attrs,
- replace_if_exists);
+   status = rename_internals_fsp(conn, fsp, destname, dname,
+ attrs, replace_if_exists);
 
close_file(fsp, NORMAL_CLOSE);
 

Modified: branches/SAMBA_3_2/source/smbd/trans2.c
===
--- branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-19 19:52:18 UTC (rev 
24547)
+++ branches/SAMBA_3_2/source/smbd/trans2.c 2007-08-19 19:57:55 UTC (rev 
24548)
@@ -4937,9 +4937,28 @@
pstrcat(base_name, newname);
 
if (fsp) {
+   SMB_STRUCT_STAT sbuf;
+   pstring newname_last_component;
+
+   ZERO_STRUCT(sbuf);
+
+   status = unix_convert(conn, newname, False,
+ newname_last_component, sbuf);
+
+   /* If an error we expect this to be
+* NT_STATUS_OBJECT_PATH_NOT_FOUND */
+
+   if (!NT_STATUS_IS_OK(status)
+!NT_STATUS_EQUAL(NT_STATUS_OBJECT_PATH_NOT_FOUND,
+   status)) {
+   return status;
+   }
+
DEBUG(10,(smb_file_rename_information: 
SMB_FILE_RENAME_INFORMATION (fnum %d) %s - %s\n,
fsp-fnum, fsp-fsp_name, base_name ));
-   status = rename_internals_fsp(conn, fsp, base_name, 0, 
overwrite);
+   status = rename_internals_fsp(conn, fsp, base_name,
+ newname_last_component, 0,
+ overwrite);
} else {
DEBUG(10,(smb_file_rename_information: 
SMB_FILE_RENAME_INFORMATION %s - %s\n,
fname, newname ));

Modified: branches/SAMBA_3_2_0/source/smbd/reply.c
===
--- branches/SAMBA_3_2_0/source/smbd/reply.c2007-08-19 19:52:18 UTC (rev 
24547)
+++ branches/SAMBA_3_2_0/source/smbd/reply.c2007-08-19 19:57:55 UTC (rev 
24548)
@@ -4361,24 +4361,18 @@
  Rename an open file - given an fsp.
 /
 
-NTSTATUS rename_internals_fsp(connection_struct *conn, files_struct *fsp, 
pstring newname, uint32 attrs, BOOL

svn commit: samba r24549 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

2007-08-19 Thread vlendec
Author: vlendec
Date: 2007-08-19 20:00:43 + (Sun, 19 Aug 2007)
New Revision: 24549

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

Log:
Fix unix_convert to return the already converted part

This API will change anyway when moving away from pstrings.

It took so long to fix, because that rename bug I just fixed gave make
test failures that had nothing to do with this one.

I have samba4 tests for both bugs, will check them in when the build
farm has caught up

Modified:
   branches/SAMBA_3_2/source/smbd/filename.c
   branches/SAMBA_3_2_0/source/smbd/filename.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/filename.c
===
--- branches/SAMBA_3_2/source/smbd/filename.c   2007-08-19 19:57:55 UTC (rev 
24548)
+++ branches/SAMBA_3_2/source/smbd/filename.c   2007-08-19 20:00:43 UTC (rev 
24549)
@@ -173,7 +173,7 @@
result =determine_path_error(
orig_path[2], allow_wcard_last_component);
}
-   goto fail;
+   return result;
}
 
/*
@@ -222,8 +222,8 @@
 
if ((dirpath == NULL)  (!(dirpath = SMB_STRDUP( {
DEBUG(0, (strdup failed\n));
-   result = NT_STATUS_NO_MEMORY;
-   goto fail;
+   SAFE_FREE(name);
+   return NT_STATUS_NO_MEMORY;
}
 
/*
@@ -602,9 +602,15 @@
DEBUG(5,(conversion finished %s - %s\n,orig_path, name));
 
  done:
-   result = NT_STATUS_OK;
pstrcpy(orig_path, name);
+   SAFE_FREE(name);
+   SAFE_FREE(dirpath);
+   return NT_STATUS_OK;
  fail:
+   DEBUG(10, (dirpath = [%s] start = [%s]\n, dirpath, start));
+   pstrcpy(orig_path, dirpath);
+   pstrcat(orig_path, /);
+   pstrcat(orig_path, start);
SAFE_FREE(name);
SAFE_FREE(dirpath);
return result;

Modified: branches/SAMBA_3_2_0/source/smbd/filename.c
===
--- branches/SAMBA_3_2_0/source/smbd/filename.c 2007-08-19 19:57:55 UTC (rev 
24548)
+++ branches/SAMBA_3_2_0/source/smbd/filename.c 2007-08-19 20:00:43 UTC (rev 
24549)
@@ -173,7 +173,7 @@
result =determine_path_error(
orig_path[2], allow_wcard_last_component);
}
-   goto fail;
+   return result;
}
 
/*
@@ -222,8 +222,8 @@
 
if ((dirpath == NULL)  (!(dirpath = SMB_STRDUP( {
DEBUG(0, (strdup failed\n));
-   result = NT_STATUS_NO_MEMORY;
-   goto fail;
+   SAFE_FREE(name);
+   return NT_STATUS_NO_MEMORY;
}
 
/*
@@ -602,9 +602,15 @@
DEBUG(5,(conversion finished %s - %s\n,orig_path, name));
 
  done:
-   result = NT_STATUS_OK;
pstrcpy(orig_path, name);
+   SAFE_FREE(name);
+   SAFE_FREE(dirpath);
+   return NT_STATUS_OK;
  fail:
+   DEBUG(10, (dirpath = [%s] start = [%s]\n, dirpath, start));
+   pstrcpy(orig_path, dirpath);
+   pstrcat(orig_path, /);
+   pstrcat(orig_path, start);
SAFE_FREE(name);
SAFE_FREE(dirpath);
return result;



svn commit: samba r24550 - in branches/SAMBA_3_2/source/libgpo: .

2007-08-19 Thread vlendec
Author: vlendec
Date: 2007-08-19 20:09:16 + (Sun, 19 Aug 2007)
New Revision: 24550

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

Log:
Attempt to fix the non-LDAP build

For example host bigboy doesn't have it.

G?\195?\188nther, please fix it properly and merge to 3_2_0

Thanks,

Volker

Modified:
   branches/SAMBA_3_2/source/libgpo/gpo_ini.c


Changeset:
Modified: branches/SAMBA_3_2/source/libgpo/gpo_ini.c
===
--- branches/SAMBA_3_2/source/libgpo/gpo_ini.c  2007-08-19 20:00:43 UTC (rev 
24549)
+++ branches/SAMBA_3_2/source/libgpo/gpo_ini.c  2007-08-19 20:09:16 UTC (rev 
24550)
@@ -145,8 +145,12 @@
 
talloc_set_destructor(ctx, gp_inifile_free_context);
 
+#ifdef HAVE_LDAP
status = gp_find_file(mem_ctx, flags, unix_path, suffix,
  ini_filename);
+#else
+   status = NT_STATUS_NOT_IMPLEMENTED;
+#endif
 
if (!NT_STATUS_IS_OK(status)) {
goto failed;



svn commit: samba r24569 - in branches/SAMBA_4_0/source/torture/raw: .

2007-08-19 Thread vlendec
Author: vlendec
Date: 2007-08-20 05:24:19 + (Mon, 20 Aug 2007)
New Revision: 24569

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

Log:
Add two tests

A subtest for rename to check if case-changing renames work

A test that exposes the case insensitivity unix_convert bug

Modified:
   branches/SAMBA_4_0/source/torture/raw/raw.c
   branches/SAMBA_4_0/source/torture/raw/rename.c
   branches/SAMBA_4_0/source/torture/raw/samba3misc.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/raw.c
===
--- branches/SAMBA_4_0/source/torture/raw/raw.c 2007-08-20 01:03:51 UTC (rev 
24568)
+++ branches/SAMBA_4_0/source/torture/raw/raw.c 2007-08-20 05:24:19 UTC (rev 
24569)
@@ -62,6 +62,8 @@
torture_suite_add_simple_test(suite, SAMBA3CLOSEERR, 
torture_samba3_closeerr);
torture_suite_add_simple_test(suite, SAMBA3CHECKFSP, 
torture_samba3_checkfsp);
torture_suite_add_simple_test(suite, SAMBA3BADPATH, 
torture_samba3_badpath);
+   torture_suite_add_simple_test(suite, SAMBA3CASEINSENSITIVE,
+ torture_samba3_caseinsensitive);
torture_suite_add_simple_test(suite, SCAN-EAMAX, torture_max_eas);
 
suite-description = talloc_strdup(suite, 

Modified: branches/SAMBA_4_0/source/torture/raw/rename.c
===
--- branches/SAMBA_4_0/source/torture/raw/rename.c  2007-08-20 01:03:51 UTC 
(rev 24568)
+++ branches/SAMBA_4_0/source/torture/raw/rename.c  2007-08-20 05:24:19 UTC 
(rev 24569)
@@ -51,6 +51,8 @@
int fnum = -1;
const char *fname1 = BASEDIR \\test1.txt;
const char *fname2 = BASEDIR \\test2.txt;
+   const char *Fname1 = BASEDIR \\Test1.txt;
+   union smb_fileinfo finfo;
union smb_open op;
 
printf(Testing SMBmv\n);
@@ -109,7 +111,25 @@
status = smb_raw_rename(cli-tree, io);
CHECK_STATUS(status, NT_STATUS_OK);
 
+   printf(Trying case-changing rename\n);
io.rename.in.pattern1 = fname1;
+   io.rename.in.pattern2 = Fname1;
+   status = smb_raw_rename(cli-tree, io);
+   CHECK_STATUS(status, NT_STATUS_OK);
+
+   finfo.generic.level = RAW_FILEINFO_ALL_INFO;
+   finfo.all_info.in.file.path = fname1;
+   status = smb_raw_pathinfo(cli-tree, mem_ctx, finfo);
+   CHECK_STATUS(status, NT_STATUS_OK);
+   if (strcmp(finfo.all_info.out.fname.s, Fname1) != 0) {
+   printf((%s) Incorrect filename [%s] after case-changing 
+  rename, should be [%s]\n, __location__,
+  finfo.all_info.out.fname.s, Fname1);
+   ret = False;
+   goto done;
+   }
+
+   io.rename.in.pattern1 = fname1;
io.rename.in.pattern2 = fname2;
 
printf(trying rename while not open\n);

Modified: branches/SAMBA_4_0/source/torture/raw/samba3misc.c
===
--- branches/SAMBA_4_0/source/torture/raw/samba3misc.c  2007-08-20 01:03:51 UTC 
(rev 24568)
+++ branches/SAMBA_4_0/source/torture/raw/samba3misc.c  2007-08-20 05:24:19 UTC 
(rev 24569)
@@ -598,3 +598,70 @@
 
return ret;
 }
+
+static void count_fn(struct clilist_file_info *info, const char *name,
+void *private_data)
+{
+   int *counter = (int *)private_data;
+   *counter += 1;
+}
+
+BOOL torture_samba3_caseinsensitive(struct torture_context *torture)
+{
+   struct smbcli_state *cli;
+   TALLOC_CTX *mem_ctx;
+   NTSTATUS status;
+   const char *dirname = insensitive;
+   const char *ucase_dirname = InSeNsItIvE;
+   const char *fname = foo;
+   char *fpath;
+   int fnum;
+   int counter = 0;
+   BOOL ret = True;
+
+   if (!(mem_ctx = talloc_init(torture_samba3_caseinsensitive))) {
+   d_printf(talloc_init failed\n);
+   return False;
+   }
+
+   if (!torture_open_connection(cli, 0)) {
+   goto done;
+   }
+
+   smbcli_deltree(cli-tree, dirname);
+
+   status = smbcli_mkdir(cli-tree, dirname);
+   if (!NT_STATUS_IS_OK(status)) {
+   d_printf(smbcli_mkdir failed: %s\n, nt_errstr(status));
+   goto done;
+   }
+
+   if (!(fpath = talloc_asprintf(mem_ctx, %s\\%s, dirname, fname))) {
+   goto done;
+   }
+   fnum = smbcli_open(cli-tree, fpath, O_RDWR | O_CREAT, DENY_NONE);
+   if (fnum == -1) {
+   d_printf(Could not create file %s: %s\n, fpath,
+smbcli_errstr(cli-tree));
+   goto done;
+   }
+   smbcli_close(cli-tree, fnum);
+
+   smbcli_list(cli-tree, talloc_asprintf(
+   mem_ctx, %s\\*, ucase_dirname),
+   FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN
+   |FILE_ATTRIBUTE_SYSTEM,
+   count_fn

svn commit: samba r24512 - in branches/SAMBA_3_2/source/smbd: .

2007-08-17 Thread vlendec
Author: vlendec
Date: 2007-08-17 10:05:14 + (Fri, 17 Aug 2007)
New Revision: 24512

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

Log:
Fix RAW-NOTIFY

With the inbuf consistency checks we have to more correctly fake the
inbuf

Modified:
   branches/SAMBA_3_2/source/smbd/notify.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/notify.c
===
--- branches/SAMBA_3_2/source/smbd/notify.c 2007-08-17 09:12:13 UTC (rev 
24511)
+++ branches/SAMBA_3_2/source/smbd/notify.c 2007-08-17 10:05:14 UTC (rev 
24512)
@@ -156,6 +156,7 @@
 {
prs_struct ps;
struct smb_request *req = NULL;
+   uint8 tmp_request[smb_size];
 
if (notify_buf-num_changes == -1) {
change_notify_reply_packet(request_buf, NT_STATUS_OK);
@@ -180,10 +181,17 @@
goto done;
}
 
-   smb_setlen(NULL, request_buf, smb_size);
+   memcpy(tmp_request, request_buf, smb_size);
 
-   init_smb_request(req, request_buf);
+   /*
+* We're only interested in the header fields here
+*/
 
+   smb_setlen(NULL, (char *)tmp_request, smb_size);
+   SCVAL(tmp_request, smb_wct, 0);
+
+   init_smb_request(req, tmp_request);
+
send_nt_replies(req, NT_STATUS_OK, prs_data_p(ps),
prs_offset(ps), NULL, 0);
 



svn commit: samba r24529 - in branches/SAMBA_4_0/source/torture/raw: .

2007-08-17 Thread vlendec
Author: vlendec
Date: 2007-08-17 19:48:27 + (Fri, 17 Aug 2007)
New Revision: 24529

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

Log:
Against samba3, treat EAS_NOT_SUPPORTED as acceptable for t2open

Many hosts in the build farm don't have EA support

Modified:
   branches/SAMBA_4_0/source/torture/raw/samba3misc.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/samba3misc.c
===
--- branches/SAMBA_4_0/source/torture/raw/samba3misc.c  2007-08-17 19:47:22 UTC 
(rev 24528)
+++ branches/SAMBA_4_0/source/torture/raw/samba3misc.c  2007-08-17 19:48:27 UTC 
(rev 24529)
@@ -537,9 +537,17 @@
CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS,ERRfilexists));
 
status = raw_smbcli_t2open(cli_nt-tree, fpath, O_RDONLY | O_CREAT| 
O_EXCL, DENY_NONE, NULL);
-   CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_COLLISION);
+   if (!NT_STATUS_EQUAL(status, NT_STATUS_EAS_NOT_SUPPORTED)
+   || !lp_parm_bool(-1, torture, samba3, False)) {
+   /* Against samba3, treat EAS_NOT_SUPPORTED as acceptable */
+   CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_COLLISION);
+   }
status = raw_smbcli_t2open(cli_dos-tree, fpath, O_RDONLY | O_CREAT| 
O_EXCL, DENY_NONE, NULL);
-   CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS,ERRfilexists));
+   if (!NT_STATUS_EQUAL(status, NT_STATUS_DOS(ERRDOS,ERReasnotsupported))
+   || !lp_parm_bool(-1, torture, samba3, False)) {
+   /* Against samba3, treat EAS_NOT_SUPPORTED as acceptable */
+   CHECK_STATUS(status, NT_STATUS_DOS(ERRDOS,ERRfilexists));
+   }
 
status = raw_smbcli_ntcreate(cli_nt-tree, fpath, NULL);
CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_COLLISION);



svn commit: samba r24485 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

2007-08-16 Thread vlendec
Author: vlendec
Date: 2007-08-16 12:15:52 + (Thu, 16 Aug 2007)
New Revision: 24485

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

Log:
Even in the failure case unix_convert must pass the already converted
part of the string to the caller.

Modified:
   branches/SAMBA_3_2/source/smbd/filename.c
   branches/SAMBA_3_2_0/source/smbd/filename.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/filename.c
===
--- branches/SAMBA_3_2/source/smbd/filename.c   2007-08-16 10:54:11 UTC (rev 
24484)
+++ branches/SAMBA_3_2/source/smbd/filename.c   2007-08-16 12:15:52 UTC (rev 
24485)
@@ -603,8 +603,8 @@
 
  done:
result = NT_STATUS_OK;
+ fail:
pstrcpy(orig_path, name);
- fail:
SAFE_FREE(name);
SAFE_FREE(dirpath);
return result;

Modified: branches/SAMBA_3_2_0/source/smbd/filename.c
===
--- branches/SAMBA_3_2_0/source/smbd/filename.c 2007-08-16 10:54:11 UTC (rev 
24484)
+++ branches/SAMBA_3_2_0/source/smbd/filename.c 2007-08-16 12:15:52 UTC (rev 
24485)
@@ -603,8 +603,8 @@
 
  done:
result = NT_STATUS_OK;
+ fail:
pstrcpy(orig_path, name);
- fail:
SAFE_FREE(name);
SAFE_FREE(dirpath);
return result;



svn commit: samba r24497 - in branches: SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

2007-08-16 Thread vlendec
Author: vlendec
Date: 2007-08-16 15:44:13 + (Thu, 16 Aug 2007)
New Revision: 24497

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

Log:
Revert r24485 -- this needs more thought
Modified:
   branches/SAMBA_3_2/source/smbd/filename.c
   branches/SAMBA_3_2_0/source/smbd/filename.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/filename.c
===
--- branches/SAMBA_3_2/source/smbd/filename.c   2007-08-16 15:32:00 UTC (rev 
24496)
+++ branches/SAMBA_3_2/source/smbd/filename.c   2007-08-16 15:44:13 UTC (rev 
24497)
@@ -603,8 +603,8 @@
 
  done:
result = NT_STATUS_OK;
+   pstrcpy(orig_path, name);
  fail:
-   pstrcpy(orig_path, name);
SAFE_FREE(name);
SAFE_FREE(dirpath);
return result;

Modified: branches/SAMBA_3_2_0/source/smbd/filename.c
===
--- branches/SAMBA_3_2_0/source/smbd/filename.c 2007-08-16 15:32:00 UTC (rev 
24496)
+++ branches/SAMBA_3_2_0/source/smbd/filename.c 2007-08-16 15:44:13 UTC (rev 
24497)
@@ -603,8 +603,8 @@
 
  done:
result = NT_STATUS_OK;
+   pstrcpy(orig_path, name);
  fail:
-   pstrcpy(orig_path, name);
SAFE_FREE(name);
SAFE_FREE(dirpath);
return result;



svn commit: samba r24453 - in branches/SAMBA_3_2/source: param smbd

2007-08-15 Thread vlendec
Author: vlendec
Date: 2007-08-15 09:52:09 + (Wed, 15 Aug 2007)
New Revision: 24453

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

Log:
Remove the read and write bmpx calls

Talked to both Tridge and Jeremy about this, Tridge said that there is a
special error message persuading OS/2 to fall back to other methods.
The calls now checked in always return the error message we used to
return when read bmpx = False was set (the default): ERRSRV, ERRuseSTD.

If someone has a reproducable test case where this is really needed, we
can always dig it up from version control and convert it to the new API.
But that time without that silly parameter, and with a torture test case
for make test please :-)

Volker

Modified:
   branches/SAMBA_3_2/source/param/loadparm.c
   branches/SAMBA_3_2/source/smbd/process.c
   branches/SAMBA_3_2/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_2/source/param/loadparm.c
===
--- branches/SAMBA_3_2/source/param/loadparm.c  2007-08-15 09:18:25 UTC (rev 
24452)
+++ branches/SAMBA_3_2/source/param/loadparm.c  2007-08-15 09:52:09 UTC (rev 
24453)
@@ -278,7 +278,6 @@
BOOL bLargeReadwrite;
BOOL bReadRaw;
BOOL bWriteRaw;
-   BOOL bReadbmpx;
BOOL bSyslogOnly;
BOOL bBrowseList;
BOOL bNISHomeMap;
@@ -991,7 +990,6 @@
{max protocol, P_ENUM, P_GLOBAL, Globals.maxprotocol, NULL, 
enum_protocol, FLAG_ADVANCED}, 
{protocol, P_ENUM, P_GLOBAL, Globals.maxprotocol, NULL, 
enum_protocol, FLAG_ADVANCED}, 
{min protocol, P_ENUM, P_GLOBAL, Globals.minprotocol, NULL, 
enum_protocol, FLAG_ADVANCED}, 
-   {read bmpx, P_BOOL, P_GLOBAL, Globals.bReadbmpx, NULL, NULL, 
FLAG_ADVANCED}, 
{read raw, P_BOOL, P_GLOBAL, Globals.bReadRaw, NULL, NULL, 
FLAG_ADVANCED}, 
{write raw, P_BOOL, P_GLOBAL, Globals.bWriteRaw, NULL, NULL, 
FLAG_ADVANCED}, 
{disable netbios, P_BOOL, P_GLOBAL, Globals.bDisableNetbios, NULL, 
NULL, FLAG_ADVANCED}, 
@@ -1536,7 +1534,6 @@
Globals.serverSchannel = Auto;
Globals.bReadRaw = True;
Globals.bWriteRaw = True;
-   Globals.bReadbmpx = False;
Globals.bNullPasswords = False;
Globals.bObeyPamRestrictions = False;
Globals.syslog = 1;
@@ -1973,7 +1970,6 @@
 FN_GLOBAL_BOOL(lp_local_master, Globals.bLocalMaster)
 FN_GLOBAL_BOOL(lp_domain_logons, Globals.bDomainLogons)
 FN_GLOBAL_BOOL(lp_load_printers, Globals.bLoadPrinters)
-FN_GLOBAL_BOOL(lp_readbmpx, Globals.bReadbmpx)
 FN_GLOBAL_BOOL(lp_readraw, Globals.bReadRaw)
 FN_GLOBAL_BOOL(lp_large_readwrite, Globals.bLargeReadwrite)
 FN_GLOBAL_BOOL(lp_writeraw, Globals.bWriteRaw)

Modified: branches/SAMBA_3_2/source/smbd/process.c
===
--- branches/SAMBA_3_2/source/smbd/process.c2007-08-15 09:18:25 UTC (rev 
24452)
+++ branches/SAMBA_3_2/source/smbd/process.c2007-08-15 09:52:09 UTC (rev 
24453)
@@ -717,11 +717,11 @@
 /* 0x18 */ { NULL, NULL, NULL, 0 },
 /* 0x19 */ { NULL, NULL, NULL, 0 },
 /* 0x1a */ { SMBreadbraw,NULL,reply_readbraw,AS_USER},
-/* 0x1b */ { SMBreadBmpx,reply_readbmpx,NULL,AS_USER},
-/* 0x1c */ { SMBreadBs,NULL, NULL,0 },
+/* 0x1b */ { SMBreadBmpx,NULL,reply_readbmpx,AS_USER},
+/* 0x1c */ { SMBreadBs,NULL,reply_readbs,AS_USER },
 /* 0x1d */ { SMBwritebraw,NULL,reply_writebraw,AS_USER},
-/* 0x1e */ { SMBwriteBmpx,reply_writebmpx,NULL,AS_USER},
-/* 0x1f */ { SMBwriteBs,reply_writebs,NULL,AS_USER},
+/* 0x1e */ { SMBwriteBmpx,NULL,reply_writebmpx,AS_USER},
+/* 0x1f */ { SMBwriteBs,NULL,reply_writebs,AS_USER},
 /* 0x20 */ { SMBwritec,NULL, NULL,0},
 /* 0x21 */ { NULL, NULL, NULL, 0 },
 /* 0x22 */ { SMBsetattrE,NULL,reply_setattrE,AS_USER | NEED_WRITE },

Modified: branches/SAMBA_3_2/source/smbd/reply.c
===
--- branches/SAMBA_3_2/source/smbd/reply.c  2007-08-15 09:18:25 UTC (rev 
24452)
+++ branches/SAMBA_3_2/source/smbd/reply.c  2007-08-15 09:52:09 UTC (rev 
24453)
@@ -6539,80 +6539,30 @@
 
 /
  Reply to a SMBreadbmpx (read block multiplex) request.
+ Always reply with an error, if someone has a platform really needs this,
+ please contact [EMAIL PROTECTED]
 /
 
-int reply_readbmpx(connection_struct *conn, char *inbuf,char *outbuf,int 
length,int bufsize)
+void reply_readbmpx(connection_struct *conn, struct smb_request *req)
 {
-   ssize_t nread = -1;
-   ssize_t total_read;
-   char *data;
-   SMB_OFF_T startpos;
-   int outsize;
-   size_t maxcount;
-   int max_per_packet;
-   size_t tcount;
-   int pad;
-   files_struct *fsp = file_fsp(SVAL(inbuf,smb_vwv0));
START_PROFILE(SMBreadBmpx);
+   reply_doserror(req, ERRSRV, ERRuseSTD

svn commit: samba-docs r1151 - in trunk/smbdotconf/protocol: .

2007-08-15 Thread vlendec
Author: vlendec
Date: 2007-08-15 09:53:04 + (Wed, 15 Aug 2007)
New Revision: 1151

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

Log:
Remove read bmpx man page entry
Removed:
   trunk/smbdotconf/protocol/readbmpx.xml


Changeset:
Deleted: trunk/smbdotconf/protocol/readbmpx.xml
===
--- trunk/smbdotconf/protocol/readbmpx.xml  2007-08-14 14:41:48 UTC (rev 
1150)
+++ trunk/smbdotconf/protocol/readbmpx.xml  2007-08-15 09:53:04 UTC (rev 
1151)
@@ -1,16 +0,0 @@
-samba:parameter name=read bmpx
- context=G
-type=boolean
- developer=1
- xmlns:samba=http://www.samba.org/samba/DTD/samba-doc;
-description
-paraThis boolean parameter controls whether
-citerefentryrefentrytitlesmbd/refentrytitle  
 
-manvolnum8/manvolnum/citerefentry will support the quot;Read
-Block Multiplexquot; SMB. This is now rarely used and defaults to 
-constantno/constant. You should never need to set this 
-   parameter./para
-/description
-
-value type=defaultno/value
-/samba:parameter



svn commit: samba r24457 - in branches/SAMBA_3_2/source/smbd: .

2007-08-15 Thread vlendec
Author: vlendec
Date: 2007-08-15 10:29:47 + (Wed, 15 Aug 2007)
New Revision: 24457

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

Log:
Convert reply_tcon to the new API

Jeremy, I really apologize for doing this, but I just wanted to enjoy
converting the last SMB call :-)

I've left one little task for you there, I'm not certain that checking
the inbuf length is correct here.

Volker

Modified:
   branches/SAMBA_3_2/source/smbd/process.c
   branches/SAMBA_3_2/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/process.c
===
--- branches/SAMBA_3_2/source/smbd/process.c2007-08-15 10:28:53 UTC (rev 
24456)
+++ branches/SAMBA_3_2/source/smbd/process.c2007-08-15 10:29:47 UTC (rev 
24457)
@@ -802,7 +802,7 @@
 /* 0x6d */ { NULL, NULL, NULL, 0 },
 /* 0x6e */ { NULL, NULL, NULL, 0 },
 /* 0x6f */ { NULL, NULL, NULL, 0 },
-/* 0x70 */ { SMBtcon,reply_tcon,NULL,0},
+/* 0x70 */ { SMBtcon,NULL,reply_tcon,0},
 /* 0x71 */ { SMBtdis,NULL,reply_tdis,DO_CHDIR},
 /* 0x72 */ { SMBnegprot,NULL,reply_negprot,0},
 /* 0x73 */ { SMBsesssetupX,NULL,reply_sesssetup_and_X,0},

Modified: branches/SAMBA_3_2/source/smbd/reply.c
===
--- branches/SAMBA_3_2/source/smbd/reply.c  2007-08-15 10:28:53 UTC (rev 
24456)
+++ branches/SAMBA_3_2/source/smbd/reply.c  2007-08-15 10:29:47 UTC (rev 
24457)
@@ -429,16 +429,12 @@
  conn POINTER CAN BE NULL HERE !
 /
 
-int reply_tcon(connection_struct *conn,
-  char *inbuf,char *outbuf, int dum_size, int dum_buffsize)
+void reply_tcon(connection_struct *conn, struct smb_request *req)
 {
-   TALLOC_CTX *ctx;
const char *service;
char *service_buf = NULL;
char *password = NULL;
char *dev = NULL;
-   int outsize = 0;
-   uint16 vuid = SVAL(inbuf,smb_uid);
int pwlen=0;
NTSTATUS nt_status;
char *p;
@@ -446,25 +442,26 @@
 
START_PROFILE(SMBtcon);
 
-   ctx = talloc_init(reply_tcon);
-   if (!ctx) {
-   END_PROFILE(SMBtcon);
-   return ERROR_NT(NT_STATUS_NO_MEMORY);
-   }
+   /
+* Warning! I'm not sure that the inbuf length check is actually 
+* correct here. -- vl
+*
+* Jeremy, please check and remove this comment :-)
+/
 
-   p = smb_buf(inbuf)+1;
-   p += srvstr_pull_buf_talloc(ctx, inbuf, SVAL(inbuf, smb_flg2),
-   service_buf, p, STR_TERMINATE) + 1;
-   pwlen = srvstr_pull_buf_talloc(ctx, inbuf, SVAL(inbuf, smb_flg2),
-   password, p, STR_TERMINATE) + 1;
+   p = smb_buf(req-inbuf)+1;
+   p += srvstr_pull_buf_talloc(req, req-inbuf, req-flags2,
+   service_buf, p, STR_TERMINATE) + 1;
+   pwlen = srvstr_pull_buf_talloc(req, req-inbuf, req-flags2,
+  password, p, STR_TERMINATE) + 1;
p += pwlen;
-   p += srvstr_pull_buf_talloc(ctx, inbuf, SVAL(inbuf, smb_flg2),
-   dev, p, STR_TERMINATE) + 1;
+   p += srvstr_pull_buf_talloc(req, req-inbuf, req-flags2,
+   dev, p, STR_TERMINATE) + 1;
 
if (service_buf == NULL || password == NULL || dev == NULL) {
-   TALLOC_FREE(ctx);
+   reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
END_PROFILE(SMBtcon);
-   return ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+   return;
}
p = strrchr_m(service_buf,'\\');
if (p) {
@@ -475,27 +472,26 @@
 
password_blob = data_blob(password, pwlen+1);
 
-   conn = make_connection(service,password_blob,dev,vuid,nt_status);
+   conn = make_connection(service,password_blob,dev,req-vuid,nt_status);
 
data_blob_clear_free(password_blob);
 
if (!conn) {
-   TALLOC_FREE(ctx);
+   reply_nterror(req, nt_status);
END_PROFILE(SMBtcon);
-   return ERROR_NT(nt_status);
+   return;
}
 
-   outsize = set_message(inbuf,outbuf,2,0,True);
-   SSVAL(outbuf,smb_vwv0,max_recv);
-   SSVAL(outbuf,smb_vwv1,conn-cnum);
-   SSVAL(outbuf,smb_tid,conn-cnum);
+   reply_outbuf(req, 2, 0);
+   SSVAL(req-outbuf,smb_vwv0,max_recv);
+   SSVAL(req-outbuf,smb_vwv1,conn-cnum);
+   SSVAL(req-outbuf,smb_tid,conn-cnum);
 
DEBUG(3,(tcon service=%s cnum=%d\n, 
 service, conn-cnum));
 
END_PROFILE(SMBtcon);
-   TALLOC_FREE(ctx);
-   return(outsize);
+   return;
 }
 
 /



svn commit: samba r24461 - in branches: SAMBA_3_0_25/source/smbd SAMBA_3_2/source/smbd SAMBA_3_2_0/source/smbd

2007-08-15 Thread vlendec
Author: vlendec
Date: 2007-08-15 13:44:34 + (Wed, 15 Aug 2007)
New Revision: 24461

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

Log:
Fix Bug 4852, thank to anto [EMAIL PROTECTED] for reporting it.

Modified:
   branches/SAMBA_3_0_25/source/smbd/reply.c
   branches/SAMBA_3_2/source/smbd/reply.c
   branches/SAMBA_3_2_0/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/smbd/reply.c
===
--- branches/SAMBA_3_0_25/source/smbd/reply.c   2007-08-15 13:44:33 UTC (rev 
24460)
+++ branches/SAMBA_3_0_25/source/smbd/reply.c   2007-08-15 13:44:34 UTC (rev 
24461)
@@ -1455,6 +1455,16 @@
/* We have re-scheduled this call. */
return -1;
}
+   if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
+   /*
+* We hit an existing file, and if we're returning DOS
+* error codes OBJECT_NAME_COLLISION would map to
+* ERRDOS/183, we need to return ERRDOS/80, see bug
+* 4852.
+*/
+   return ERROR_BOTH(NT_STATUS_OBJECT_NAME_COLLISION,
+ ERRDOS, ERRfilexists);
+   }
return ERROR_NT(status);
}
 

Modified: branches/SAMBA_3_2/source/smbd/reply.c
===
--- branches/SAMBA_3_2/source/smbd/reply.c  2007-08-15 13:44:33 UTC (rev 
24460)
+++ branches/SAMBA_3_2/source/smbd/reply.c  2007-08-15 13:44:34 UTC (rev 
24461)
@@ -1718,9 +1718,23 @@
END_PROFILE(SMBopenX);
if (open_was_deferred(req-mid)) {
/* We have re-scheduled this call. */
+   END_PROFILE(SMBopenX);
return;
}
+   if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
+   /*
+* We hit an existing file, and if we're returning DOS
+* error codes OBJECT_NAME_COLLISION would map to
+* ERRDOS/183, we need to return ERRDOS/80, see bug
+* 4852.
+*/
+   reply_botherror(req, NT_STATUS_OBJECT_NAME_COLLISION,
+   ERRDOS, ERRfilexists);
+   END_PROFILE(SMBopenX);
+   return;
+   }
reply_nterror(req, status);
+   END_PROFILE(SMBopenX);
return;
}
 

Modified: branches/SAMBA_3_2_0/source/smbd/reply.c
===
--- branches/SAMBA_3_2_0/source/smbd/reply.c2007-08-15 13:44:33 UTC (rev 
24460)
+++ branches/SAMBA_3_2_0/source/smbd/reply.c2007-08-15 13:44:34 UTC (rev 
24461)
@@ -1505,6 +1505,16 @@
/* We have re-scheduled this call. */
return -1;
}
+   if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
+   /*
+* We hit an existing file, and if we're returning DOS
+* error codes OBJECT_NAME_COLLISION would map to
+* ERRDOS/183, we need to return ERRDOS/80, see bug
+* 4852.
+*/
+   return ERROR_BOTH(NT_STATUS_OBJECT_NAME_COLLISION,
+ ERRDOS, ERRfilexists);
+   }
return ERROR_NT(status);
}
 



svn commit: samba r24392 - in branches/SAMBA_3_2/source/smbd: .

2007-08-14 Thread vlendec
Author: vlendec
Date: 2007-08-14 06:18:55 + (Tue, 14 Aug 2007)
New Revision: 24392

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

Log:
Minor simplifications
Modified:
   branches/SAMBA_3_2/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/reply.c
===
--- branches/SAMBA_3_2/source/smbd/reply.c  2007-08-14 05:58:13 UTC (rev 
24391)
+++ branches/SAMBA_3_2/source/smbd/reply.c  2007-08-14 06:18:55 UTC (rev 
24392)
@@ -2459,9 +2459,7 @@
DATA_BLOB header_blob;
 
_smb_setlen(header,nread);
-   header_blob.data = (uint8 *)header;
-   header_blob.length = 4;
-   header_blob.free = NULL;
+   header_blob = data_blob_const(header, 4);
 
if ( SMB_VFS_SENDFILE( smbd_server_fd(), fsp, fsp-fh-fd,
header_blob, startpos, nread) == -1) {
@@ -2594,7 +2592,7 @@
flush_write_cache(fsp, READRAW_FLUSH);
 
startpos = IVAL_TO_SMB_OFF_T(req-inbuf,smb_vwv1);
-   if(CVAL(req-inbuf,smb_wct) == 10) {
+   if(req-wct == 10) {
/*
 * This is a large offset (64 bit) read.
 */



svn commit: samba r24393 - in branches/SAMBA_3_2/source/smbd: .

2007-08-14 Thread vlendec
Author: vlendec
Date: 2007-08-14 06:21:02 + (Tue, 14 Aug 2007)
New Revision: 24393

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

Log:
Convert call_nt_transact_set_user_quota to the new API
Modified:
   branches/SAMBA_3_2/source/smbd/nttrans.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/nttrans.c
===
--- branches/SAMBA_3_2/source/smbd/nttrans.c2007-08-14 06:18:55 UTC (rev 
24392)
+++ branches/SAMBA_3_2/source/smbd/nttrans.c2007-08-14 06:21:02 UTC (rev 
24393)
@@ -2983,10 +2983,15 @@
  Reply to set user quota
 /
 
-static int call_nt_transact_set_user_quota(connection_struct *conn, char 
*inbuf, char *outbuf, int length, int bufsize, 
-  uint16 **ppsetup, uint32 setup_count,
- char **ppparams, uint32 parameter_count,
- char **ppdata, uint32 data_count, uint32 
max_data_count)
+static void call_nt_transact_set_user_quota(connection_struct *conn,
+   struct smb_request *req,
+   uint16 **ppsetup,
+   uint32 setup_count,
+   char **ppparams,
+   uint32 parameter_count,
+   char **ppdata,
+   uint32 data_count,
+   uint32 max_data_count)
 {
char *params = *ppparams;
char *pdata = *ppdata;
@@ -3002,7 +3007,8 @@
if (current_user.ut.uid != 0) {
DEBUG(1,(set_user_quota: access_denied service [%s] user 
[%s]\n,
lp_servicename(SNUM(conn)),conn-user));
-   return ERROR_DOS(ERRDOS,ERRnoaccess);
+   reply_doserror(req, ERRDOS, ERRnoaccess);
+   return;
}
 
/*
@@ -3011,19 +3017,22 @@
 
if (parameter_count  2) {
DEBUG(0,(TRANSACT_SET_USER_QUOTA: requires %d = 2 bytes 
parameters\n,parameter_count));
-   return ERROR_DOS(ERRDOS,ERRinvalidparam);
+   reply_doserror(req, ERRDOS, ERRinvalidparam);
+   return;
}

/* maybe we can check the quota_fnum */
fsp = file_fsp(SVAL(params,0));
if (!CHECK_NTQUOTA_HANDLE_OK(fsp,conn)) {
DEBUG(3,(TRANSACT_GET_USER_QUOTA: no valid QUOTA HANDLE\n));
-   return ERROR_NT(NT_STATUS_INVALID_HANDLE);
+   reply_nterror(req, NT_STATUS_INVALID_HANDLE);
+   return;
}
 
if (data_count  40) {
DEBUG(0,(TRANSACT_SET_USER_QUOTA: requires %d = %d bytes 
data\n,data_count,40));
-   return ERROR_DOS(ERRDOS,ERRunknownlevel);   
+   reply_doserror(req, ERRDOS, ERRunknownlevel);
+   return;
}
 
/* offset to next quota record.
@@ -3036,7 +3045,8 @@
 
if (data_count  40+sid_len) {
DEBUG(0,(TRANSACT_SET_USER_QUOTA: requires %d = %lu bytes 
data\n,data_count,(unsigned long)40+sid_len));
-   return ERROR_DOS(ERRDOS,ERRunknownlevel);   
+   reply_doserror(req, ERRDOS, ERRunknownlevel);
+   return;
}
 
/* unknown 8 bytes in pdata 
@@ -3052,7 +3062,8 @@
((qt.usedspace != 0x)||
(IVAL(pdata,20)!=0x))) {
/* more than 32 bits? */
-   return ERROR_DOS(ERRDOS,ERRunknownlevel);
+   reply_doserror(req, ERRDOS, ERRunknownlevel);
+   return;
}
 #endif /* LARGE_SMB_OFF_T */
 
@@ -3065,7 +3076,8 @@
((qt.softlim != 0x)||
(IVAL(pdata,28)!=0x))) {
/* more than 32 bits? */
-   return ERROR_DOS(ERRDOS,ERRunknownlevel);
+   reply_doserror(req, ERRDOS, ERRunknownlevel);
+   return;
}
 #endif /* LARGE_SMB_OFF_T */
 
@@ -3078,7 +3090,8 @@
((qt.hardlim != 0x)||
(IVAL(pdata,36)!=0x))) {
/* more than 32 bits? */
-   return ERROR_DOS(ERRDOS,ERRunknownlevel);
+   reply_doserror(req, ERRDOS, ERRunknownlevel);
+   return;
}
 #endif /* LARGE_SMB_OFF_T */

@@ -3088,13 +3101,12 @@
/* 44 unknown bytes left... */
 
if (vfs_set_ntquota(fsp, SMB_USER_QUOTA_TYPE, sid, qt)!=0) {
-   return ERROR_DOS(ERRSRV,ERRerror);  
+   reply_doserror(req, ERRSRV, ERRerror);
+   return;
}
 
-   send_nt_replies(inbuf, outbuf, bufsize, NT_STATUS_OK, params, param_len,
-   pdata, data_len);
-
-   return -1

svn commit: samba r24394 - in branches/SAMBA_3_2/source/smbd: .

2007-08-14 Thread vlendec
Author: vlendec
Date: 2007-08-14 06:52:30 + (Tue, 14 Aug 2007)
New Revision: 24394

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

Log:
Convert call_nt_transact_rename to the new API
Modified:
   branches/SAMBA_3_2/source/smbd/nttrans.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/nttrans.c
===
--- branches/SAMBA_3_2/source/smbd/nttrans.c2007-08-14 06:21:02 UTC (rev 
24393)
+++ branches/SAMBA_3_2/source/smbd/nttrans.c2007-08-14 06:52:30 UTC (rev 
24394)
@@ -2167,10 +2167,12 @@
  Reply to an NT transact rename command.
 /
 
-static int call_nt_transact_rename(connection_struct *conn, char *inbuf, char 
*outbuf, int length, int bufsize,
-  uint16 **ppsetup, uint32 setup_count,
- char **ppparams, uint32 parameter_count,
- char **ppdata, uint32 data_count, uint32 
max_data_count)
+static void call_nt_transact_rename(connection_struct *conn,
+   struct smb_request *req,
+   uint16 **ppsetup, uint32 setup_count,
+   char **ppparams, uint32 parameter_count,
+   char **ppdata, uint32 data_count,
+   uint32 max_data_count)
 {
char *params = *ppparams;
pstring new_name;
@@ -2178,44 +2180,46 @@
BOOL replace_if_exists = False;
BOOL dest_has_wcard = False;
NTSTATUS status;
-   struct smb_request req;
 
-   init_smb_request(req, (uint8 *)inbuf);
-
 if(parameter_count  5) {
-   return ERROR_DOS(ERRDOS,ERRbadfunc);
+   reply_doserror(req, ERRDOS, ERRbadfunc);
+   return;
}
 
fsp = file_fsp(SVAL(params, 0));
replace_if_exists = (SVAL(params,2)  RENAME_REPLACE_IF_EXISTS) ? True 
: False;
-   CHECK_FSP(fsp, conn);
-   srvstr_get_path_wcard(inbuf, SVAL(inbuf,smb_flg2), new_name, params+4,
+   if (!check_fsp(conn, req, fsp, current_user)) {
+   return;
+   }
+   srvstr_get_path_wcard(params, req-flags2, new_name, params+4,
  sizeof(new_name), parameter_count - 4,
  STR_TERMINATE, status, dest_has_wcard);
if (!NT_STATUS_IS_OK(status)) {
-   return ERROR_NT(status);
+   reply_nterror(req, status);
+   return;
}
 
-   status = rename_internals(conn, req, fsp-fsp_name,
+   status = rename_internals(conn, req, fsp-fsp_name,
  new_name, 0, replace_if_exists, False, 
dest_has_wcard);
 
if (!NT_STATUS_IS_OK(status)) {
-   if (open_was_deferred(SVAL(inbuf,smb_mid))) {
+   if (open_was_deferred(req-mid)) {
/* We have re-scheduled this call. */
-   return -1;
+   return;
}
-   return ERROR_NT(status);
+   reply_nterror(req, status);
+   return;
}
 
/*
 * Rename was successful.
 */
-   send_nt_replies(inbuf, outbuf, bufsize, NT_STATUS_OK, NULL, 0, NULL, 0);
+   send_nt_replies_new(req, NT_STATUS_OK, NULL, 0, NULL, 0);

DEBUG(3,(nt transact rename from = %s, to = %s succeeded.\n, 
 fsp-fsp_name, new_name));

-   return -1;
+   return;
 }
 
 /**
@@ -3190,28 +3194,13 @@
 
case NT_TRANSACT_RENAME:
{
-   char *inbuf, *outbuf;
-   int size, bufsize;
-
START_PROFILE(NT_transact_rename);
-
-   if (!reply_prep_legacy(req, inbuf, outbuf, size,
-  bufsize)) {
-   reply_nterror(req, NT_STATUS_NO_MEMORY);
-   END_PROFILE(SMBnttrans);
-   return;
-   }
-
-   reply_post_legacy(
-   req,
-   call_nt_transact_rename(
-   conn, inbuf, outbuf,
-   size, bufsize,
-   state-setup, state-setup_count,
-   state-param, state-total_param,
-   state-data, state-total_data,
-   state-max_data_return));
-
+   call_nt_transact_rename(
+   conn, req,
+   state-setup, state-setup_count

svn commit: samba r24398 - in branches/SAMBA_3_2/source/smbd: .

2007-08-14 Thread vlendec
Author: vlendec
Date: 2007-08-14 07:39:11 + (Tue, 14 Aug 2007)
New Revision: 24398

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

Log:
Convert call_nt_transact_notify_change to the new API
Modified:
   branches/SAMBA_3_2/source/smbd/notify.c
   branches/SAMBA_3_2/source/smbd/nttrans.c


Changeset:
Modified: branches/SAMBA_3_2/source/smbd/notify.c
===
--- branches/SAMBA_3_2/source/smbd/notify.c 2007-08-14 07:21:10 UTC (rev 
24397)
+++ branches/SAMBA_3_2/source/smbd/notify.c 2007-08-14 07:39:11 UTC (rev 
24398)
@@ -24,7 +24,7 @@
 struct notify_change_request {
struct notify_change_request *prev, *next;
struct files_struct *fsp;   /* backpointer for cancel by mid */
-   char request_buf[smb_size];
+   uint8 request_buf[smb_size];
uint32 filter;
uint32 max_param;
struct notify_mid_map *mid_map;
@@ -128,14 +128,14 @@
  Setup the common parts of the return packet and send it.
 */
 
-static void change_notify_reply_packet(const char *request_buf,
+static void change_notify_reply_packet(const uint8 *request_buf,
   NTSTATUS error_code)
 {
-   const char *inbuf = request_buf;
+   const char *inbuf = (char *)request_buf;
char outbuf[smb_size+38];
 
memset(outbuf, '\0', sizeof(outbuf));
-   construct_reply_common(request_buf, outbuf);
+   construct_reply_common(inbuf, outbuf);
 
ERROR_NT(error_code);
 
@@ -151,7 +151,7 @@
failed.);
 }
 
-void change_notify_reply(const char *request_buf, uint32 max_param,
+void change_notify_reply(const uint8 *request_buf, uint32 max_param,
 struct notify_change_buf *notify_buf)
 {
char *outbuf = NULL;
@@ -183,9 +183,9 @@
goto done;
}
 
-   construct_reply_common(request_buf, outbuf);
+   construct_reply_common((char *)request_buf, outbuf);
 
-   if (send_nt_replies(request_buf, outbuf, buflen, NT_STATUS_OK, 
prs_data_p(ps),
+   if (send_nt_replies((char *)request_buf, outbuf, buflen, NT_STATUS_OK, 
prs_data_p(ps),
prs_offset(ps), NULL, 0) == -1) {
exit_server(change_notify_reply_packet: send_smb failed.);
}
@@ -238,7 +238,7 @@
return status;
 }
 
-NTSTATUS change_notify_add_request(const char *inbuf, uint32 max_param,
+NTSTATUS change_notify_add_request(const uint8 *inbuf, uint32 max_param,
   uint32 filter, BOOL recursive,
   struct files_struct *fsp)
 {

Modified: branches/SAMBA_3_2/source/smbd/nttrans.c
===
--- branches/SAMBA_3_2/source/smbd/nttrans.c2007-08-14 07:21:10 UTC (rev 
24397)
+++ branches/SAMBA_3_2/source/smbd/nttrans.c2007-08-14 07:39:11 UTC (rev 
24398)
@@ -2071,15 +2071,15 @@
  don't allow a directory to be opened.
 /
 
-static int call_nt_transact_notify_change(connection_struct *conn, char *inbuf,
- char *outbuf, int length,
- int bufsize, 
- uint16 **ppsetup, uint32 setup_count,
- char **ppparams,
- uint32 parameter_count,
- char **ppdata, uint32 data_count,
- uint32 max_data_count,
- uint32 max_param_count)
+static void call_nt_transact_notify_change(connection_struct *conn,
+  struct smb_request *req,
+  uint16 **ppsetup,
+  uint32 setup_count,
+  char **ppparams,
+  uint32 parameter_count,
+  char **ppdata, uint32 data_count,
+  uint32 max_data_count,
+  uint32 max_param_count)
 {
uint16 *setup = *ppsetup;
files_struct *fsp;
@@ -2088,7 +2088,8 @@
BOOL recursive;
 
if(setup_count  6) {
-   return ERROR_DOS(ERRDOS,ERRbadfunc);
+   reply_doserror(req, ERRDOS, ERRbadfunc);
+   return;
}
 
fsp = file_fsp(SVAL(setup,4));
@@ -2098,14 +2099,16 @@
DEBUG(3,(call_nt_transact_notify_change\n));
 
if(!fsp) {
-   return ERROR_DOS(ERRDOS,ERRbadfid);
+   reply_doserror(req, ERRDOS, ERRbadfid);
+   return

  1   2   3   4   5   6   7   8   9   10   >