svn commit: samba r3355 - in branches/SAMBA_4_0/source/smb_server: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-29 06:01:51 + (Fri, 29 Oct 2004)
New Revision: 3355

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3355

Log:
fixed the old style search code in smb_server to correctly handle
searches that go beyond the negotiated max xmit size

Modified:
   branches/SAMBA_4_0/source/smb_server/search.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/search.c
===
--- branches/SAMBA_4_0/source/smb_server/search.c   2004-10-29 06:01:00 UTC (rev 
3354)
+++ branches/SAMBA_4_0/source/smb_server/search.c   2004-10-29 06:01:51 UTC (rev 
3355)
@@ -65,10 +65,14 @@
 /*
   fill a single entry in a search find reply 
 */
-static void find_fill_info(struct smbsrv_request *req,
+static BOOL find_fill_info(struct smbsrv_request *req,
   union smb_search_data *file)
 {
char *p;
+
+   if (req->out.data_size + 43 > req_max_data(req)) {
+   return False;
+   }

req_grow_data(req, req->out.data_size + 43);
p = req->out.data + req->out.data_size - 43;
@@ -84,6 +88,8 @@
memset(p+30, ' ', 12);
memcpy(p+30, file->search.name, MIN(strlen(file->search.name)+1, 12));
SCVAL(p,42,0);
+
+   return True;
 }
 
 /* callback function for search first/next */
@@ -91,9 +97,7 @@
 {
struct search_state *state = (struct search_state *)private;
 
-   find_fill_info(state->req, file);
-
-   return True;
+   return find_fill_info(state->req, file);
 }
 
 /



svn commit: samba r3354 - in branches/SAMBA_4_0/source: include libcli/raw

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-29 06:01:00 + (Fri, 29 Oct 2004)
New Revision: 3354

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3354

Log:
honor "max xmit" and "max mux" from smb.conf in our client code. This
is important as it allows the test suite to exercise the multiple
reply logic in smbd for trans2 search replies.

Modified:
   branches/SAMBA_4_0/source/include/cli_context.h
   branches/SAMBA_4_0/source/libcli/raw/clisession.c
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c
   branches/SAMBA_4_0/source/libcli/raw/rawnegotiate.c


Changeset:
Modified: branches/SAMBA_4_0/source/include/cli_context.h
===
--- branches/SAMBA_4_0/source/include/cli_context.h 2004-10-29 05:58:22 UTC (rev 
3353)
+++ branches/SAMBA_4_0/source/include/cli_context.h 2004-10-29 06:01:00 UTC (rev 
3354)
@@ -91,6 +91,8 @@
uint_t use_oplocks:1;
uint_t use_level2_oplocks:1;
uint_t use_spnego:1;
+   uint32_t max_xmit;
+   uint16_t max_mux;
 };
 
 /* this is the context for the client transport layer */

Modified: branches/SAMBA_4_0/source/libcli/raw/clisession.c
===
--- branches/SAMBA_4_0/source/libcli/raw/clisession.c   2004-10-29 05:58:22 UTC (rev 
3353)
+++ branches/SAMBA_4_0/source/libcli/raw/clisession.c   2004-10-29 06:01:00 UTC (rev 
3354)
@@ -263,8 +263,8 @@
 
/* use the old interface */
s2.generic.level = RAW_SESSSETUP_OLD;
-   s2.old.in.bufsize = ~0;
-   s2.old.in.mpx_max = 50;
+   s2.old.in.bufsize = session->transport->options.max_xmit;
+   s2.old.in.mpx_max = session->transport->options.max_mux;
s2.old.in.vc_num = 1;
s2.old.in.sesskey = parms->generic.in.sesskey;
s2.old.in.domain = parms->generic.in.domain;
@@ -311,8 +311,8 @@
union smb_sesssetup s2;
 
s2.generic.level = RAW_SESSSETUP_NT1;
-   s2.nt1.in.bufsize = ~0;
-   s2.nt1.in.mpx_max = 50;
+   s2.nt1.in.bufsize = session->transport->options.max_xmit;
+   s2.nt1.in.mpx_max = session->transport->options.max_mux;
s2.nt1.in.vc_num = 1;
s2.nt1.in.sesskey = parms->generic.in.sesskey;
s2.nt1.in.capabilities = parms->generic.in.capabilities;
@@ -371,8 +371,8 @@
const char *chosen_oid;
 
s2.generic.level = RAW_SESSSETUP_SPNEGO;
-   s2.spnego.in.bufsize = ~0;
-   s2.spnego.in.mpx_max = 50;
+   s2.spnego.in.bufsize = session->transport->options.max_xmit;
+   s2.spnego.in.mpx_max = session->transport->options.max_mux;
s2.spnego.in.vc_num = 1;
s2.spnego.in.sesskey = parms->generic.in.sesskey;
s2.spnego.in.capabilities = parms->generic.in.capabilities;

Modified: branches/SAMBA_4_0/source/libcli/raw/clitransport.c
===
--- branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2004-10-29 05:58:22 UTC (rev 
3353)
+++ branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2004-10-29 06:01:00 UTC (rev 
3354)
@@ -76,7 +76,10 @@
transport->socket = talloc_reference(transport, sock);
transport->negotiate.protocol = PROTOCOL_NT1;
transport->options.use_spnego = lp_use_spnego();
-   transport->negotiate.max_xmit = ~0;
+   transport->options.max_xmit = lp_max_xmit();
+   transport->options.max_mux = lp_maxmux();
+
+   transport->negotiate.max_xmit = transport->options.max_xmit;

smbcli_init_signing(transport);
 

Modified: branches/SAMBA_4_0/source/libcli/raw/rawnegotiate.c
===
--- branches/SAMBA_4_0/source/libcli/raw/rawnegotiate.c 2004-10-29 05:58:22 UTC (rev 
3353)
+++ branches/SAMBA_4_0/source/libcli/raw/rawnegotiate.c 2004-10-29 06:01:00 UTC (rev 
3354)
@@ -169,7 +169,7 @@
/* the old core protocol */
transport->negotiate.sec_mode = 0;
transport->negotiate.server_time = time(NULL);
-   transport->negotiate.max_xmit = ~0;
+   transport->negotiate.max_xmit = transport->options.max_xmit;
transport->negotiate.server_zone = 
get_time_zone(transport->negotiate.server_time);
}
 



svn commit: samba r3353 - in branches/SAMBA_4_0/source/ntvfs/posix: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-29 05:58:22 + (Fri, 29 Oct 2004)
New Revision: 3353

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3353

Log:
don't reference dos.attrib unless its initialised


Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c2004-10-29 05:31:35 
UTC (rev 3352)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c2004-10-29 05:58:22 
UTC (rev 3353)
@@ -510,7 +510,7 @@
inode = name->st.st_ino;
}
 
-   if (name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) {
+   if (name->exists && (name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY)) {
if (stat(name->full_name, &name->st) == -1) {
return NT_STATUS_INVALID_HANDLE;
}



svn commit: samba r3352 - in branches/SAMBA_4_0/source/libcli: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-29 05:31:35 + (Fri, 29 Oct 2004)
New Revision: 3352

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3352

Log:
make smbcli_read() and smbcli_write() work with very small negotiated SMB buffer sizes

Modified:
   branches/SAMBA_4_0/source/libcli/clireadwrite.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/clireadwrite.c
===
--- branches/SAMBA_4_0/source/libcli/clireadwrite.c 2004-10-29 04:43:28 UTC (rev 
3351)
+++ branches/SAMBA_4_0/source/libcli/clireadwrite.c 2004-10-29 05:31:35 UTC (rev 
3352)
@@ -42,8 +42,7 @@
 * Set readsize to the maximum size we can handle in one readX,
 * rounded down to a multiple of 1024.
 */
-   readsize = (tree->session->transport->negotiate.max_xmit - 
-   (MIN_SMB_SIZE+32)) & ~1023;
+   readsize = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32));
if (readsize > 0x) readsize = 0x;
 
while (total < size) {
@@ -87,7 +86,7 @@
 const uint8_t *buf, off_t offset, size_t size)
 {
union smb_write parms;
-   int block = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32)) 
& ~1023;
+   int block = (tree->session->transport->negotiate.max_xmit - (MIN_SMB_SIZE+32));
ssize_t total = 0;
 
if (size == 0) {



svn commit: samba r3351 - in branches/SAMBA_4_0/source/ntvfs/posix: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-29 04:43:28 + (Fri, 29 Oct 2004)
New Revision: 3351

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3351

Log:
handle far more operations on open directory handles. pvfs was failing
with a wxp client because of qfileinfo operations on directories
failing with NT_STATUS_INVALID_HANDLE after the fstat() failed (as
pvfs sets f->fd to -1 for directories)

Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_flush.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_setfileinfo.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_flush.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_flush.c  2004-10-29 03:48:49 UTC (rev 
3350)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_flush.c  2004-10-29 04:43:28 UTC (rev 
3351)
@@ -28,6 +28,9 @@
 */
 static void pvfs_flush_file(struct pvfs_state *pvfs, struct pvfs_file *f)
 {
+   if (f->name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) {
+   return;
+   }
if (pvfs->flags & PVFS_FLAG_STRICT_SYNC) {
fsync(f->fd);
}

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c2004-10-29 03:48:49 
UTC (rev 3350)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_resolve.c2004-10-29 04:43:28 
UTC (rev 3351)
@@ -510,8 +510,14 @@
inode = name->st.st_ino;
}
 
-   if (fstat(fd, &name->st) == -1) {
-   return NT_STATUS_INVALID_HANDLE;
+   if (name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) {
+   if (stat(name->full_name, &name->st) == -1) {
+   return NT_STATUS_INVALID_HANDLE;
+   }
+   } else {
+   if (fstat(fd, &name->st) == -1) {
+   return NT_STATUS_INVALID_HANDLE;
+   }
}
 
if (name->exists &&

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_setfileinfo.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_setfileinfo.c2004-10-29 03:48:49 
UTC (rev 3350)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_setfileinfo.c2004-10-29 04:43:28 
UTC (rev 3351)
@@ -128,6 +128,9 @@
 
/* possibly change the file size */
if (newstats.st.st_size != f->name->st.st_size) {
+   if (f->name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) {
+   return NT_STATUS_FILE_IS_A_DIRECTORY;
+   }
if (ftruncate(f->fd, newstats.st.st_size) == -1) {
return pvfs_map_errno(pvfs, errno);
}
@@ -150,6 +153,10 @@
/* possibly change the attribute */
if (newstats.dos.attrib != f->name->dos.attrib) {
mode_t mode = pvfs_fileperms(pvfs, newstats.dos.attrib);
+   if (f->name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY) {
+   /* ignore on directories for now */
+   return NT_STATUS_OK;
+   }
if (fchmod(f->fd, mode) == -1) {
return pvfs_map_errno(pvfs, errno);
}



svn commit: samba r3350 - in branches/SAMBA_4_0/source/smb_server: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-29 03:48:49 + (Fri, 29 Oct 2004)
New Revision: 3350

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3350

Log:
fixed a bug with sending multiple replies for the one request, as
happens with trans2, trans and echo. Now that smbd is async we queue
the multiples replies all at once, and now need a way to ensure each
reply gets it own smbsrv_request buffer. I have added
req_setup_secondary() to cope with this.

Modified:
   branches/SAMBA_4_0/source/smb_server/nttrans.c
   branches/SAMBA_4_0/source/smb_server/reply.c
   branches/SAMBA_4_0/source/smb_server/request.c
   branches/SAMBA_4_0/source/smb_server/trans2.c


Changeset:
Sorry, the patch is too large (284 lines) to include; please use WebSVN to see it!
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3350


svn commit: lorikeet r116 - in trunk/samba4-ad-thesis: .

2004-10-28 Thread abartlet
Author: abartlet
Date: 2004-10-29 01:23:58 + (Fri, 29 Oct 2004)
New Revision: 116

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=116

Log:
- Add comments on the implications of KEY_EXCHANGE on the LSAKEY
crypto challenge, and make a few more of the things I've done clear.

- Death to dashes.

Andrew Bartlett

Modified:
   trunk/samba4-ad-thesis/chapters.lyx


Changeset:
Modified: trunk/samba4-ad-thesis/chapters.lyx
===
--- trunk/samba4-ad-thesis/chapters.lyx 2004-10-28 15:56:11 UTC (rev 115)
+++ trunk/samba4-ad-thesis/chapters.lyx 2004-10-29 01:23:58 UTC (rev 116)
@@ -2915,7 +2915,9 @@
 
 , Samba quietly evolved over the past 12 years from a barely functional
  prototype, used to communicate between a DOS Pathworks client and a Sun
- server, into a solid file and print server for Windows clients.
+ server, into a solid file and print server for Windows clients, maintained
+ by a team of over 30 international developers, 12 of which are active at
+ any one time.
 \layout Subsubsection*
 
 Samba 2.0
@@ -3116,11 +3118,16 @@
 Samba4 Status
 \layout Standard
 
-Samba version 4 is an ongoing research project, but has made significant
- headway into this problem space before I even proposed my thesis topic.
+Samba version 4 is an ongoing research project of the Samba Team, and had
+ made significant headway into this problem space before I even proposed
+ my thesis topic.
  It has grown up in a very modular style, and with a much cleaner code-base
  than Samba 3.0.
- While there is far more to Samba4 than these subsystems, the AD emulation
+ The core development on Samba4 has been by Dr Tridgell, Stefan Metzmacher
+ and myself, with contributions from many others from time to time.
+\layout Standard
+
+While there is far more to Samba4 than these subsystems, the AD emulation
  work hits on these in particular:
 \layout Section
 
@@ -3261,7 +3268,7 @@
  calls are made, negotiating security mechanisms such as 128-bit session
  keys.
 \begin_inset Foot
-collapsed false
+collapsed true
 
 \layout Standard
 
@@ -3348,8 +3355,8 @@
  easier initial development.
  In this case, we `hash' the passwords on the fly, but we can also store
  the pre-hashed password if the plain-text is not available.
- These requirements required a minor code restructure, that has now been
- included by Heimdal's developers into current snapshots.
+ These requirements required me to perform a minor code restructure, which
+ has now been included by Heimdal's developers into current snapshots.
 \layout Subsection
 
 No PAC at this stage
@@ -3361,7 +3368,7 @@
 
 \end_inset 
 
-, PAC support was not implemented - instead, the Samba server was modified
+, PAC support was not implemented: instead the Samba server was modified
  to accept Kerberos packets without the PAC.
  (The client does not process the PAC in the initial use case, so this complexit
 y was deferred).
@@ -3766,15 +3773,30 @@
  can be derived by extracting the cipher-text for a known plain-text.
 \layout Subsection
 
+Controlling the session key
+\layout Standard
+
+In researching this problem, I noticed that in NTLMSSP, the 
+\family typewriter 
+KEY_EXCHANGE
+\family default 
+ option allows the network client to chose the session key.
+ At this stage, it was unknown what encryption function was in use, but
+ by choosing a known weak encryption key, such as all-ones (all zeros was
+ not supported), we could analyise the properties of the cyphertext.
+ 
+\layout Subsection
+
 Proof that it's a fixed key
 \layout Standard
 
 One of the first breakthroughs in solving the puzzle was the realisation
- that, despite changes in user-names and passwords, the encrypted secret
- would not change.
+ that, despite changes in session keys, user-names or passwords, the encrypted
+ secret would not change.
  This was most puzzling, because secrets are typically encrypted with a
- session key, a secret to between the user and server (which implies that
- it should change with the user's password).
+ value shared between the user and server (which implies that it should
+ change with the user's password, even if somehow disconnected from the
+ key exchange mentioned above).
 \layout Standard
 
 This strongly suggests that the key is some constant value, possibly a `dummy'
@@ -3800,8 +3822,8 @@
  Microsoft implementations.
 \layout Standard
 
-It was suggested that the key was probably not a random value, but more
- likely an ASCII string used for initialisation.
+In considering the possible secret keys, I suggested that the key was probably
+ not a random value, but more likely an ASCII string used for initialisation.
 \begin_inset Foot
 collapsed true
 
@@ -3822,7 +3844,7 @@
 \layout Standard
 
 Eventually (and this only took a matter of 24 hours of CPU time) the fixed
- key was found - 
+ key was found: 
 \family typewriter 
 "SystemLibraryDTC"
 \family default 



svn commit: samba r3349 - in branches/SAMBA_4_0/source/ntvfs/nbench: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-29 01:22:47 + (Fri, 29 Oct 2004)
New Revision: 3349

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3349

Log:
fixed more uninitialised variable problems with the nbench module

Modified:
   branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c
===
--- branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c 2004-10-29 01:10:40 UTC (rev 
3348)
+++ branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c 2004-10-29 01:22:47 UTC (rev 
3349)
@@ -286,6 +286,9 @@
 
switch (io->generic.level) {
case RAW_OPEN_NTCREATEX:
+   if (!NT_STATUS_IS_OK(req->async_states->status)) {
+   ZERO_STRUCT(io->ntcreatex.out);
+   }
nbench_log(req, "NTCreateX \"%s\" 0x%x 0x%x %d %s\n", 
   io->ntcreatex.in.fname, 
   io->ntcreatex.in.create_options, 
@@ -417,20 +420,17 @@
 static void nbench_read_send(struct smbsrv_request *req)
 {
union smb_read *rd = req->async_states->private_data;
-   uint32_t nread;

switch (rd->generic.level) {
case RAW_READ_READX:
-   if (NT_STATUS_IS_OK(req->async_states->status)) {
-   nread = rd->readx.out.nread;
-   } else {
-   nread = 0;
+   if (!NT_STATUS_IS_OK(req->async_states->status)) {
+   ZERO_STRUCT(rd->readx.out);
}
nbench_log(req, "ReadX %d %d %d %d %s\n", 
   rd->readx.in.fnum, 
   (int)rd->readx.in.offset,
   rd->readx.in.maxcnt,
-  nread,
+  rd->readx.out.nread,
   get_nt_error_c_code(req->async_states->status));
break;
default:
@@ -461,6 +461,9 @@
 
switch (wr->generic.level) {
case RAW_WRITE_WRITEX:
+   if (!NT_STATUS_IS_OK(req->async_states->status)) {
+   ZERO_STRUCT(wr->writex.out);
+   }
nbench_log(req, "WriteX %d %d %d %d %s\n", 
   wr->writex.in.fnum, 
   (int)wr->writex.in.offset,
@@ -470,6 +473,9 @@
break;
 
case RAW_WRITE_WRITE:
+   if (!NT_STATUS_IS_OK(req->async_states->status)) {
+   ZERO_STRUCT(wr->write.out);
+   }
nbench_log(req, "Write %d %d %d %d %s\n", 
   wr->write.in.fnum, 
   wr->write.in.offset,
@@ -756,6 +762,9 @@

switch (io->generic.level) {
case RAW_SEARCH_BOTH_DIRECTORY_INFO:
+   if (NT_STATUS_IS_ERR(req->async_states->status)) {
+   ZERO_STRUCT(io->t2ffirst.out);
+   }
nbench_log(req, "FIND_FIRST \"%s\" %d %d %d %s\n", 
   io->t2ffirst.in.pattern,
   io->generic.level,



svn commit: samba r3348 - in branches/SAMBA_4_0/source: lib/registry/common lib/registry/reg_backend_gconf lib/registry/reg_backend_ldb rpc_server/winreg torture/rpc

2004-10-28 Thread jelmer
Author: jelmer
Date: 2004-10-29 01:10:40 + (Fri, 29 Oct 2004)
New Revision: 3348

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3348

Log:
More registry fixes and additions. The following functions work right now against 
samba 4, at least with a ldb backend:

winreg_Open*
winreg_OpenKey
winreg_EnumKey
winreg_DeleteKey
winreg_CreateKey


Modified:
   branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c
   branches/SAMBA_4_0/source/lib/registry/reg_backend_gconf/reg_backend_gconf.c
   branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb/reg_backend_ldb.c
   branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c
   branches/SAMBA_4_0/source/torture/rpc/winreg.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c
===
--- branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c   2004-10-29 
01:07:07 UTC (rev 3347)
+++ branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c   2004-10-29 
01:10:40 UTC (rev 3348)
@@ -367,6 +367,7 @@
 
if(key->hive->functions->get_subkey_by_name) {
error = key->hive->functions->get_subkey_by_name(mem_ctx, 
key,name,subkey);
+   /* FIXME: Fall back to reg_open_key rather then get_subkey_by_index */
} else if(key->hive->functions->get_subkey_by_index) {
for(i = 0; W_ERROR_IS_OK(error); i++) {
error = reg_key_get_subkey_by_index(mem_ctx, key, i, subkey);

Modified: branches/SAMBA_4_0/source/lib/registry/reg_backend_gconf/reg_backend_gconf.c
===
--- branches/SAMBA_4_0/source/lib/registry/reg_backend_gconf/reg_backend_gconf.c   
 2004-10-29 01:07:07 UTC (rev 3347)
+++ branches/SAMBA_4_0/source/lib/registry/reg_backend_gconf/reg_backend_gconf.c   
 2004-10-29 01:10:40 UTC (rev 3348)
@@ -35,8 +35,8 @@
if(!h->backend_data) return WERR_FOOBAR;

*k = talloc_p(mem_ctx, struct registry_key);
-   (*k)->name = "";
-   (*k)->path = "";
+   (*k)->name = talloc_strdup(mem_ctx, "");
+   (*k)->path = talloc_strdup(mem_ctx, "");
(*k)->backend_data = talloc_strdup(mem_ctx, "/");
return WERR_OK;
 }
@@ -46,17 +46,15 @@
struct registry_key *ret;
char *fullpath;

-   fullpath = reg_path_win2unix(strdup(name));
+   fullpath = talloc_asprintf(mem_ctx, "/%s", 
reg_path_win2unix(talloc_strdup(mem_ctx, name)));
 
/* Check if key exists */
if(!gconf_client_dir_exists((GConfClient *)h->backend_data, fullpath, NULL)) {
-   SAFE_FREE(fullpath);
return WERR_DEST_NOT_FOUND;
}
 
ret = talloc_p(mem_ctx, struct registry_key);
-   ret->backend_data = talloc_strdup(mem_ctx, fullpath);
-   SAFE_FREE(fullpath);
+   ret->backend_data = fullpath;
 
*key = ret;
return WERR_OK;

Modified: branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb/reg_backend_ldb.c
===
--- branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb/reg_backend_ldb.c
2004-10-29 01:07:07 UTC (rev 3347)
+++ branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb/reg_backend_ldb.c
2004-10-29 01:10:40 UTC (rev 3348)
@@ -142,7 +142,10 @@
if (!hive->location) return WERR_INVALID_PARAM;
c = ldb_connect(hive->location, 0, NULL);
 
-   if(!c) return WERR_FOOBAR;
+   if(!c) {
+   DEBUG(1, ("ldb_open_hive: %s\n", ldb_errstring(hive->backend_data)));
+   return WERR_FOOBAR;
+   }
ldb_set_debug_stderr(c);
hive->backend_data = c;
 
@@ -152,8 +155,49 @@
return WERR_OK;
 }
 
+static WERROR ldb_add_key (TALLOC_CTX *mem_ctx, struct registry_key *parent, const 
char *name, uint32_t access_mask, SEC_DESC *sd, struct registry_key **newkey)
+{
+   struct ldb_context *ctx = parent->hive->backend_data;
+   struct ldb_message msg;
+   int ret;
+
+   ZERO_STRUCT(msg);
+
+   msg.dn = reg_path_to_ldb(mem_ctx, parent->path, talloc_asprintf(mem_ctx, 
"key=%s,", name));
+
+   ldb_msg_add_string(ctx, &msg, "key", talloc_strdup(mem_ctx, name));
+
+   ret = ldb_add(ctx, &msg);
+   if (ret < 0) {
+   DEBUG(1, ("ldb_msg_add: %s\n", 
ldb_errstring(parent->hive->backend_data)));
+   return WERR_FOOBAR;
+   }
+
+   *newkey = talloc_zero_p(mem_ctx, struct registry_key);
+   (*newkey)->backend_data = msg.dn;
+   (*newkey)->name = talloc_strdup(mem_ctx, name);
+
+   return WERR_OK;
+}
+
+static WERROR ldb_del_key (struct registry_key *key)
+{
+   int ret;
+
+   ret = ldb_delete(key->hive->backend_data, key->backend_data);
+
+   if (ret < 0) {
+   DEBUG(1, ("ldb_del_key: %s\n", 
ldb_errstring(key->hive->backend_data)));
+   return WERR_FOOBAR;
+   }
+

svn commit: samba r3347 - in branches/SAMBA_4_0/source/ntvfs/nbench: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-29 01:07:07 + (Fri, 29 Oct 2004)
New Revision: 3347

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3347

Log:
fixed an uninitialised variable bug. Surprisingly hard to track down,
as valgrind got a corrupt stack when trying to debug it.

Modified:
   branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c
===
--- branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c 2004-10-29 00:51:41 UTC (rev 
3346)
+++ branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c 2004-10-29 01:07:07 UTC (rev 
3347)
@@ -417,14 +417,20 @@
 static void nbench_read_send(struct smbsrv_request *req)
 {
union smb_read *rd = req->async_states->private_data;
-
+   uint32_t nread;
+   
switch (rd->generic.level) {
case RAW_READ_READX:
+   if (NT_STATUS_IS_OK(req->async_states->status)) {
+   nread = rd->readx.out.nread;
+   } else {
+   nread = 0;
+   }
nbench_log(req, "ReadX %d %d %d %d %s\n", 
   rd->readx.in.fnum, 
   (int)rd->readx.in.offset,
   rd->readx.in.maxcnt,
-  rd->readx.out.nread,
+  nread,
   get_nt_error_c_code(req->async_states->status));
break;
default:



svn commit: samba r3346 - in branches/SAMBA_4_0/source/ntvfs/nbench: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-29 00:51:41 + (Fri, 29 Oct 2004)
New Revision: 3346

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3346

Log:
- simplified vfs_nbench.c a bit, by using req->async_state->ntvfs inside
  nbench_log() instead of declaring nprivates every time.

- added correct async_setup pass-thru in nbench



Modified:
   branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c


Changeset:
Sorry, the patch is too large (459 lines) to include; please use WebSVN to see it!
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3346


svn commit: samba r3345 - in branches/SAMBA_3_0/source: . libsmb

2004-10-28 Thread jra
Author: jra
Date: 2004-10-29 00:02:32 + (Fri, 29 Oct 2004)
New Revision: 3345

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3345

Log:
More MIT/Heimdal tests for comparing enctypes now.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/configure.in
   branches/SAMBA_3_0/source/libsmb/clikrb5.c


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===
--- branches/SAMBA_3_0/source/configure.in  2004-10-29 00:02:26 UTC (rev 3344)
+++ branches/SAMBA_3_0/source/configure.in  2004-10-29 00:02:32 UTC (rev 3345)
@@ -2784,6 +2784,8 @@
   AC_CHECK_FUNC_EXT(krb5_free_keytab_entry_contents, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_kt_free_entry, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_krbhst_get_addrinfo, $KRB5_LIBS)
+  AC_CHECK_FUNC_EXT(krb5_c_enctype_compare, $KRB5_LIBS)
+  AC_CHECK_FUNC_EXT(krb5_enctypes_compatible_keys, $KRB5_LIBS)
 
   LIBS="$LIBS $KRB5_LIBS"
   

Modified: branches/SAMBA_3_0/source/libsmb/clikrb5.c
===
--- branches/SAMBA_3_0/source/libsmb/clikrb5.c  2004-10-29 00:02:26 UTC (rev 3344)
+++ branches/SAMBA_3_0/source/libsmb/clikrb5.c  2004-10-29 00:02:32 UTC (rev 3345)
@@ -262,6 +262,20 @@
 #endif
 }
 
+krb5_boolean kerberos_compatible_enctypes(krb5_context context,
+ krb5_enctype enctype1,
+ krb5_enctype enctype2)
+{
+#if defined(HAVE_KRB5_C_ENCTYPE_COMPARE)
+   krb5_boolean similar = 0;
+
+   krb5_c_enctype_compare(context, enctype1, enctype2, &similar);
+   return similar;
+#elif defined(HAVE_KRB5_ENCTYPES_COMPATIBLE_KEYS)
+   return krb5_enctypes_compatible_keys(context, enctype1, enctype2);
+#endif
+}
+
 static BOOL ads_cleanup_expired_creds(krb5_context context, 
  krb5_ccache  ccache,
  krb5_creds  *credsp)



svn commit: samba r3344 - in trunk/source: . libsmb

2004-10-28 Thread jra
Author: jra
Date: 2004-10-29 00:02:26 + (Fri, 29 Oct 2004)
New Revision: 3344

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3344

Log:
More MIT/Heimdal tests for comparing enctypes now.
Jeremy.

Modified:
   trunk/source/configure.in
   trunk/source/libsmb/clikrb5.c


Changeset:
Modified: trunk/source/configure.in
===
--- trunk/source/configure.in   2004-10-28 23:50:14 UTC (rev 3343)
+++ trunk/source/configure.in   2004-10-29 00:02:26 UTC (rev 3344)
@@ -2787,6 +2787,8 @@
   AC_CHECK_FUNC_EXT(krb5_free_keytab_entry_contents, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_kt_free_entry, $KRB5_LIBS)
   AC_CHECK_FUNC_EXT(krb5_krbhst_get_addrinfo, $KRB5_LIBS)
+  AC_CHECK_FUNC_EXT(krb5_c_enctype_compare, $KRB5_LIBS)
+  AC_CHECK_FUNC_EXT(krb5_enctypes_compatible_keys, $KRB5_LIBS)
 
   LIBS="$LIBS $KRB5_LIBS"
   

Modified: trunk/source/libsmb/clikrb5.c
===
--- trunk/source/libsmb/clikrb5.c   2004-10-28 23:50:14 UTC (rev 3343)
+++ trunk/source/libsmb/clikrb5.c   2004-10-29 00:02:26 UTC (rev 3344)
@@ -262,6 +262,20 @@
 #endif
 }
 
+krb5_boolean kerberos_compatible_enctypes(krb5_context context,
+ krb5_enctype enctype1,
+ krb5_enctype enctype2)
+{
+#if defined(HAVE_KRB5_C_ENCTYPE_COMPARE)
+   krb5_boolean similar = 0;
+
+   krb5_c_enctype_compare(context, enctype1, enctype2, &similar);
+   return similar;
+#elif defined(HAVE_KRB5_ENCTYPES_COMPATIBLE_KEYS)
+   return krb5_enctypes_compatible_keys(context, enctype1, enctype2);
+#endif
+}
+
 static BOOL ads_cleanup_expired_creds(krb5_context context, 
  krb5_ccache  ccache,
  krb5_creds  *credsp)



svn commit: samba r3343 - in trunk/source: . libsmb

2004-10-28 Thread jra
Author: jra
Date: 2004-10-28 23:50:14 + (Thu, 28 Oct 2004)
New Revision: 3343

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3343

Log:
More MIT/Heimdal fixes to allow an enctype to be explicitly set in a krb5_creds
struct.
Jeremy.

Modified:
   trunk/source/configure.in
   trunk/source/libsmb/clikrb5.c


Changeset:
Modified: trunk/source/configure.in
===
--- trunk/source/configure.in   2004-10-28 23:50:14 UTC (rev 3342)
+++ trunk/source/configure.in   2004-10-28 23:50:14 UTC (rev 3343)
@@ -2825,6 +2825,30 @@
   [Whether the krb5_ticket struct has a enc_part2 property])
   fi
 
+  AC_CACHE_CHECK([for keyblock in krb5_creds],
+ samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS,[
+AC_TRY_COMPILE([#include ],
+  [krb5_creds creds; krb5_keyblock kb; creds.keyblock = kb;],
+  samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS=yes,
+  samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS=no)])
+
+  if test x"$samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS" = x"yes"; then
+AC_DEFINE(HAVE_KRB5_KEYBLOCK_IN_CREDS,1,
+  [Whether the krb5_creds struct has a keyblock property])
+  fi
+
+  AC_CACHE_CHECK([for session in krb5_creds],
+ samba_cv_HAVE_KRB5_SESSION_IN_CREDS,[
+AC_TRY_COMPILE([#include ],
+  [krb5_creds creds; krb5_keyblock kb; creds.session = kb;],
+  samba_cv_HAVE_KRB5_SESSION_IN_CREDS=yes,
+  samba_cv_HAVE_KRB5_SESSION_IN_CREDS=no)])
+
+  if test x"$samba_cv_HAVE_KRB5_SESSION_IN_CREDS" = x"yes"; then
+AC_DEFINE(HAVE_KRB5_SESSION_IN_CREDS,1,
+  [Whether the krb5_creds struct has a session property])
+  fi
+
   AC_CACHE_CHECK([for keyvalue in krb5_keyblock],
  samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE,[
 AC_TRY_COMPILE([#include ],

Modified: trunk/source/libsmb/clikrb5.c
===
--- trunk/source/libsmb/clikrb5.c   2004-10-28 23:50:14 UTC (rev 3342)
+++ trunk/source/libsmb/clikrb5.c   2004-10-28 23:50:14 UTC (rev 3343)
@@ -251,6 +251,17 @@
 }
 #endif
 
+void kerberos_set_creds_enctype(krb5_creds *pcreds, int enctype)
+{
+#if defined(HAVE_KRB5_KEYBLOCK_IN_CREDS)
+   KRB5_KEY_TYPE((&pcreds->keyblock)) = enctype;
+#elif defined(HAVE_KRB5_SESSION_IN_CREDS)
+   KRB5_KEY_TYPE((&pcreds->session)) = enctype;
+#else
+#error UNKNOWN_KEYBLOCK_MEMBER_IN_KRB5_CREDS_STRUCT
+#endif
+}
+
 static BOOL ads_cleanup_expired_creds(krb5_context context, 
  krb5_ccache  ccache,
  krb5_creds  *credsp)



svn commit: samba r3342 - in branches/SAMBA_3_0/source: . libsmb

2004-10-28 Thread jra
Author: jra
Date: 2004-10-28 23:50:14 + (Thu, 28 Oct 2004)
New Revision: 3342

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3342

Log:
More MIT/Heimdal fixes to allow an enctype to be explicitly set in a krb5_creds
struct.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/configure.in
   branches/SAMBA_3_0/source/libsmb/clikrb5.c


Changeset:
Modified: branches/SAMBA_3_0/source/configure.in
===
--- branches/SAMBA_3_0/source/configure.in  2004-10-28 23:09:40 UTC (rev 3341)
+++ branches/SAMBA_3_0/source/configure.in  2004-10-28 23:50:14 UTC (rev 3342)
@@ -2822,6 +2822,30 @@
   [Whether the krb5_ticket struct has a enc_part2 property])
   fi
 
+  AC_CACHE_CHECK([for keyblock in krb5_creds],
+ samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS,[
+AC_TRY_COMPILE([#include ],
+  [krb5_creds creds; krb5_keyblock kb; creds.keyblock = kb;],
+  samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS=yes,
+  samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS=no)])
+
+  if test x"$samba_cv_HAVE_KRB5_KEYBLOCK_IN_CREDS" = x"yes"; then
+AC_DEFINE(HAVE_KRB5_KEYBLOCK_IN_CREDS,1,
+  [Whether the krb5_creds struct has a keyblock property])
+  fi
+
+  AC_CACHE_CHECK([for session in krb5_creds],
+ samba_cv_HAVE_KRB5_SESSION_IN_CREDS,[
+AC_TRY_COMPILE([#include ],
+  [krb5_creds creds; krb5_keyblock kb; creds.session = kb;],
+  samba_cv_HAVE_KRB5_SESSION_IN_CREDS=yes,
+  samba_cv_HAVE_KRB5_SESSION_IN_CREDS=no)])
+
+  if test x"$samba_cv_HAVE_KRB5_SESSION_IN_CREDS" = x"yes"; then
+AC_DEFINE(HAVE_KRB5_SESSION_IN_CREDS,1,
+  [Whether the krb5_creds struct has a session property])
+  fi
+
   AC_CACHE_CHECK([for keyvalue in krb5_keyblock],
  samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE,[
 AC_TRY_COMPILE([#include ],

Modified: branches/SAMBA_3_0/source/libsmb/clikrb5.c
===
--- branches/SAMBA_3_0/source/libsmb/clikrb5.c  2004-10-28 23:09:40 UTC (rev 3341)
+++ branches/SAMBA_3_0/source/libsmb/clikrb5.c  2004-10-28 23:50:14 UTC (rev 3342)
@@ -251,6 +251,17 @@
 }
 #endif
 
+void kerberos_set_creds_enctype(krb5_creds *pcreds, int enctype)
+{
+#if defined(HAVE_KRB5_KEYBLOCK_IN_CREDS)
+   KRB5_KEY_TYPE((&pcreds->keyblock)) = enctype;
+#elif defined(HAVE_KRB5_SESSION_IN_CREDS)
+   KRB5_KEY_TYPE((&pcreds->session)) = enctype;
+#else
+#error UNKNOWN_KEYBLOCK_MEMBER_IN_KRB5_CREDS_STRUCT
+#endif
+}
+
 static BOOL ads_cleanup_expired_creds(krb5_context context, 
  krb5_ccache  ccache,
  krb5_creds  *credsp)



svn commit: samba r3341 - in branches/SAMBA_4_0/source/smb_server: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 23:09:40 + (Thu, 28 Oct 2004)
New Revision: 3341

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3341

Log:
- don't zero the async structure (makes valgrind more useful)

- get rid of req->mid, as it isn't a safe value to use to match
  requests in the server (it is safe in the client code, as we choose
  the mid, but in the server we can't rely on other clients to choose
  the mid carefully)


Modified:
   branches/SAMBA_4_0/source/smb_server/request.c
   branches/SAMBA_4_0/source/smb_server/smb_server.c
   branches/SAMBA_4_0/source/smb_server/smb_server.h


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/request.c
===
--- branches/SAMBA_4_0/source/smb_server/request.c  2004-10-28 23:06:12 UTC (rev 
3340)
+++ branches/SAMBA_4_0/source/smb_server/request.c  2004-10-28 23:09:40 UTC (rev 
3341)
@@ -57,11 +57,11 @@
 
req->async_states = talloc_p(req, struct ntvfs_async_state);
if (!req->async_states) {
+   talloc_free(req);
return NULL;
}
+   req->async_states->state = 0;
 
-   ZERO_STRUCTP(req->async_states);
-
return req;
 }
 

Modified: branches/SAMBA_4_0/source/smb_server/smb_server.c
===
--- branches/SAMBA_4_0/source/smb_server/smb_server.c   2004-10-28 23:06:12 UTC (rev 
3340)
+++ branches/SAMBA_4_0/source/smb_server/smb_server.c   2004-10-28 23:09:40 UTC (rev 
3341)
@@ -624,7 +624,6 @@
req->flags = CVAL(req->in.hdr, HDR_FLG);
req->flags2 = SVAL(req->in.hdr, HDR_FLG2);
req->smbpid = SVAL(req->in.hdr,HDR_PID);
-   req->mid = SVAL(req->in.hdr,HDR_MID);
 
if (!req_signing_check_incoming(req)) {
req_reply_error(req, NT_STATUS_ACCESS_DENIED);

Modified: branches/SAMBA_4_0/source/smb_server/smb_server.h
===
--- branches/SAMBA_4_0/source/smb_server/smb_server.h   2004-10-28 23:06:12 UTC (rev 
3340)
+++ branches/SAMBA_4_0/source/smb_server/smb_server.h   2004-10-28 23:09:40 UTC (rev 
3341)
@@ -89,9 +89,6 @@
/* the session context is derived from the vuid */
struct smbsrv_session *session;
 
-   /* the mid of this packet - used to match replies */
-   uint16_t mid;
-
/* a set of flags to control usage of the request. See REQ_CONTROL_* */
unsigned control_flags;
 



svn commit: samba r3340 - in branches/SAMBA_4_0/source: lib/registry/common lib/registry/reg_backend_ldb lib/registry/reg_backend_rpc rpc_server/winreg torture/rpc

2004-10-28 Thread jelmer
Author: jelmer
Date: 2004-10-28 23:06:12 + (Thu, 28 Oct 2004)
New Revision: 3340

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3340

Log:
Various fixes in the registry code. Implement the EnumKey call 
in the server.

Modified:
   branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c
   branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb/reg_backend_ldb.c
   branches/SAMBA_4_0/source/lib/registry/reg_backend_rpc/reg_backend_rpc.c
   branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c
   branches/SAMBA_4_0/source/torture/rpc/winreg.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c
===
--- branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c   2004-10-28 
22:58:21 UTC (rev 3339)
+++ branches/SAMBA_4_0/source/lib/registry/common/reg_interface.c   2004-10-28 
23:06:12 UTC (rev 3340)
@@ -191,7 +191,10 @@
 
if(!W_ERROR_IS_OK(werr)) return werr;

-   if(!ret->root) return WERR_GENERAL_FAILURE;
+   if(!ret->root) {
+   DEBUG(0, ("Backend %s didn't provide root key!\n", backend));
+   return WERR_GENERAL_FAILURE;
+   }
 
ret->root->hive = ret;
ret->root->name = NULL;

Modified: branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb/reg_backend_ldb.c
===
--- branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb/reg_backend_ldb.c
2004-10-28 22:58:21 UTC (rev 3339)
+++ branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb/reg_backend_ldb.c
2004-10-28 23:06:12 UTC (rev 3340)
@@ -146,7 +146,10 @@
ldb_set_debug_stderr(c);
hive->backend_data = c;
 
-   return ldb_open_key(mem_ctx, hive, "", k);
+   hive->root = talloc_zero_p(mem_ctx, struct registry_key);
+   hive->root->name = talloc_strdup(mem_ctx, "");
+
+   return WERR_OK;
 }
 
 static struct registry_operations reg_backend_ldb = {

Modified: branches/SAMBA_4_0/source/lib/registry/reg_backend_rpc/reg_backend_rpc.c
===
--- branches/SAMBA_4_0/source/lib/registry/reg_backend_rpc/reg_backend_rpc.c
2004-10-28 22:58:21 UTC (rev 3339)
+++ branches/SAMBA_4_0/source/lib/registry/reg_backend_rpc/reg_backend_rpc.c
2004-10-28 23:06:12 UTC (rev 3340)
@@ -85,7 +85,7 @@
 
 static WERROR rpc_query_key(struct registry_key *k);
 
-WERROR rpc_list_hives (TALLOC_CTX *mem_ctx, const char *location, const char 
*credentials, char ***hives)
+static WERROR rpc_list_hives (TALLOC_CTX *mem_ctx, const char *location, const char 
*credentials, char ***hives)
 {
int i = 0;
*hives = talloc_p(mem_ctx, char *);

Modified: branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c
===
--- branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c2004-10-28 22:58:21 
UTC (rev 3339)
+++ branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c2004-10-28 23:06:12 
UTC (rev 3340)
@@ -177,7 +177,15 @@
h = dcesrv_handle_fetch(dce_call->conn, r->in.handle, HTYPE_REGKEY);
DCESRV_CHECK_HANDLE(h);
 
-   key = h->data;
+   r->out.result = reg_key_get_subkey_by_index(mem_ctx, (struct registry_key 
*)h->data, r->in.enum_index, &key);
+
+   if (W_ERROR_IS_OK(r->out.result)) {
+   r->out.key_name_len = strlen(key->name);
+   r->out.out_name = talloc_zero_p(mem_ctx, struct 
winreg_EnumKeyNameResponse);
+   r->out.out_name->name = key->name;
+   r->out.class = talloc_zero_p(mem_ctx, struct winreg_String);
+   r->out.last_changed_time = talloc_zero_p(mem_ctx, struct winreg_Time);
+   }

return WERR_NOT_SUPPORTED;
 }

Modified: branches/SAMBA_4_0/source/torture/rpc/winreg.c
===
--- branches/SAMBA_4_0/source/torture/rpc/winreg.c  2004-10-28 22:58:21 UTC (rev 
3339)
+++ branches/SAMBA_4_0/source/torture/rpc/winreg.c  2004-10-28 23:06:12 UTC (rev 
3340)
@@ -51,6 +51,11 @@
return False;
}
 
+   if (!W_ERROR_IS_OK(r.out.result)) {
+   printf("GetVersion failed - %s\n", win_errstr(r.out.result));
+   return False;
+   }
+
return True;
 }
 
@@ -106,6 +111,11 @@
return False;
}
 
+   if (!W_ERROR_IS_OK(r.out.result)) {
+   printf("CloseKey failed - %s\n", win_errstr(r.out.result));
+   return False;
+   }
+
return True;
 }
 
@@ -228,6 +238,8 @@
struct winreg_Time tm;
NTSTATUS status;
 
+   printf("Testing EnumKey\n\n");
+
r.in.handle = handle;
r.in.enum_index = 0;
r.in.key_name_len = r.out.key_name_len = 0;



svn commit: samba r3339 - in branches/SAMBA_3_0/source: .

2004-10-28 Thread herb
Author: herb
Date: 2004-10-28 22:58:21 + (Thu, 28 Oct 2004)
New Revision: 3339

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3339

Log:
allow tdbtool to be built

Modified:
   branches/SAMBA_3_0/source/Makefile.in


Changeset:
Modified: branches/SAMBA_3_0/source/Makefile.in
===
--- branches/SAMBA_3_0/source/Makefile.in   2004-10-28 22:38:27 UTC (rev 3338)
+++ branches/SAMBA_3_0/source/Makefile.in   2004-10-28 22:58:21 UTC (rev 3339)
@@ -124,7 +124,8 @@
 BIN_PROGS1 = bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ \
bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ 
 BIN_PROGS2 = bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ \
-   bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@
+   bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ \
+   bin/[EMAIL PROTECTED]@
 BIN_PROGS3 = bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ \
bin/[EMAIL PROTECTED]@ bin/[EMAIL PROTECTED]@ \
bin/[EMAIL PROTECTED]@
@@ -677,6 +678,8 @@
 
 TDBBACKUP_OBJ = tdb/tdbbackup.o tdb/tdbback.o $(SNPRINTF_OBJ) $(TDBBASE_OBJ)
 
+TDBTOOL_OBJ = tdb/tdbtool.o $(TDBBASE_OBJ)
+
 TDBDUMP_OBJ = tdb/tdbdump.o $(TDBBASE_OBJ)
 
 NTLM_AUTH_OBJ1 = utils/ntlm_auth.o utils/ntlm_auth_diagnostics.o 
@@ -1249,6 +1252,10 @@
@echo Linking $@
@$(CC) $(FLAGS) -o $@ $(DYNEXP) $(TDBBACKUP_OBJ)
 
+bin/[EMAIL PROTECTED]@: $(TDBTOOL_OBJ) bin/.dummy
+   @echo Linking $@
+   @$(CC) $(FLAGS) -o $@ $(DYNEXP) $(TDBTOOL_OBJ)
+
 bin/[EMAIL PROTECTED]@: $(TDBDUMP_OBJ) bin/.dummy
@echo Linking $@
@$(CC) $(FLAGS) -o $@ $(DYNEXP) $(TDBDUMP_OBJ)



svn commit: samba r3338 - in branches/SAMBA_4_0/source: param rpc_server/winreg

2004-10-28 Thread jelmer
Author: jelmer
Date: 2004-10-28 22:38:27 + (Thu, 28 Oct 2004)
New Revision: 3338

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3338

Log:
More work on the winreg RPC server. Opening hives is now supported, most other calls 
return WERR_NOT_SUPPORTED for now.

Hive backends can be set like this:

registry:HKEY_LOCAL_MACHINE = ldb:tdb://registry.tdb
registry:HKEY_CURRENT_USER = gconf
registry:HKEY_USERS = dir:/tmp/registry
registry:HKEY_CLASSES_ROOT = nt4:/path/to/NTUSER.DAT
registry:HKEY_PERFORMANCE_DATA = w95:/path/to/USER.DAT


Modified:
   branches/SAMBA_4_0/source/param/loadparm.c
   branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c


Changeset:
Modified: branches/SAMBA_4_0/source/param/loadparm.c
===
--- branches/SAMBA_4_0/source/param/loadparm.c  2004-10-28 22:18:52 UTC (rev 3337)
+++ branches/SAMBA_4_0/source/param/loadparm.c  2004-10-28 22:38:27 UTC (rev 3338)
@@ -896,7 +896,7 @@
do_parameter("fstype", FSTYPE_STRING);
do_parameter("ntvfs handler", "unixuid default");
 
-   do_parameter("dcerpc endpoint servers", "epmapper srvsvc wkssvc rpcecho samr 
netlogon lsarpc spoolss drsuapi");
+   do_parameter("dcerpc endpoint servers", "epmapper srvsvc wkssvc rpcecho samr 
netlogon lsarpc spoolss drsuapi winreg");
do_parameter("server services", "smb rpc");
do_parameter("auth methods", "guest sam_ignoredomain");
do_parameter("smb passwd file", dyn_SMB_PASSWD_FILE);

Modified: branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c
===
--- branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c2004-10-28 22:18:52 
UTC (rev 3337)
+++ branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c2004-10-28 22:38:27 
UTC (rev 3338)
@@ -23,62 +23,47 @@
 #include "includes.h"
 #include "rpc_server/common/common.h"
 
-/**
- * General notes for the current implementation:
- * 
- * - All hives are currently openened as subkeys of one single registry file 
- *   (e.g. HKCR from \HKEY_CURRENT_USER, etc). This might be changed in 
- *   the future and we might want to make it possible to configure 
- *   what registries are behind which hives (e.g. 
- * \HKEY_CURRENT_USER -> gconf,
- * \HKEY_LOCAL_MACHINE -> tdb,
- * etc
- */
+enum handle_types { HTYPE_REGVAL, HTYPE_REGKEY };
 
-enum handle_types { HTYPE_REGKEY, HTYPE_REGVAL };
-
-struct _privatedata {
-   struct registry_context *registry;
-};
-
-
-/* this function is called when the client disconnects the endpoint */
-static void winreg_unbind(struct dcesrv_connection *dc, const struct dcesrv_interface 
*di) 
+static void winreg_destroy_hive(struct dcesrv_connection *c, struct dcesrv_handle *h)
 {
+   /* FIXME: Free ((struct registry_key *)h->data)->root->hive->reg_ctx */
 }
 
-static NTSTATUS winreg_bind(struct dcesrv_call_state *dc, const struct 
dcesrv_interface *di) 
+static WERROR winreg_openhive (struct dcesrv_call_state *dce_call, TALLOC_CTX 
*mem_ctx, const char *hivename, struct policy_handle **outh)
 {
-   struct _privatedata *data;
+   struct registry_context *ctx;
+   struct dcesrv_handle *h; 
WERROR error;
-   data = talloc_p(dc->conn, struct _privatedata);
-   error = reg_create(&data->registry);
+   const char *conf = lp_parm_string(-1, "registry", hivename);
+   char *backend, *location;
+   
+   if (!conf) {
+   return WERR_NOT_SUPPORTED;
+   }
 
-   /* FIXME: This should happen somewhere after configuration... */
-   reg_import_hive(data->registry, "nt4", "NTUSER.DAT", "", "HKEY_CURRENT_USER");
-   reg_import_hive(data->registry, "ldb", "ldb:///", "", "HKEY_LOCAL_MACHINE");
+   backend = talloc_strdup(mem_ctx, conf);
+   location = strchr(backend, ':');
 
-   if(!W_ERROR_IS_OK(error)) return werror_to_ntstatus(error);
-   dc->conn->private = data;
-   return NT_STATUS_OK;
+   if (location) {
+   *location = '\0';
+   location++;
+   }
+
+   error = reg_open(&ctx, backend, location, NULL); 
+   if(!W_ERROR_IS_OK(error)) return error; 
+   
+   h = dcesrv_handle_new(dce_call->conn, HTYPE_REGKEY); 
+   h->data = ctx->hives[0]->root; 
+   SMB_ASSERT(h->data);
+   h->destroy = winreg_destroy_hive;
+   *outh = &h->wire_handle; 
+   return WERR_OK; 
 }
 
-#define DCESRV_INTERFACE_WINREG_BIND winreg_bind
-#define DCESRV_INTERFACE_WINREG_UNBIND winreg_unbind
-
 #define func_winreg_OpenHive(k,n) static WERROR winreg_Open ## k (struct 
dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct winreg_Open ## k *r) \
 { \
-   struct _privatedata *data = dce_call->conn->private; \
-   struct registry_key *root; \
-   struct dcesrv_handle *h; \
-   WERROR error = reg_get_hive(data->registry, n, &root); \
-   if(!W_ERROR_IS_OK(error)) return error; \
- 

svn commit: samba r3337 - in branches/SAMBA_4_0/source/ntvfs/nbench: .

2004-10-28 Thread metze
Author: metze
Date: 2004-10-28 22:18:52 + (Thu, 28 Oct 2004)
New Revision: 3337

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3337

Log:
remove debug code and reanable the reall logging:-)

metze

Modified:
   branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c
===
--- branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c 2004-10-28 21:48:53 UTC (rev 
3336)
+++ branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c 2004-10-28 22:18:52 UTC (rev 
3337)
@@ -47,7 +47,7 @@
vasprintf(&s, format, ap);
va_end(ap);
 
-   //write(private->log_fd, s, strlen(s));
+   write(private->log_fd, s, strlen(s));
free(s);
 }
 
@@ -68,10 +68,7 @@
 #define PASS_THRU_REQ_POST_ASYNC(req) do { \
req->async_states->status = status; \
if (!(req->async_states->state & NTVFS_ASYNC_STATE_ASYNC)) { \
-DEBUG(0,("NBENCH S 0x%04X: %s: %s 0x%X\n", req->mid, __FUNCTION__, 
nt_errstr(status),req->async_states->state)); \
req->async_states->send_fn(req); \
-   } else { \
-DEBUG(0,("NBENCH A 0x%04X: %s: %s\n", req->mid, __FUNCTION__, nt_errstr(status))); \
} \
 } while (0)
 
@@ -84,7 +81,6 @@
 #define PASS_THRU_REP_POST(req) do { \
ntvfs_async_state_pop(req); \
if (req->async_states->state & NTVFS_ASYNC_STATE_ASYNC) { \
-DEBUG(0,("NBENCH  A0x%04X: %s: %s\n", req->mid, __FUNCTION__, 
nt_errstr(req->async_states->status))); \
req->async_states->send_fn(req); \
} \
 } while (0)
@@ -106,7 +102,7 @@
if (!nprivates) {
return NT_STATUS_NO_MEMORY;
}
-#if 0
+
asprintf(&logname, "/tmp/nbenchlog%d.%u", ntvfs->depth, getpid());
nprivates->log_fd = sys_open(logname, O_WRONLY|O_CREAT|O_APPEND, 0644);
free(logname);
@@ -115,7 +111,7 @@
DEBUG(0,("Failed to open nbench log\n"));
return NT_STATUS_UNSUCCESSFUL;
}
-#endif
+
ntvfs->private_data = nprivates;
 
status = ntvfs_next_connect(ntvfs, req, sharename);



svn commit: samba r3336 - in branches/SAMBA_4_0/source: include ntvfs ntvfs/cifs ntvfs/nbench ntvfs/posix smb_server

2004-10-28 Thread metze
Author: metze
Date: 2004-10-28 21:48:53 + (Thu, 28 Oct 2004)
New Revision: 3336

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3336

Log:
use a struct ntvfs_async_state to be able to do async chaning of ntvfs modules

the idea is that a passthru module can use ntvfs_async_state_push() before
calling ntvfs_next_*() and in the _send function it calls 
ntvfs_async_state_pop() and then call the upper layer send_fn itself

- ntvfs_nbench is now fully async

- the ntvfs_map_*() functions and the trans(2) mapping functions are not converted yet

metze

Modified:
   branches/SAMBA_4_0/source/include/smb.h
   branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c
   branches/SAMBA_4_0/source/ntvfs/nbench/vfs_nbench.c
   branches/SAMBA_4_0/source/ntvfs/ntvfs.h
   branches/SAMBA_4_0/source/ntvfs/ntvfs_base.c
   branches/SAMBA_4_0/source/ntvfs/ntvfs_generic.c
   branches/SAMBA_4_0/source/ntvfs/ntvfs_util.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_lock.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_wait.c
   branches/SAMBA_4_0/source/smb_server/reply.c
   branches/SAMBA_4_0/source/smb_server/request.c
   branches/SAMBA_4_0/source/smb_server/search.c
   branches/SAMBA_4_0/source/smb_server/smb_server.c
   branches/SAMBA_4_0/source/smb_server/smb_server.h


Changeset:
Sorry, the patch is too large (2458 lines) to include; please use WebSVN to see it!
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3336


svn commit: samba r3335 - in branches/SAMBA_4_0/source/lib/socket: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 21:47:10 + (Thu, 28 Oct 2004)
New Revision: 3335

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3335

Log:
better configure support for ipv6 - thanks to a quick tutorial from metze


Modified:
   branches/SAMBA_4_0/source/lib/socket/config.m4


Changeset:
Modified: branches/SAMBA_4_0/source/lib/socket/config.m4
===
--- branches/SAMBA_4_0/source/lib/socket/config.m4  2004-10-28 21:41:21 UTC (rev 
3334)
+++ branches/SAMBA_4_0/source/lib/socket/config.m4  2004-10-28 21:47:10 UTC (rev 
3335)
@@ -2,10 +2,16 @@
 SMB_MODULE_MK(socket_ipv4,SOCKET,STATIC,lib/socket/config.mk)
 SMB_MODULE_MK(socket_unix,SOCKET,STATIC,lib/socket/config.mk)
 
+dnl test for ipv6 using the gethostbyname2() function. That should be sufficient
+dnl for now
 AC_CHECK_FUNCS(gethostbyname2, have_ipv6=true, have_ipv6=false)
 if $have_ipv6 = true; then
+SMB_MODULE_DEFAULT(socket_ipv6, STATIC)
 AC_DEFINE(HAVE_SOCKET_IPV6,1,[Whether the system has ipv6 support])
-SMB_MODULE_MK(socket_ipv6,SOCKET,STATIC,lib/socket/config.mk)
 fi
 
+dnl don't build ipv6 by default, unless the above test enables it, or
+dnl the configure uses --with-static-modules=socket_ipv6
+SMB_MODULE_MK(socket_ipv6,SOCKET,NOT,lib/socket/config.mk)
+
 SMB_SUBSYSTEM_MK(SOCKET,lib/socket/config.mk)



svn commit: samba r3334 - in branches/SAMBA_4_0/source/lib/socket: .

2004-10-28 Thread jelmer
Author: jelmer
Date: 2004-10-28 21:41:21 + (Thu, 28 Oct 2004)
New Revision: 3334

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3334

Log:
Allow disabling IPv6 support using socket:noipv6

Modified:
   branches/SAMBA_4_0/source/lib/socket/socket.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/socket/socket.c
===
--- branches/SAMBA_4_0/source/lib/socket/socket.c   2004-10-28 21:36:27 UTC (rev 
)
+++ branches/SAMBA_4_0/source/lib/socket/socket.c   2004-10-28 21:41:21 UTC (rev 
3334)
@@ -269,6 +269,10 @@
 
 #if HAVE_SOCKET_IPV6
if (strcmp("ipv6", name) == 0) {
+   if (lp_parm_bool(-1, "socket", "noipv6", False)) {
+   DEBUG(3, ("IPv6 support was disabled in smb.conf"));
+   return NULL;
+   }
return socket_ipv6_ops();
}
 #endif



svn commit: samba r3333 - in branches/SAMBA_4_0/source/lib/socket: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 21:36:27 + (Thu, 28 Oct 2004)
New Revision: 

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=

Log:
added configure tests for ipv6 support

Modified:
   branches/SAMBA_4_0/source/lib/socket/config.m4
   branches/SAMBA_4_0/source/lib/socket/socket.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/socket/config.m4
===
--- branches/SAMBA_4_0/source/lib/socket/config.m4  2004-10-28 21:24:29 UTC (rev 
3332)
+++ branches/SAMBA_4_0/source/lib/socket/config.m4  2004-10-28 21:36:27 UTC (rev 
)
@@ -1,6 +1,11 @@
 
 SMB_MODULE_MK(socket_ipv4,SOCKET,STATIC,lib/socket/config.mk)
-SMB_MODULE_MK(socket_ipv6,SOCKET,STATIC,lib/socket/config.mk)
 SMB_MODULE_MK(socket_unix,SOCKET,STATIC,lib/socket/config.mk)
 
+AC_CHECK_FUNCS(gethostbyname2, have_ipv6=true, have_ipv6=false)
+if $have_ipv6 = true; then
+AC_DEFINE(HAVE_SOCKET_IPV6,1,[Whether the system has ipv6 support])
+SMB_MODULE_MK(socket_ipv6,SOCKET,STATIC,lib/socket/config.mk)
+fi
+
 SMB_SUBSYSTEM_MK(SOCKET,lib/socket/config.mk)

Modified: branches/SAMBA_4_0/source/lib/socket/socket.c
===
--- branches/SAMBA_4_0/source/lib/socket/socket.c   2004-10-28 21:24:29 UTC (rev 
3332)
+++ branches/SAMBA_4_0/source/lib/socket/socket.c   2004-10-28 21:36:27 UTC (rev 
)
@@ -267,9 +267,11 @@
return socket_ipv4_ops();
}
 
+#if HAVE_SOCKET_IPV6
if (strcmp("ipv6", name) == 0) {
return socket_ipv6_ops();
}
+#endif
 
if (strcmp("unix", name) == 0) {
return socket_unixdom_ops();



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

2004-10-28 Thread jelmer
Author: jelmer
Date: 2004-10-28 21:24:29 + (Thu, 28 Oct 2004)
New Revision: 3332

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3332

Log:
Check result codes in some more places...

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/winreg.c
===
--- branches/SAMBA_4_0/source/torture/rpc/winreg.c  2004-10-28 21:00:38 UTC (rev 
3331)
+++ branches/SAMBA_4_0/source/torture/rpc/winreg.c  2004-10-28 21:24:29 UTC (rev 
3332)
@@ -126,6 +126,11 @@
return False;
}
 
+   if (!W_ERROR_IS_OK(r.out.result)) {
+   printf("FlushKey failed - %s\n", win_errstr(r.out.result));
+   return False;
+   }
+
return True;
 }
 
@@ -257,7 +262,7 @@
 
r.in.enum_index++;
 
-   } while (W_ERROR_IS_OK(r.out.result));
+   } while (NT_STATUS_IS_OK(status) && W_ERROR_IS_OK(r.out.result));
 
return True;
 }
@@ -330,6 +335,11 @@
return False;
}
 
+   if (!W_ERROR_IS_OK(r.out.result)) {
+   printf("OpenHKLM failed - %s\n", win_errstr(r.out.result));
+   return False;
+   }
+
return ret;
 }
 



svn commit: samba r3331 - in branches/SAMBA_4_0/source/libcli/util: .

2004-10-28 Thread jelmer
Author: jelmer
Date: 2004-10-28 21:00:38 + (Thu, 28 Oct 2004)
New Revision: 3331

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3331

Log:
Add string descriptions for a couple more WERROR's

Modified:
   branches/SAMBA_4_0/source/libcli/util/doserr.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/util/doserr.c
===
--- branches/SAMBA_4_0/source/libcli/util/doserr.c  2004-10-28 19:14:26 UTC (rev 
3330)
+++ branches/SAMBA_4_0/source/libcli/util/doserr.c  2004-10-28 21:00:38 UTC (rev 
3331)
@@ -68,9 +68,19 @@
{ "WERR_INVALID_SECURITY_DESCRIPTOR", WERR_INVALID_SECURITY_DESCRIPTOR },
{ "WERR_INVALID_OWNER", WERR_INVALID_OWNER },
{ "WERR_DS_OBJ_NOT_FOUND", WERR_DS_OBJ_NOT_FOUND },
+   { "WERR_GENERAL_FAILURE", WERR_GENERAL_FAILURE },
+   { "WERR_PRINTQ_FULL", WERR_PRINTQ_FULL },
+   { "WERR_NO_SPOOL_SPACE", WERR_NO_SPOOL_SPACE },
+   { "WERR_CAN_NOT_COMPLETE", WERR_CAN_NOT_COMPLETE },
+   { "WERR_SERVER_UNAVAILABLE", WERR_SERVER_UNAVAILABLE },
{ NULL, W_ERROR(0) }
 };
 
+
+
+
+/* DFS errors */
+
 /*
  returns a windows error message.  not amazingly helpful, but better than a number.
  */



svn commit: samba r3330 - in branches/SAMBA_4_0/source/librpc/rpc: .

2004-10-28 Thread jelmer
Author: jelmer
Date: 2004-10-28 19:14:26 + (Thu, 28 Oct 2004)
New Revision: 3330

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3330

Log:
Use IPv6 for RPC client connections if we can

Modified:
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_sock.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_sock.c
===
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_sock.c  2004-10-28 18:57:48 UTC (rev 
3329)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_sock.c  2004-10-28 19:14:26 UTC (rev 
3330)
@@ -361,7 +361,15 @@
 */
 NTSTATUS dcerpc_pipe_open_tcp(struct dcerpc_pipe **p, const char *server, uint32_t 
port)
 {
-   return dcerpc_pipe_open_socket(p, server, port, "ip", NCACN_IP_TCP);
+   NTSTATUS status;
+   
+   /* Try IPv6 first */
+   status = dcerpc_pipe_open_socket(p, server, port, "ipv6", NCACN_IP_TCP);
+   if (NT_STATUS_IS_OK(status)) {
+   return status;
+   }
+   
+   return dcerpc_pipe_open_socket(p, server, port, "ipv4", NCACN_IP_TCP);
 }
 
 /* 



svn commit: samba r3329 - in branches/SAMBA_4_0/source/lib/socket: .

2004-10-28 Thread jelmer
Author: jelmer
Date: 2004-10-28 18:57:48 + (Thu, 28 Oct 2004)
New Revision: 3329

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3329

Log:
Add support for IPv6

Added:
   branches/SAMBA_4_0/source/lib/socket/socket_ipv6.c
Modified:
   branches/SAMBA_4_0/source/lib/socket/config.m4
   branches/SAMBA_4_0/source/lib/socket/config.mk
   branches/SAMBA_4_0/source/lib/socket/socket.c


Changeset:
Sorry, the patch is too large (413 lines) to include; please use WebSVN to see it!
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3329


svn commit: samba-web r391 - in hooks: .

2004-10-28 Thread metze
Author: metze
Date: 2004-10-28 15:57:23 + (Thu, 28 Oct 2004)
New Revision: 391

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-web&rev=391

Log:
point changeset link directly to the new viewcvs

metze

Modified:
   hooks/commit-email.pl


Changeset:
Modified: hooks/commit-email.pl
===
--- hooks/commit-email.pl   2004-10-28 15:51:05 UTC (rev 390)
+++ hooks/commit-email.pl   2004-10-28 15:57:23 UTC (rev 391)
@@ -339,7 +339,7 @@
 
 # Put together the body of the log message.
 my $repname = basename($repos);
-my $websvn_link = "WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=$repname\&path=/$commondir\&rev=$rev\&nolog=1\n";;
+my $websvn_link = "WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev\&root=$repname\&rev=$rev\n";;
 my @body;
 push(@body, "Author: $author\n");
 push(@body, "Date: $date\n");



svn commit: samba r3328 - in hooks: .

2004-10-28 Thread metze
Author: metze
Date: 2004-10-28 15:56:51 + (Thu, 28 Oct 2004)
New Revision: 3328

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=3328

Log:
point changeset link directly to the new viewcvs

metze

Modified:
   hooks/commit-email.pl


Changeset:
Modified: hooks/commit-email.pl
===
--- hooks/commit-email.pl   2004-10-28 13:51:41 UTC (rev 3327)
+++ hooks/commit-email.pl   2004-10-28 15:56:51 UTC (rev 3328)
@@ -339,7 +339,7 @@
 
 # Put together the body of the log message.
 my $repname = basename($repos);
-my $websvn_link = "WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=$repname\&path=/$commondir\&rev=$rev\&nolog=1\n";;
+my $websvn_link = "WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev\&root=$repname\&rev=$rev\n";;
 my @body;
 push(@body, "Author: $author\n");
 push(@body, "Date: $date\n");



svn commit: lorikeet r115 - in hooks: .

2004-10-28 Thread metze
Author: metze
Date: 2004-10-28 15:56:11 + (Thu, 28 Oct 2004)
New Revision: 115

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=115

Log:
point changeset link directly to the new viewcvs

metze

Modified:
   hooks/commit-email.pl


Changeset:
Modified: hooks/commit-email.pl
===
--- hooks/commit-email.pl   2004-10-28 14:11:55 UTC (rev 114)
+++ hooks/commit-email.pl   2004-10-28 15:56:11 UTC (rev 115)
@@ -339,7 +339,7 @@
 
 # Put together the body of the log message.
 my $repname = basename($repos);
-my $websvn_link = "WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=$repname\&path=/$commondir\&rev=$rev\&nolog=1\n";;
+my $websvn_link = "WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev\&root=$repname\&rev=$rev\n";;
 my @body;
 push(@body, "Author: $author\n");
 push(@body, "Date: $date\n");



svn commit: linux-cifs-client r12 - in hooks: .

2004-10-28 Thread metze
Author: metze
Date: 2004-10-28 15:55:22 + (Thu, 28 Oct 2004)
New Revision: 12

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=linux-cifs-client&rev=12

Log:
point changeset link directly to the new viewcvs

metze

Modified:
   hooks/commit-email.pl


Changeset:
Modified: hooks/commit-email.pl
===
--- hooks/commit-email.pl   2004-08-25 14:05:54 UTC (rev 11)
+++ hooks/commit-email.pl   2004-10-28 15:55:22 UTC (rev 12)
@@ -339,7 +339,7 @@
 
 # Put together the body of the log message.
 my $repname = basename($repos);
-my $websvn_link = "WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=$repname\&path=/$commondir\&rev=$rev\&nolog=1\n";;
+my $websvn_link = "WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev\&root=$repname\&rev=$rev\n";;
 my @body;
 push(@body, "Author: $author\n");
 push(@body, "Date: $date\n");



svn commit: samba-web r390 - in trunk/news/developers: .

2004-10-28 Thread deryck
Author: deryck
Date: 2004-10-28 15:51:05 + (Thu, 28 Oct 2004)
New Revision: 390

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba-web&path=/trunk/news/developers&rev=390&nolog=1

Log:

Add an announcement about the new viewcvs.

--deryck

Added:
   trunk/news/developers/viewcvs_upgrade.html


Changeset:
Added: trunk/news/developers/viewcvs_upgrade.html
===
--- trunk/news/developers/viewcvs_upgrade.html  2004-10-26 22:10:08 UTC (rev 389)
+++ trunk/news/developers/viewcvs_upgrade.html  2004-10-28 15:51:05 UTC (rev 390)
@@ -0,0 +1,17 @@
+Viewcvs Successfully Upgraded 
+
+
+samba.org is pleased to announce that the web interface to our 
+Subversion repositories has been successfully migrated to Viewcvs.
+We are using the 1.0 development branch of Viewcvs, but it has been
+customized to include a changeset view and a recent commits page.
+The web-app's design was also changed to reflect the new samba.org
+design.  The ability to view changesets was a much requested feature,
+and these changes will be offered back to Viewcvs developers for their
+consideration.
+
+You can view the Samba source through the newly upgraded Viewcvs 
+install at http://websvn.samba.org";>http://websvn.samba.org/.
+
+
+   


Property changes on: trunk/news/developers/viewcvs_upgrade.html
___
Name: svn:executable
   + *



svn commit: samba-docs r259 - in hooks: .

2004-10-28 Thread metze
Author: metze
Date: 2004-10-28 15:48:25 + (Thu, 28 Oct 2004)
New Revision: 259

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba-docs&rev=259

Log:
point changeset link directly to the new viewcvs

metze

Modified:
   hooks/commit-email.pl


Changeset:
Modified: hooks/commit-email.pl
===
--- hooks/commit-email.pl   2004-10-26 18:54:49 UTC (rev 258)
+++ hooks/commit-email.pl   2004-10-28 15:48:25 UTC (rev 259)
@@ -339,7 +339,7 @@
 
 # Put together the body of the log message.
 my $repname = basename($repos);
-my $websvn_link = "WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=$repname\&path=/$commondir\&rev=$rev\&nolog=1\n";;
+my $websvn_link = "WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev\&root=$repname\&rev=$rev\n";;
 my @body;
 push(@body, "Author: $author\n");
 push(@body, "Date: $date\n");



svn commit: lorikeet r114 - in trunk/samba4-ad-thesis: .

2004-10-28 Thread abartlet
Author: abartlet
Date: 2004-10-28 14:11:55 + (Thu, 28 Oct 2004)
New Revision: 114

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=lorikeet&path=/trunk/samba4-ad-thesis&rev=114&nolog=1

Log:
More fixes - jmcd is again generous with his time.

Andrew Bartlett

Modified:
   trunk/samba4-ad-thesis/chapters.lyx


Changeset:
Modified: trunk/samba4-ad-thesis/chapters.lyx
===
--- trunk/samba4-ad-thesis/chapters.lyx 2004-10-28 13:22:14 UTC (rev 113)
+++ trunk/samba4-ad-thesis/chapters.lyx 2004-10-28 14:11:55 UTC (rev 114)
@@ -911,8 +911,8 @@
 \layout Standard
 
 Many distributed authentication systems allow logins to occur on numerous
- hosts, but only a few hosts (possibly one) actually confirms or denies
- an authentication request.
+ hosts, but only a few hosts (possibly one) actually confirm or deny an
+ authentication request.
  These are trusted third party systems; all hosts trust those with the passwords
  (the third party in the authentication exchange) to correctly return authentica
 tions success or failure.
@@ -975,9 +975,9 @@
 Single Sign On
 \layout Standard
 
-Often abbreviated as simply SSO, the concept of Single Sign On is quite
- simply a matter of usability; users wish to establish their identity once,
- and not have to think about it after that.
+Often abbreviated as simply SSO, the concept of Single Sign On is a matter
+ of usability; users wish to establish their identity once, and not have
+ to think about it after that.
  This allows for more complex authentication procedures as the user only
  has to tolerate them once per session.
  SSO has become the expectation in modern network environments.
@@ -1188,10 +1188,30 @@
 \end_inset 
 
 .
- Unfortunately a number of other improvements are also labeled NTLMv2, but
- we will start by describing the new NTLMv2 challenge-response:
+ Unfortunately a number of other improvements are also labeled NTLMv2
+\begin_inset Foot
+collapsed true
+
 \layout Standard
 
+The improvements labeled as NTLMv2 include the NTLM2 session response (described
+ in Section 
+\begin_inset LatexCommand \ref{sub:NTLM2-Session-Response}
+
+\end_inset 
+
+) and NTLMv2 Session Security, which changes the NTLMSSP signing and sealing
+ algorithm, (described in section 
+\begin_inset LatexCommand \ref{sub:NTLMSSP-Signing-and}
+
+\end_inset 
+
+).
+\end_inset 
+
+, but we will start by describing the new NTLMv2 challenge-response:
+\layout Standard
+
 NTLMv2 uses the same NT hash, but instead of the LM challenge-response formula,
  a new system based on HMAC-MD5
 \begin_inset LatexCommand \citet{rfc2104}
@@ -1207,11 +1227,11 @@
 Session Keys
 \layout Standard
 
-As part of the byproduct of NTLM authentication, a password-derived `session
- key' is produced for use in verifying or encrypting data carried between
- the client and server.
- The algorithm used varies depending on the method of authentication, but
- unfortunately  can be very weak - often a fixed derivative of the user's
+As a byproduct of NTLM authentication, a password-derived `session key'
+ is produced for use in verifying or encrypting data carried between the
+ client and server.
+ The algorithm used varies depending on the method of authentication and
+ unfortunately can be very weak - often a fixed derivative of the user's
  password! This key is known as the `user session key', and is used in a
  number of places within CIFS directly, as well as by the NTLMSSP suite.
 \layout Subsubsection*
@@ -1259,17 +1279,21 @@
 
 ).
  As such, the NTLM challenge-response steps have been wrapped into a framework
- such that a calling application need only know how to pass messages, not
- to understand them.
- At each end of the connection, these blobs of data are passed down to the
- security libraries for processing.
+ such that a calling application need only know how to pass these messages,
+ not to understand them.
+ At each end of the connection, these messages are passed down to the security
+ libraries for processing.
 \layout Subsection
 
 NTLMSSP Packets
 \layout Standard
 
-Within those blobs of data is a particular packet format, which is known
- as NTLMSSP, partly because this ASCII string prepends every protocol message.
+Within those messages is a particular packet format, which is known as NTLMSSP,
+ partly because the ASCII string 
+\family typewriter 
+"NTLMSSP"
+\family default 
+ prepends every protocol exchange.
  Three different packets pass back and forth between client and server:
 \layout List
 \labelwidthstring 00.00.
@@ -1355,21 +1379,26 @@
 \layout Standard
 
 When the LM_KEY option is not negotiated, and no other options are specified,
- the session key is the NT Key from the NTLM level.
- This is stronger in hash strength, with real 128 bit strength, but again,
- the key is fixed until the user's password changes.
- Unfortunately other factors, the use the LM response function for the authentic
-ation step, means

svn commit: samba r3327 - in branches/SAMBA_4_0/source/client: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 13:51:41 + (Thu, 28 Oct 2004)
New Revision: 3327

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/client&rev=3327&nolog=1

Log:
fixed another warning

we're now down the the last few warnings. Most are enum warnings
caused by unfinished code (unhandled enum levels). If you want to get
rid of those then work on finishing that code.

Modified:
   branches/SAMBA_4_0/source/client/clitar.c


Changeset:
Modified: branches/SAMBA_4_0/source/client/clitar.c
===
--- branches/SAMBA_4_0/source/client/clitar.c   2004-10-28 13:50:13 UTC (rev 3326)
+++ branches/SAMBA_4_0/source/client/clitar.c   2004-10-28 13:51:41 UTC (rev 3327)
@@ -1441,19 +1441,19 @@
 /
 Principal command for creating / extracting
 ***/
-int cmd_tar(char **cmd_ptr)
+int cmd_tar(const char **cmd_ptr)
 {
   fstring buf;
   char **argl;
   int argcl;
 
-  if (!next_token((const char **)cmd_ptr,buf,NULL,sizeof(buf)))
+  if (!next_token(cmd_ptr,buf,NULL,sizeof(buf)))
 {
   DEBUG(0,("tar [IXbgan] \n"));
   return 1;
 }
 
-  argl=toktocliplist(*cmd_ptr, &argcl, NULL);
+  argl=toktocliplist(discard_const_p(char, *cmd_ptr), &argcl, NULL);
   if (!tar_parseargs(argcl, argl, buf, 0))
 return 1;
 



svn commit: samba r3326 - in branches/SAMBA_3_0/source/param: .

2004-10-28 Thread jerry
Author: jerry
Date: 2004-10-28 13:50:13 + (Thu, 28 Oct 2004)
New Revision: 3326

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_3_0/source/param&rev=3326&nolog=1

Log:
BUG 1782: reorder loadparm.c to prevent testparm from displaying synonyms; patch from 
Luke Mewburn <[EMAIL PROTECTED]>
Modified:
   branches/SAMBA_3_0/source/param/loadparm.c


Changeset:
Modified: branches/SAMBA_3_0/source/param/loadparm.c
===
--- branches/SAMBA_3_0/source/param/loadparm.c  2004-10-28 13:41:35 UTC (rev 3325)
+++ branches/SAMBA_3_0/source/param/loadparm.c  2004-10-28 13:50:13 UTC (rev 3326)
@@ -794,8 +794,8 @@
{"server schannel", P_ENUM, P_GLOBAL, &Globals.serverSchannel, NULL, 
enum_bool_auto, FLAG_BASIC | FLAG_ADVANCED}, 
{"allow trusted domains", P_BOOL, P_GLOBAL, &Globals.bAllowTrustedDomains, 
NULL, NULL, FLAG_ADVANCED}, 
{"hosts equiv", P_STRING, P_GLOBAL, &Globals.szHostsEquiv, NULL, NULL, 
FLAG_ADVANCED}, 
+   {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, 
NULL, FLAG_ADVANCED}, 
{"min passwd length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, 
NULL, FLAG_ADVANCED}, 
-   {"min password length", P_INTEGER, P_GLOBAL, &Globals.min_passwd_length, NULL, 
NULL, FLAG_ADVANCED}, 
{"map to guest", P_ENUM, P_GLOBAL, &Globals.map_to_guest, NULL, 
enum_map_to_guest, FLAG_ADVANCED}, 
{"null passwords", P_BOOL, P_GLOBAL, &Globals.bNullPasswords, NULL, NULL, 
FLAG_ADVANCED}, 
{"obey pam restrictions", P_BOOL, P_GLOBAL, &Globals.bObeyPamRestrictions, 
NULL, NULL, FLAG_ADVANCED}, 
@@ -881,8 +881,8 @@
{"log file", P_STRING, P_GLOBAL, &Globals.szLogFile, NULL, NULL, 
FLAG_ADVANCED}, 
 
{"max log size", P_INTEGER, P_GLOBAL, &Globals.max_log_size, NULL, NULL, 
FLAG_ADVANCED}, 
+   {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 
FLAG_ADVANCED}, 
{"timestamp logs", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 
FLAG_ADVANCED}, 
-   {"debug timestamp", P_BOOL, P_GLOBAL, &Globals.bTimestampLogs, NULL, NULL, 
FLAG_ADVANCED}, 
{"debug hires timestamp", P_BOOL, P_GLOBAL, &Globals.bDebugHiresTimestamp, 
NULL, NULL, FLAG_ADVANCED}, 
{"debug pid", P_BOOL, P_GLOBAL, &Globals.bDebugPid, NULL, NULL, 
FLAG_ADVANCED}, 
{"debug uid", P_BOOL, P_GLOBAL, &Globals.bDebugUid, NULL, NULL, 
FLAG_ADVANCED}, 
@@ -890,9 +890,9 @@
{N_("Protocol Options"), P_SEP, P_SEPARATOR}, 
 
{"smb ports", P_STRING, P_GLOBAL, &Globals.smb_ports, NULL, NULL, 
FLAG_ADVANCED}, 
-   {"protocol", P_ENUM, P_GLOBAL, &Globals.maxprotocol, NULL, enum_protocol, 
FLAG_ADVANCED}, 
{"large readwrite", P_BOOL, P_GLOBAL, &Globals.bLargeReadwrite, NULL, NULL, 
FLAG_ADVANCED}, 
{"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}, 
@@ -1131,8 +1131,8 @@
 
{"copy", P_STRING, P_LOCAL, &sDefault.szCopy, handle_copy, NULL, FLAG_HIDE}, 
{"include", P_STRING, P_LOCAL, &sDefault.szInclude, handle_include, NULL, 
FLAG_HIDE}, 
-   {"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_ADVANCED | 
FLAG_SHARE | FLAG_PRINT}, 
-   {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, 
FLAG_ADVANCED}, 
+   {"preexec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_ADVANCED 
| FLAG_SHARE | FLAG_PRINT}, 
+   {"exec", P_STRING, P_LOCAL, &sDefault.szPreExec, NULL, NULL, FLAG_ADVANCED}, 
 
{"preexec close", P_BOOL, P_LOCAL, &sDefault.bPreexecClose, NULL, NULL, 
FLAG_ADVANCED | FLAG_SHARE}, 
{"postexec", P_STRING, P_LOCAL, &sDefault.szPostExec, NULL, NULL, 
FLAG_ADVANCED | FLAG_SHARE | FLAG_PRINT}, 



svn commit: samba r3325 - in branches/SAMBA_4_0/source/torture/nbench: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 13:41:35 + (Thu, 28 Oct 2004)
New Revision: 3325

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/torture/nbench&rev=3325&nolog=1

Log:
missed one of the torture changes ...



Modified:
   branches/SAMBA_4_0/source/torture/nbench/nbio.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/nbench/nbio.c
===
--- branches/SAMBA_4_0/source/torture/nbench/nbio.c 2004-10-28 13:40:50 UTC (rev 
3324)
+++ branches/SAMBA_4_0/source/torture/nbench/nbio.c 2004-10-28 13:41:35 UTC (rev 
3325)
@@ -61,7 +61,7 @@
 }
 
 
-void nb_alarm(void)
+void nb_alarm(int sig)
 {
int i;
int lines=0, num_clients=0;



svn commit: samba r3324 - in branches/SAMBA_4_0/source/torture: . auth basic ldap local nbench rap raw rpc

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 13:40:50 + (Thu, 28 Oct 2004)
New Revision: 3324

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/torture&rev=3324&nolog=1

Log:
made the smbtorture code completely warning free


Modified:
   branches/SAMBA_4_0/source/torture/auth/ntlmssp.c
   branches/SAMBA_4_0/source/torture/basic/aliases.c
   branches/SAMBA_4_0/source/torture/basic/attr.c
   branches/SAMBA_4_0/source/torture/basic/charset.c
   branches/SAMBA_4_0/source/torture/basic/delete.c
   branches/SAMBA_4_0/source/torture/basic/denytest.c
   branches/SAMBA_4_0/source/torture/basic/dfstest.c
   branches/SAMBA_4_0/source/torture/basic/dir.c
   branches/SAMBA_4_0/source/torture/basic/locking.c
   branches/SAMBA_4_0/source/torture/basic/mangle_test.c
   branches/SAMBA_4_0/source/torture/basic/rename.c
   branches/SAMBA_4_0/source/torture/basic/scanner.c
   branches/SAMBA_4_0/source/torture/basic/secleak.c
   branches/SAMBA_4_0/source/torture/basic/utable.c
   branches/SAMBA_4_0/source/torture/ldap/basic.c
   branches/SAMBA_4_0/source/torture/local/binding_string.c
   branches/SAMBA_4_0/source/torture/local/iconv.c
   branches/SAMBA_4_0/source/torture/local/idtree.c
   branches/SAMBA_4_0/source/torture/local/messaging.c
   branches/SAMBA_4_0/source/torture/local/talloc.c
   branches/SAMBA_4_0/source/torture/nbench/nbench.c
   branches/SAMBA_4_0/source/torture/rap/rap.c
   branches/SAMBA_4_0/source/torture/raw/chkpath.c
   branches/SAMBA_4_0/source/torture/raw/close.c
   branches/SAMBA_4_0/source/torture/raw/context.c
   branches/SAMBA_4_0/source/torture/raw/ioctl.c
   branches/SAMBA_4_0/source/torture/raw/lock.c
   branches/SAMBA_4_0/source/torture/raw/mkdir.c
   branches/SAMBA_4_0/source/torture/raw/mux.c
   branches/SAMBA_4_0/source/torture/raw/notify.c
   branches/SAMBA_4_0/source/torture/raw/open.c
   branches/SAMBA_4_0/source/torture/raw/oplock.c
   branches/SAMBA_4_0/source/torture/raw/qfileinfo.c
   branches/SAMBA_4_0/source/torture/raw/qfsinfo.c
   branches/SAMBA_4_0/source/torture/raw/read.c
   branches/SAMBA_4_0/source/torture/raw/rename.c
   branches/SAMBA_4_0/source/torture/raw/search.c
   branches/SAMBA_4_0/source/torture/raw/seek.c
   branches/SAMBA_4_0/source/torture/raw/setfileinfo.c
   branches/SAMBA_4_0/source/torture/raw/unlink.c
   branches/SAMBA_4_0/source/torture/raw/write.c
   branches/SAMBA_4_0/source/torture/rpc/atsvc.c
   branches/SAMBA_4_0/source/torture/rpc/autoidl.c
   branches/SAMBA_4_0/source/torture/rpc/bind.c
   branches/SAMBA_4_0/source/torture/rpc/countcalls.c
   branches/SAMBA_4_0/source/torture/rpc/dcom.c
   branches/SAMBA_4_0/source/torture/rpc/dfs.c
   branches/SAMBA_4_0/source/torture/rpc/drsuapi.c
   branches/SAMBA_4_0/source/torture/rpc/echo.c
   branches/SAMBA_4_0/source/torture/rpc/epmapper.c
   branches/SAMBA_4_0/source/torture/rpc/eventlog.c
   branches/SAMBA_4_0/source/torture/rpc/lsa.c
   branches/SAMBA_4_0/source/torture/rpc/mgmt.c
   branches/SAMBA_4_0/source/torture/rpc/netlogon.c
   branches/SAMBA_4_0/source/torture/rpc/oxidresolve.c
   branches/SAMBA_4_0/source/torture/rpc/samr.c
   branches/SAMBA_4_0/source/torture/rpc/scanner.c
   branches/SAMBA_4_0/source/torture/rpc/schannel.c
   branches/SAMBA_4_0/source/torture/rpc/spoolss.c
   branches/SAMBA_4_0/source/torture/rpc/srvsvc.c
   branches/SAMBA_4_0/source/torture/rpc/svcctl.c
   branches/SAMBA_4_0/source/torture/rpc/winreg.c
   branches/SAMBA_4_0/source/torture/rpc/wkssvc.c
   branches/SAMBA_4_0/source/torture/torture.c


Changeset:
Sorry, the patch is too large (1360 lines) to include; please use WebSVN to see it!
WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/torture&rev=3324&nolog=1


svn commit: lorikeet r113 - in trunk/samba4-ad-thesis: .

2004-10-28 Thread abartlet
Author: abartlet
Date: 2004-10-28 13:22:14 + (Thu, 28 Oct 2004)
New Revision: 113

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=lorikeet&path=/trunk/samba4-ad-thesis&rev=113&nolog=1

Log:
More fixes from dad.

Andrew Bartlett

Modified:
   trunk/samba4-ad-thesis/chapters.lyx


Changeset:
Modified: trunk/samba4-ad-thesis/chapters.lyx
===
--- trunk/samba4-ad-thesis/chapters.lyx 2004-10-27 13:26:57 UTC (rev 112)
+++ trunk/samba4-ad-thesis/chapters.lyx 2004-10-28 13:22:14 UTC (rev 113)
@@ -3043,10 +3043,10 @@
  hdb module development.
 \layout Section
 
-clapd
+Clapd
 \layout Standard
 
-clapd is a simple Connectionless LDAP daemon, written as part of the IBM
+Clapd is a simple Connectionless LDAP daemon, written as part of the IBM
  research effort
 \begin_inset LatexCommand \citep{jmcdAD}
 
@@ -3087,12 +3087,12 @@
 LDB
 \layout Standard
 
-LDB is a described as a `LDAP like Database'.
+LDB is described as a `LDAP like Database'.
  Designed to avoid giving Samba4 a dependency on OpenLDAP, ldb implements
  an `LDAP like' API and data format.
  LDB includes an abstraction layer that allows it to be backed onto LDAP,
  or onto a local flat-file database, in the format of a TDB.
- As such, a Samba4 installation can remain self-contained, without demanding
+ Therefore, a Samba4 installation can remain self-contained, without demanding
  the notoriously complex task of setting up an external LDAP server.
  
 \layout Standard
@@ -3402,7 +3402,7 @@
 Trying the short name
 \layout Standard
 
-After compleating the `failed' testing with long-name domain joins, comparison
+After completing the `failed' testing with long-name domain joins, comparison
  tests were run - to confirm the status of the `before' case, which was
  expected to easily be triggered by simply using the `short' or NetBIOS
  domain name.
@@ -3461,7 +3461,7 @@
 Crypto Challenges
 \layout Standard
 
-In implementing many of the Active Directory protocols, a there have been
+In implementing many of the Active Directory protocols, there have been
  a number of cryptographic puzzles which we have had to solve.
  These have involved determining the encryption routine, or in one case
  the previously unknown encryption keys used between Microsoft's own client
@@ -3469,7 +3469,7 @@
 \layout Standard
 
 Cryptographic challenges differ greatly from the normal style of network
- protocol analysis, because until the correct answer is obtained, there
+ protocol analysis because, until the correct answer is obtained, there
  is no indication how `close' a particular solution may be.
  This puts off many people from the challenge, but also makes the problem
  that much more rewarding when the answer finally arrives.
@@ -3576,7 +3576,7 @@
  own password.
 \end_inset 
 
- As such, versions of Windows 2000 introduced a confounder, into the session
+ Hence, versions of Windows 2000 introduced a confounder, into the session
  key (integrated in this case with MD5), to ensure that any two password
  set operations have distinct encryption keys.
 \layout Subsection
@@ -3729,8 +3729,8 @@
 Proof that it's a fixed key
 \layout Standard
 
-One of the first breakthrough in solving the puzzle was the realisation
- that despite changes in user-names and passwords, the encrypted secret
+One of the first breakthroughs in solving the puzzle was the realisation
+ that, despite changes in user-names and passwords, the encrypted secret
  would not change.
  This was most puzzling, because secrets are typically encrypted with a
  session key, a secret to between the user and server (which implies that



svn commit: samba r3323 - in branches/SAMBA_4_0/source: client lib lib/cmdline lib/ldb/ldb_ldap lib/registry/reg_backend_ldb lib/registry/reg_backend_nt4 lib/registry/reg_backend_rpc lib/registry/reg_backend_w95 libcli/auth nsswitch ntvfs/posix ntvfs/simple rpc_server torture utils/net

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 13:19:39 + (Thu, 28 Oct 2004)
New Revision: 3323

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=3323&nolog=1

Log:
more warning reductions

Modified:
   branches/SAMBA_4_0/source/client/client.c
   branches/SAMBA_4_0/source/client/clitar.c
   branches/SAMBA_4_0/source/lib/cmdline/readline.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
   branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb/reg_backend_ldb.c
   branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4/reg_backend_nt4.c
   branches/SAMBA_4_0/source/lib/registry/reg_backend_rpc/reg_backend_rpc.c
   branches/SAMBA_4_0/source/lib/registry/reg_backend_w95/reg_backend_w95.c
   branches/SAMBA_4_0/source/lib/time.c
   branches/SAMBA_4_0/source/libcli/auth/spnego_parse.c
   branches/SAMBA_4_0/source/nsswitch/wb_common.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_qfileinfo.c
   branches/SAMBA_4_0/source/ntvfs/simple/vfs_simple.c
   branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c
   branches/SAMBA_4_0/source/torture/torture.c
   branches/SAMBA_4_0/source/utils/net/net_time.c


Changeset:
Sorry, the patch is too large (472 lines) to include; please use WebSVN to see it!
WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=3323&nolog=1


svn commit: samba r3322 - in branches/SAMBA_4_0/source: lib libcli/auth libcli/raw libcli/util librpc/idl librpc/ndr librpc/rpc

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 12:46:59 + (Thu, 28 Oct 2004)
New Revision: 3322

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=3322&nolog=1

Log:
fixed a bunch of warnings in the build, including one case where it was a real bug

Modified:
   branches/SAMBA_4_0/source/lib/iconv.c
   branches/SAMBA_4_0/source/libcli/auth/clikrb5.c
   branches/SAMBA_4_0/source/libcli/auth/ntlmssp_parse.c
   branches/SAMBA_4_0/source/libcli/auth/spnego.c
   branches/SAMBA_4_0/source/libcli/auth/spnego.h
   branches/SAMBA_4_0/source/libcli/raw/rawrequest.c
   branches/SAMBA_4_0/source/libcli/raw/rawsearch.c
   branches/SAMBA_4_0/source/libcli/util/asn1.c
   branches/SAMBA_4_0/source/librpc/idl/epmapper.idl
   branches/SAMBA_4_0/source/librpc/ndr/ndr.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/iconv.c
===
--- branches/SAMBA_4_0/source/lib/iconv.c   2004-10-28 11:59:48 UTC (rev 3321)
+++ branches/SAMBA_4_0/source/lib/iconv.c   2004-10-28 12:46:59 UTC (rev 3322)
@@ -131,7 +131,6 @@
 char **outbuf, size_t *outbytesleft)
 {
char cvtbuf[2048];
-   char *bufp = cvtbuf;
size_t bufsize;
 
/* in many cases we can go direct */
@@ -143,18 +142,19 @@
 
/* otherwise we have to do it chunks at a time */
while (*inbytesleft > 0) {
-   bufp = cvtbuf;
+   char *bufp1 = cvtbuf;
+   const char *bufp2 = cvtbuf;
+
bufsize = sizeof(cvtbuf);

if (cd->pull(cd->cd_pull, 
-inbuf, inbytesleft, &bufp, &bufsize) == -1
+inbuf, inbytesleft, &bufp1, &bufsize) == -1
&& errno != E2BIG) return -1;
 
-   bufp = cvtbuf;
bufsize = sizeof(cvtbuf) - bufsize;
 
if (cd->push(cd->cd_push, 
-&bufp, &bufsize, 
+&bufp2, &bufsize, 
 outbuf, outbytesleft) == -1) return -1;
}
 

Modified: branches/SAMBA_4_0/source/libcli/auth/clikrb5.c
===
--- branches/SAMBA_4_0/source/libcli/auth/clikrb5.c 2004-10-28 11:59:48 UTC (rev 
3321)
+++ branches/SAMBA_4_0/source/libcli/auth/clikrb5.c 2004-10-28 12:46:59 UTC (rev 
3322)
@@ -386,7 +386,7 @@
 {
static krb5_data kdata;
 
-   kdata.data = krb5_principal_get_comp_string(context, principal, i);
+   kdata.data = discard_const(krb5_principal_get_comp_string(context, principal, 
i));
kdata.length = strlen(kdata.data);
return &kdata;
 }

Modified: branches/SAMBA_4_0/source/libcli/auth/ntlmssp_parse.c
===
--- branches/SAMBA_4_0/source/libcli/auth/ntlmssp_parse.c   2004-10-28 11:59:48 
UTC (rev 3321)
+++ branches/SAMBA_4_0/source/libcli/auth/ntlmssp_parse.c   2004-10-28 12:46:59 
UTC (rev 3322)
@@ -64,7 +64,7 @@
case 'U':
s = va_arg(ap, char *);
head_size += 8;
-   n = push_ucs2_talloc(pointers, &pointers[i].data, s);
+   n = push_ucs2_talloc(pointers, (void **)&pointers[i].data, s);
if (n == -1) {
return False;
}
@@ -87,7 +87,7 @@
n = va_arg(ap, int);
intargs[i] = n;
s = va_arg(ap, char *);
-   n = push_ucs2_talloc(pointers, &pointers[i].data, s);
+   n = push_ucs2_talloc(pointers, (void **)&pointers[i].data, s);
if (n == -1) {
return False;
}

Modified: branches/SAMBA_4_0/source/libcli/auth/spnego.c
===
--- branches/SAMBA_4_0/source/libcli/auth/spnego.c  2004-10-28 11:59:48 UTC (rev 
3321)
+++ branches/SAMBA_4_0/source/libcli/auth/spnego.c  2004-10-28 12:46:59 UTC (rev 
3322)
@@ -483,7 +483,7 @@
{
/* The server offers a list of mechanisms */

-   char *my_mechs[] = {NULL, NULL};
+   const char *my_mechs[] = {NULL, NULL};
NTSTATUS nt_status = NT_STATUS_INVALID_PARAMETER;
 
if (!in.length) {

Modified: branches/SAMBA_4_0/source/libcli/auth/spnego.h
===
--- branches/SAMBA_4_0/source/libcli/auth/spnego.h  2004-10-28 11:59:48 UTC (rev 
3321)
+++ branches/SAMBA_4_0/source/libcli/auth/spnego.h  2004-10-28 12:46:59 UTC (rev 
3322)
@@ -41,7 +41,7 @@
 };
 
 struct spnego_negTokenInit {
-   char **mechTypes;
+   const char **mech

svn commit: samba r3321 - in branches/SAMBA_4_0/source/script/tests: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 11:59:48 + (Thu, 28 Oct 2004)
New Revision: 3321

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/script/tests&rev=3321&nolog=1

Log:
make the test_echo.sh test suite test non-blocking on all rpc transports
this test now passes

Modified:
   branches/SAMBA_4_0/source/script/tests/test_echo.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/test_echo.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_echo.sh 2004-10-28 11:59:03 UTC (rev 
3320)
+++ branches/SAMBA_4_0/source/script/tests/test_echo.sh 2004-10-28 11:59:48 UTC (rev 
3321)
@@ -27,6 +27,7 @@
 for transport in ncalrpc ncacn_np ncacn_ip_tcp; do
  for bindoptions in connect sign seal sign,seal validate padcheck bigendian 
bigendian,seal; do
   for ntlmoptions in \
+"--option=socket:testnonblock=True" \
 "--option=ntlmssp_client:ntlm2=yes" \
 "--option=ntlmssp_client:ntlm2=no" \
 "--option=ntlmssp_client:ntlm2=yes --option=ntlmssp_client:128bit=no" \



svn commit: samba r3320 - in branches/SAMBA_4_0/source/rpc_server: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 11:59:03 + (Thu, 28 Oct 2004)
New Revision: 3320

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/rpc_server&rev=3320&nolog=1

Log:
fixed bugs in the rpc_server code in handling partial packet receives and sends
it now passes the non-blocking test suite


Modified:
   branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c
   branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c


Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c
===
--- branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c2004-10-28 11:58:09 
UTC (rev 3319)
+++ branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c2004-10-28 11:59:03 
UTC (rev 3320)
@@ -907,7 +907,6 @@
struct dcesrv_call_state *call;
struct dcesrv_call_reply *rep;
ssize_t nwritten;
-   NTSTATUS status = NT_STATUS_OK;
 
call = dce_conn->call_list;
if (!call || !call->replies) {
@@ -928,8 +927,6 @@
if (rep->data.length == 0) {
/* we're done with this section of the call */
DLIST_REMOVE(call->replies, rep);
-   } else {
-   status = STATUS_BUFFER_OVERFLOW;
}
 
if (call->replies == NULL) {
@@ -938,7 +935,7 @@
talloc_free(call);
}
 
-   return status;
+   return NT_STATUS_OK;
 }
 
 

Modified: branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c
===
--- branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c  2004-10-28 11:58:09 UTC (rev 
3319)
+++ branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c  2004-10-28 11:59:03 UTC (rev 
3320)
@@ -39,7 +39,7 @@
size_t sendlen;
 
status = socket_send(sock, out, &sendlen, 0);
-   if (!NT_STATUS_IS_OK(status)) {
+   if (NT_STATUS_IS_ERR(status)) {
return -1;
}
 
@@ -265,6 +265,7 @@
return;
}
if (nread == 0) {
+   talloc_free(tmp_blob.data);
return;
}
 



svn commit: samba r3319 - in branches/SAMBA_4_0/source/libcli/raw: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 11:58:09 + (Thu, 28 Oct 2004)
New Revision: 3319

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/libcli/raw&rev=3319&nolog=1

Log:
fixed a bug in the client library found by the new non-block testing code

Modified:
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/clitransport.c
===
--- branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2004-10-28 11:57:20 UTC (rev 
3318)
+++ branches/SAMBA_4_0/source/libcli/raw/clitransport.c 2004-10-28 11:58:09 UTC (rev 
3319)
@@ -443,14 +443,7 @@
transport->recv_buffer.header + 
transport->recv_buffer.received,
NBT_HDR_SIZE - transport->recv_buffer.received);
-   if (ret == 0) {
-   smbcli_transport_dead(transport);
-   return;
-   }
if (ret == -1) {
-   if (errno == EINTR || errno == EAGAIN) {
-   return;
-   }
smbcli_transport_dead(transport);
return;
}
@@ -478,9 +471,6 @@
transport->recv_buffer.req_size - 
transport->recv_buffer.received);
if (ret == -1) {
-   if (errno == EINTR || errno == EAGAIN) {
-   return;
-   }
smbcli_transport_dead(transport);
return;
}



svn commit: samba r3318 - in branches/SAMBA_4_0/source/lib/socket: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 11:57:20 + (Thu, 28 Oct 2004)
New Revision: 3318

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/lib/socket&rev=3318&nolog=1

Log:
generate random STATUS_MORE_ENTRIES errors (1 in 10 packets) as well
as randomly short recv/send when socket:testnonblock is enabled



Modified:
   branches/SAMBA_4_0/source/lib/socket/socket.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/socket/socket.c
===
--- branches/SAMBA_4_0/source/lib/socket/socket.c   2004-10-28 08:37:46 UTC (rev 
3317)
+++ branches/SAMBA_4_0/source/lib/socket/socket.c   2004-10-28 11:57:20 UTC (rev 
3318)
@@ -158,7 +158,11 @@
}
 
if ((sock->flags & SOCKET_FLAG_TESTNONBLOCK) && wantlen > 1) {
-   return sock->ops->recv(sock, buf, 1+(random() % (wantlen-1)), nread, 
flags);
+   if (random() % 10 == 0) {
+   *nread = 0;
+   return STATUS_MORE_ENTRIES;
+   }
+   return sock->ops->recv(sock, buf, 1+(random() % wantlen), nread, 
flags);
}
 
return sock->ops->recv(sock, buf, wantlen, nread, flags);
@@ -182,7 +186,11 @@
 
if ((sock->flags & SOCKET_FLAG_TESTNONBLOCK) && blob->length > 1) {
DATA_BLOB blob2 = *blob;
-   blob2.length = 1+(random() % (blob2.length-1));
+   if (random() % 10 == 0) {
+   *sendlen = 0;
+   return STATUS_MORE_ENTRIES;
+   }
+   blob2.length = 1+(random() % blob2.length);
return sock->ops->send(sock, &blob2, sendlen, flags);
}
 



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

2004-10-28 Thread vlendec
Author: vlendec
Date: 2004-10-28 08:37:46 + (Thu, 28 Oct 2004)
New Revision: 3317

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/torture/rpc&rev=3317&nolog=1

Log:
Fix the build
Modified:
   branches/SAMBA_4_0/source/torture/rpc/spoolss.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/spoolss.c
===
--- branches/SAMBA_4_0/source/torture/rpc/spoolss.c 2004-10-28 08:36:23 UTC (rev 
3316)
+++ branches/SAMBA_4_0/source/torture/rpc/spoolss.c 2004-10-28 08:37:46 UTC (rev 
3317)
@@ -177,7 +177,7 @@
}
 
for (j = 0; j < r.out.count; j++)
-   test_GetForm(p, mem_ctx, handle, info[j].info1.name);
+   test_GetForm(p, mem_ctx, handle, info[j].info1.formname);
}
 
if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
@@ -221,7 +221,7 @@
r.in.handle = handle;
r.in.level = 1;
form.flags = 2; /* User form */
-   form.name = formname;
+   form.formname = formname;
form.width = 1;
form.length = 2;
form.left = 3;



svn commit: samba r3316 - in branches/SAMBA_4_0/source/ldap_server: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 08:36:23 + (Thu, 28 Oct 2004)
New Revision: 3316

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/ldap_server&rev=3316&nolog=1

Log:
give the LDAP server a chance of operating correctly non-blocking (it
didn't handle EINTR or EAGAIN)


Modified:
   branches/SAMBA_4_0/source/ldap_server/ldap_server.c


Changeset:
Modified: branches/SAMBA_4_0/source/ldap_server/ldap_server.c
===
--- branches/SAMBA_4_0/source/ldap_server/ldap_server.c 2004-10-28 08:15:12 UTC (rev 
3315)
+++ branches/SAMBA_4_0/source/ldap_server/ldap_server.c 2004-10-28 08:36:23 UTC (rev 
3316)
@@ -163,7 +163,7 @@
}
 
status = socket_recv(sock, tmp_blob.data, tmp_blob.length, &nread, 0);
-   if (!NT_STATUS_IS_OK(status)) {
+   if (NT_STATUS_IS_ERR(status)) {
DEBUG(10,("socket_recv: %s\n",nt_errstr(status)));
talloc_free(tmp_blob.data);
return False;
@@ -207,7 +207,7 @@
}
 
status = socket_recv(sock, tmp_blob.data, tmp_blob.length, &nread, 0);
-   if (!NT_STATUS_IS_OK(status)) {
+   if (NT_STATUS_IS_ERR(status)) {
DEBUG(10,("socket_recv: %s\n",nt_errstr(status)));
talloc_free(mem_ctx);
return False;



svn commit: samba r3315 - in branches/SAMBA_4_0/source: include libcli/raw

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 08:15:12 + (Thu, 28 Oct 2004)
New Revision: 3315

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=3315&nolog=1

Log:
converted the libcli/raw/ code to use the generic socket library. This
allows me to test with the socket:testnonblock option. It passes.

Modified:
   branches/SAMBA_4_0/source/include/cli_context.h
   branches/SAMBA_4_0/source/libcli/raw/clisocket.c
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c


Changeset:
Modified: branches/SAMBA_4_0/source/include/cli_context.h
===
--- branches/SAMBA_4_0/source/include/cli_context.h 2004-10-28 07:55:33 UTC (rev 
3314)
+++ branches/SAMBA_4_0/source/include/cli_context.h 2004-10-28 08:15:12 UTC (rev 
3315)
@@ -70,8 +70,7 @@
/* the port used */
int port;

-   /* the open file descriptor */
-   int fd;
+   struct socket_context *sock;
 
/* a count of the number of packets we have received. We
 * actually only care about zero/non-zero at this stage */

Modified: branches/SAMBA_4_0/source/libcli/raw/clisocket.c
===
--- branches/SAMBA_4_0/source/libcli/raw/clisocket.c2004-10-28 07:55:33 UTC (rev 
3314)
+++ branches/SAMBA_4_0/source/libcli/raw/clisocket.c2004-10-28 08:15:12 UTC (rev 
3315)
@@ -22,19 +22,6 @@
 #include "includes.h"
 
 /*
-  destroy a socket
- */
-static int sock_destructor(void *ptr)
-{
-   struct smbcli_socket *sock = ptr;
-   if (sock->fd != -1) {
-   close(sock->fd);
-   sock->fd = -1;
-   }
-   return 0;
-}
-
-/*
   create a smbcli_socket context
 */
 struct smbcli_socket *smbcli_sock_init(TALLOC_CTX *mem_ctx)
@@ -47,15 +34,13 @@
}
 
ZERO_STRUCTP(sock);
-   sock->fd = -1;
+   sock->sock = NULL;
sock->port = 0;
 
/* 20 second default timeout */
sock->timeout = 2;
sock->hostname = NULL;
 
-   talloc_set_destructor(sock, sock_destructor);
-
return sock;
 }
 
@@ -65,10 +50,7 @@
 */
 BOOL smbcli_sock_connect(struct smbcli_socket *sock, struct in_addr *ip, int port)
 {
-   if (getenv("LIBSMB_PROG")) {
-   sock->fd = sock_exec(getenv("LIBSMB_PROG"));
-   return sock->fd != -1;
-   }
+   NTSTATUS status;
 
if (port == 0) {
int i;
@@ -82,19 +64,24 @@
return False;
}
 
-   sock->dest_ip = *ip;
-   sock->port = port;
-   sock->fd = open_socket_out(SOCK_STREAM,
-  &sock->dest_ip,
-  sock->port, 
-  LONG_CONNECT_TIMEOUT);
-   if (sock->fd == -1) {
+   status = socket_create("ip", SOCKET_TYPE_STREAM, &sock->sock, 0);
+   if (!NT_STATUS_IS_OK(status)) {
return False;
}
+   talloc_steal(sock, sock->sock);
 
-   set_blocking(sock->fd, False);
-   set_socket_options(sock->fd, lp_socket_options());
+   status = socket_connect(sock->sock, NULL, 0, inet_ntoa(*ip), port, 0);
+   if (!NT_STATUS_IS_OK(status)) {
+   talloc_free(sock->sock);
+   sock->sock = NULL;
+   return False;
+   }
 
+   sock->dest_ip = *ip;
+   sock->port = port;
+
+   socket_set_option(sock->sock, lp_socket_options(), NULL);
+
return True;
 }
 
@@ -104,9 +91,9 @@
 /
 void smbcli_sock_dead(struct smbcli_socket *sock)
 {
-   if (sock->fd != -1) {
-   close(sock->fd);
-   sock->fd = -1;
+   if (sock->sock != NULL) {
+   talloc_free(sock->sock);
+   sock->sock = NULL;
}
 }
 
@@ -115,7 +102,7 @@
 /
 void smbcli_sock_set_options(struct smbcli_socket *sock, const char *options)
 {
-   set_socket_options(sock->fd, options);
+   socket_set_option(sock->sock, options, NULL);
 }
 
 /
@@ -123,12 +110,24 @@
 /
 ssize_t smbcli_sock_write(struct smbcli_socket *sock, const char *data, size_t len)
 {
-   if (sock->fd == -1) {
+   NTSTATUS status;
+   DATA_BLOB blob;
+   size_t nsent;
+
+   if (sock->sock == NULL) {
errno = EIO;
return -1;
}
 
-   return write(sock->fd, data, len);
+   blob.data = discard_const(data);
+   blob.length = len;
+
+   status = socket_send(sock->sock, &blob, &nsent, 0);
+   if (NT_STATUS_IS_ERR(status)) {
+   return -1;
+   }
+
+   return nsent;
 }
 
 
@@ -137,12 +136,20 @@
 **

svn commit: samba r3314 - in branches/SAMBA_4_0/source: lib/messaging lib/socket smbd

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 07:55:33 + (Thu, 28 Oct 2004)
New Revision: 3314

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source&rev=3314&nolog=1

Log:
added a option "socket:testnonblock" to the generic socket code. If
you set this option (either on the command line using --option or in
smb.conf) then every socket recv or send will return short by random
amounts. This allows you to test that the non-blocking socket logic in
your code works correctly.

I also removed the flags argument to socket_accept(), and instead made
the new socket inherit the flags of the old socket, which makes more
sense to me.


Modified:
   branches/SAMBA_4_0/source/lib/messaging/messaging.c
   branches/SAMBA_4_0/source/lib/socket/socket.c
   branches/SAMBA_4_0/source/lib/socket/socket.h
   branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c
   branches/SAMBA_4_0/source/lib/socket/socket_unix.c
   branches/SAMBA_4_0/source/smbd/process_single.c
   branches/SAMBA_4_0/source/smbd/process_standard.c
   branches/SAMBA_4_0/source/smbd/process_thread.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/messaging/messaging.c
===
--- branches/SAMBA_4_0/source/lib/messaging/messaging.c 2004-10-28 07:34:11 UTC (rev 
3313)
+++ branches/SAMBA_4_0/source/lib/messaging/messaging.c 2004-10-28 07:55:33 UTC (rev 
3314)
@@ -208,7 +208,7 @@
smb_panic("Unable to allocate messaging_rec");
}
 
-   status = socket_accept(msg->sock, &rec->sock, 0);
+   status = socket_accept(msg->sock, &rec->sock);
if (!NT_STATUS_IS_OK(status)) {
smb_panic("Unable to accept messaging_rec");
}

Modified: branches/SAMBA_4_0/source/lib/socket/socket.c
===
--- branches/SAMBA_4_0/source/lib/socket/socket.c   2004-10-28 07:34:11 UTC (rev 
3313)
+++ branches/SAMBA_4_0/source/lib/socket/socket.c   2004-10-28 07:55:33 UTC (rev 
3314)
@@ -60,6 +60,14 @@
return status;
}
 
+   /* by enabling "testnonblock" mode, all socket receive and
+  send calls on non-blocking sockets will randomly recv/send
+  less data than requested */
+   if (!(flags & SOCKET_FLAG_BLOCK) &&
+   lp_parm_bool(-1, "socket", "testnonblock", False)) {
+   (*new_sock)->flags |= SOCKET_FLAG_TESTNONBLOCK;
+   }
+
talloc_set_destructor(*new_sock, socket_destructor);
 
return NT_STATUS_OK;
@@ -108,7 +116,7 @@
return sock->ops->listen(sock, my_address, port, queue_size, flags);
 }
 
-NTSTATUS socket_accept(struct socket_context *sock, struct socket_context **new_sock, 
uint32_t flags)
+NTSTATUS socket_accept(struct socket_context *sock, struct socket_context **new_sock)
 {
NTSTATUS status;
 
@@ -124,7 +132,7 @@
return NT_STATUS_NOT_IMPLEMENTED;
}
 
-   status = sock->ops->accept(sock, new_sock, flags);
+   status = sock->ops->accept(sock, new_sock);
 
if (NT_STATUS_IS_OK(status)) {
talloc_set_destructor(*new_sock, socket_destructor);
@@ -149,6 +157,10 @@
return NT_STATUS_NOT_IMPLEMENTED;
}
 
+   if ((sock->flags & SOCKET_FLAG_TESTNONBLOCK) && wantlen > 1) {
+   return sock->ops->recv(sock, buf, 1+(random() % (wantlen-1)), nread, 
flags);
+   }
+
return sock->ops->recv(sock, buf, wantlen, nread, flags);
 }
 
@@ -168,6 +180,12 @@
return NT_STATUS_NOT_IMPLEMENTED;
}
 
+   if ((sock->flags & SOCKET_FLAG_TESTNONBLOCK) && blob->length > 1) {
+   DATA_BLOB blob2 = *blob;
+   blob2.length = 1+(random() % (blob2.length-1));
+   return sock->ops->send(sock, &blob2, sendlen, flags);
+   }
+
return sock->ops->send(sock, blob, sendlen, flags);
 }
 

Modified: branches/SAMBA_4_0/source/lib/socket/socket.h
===
--- branches/SAMBA_4_0/source/lib/socket/socket.h   2004-10-28 07:34:11 UTC (rev 
3313)
+++ branches/SAMBA_4_0/source/lib/socket/socket.h   2004-10-28 07:55:33 UTC (rev 
3314)
@@ -42,8 +42,7 @@
/* server ops */
NTSTATUS (*listen)(struct socket_context *sock,
const char *my_address, int port, int queue_size, 
uint32_t flags);
-   NTSTATUS (*accept)(struct socket_context *sock,
-   struct socket_context **new_sock, uint32_t flags);
+   NTSTATUS (*accept)(struct socket_context *sock, struct socket_context 
**new_sock);
 
/* general ops */
NTSTATUS (*recv)(struct socket_context *sock, void *buf,
@@ -78,8 +77,9 @@
SOCKET_STATE_SERVER_ERROR
 };
 
-#define SOCKET_FLAG_BLOCK 0x0001
-#define SOCKET_FLAG_PEEK  0x0002
+#define SOCKET_FLAG_BLOCK0x0001
+#define SOCKET_FLAG_PEEK 0x0002
+#define SOCKE

svn commit: samba r3313 - in branches/SAMBA_4_0/source/lib/socket: .

2004-10-28 Thread tridge
Author: tridge
Date: 2004-10-28 07:34:11 + (Thu, 28 Oct 2004)
New Revision: 3313

WebSVN: 
http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/lib/socket&rev=3313&nolog=1

Log:
in socket_accept() make the new socket non-blocking unless SOCKET_FLAG_BLOCK is set.

Modified:
   branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c
   branches/SAMBA_4_0/source/lib/socket/socket_unix.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c
===
--- branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c  2004-10-28 06:45:28 UTC (rev 
3312)
+++ branches/SAMBA_4_0/source/lib/socket/socket_ipv4.c  2004-10-28 07:34:11 UTC (rev 
3313)
@@ -141,6 +141,14 @@
return map_nt_error_from_unix(errno);
}
 
+   if (!(flags & SOCKET_FLAG_BLOCK)) {
+   int ret = set_blocking(new_fd, False);
+   if (ret == -1) {
+   close(new_fd);
+   return map_nt_error_from_unix(errno);
+   }
+   }
+
/* TODO: we could add a 'accept_check' hook here
 *   which get the black/white lists via socket_set_accept_filter()
 *   or something like that

Modified: branches/SAMBA_4_0/source/lib/socket/socket_unix.c
===
--- branches/SAMBA_4_0/source/lib/socket/socket_unix.c  2004-10-28 06:45:28 UTC (rev 
3312)
+++ branches/SAMBA_4_0/source/lib/socket/socket_unix.c  2004-10-28 07:34:11 UTC (rev 
3313)
@@ -136,6 +136,14 @@
return unixdom_error(errno);
}
 
+   if (!(flags & SOCKET_FLAG_BLOCK)) {
+   int ret = set_blocking(new_fd, False);
+   if (ret == -1) {
+   close(new_fd);
+   return map_nt_error_from_unix(errno);
+   }
+   }
+
(*new_sock) = talloc_p(NULL, struct socket_context);
if (!(*new_sock)) {
close(new_fd);