[Samba] Possible to have two SAMBA srvs act as one?

2006-09-10 Thread Michael Rignaz

Hi,

is it possible to share write locks amongst two samba servers?

We are experiencing performance issues all the time, because one 
location (location A) is connected via VPN to the main location 
(location B) and needs to access files hosted there on some samba shares.
Now loc A gets its own server, but still files hosted in B need to be 
read/write accessed from A and vice versa.
It would be really nice to have all files and shares on both servers. 
And when a file is locked on srv1 it's also locked on srv2.

Is something like that possible?

Thnx in advance,
Michael

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] The specified network name is no longer available

2006-09-10 Thread François Turcotte
Hi,

I got a weird probleme.
I have a fileserver running FreeBSD 6.1 and 2 client running Windows XP.
Samba version 3.0.23c is installed on FreeBSD server

when I'm downloading something from the server to any of my client machine, I 
got no probleme even with big file, but when I'm uploading from any client 
machine to the server if the file or folder is bigger than 20mo, after a few 
seconds of transfert I got this error:

Cannot copy XXX: The specified network name is no longer available.

so since that probleme I don't have the choice of using my ftp to upload file 
and folder to my server, it's the only other way I got.

anyone got an idea how to fix this?

thanks
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Roaming profiles and USRMGR.EXE

2006-09-10 Thread Bernd Pörner
I'm using Samba 3.0.22 on Ubuntu 6.06.1 as PDC for our Windows
workstations. The passdb backend is tdbsam.

I want to employ roaming profiles and due to the fact that we have a
mixed Windows environment (Windows 2000 Pro and Windows XP Pro) I have
the following entry in my smb.conf:

logon path = \\%L\profiles\%U\%a

Basically, this works fine. If a user is working on a W2k workstation,
his roaming profile is stored under
\\servername\profiles\username\W2000. If he is working on a WinXP
workstation, his roaming profile is stored under
\\servername\profiles\username\WinXP.

Currently, I'm experimenting with the User Manager for Domains
(USRMGR.EXE) from Microsoft to evaluate how good this tool is for
administrating a Samba PDC. Concerning the type of roaming profiles
described above I have some problems with USRMGR.EXE:

When editing the User Properties of a Samba user account with
USRMGR.EXE, the user's roaming profile path is hard-set to
\\servername\profiles\username\W2000 (or
\\servername\profiles\username\WinXP, according to the workstation's OS
I run USRMGR.EXE from). So, next time the user logs in on a machine with
the other OS, for example WinXP, the roaming profile for Win2k is loaded.

Remark: This problem only occurs, when editing the User Properties of
Samba user accounts which were created using USRMGR.EXE. User accounts
which were created the UNIX way (useradd and smbpasswd) seem not to be
affected.

Any ideas how to avoid this problem, apart of not using USRMGR.EXE?

Cheers
Bernd

-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


Re: [Samba] Roaming profiles and USRMGR.EXE

2006-09-10 Thread Bernd Pörner
Another observation:

If I create a user account using USRMGR.EXE and I don't specify the
roaming profile path, the user account gets no roaming profile despite
the setting in smb.conf (logon path = \\%L\profiles\%U\%a).

Is this a bug or a feature?

B.

Bernd Pörner wrote:
 I'm using Samba 3.0.22 on Ubuntu 6.06.1 as PDC for our Windows
 workstations. The passdb backend is tdbsam.

 I want to employ roaming profiles and due to the fact that we have a
 mixed Windows environment (Windows 2000 Pro and Windows XP Pro) I have
 the following entry in my smb.conf:

 logon path = \\%L\profiles\%U\%a

 Basically, this works fine. If a user is working on a W2k workstation,
 his roaming profile is stored under
 \\servername\profiles\username\W2000. If he is working on a WinXP
 workstation, his roaming profile is stored under
 \\servername\profiles\username\WinXP.

 Currently, I'm experimenting with the User Manager for Domains
 (USRMGR.EXE) from Microsoft to evaluate how good this tool is for
 administrating a Samba PDC. Concerning the type of roaming profiles
 described above I have some problems with USRMGR.EXE:

 When editing the User Properties of a Samba user account with
 USRMGR.EXE, the user's roaming profile path is hard-set to
 \\servername\profiles\username\W2000 (or
 \\servername\profiles\username\WinXP, according to the workstation's OS
 I run USRMGR.EXE from). So, next time the user logs in on a machine with
 the other OS, for example WinXP, the roaming profile for Win2k is loaded.

 Remark: This problem only occurs, when editing the User Properties of
 Samba user accounts which were created using USRMGR.EXE. User accounts
 which were created the UNIX way (useradd and smbpasswd) seem not to be
 affected.

 Any ideas how to avoid this problem, apart of not using USRMGR.EXE?

 Cheers
 Bernd

   


-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Re: domain user types

2006-09-10 Thread Jamrock
Enos D'Andrea [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Please how can I set user types in a Samba PDC? (users, power users, etc)
 My problem is that domain users have now administrator rights on the
 clients, and I don't want that!
 I cannot set the rights on all the clients because there are hundreds of
 users and tens of clients.

 Thank you,
 -- 

By default, users don't have administrator rights.  Do you know how they got
them?  What groups are the users in?



-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


[Samba] Re: Enabling CIFS

2006-09-10 Thread Mark Nienberg

Felix Miata wrote:

I upgraded my SUSE 10.0 server to the Suse Projects 3.0.23c rpms. When I try to 
use cifs to mount, I get the error:

mount error 112: Host is down

by using this syntax:

# mount -t cifs -o ro //p-t18/G /mnt/test

What do I need to do to make this work?


Try it using the IP address of the server instead of the name.

mount -t cifs -o ro //192.168.1.35/G /mnt/test

Mark

--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/listinfo/samba


svn commit: samba r18319 - in branches/SAMBA_4_0/source: ntvfs/posix torture/raw

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 07:24:41 + (Sun, 10 Sep 2006)
New Revision: 18319

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

Log:

fixed the directory search resume code on IRIX

The problem was twofold:

  1) irix returns 64 bit numbers in telldir(). The protocol uses a 32
 bit resume key. We now cope with this properly using the code in
 pvfs_list_seek_ofs().

  2) irix returns 0x from telldir() for the last entry in the
 directory. When added to DIR_OFFSET_BASE this became
 DIR_OFFSET_DOTDOT which meant an infinite loop!

Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_dirlist.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_rename.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_unlink.c
   branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.h
   branches/SAMBA_4_0/source/torture/raw/search.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_dirlist.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_dirlist.c2006-09-10 
03:58:00 UTC (rev 18318)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_dirlist.c2006-09-10 
07:24:41 UTC (rev 18319)
@@ -45,11 +45,15 @@
uint32_t name_cache_index;
 };
 
+/* these three numbers are chosen to minimise the chances of a bad
+   interaction with the OS value for 'end of directory'. On IRIX
+   telldir() returns 0x at the end of a directory, and that
+   caused an infinite loop with the original values of 0,1,2
+*/
 #define DIR_OFFSET_DOT0
 #define DIR_OFFSET_DOTDOT 1
-#define DIR_OFFSET_BASE   2
+#define DIR_OFFSET_BASE   0x8002
 
-
 /*
   a special directory listing case where the pattern has no wildcard. We can 
just do a single stat()
   thus avoiding the more expensive directory scan
@@ -140,7 +144,7 @@
dir-pvfs = pvfs;
dir-no_wildcard = False;
dir-end_of_search = False;
-   dir-offset = 0;
+   dir-offset = DIR_OFFSET_DOT;
dir-name_cache = talloc_zero_array(dir, 
struct name_cache_entry, 
NAME_CACHE_SIZE);
@@ -173,7 +177,7 @@
 /* 
return the next entry
 */
-const char *pvfs_list_next(struct pvfs_dir *dir, uint_t *ofs)
+const char *pvfs_list_next(struct pvfs_dir *dir, off_t *ofs)
 {
struct dirent *de;
enum protocol_types protocol = dir-pvfs-ntvfs-ctx-protocol;
@@ -190,7 +194,7 @@
   not return them first in a directory, but windows client
   may assume that these entries always appear first */
if (*ofs == DIR_OFFSET_DOT) {
-   (*ofs)++;
+   (*ofs) = DIR_OFFSET_DOTDOT;
dir-offset = *ofs;
if (ms_fnmatch(dir-pattern, ., protocol) == 0) {
dcache_add(dir, .);
@@ -199,7 +203,7 @@
}
 
if (*ofs == DIR_OFFSET_DOTDOT) {
-   (*ofs)++;
+   (*ofs) = DIR_OFFSET_BASE;
dir-offset = *ofs;
if (ms_fnmatch(dir-pattern, .., protocol) == 0) {
dcache_add(dir, ..);
@@ -254,7 +258,7 @@
 /*
   return True if end of search has been reached
 */
-BOOL pvfs_list_eos(struct pvfs_dir *dir, uint_t ofs)
+BOOL pvfs_list_eos(struct pvfs_dir *dir, off_t ofs)
 {
return dir-end_of_search;
 }
@@ -262,11 +266,13 @@
 /*
   seek to the given name
 */
-NTSTATUS pvfs_list_seek(struct pvfs_dir *dir, const char *name, uint_t *ofs)
+NTSTATUS pvfs_list_seek(struct pvfs_dir *dir, const char *name, off_t *ofs)
 {
struct dirent *de;
int i;
 
+   dir-end_of_search = False;
+
if (ISDOT(name)) {
dir-offset = DIR_OFFSET_DOTDOT;
*ofs = dir-offset;
@@ -309,7 +315,68 @@
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
 }
 
+/*
+  seek to the given offset
+*/
+NTSTATUS pvfs_list_seek_ofs(struct pvfs_dir *dir, uint32_t resume_key, off_t 
*ofs)
+{
+   struct dirent *de;
+   int i;
 
+   dir-end_of_search = False;
+
+   if (resume_key == DIR_OFFSET_DOT) {
+   *ofs = DIR_OFFSET_DOTDOT;
+   return NT_STATUS_OK;
+   }
+
+   if (resume_key == DIR_OFFSET_DOTDOT) {
+   *ofs = DIR_OFFSET_BASE;
+   return NT_STATUS_OK;
+   }
+
+   if (resume_key == DIR_OFFSET_BASE) {
+   rewinddir(dir-dir);
+   if ((de=readdir(dir-dir)) == NULL) {
+   dir-end_of_search = True;
+   return NT_STATUS_OBJECT_NAME_NOT_FOUND;
+   }
+   *ofs = telldir(dir-dir) + DIR_OFFSET_BASE;
+   dir-offset = *ofs;
+   return NT_STATUS_OK;
+   }
+
+   for (i=dir-name_cache_index;i=0;i--) {
+   struct name_cache_entry *e = dir-name_cache[i];
+   if (resume_key == (uint32_t)e-offset) {
+   

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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 08:08:20 + (Sun, 10 Sep 2006)
New Revision: 18320

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

Log:

the raw write size limit test hurts too many hosts. Limit it to 2^33
bytes if --dangerous is not set.

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/write.c
===
--- branches/SAMBA_4_0/source/torture/raw/write.c   2006-09-10 07:24:41 UTC 
(rev 18319)
+++ branches/SAMBA_4_0/source/torture/raw/write.c   2006-09-10 08:08:20 UTC 
(rev 18320)
@@ -224,7 +224,13 @@
const char *fname = BASEDIR \\test.txt;
uint_t seed = time(NULL);
union smb_fileinfo finfo;
+   int max_bits=63;
 
+   if (!lp_parm_bool(-1, torture, dangerous, False)) {
+   max_bits=33;
+   printf(dangerous not set - limiting range of test to 2^%d\n, 
max_bits);
+   }
+
buf = talloc_zero_size(mem_ctx, maxsize);
 
if (!torture_setup_dir(cli, BASEDIR)) {
@@ -350,7 +356,7 @@
}
CHECK_BUFFER(buf, seed, 4000);
 
-   for (i=33;i64;i++) {
+   for (i=33;imax_bits;i++) {
printf(Trying 2^%d offset\n, i);
setup_buffer(buf, seed+1, maxsize);
io.writex.in.file.fnum = fnum;



svn commit: samba r18321 - in branches/SAMBA_4_0/source: auth/gensec lib/ldb/modules lib/replace lib/socket

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 10:00:42 + (Sun, 10 Sep 2006)
New Revision: 18321

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

Log:

fixed some warnings on AIX

Modified:
   branches/SAMBA_4_0/source/auth/gensec/gensec.c
   branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map_inbound.c
   branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map_outbound.c
   branches/SAMBA_4_0/source/lib/replace/snprintf.c
   branches/SAMBA_4_0/source/lib/socket/socket_ipv6.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/gensec/gensec.c
===
--- branches/SAMBA_4_0/source/auth/gensec/gensec.c  2006-09-10 08:08:20 UTC 
(rev 18320)
+++ branches/SAMBA_4_0/source/auth/gensec/gensec.c  2006-09-10 10:00:42 UTC 
(rev 18321)
@@ -729,7 +729,7 @@
 _PUBLIC_ NTSTATUS gensec_start_mech_by_sasl_list(struct gensec_security 
*gensec_security, 
 const char **sasl_names) 
 {
-   NTSTATUS nt_status;
+   NTSTATUS nt_status = NT_STATUS_INVALID_PARAMETER;
TALLOC_CTX *mem_ctx = talloc_new(gensec_security);
const struct gensec_security_ops **ops;
int i;

Modified: branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map_inbound.c
===
--- branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map_inbound.c 2006-09-10 
08:08:20 UTC (rev 18320)
+++ branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map_inbound.c 2006-09-10 
10:00:42 UTC (rev 18321)
@@ -68,7 +68,7 @@
 {
const struct ldb_map_context *data = map_get_context(module);
const struct ldb_map_attribute *map = map_attr_find_local(data, 
attr_name);
-   struct ldb_message_element *el;
+   struct ldb_message_element *el=NULL;
 
/* Unknown attribute: ignore */
if (map == NULL) {

Modified: branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map_outbound.c
===
--- branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map_outbound.c
2006-09-10 08:08:20 UTC (rev 18320)
+++ branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map_outbound.c
2006-09-10 10:00:42 UTC (rev 18321)
@@ -507,7 +507,7 @@
 /* Select a list of subtrees that query attributes in the local partition */
 static int map_subtree_select_local_list(struct ldb_module *module, void 
*mem_ctx, struct ldb_parse_tree **new, const struct ldb_parse_tree *tree)
 {
-   int i, j, ret;
+   int i, j, ret=0;
 
/* Prepare new tree */
*new = talloc_memdup(mem_ctx, tree, sizeof(struct ldb_parse_tree));
@@ -630,7 +630,7 @@
 /* Collect a list of subtrees that query attributes in the remote partition */
 static int map_subtree_collect_remote_list(struct ldb_module *module, void 
*mem_ctx, struct ldb_parse_tree **new, const struct ldb_parse_tree *tree)
 {
-   int i, j, ret;
+   int i, j, ret=0;
 
/* Prepare new tree */
*new = talloc_memdup(mem_ctx, tree, sizeof(struct ldb_parse_tree));

Modified: branches/SAMBA_4_0/source/lib/replace/snprintf.c
===
--- branches/SAMBA_4_0/source/lib/replace/snprintf.c2006-09-10 08:08:20 UTC 
(rev 18320)
+++ branches/SAMBA_4_0/source/lib/replace/snprintf.c2006-09-10 10:00:42 UTC 
(rev 18321)
@@ -914,7 +914,7 @@
 static double my_modf(double x0, double *iptr)
 {
int i;
-   LLONG l;
+   LLONG l=0;
double x = x0;
double f = 1.0;
 

Modified: branches/SAMBA_4_0/source/lib/socket/socket_ipv6.c
===
--- branches/SAMBA_4_0/source/lib/socket/socket_ipv6.c  2006-09-10 08:08:20 UTC 
(rev 18320)
+++ branches/SAMBA_4_0/source/lib/socket/socket_ipv6.c  2006-09-10 10:00:42 UTC 
(rev 18321)
@@ -21,6 +21,7 @@
 
 #include includes.h
 #include lib/socket/socket.h
+#include system/filesys.h /* needed for close() */
 #include system/network.h
 
 static struct in6_addr interpret_addr6(const char *name)



svn commit: samba r18322 - in branches/SAMBA_4_0/source: heimdal/lib/asn1 heimdal/lib/com_err script

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 10:02:10 + (Sun, 10 Sep 2006)
New Revision: 18322

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

Log:

fixed a compilation problem on AIX caused by lex not putting config.h
first. That leads to a conflicting define for lseek() due to
_LARGE_FILES being defined after standards headers are included

Modified:
   branches/SAMBA_4_0/source/heimdal/lib/asn1/lex.c
   branches/SAMBA_4_0/source/heimdal/lib/com_err/lex.c
   branches/SAMBA_4_0/source/script/lex_compile.sh


Changeset:
Modified: branches/SAMBA_4_0/source/heimdal/lib/asn1/lex.c
===
--- branches/SAMBA_4_0/source/heimdal/lib/asn1/lex.c2006-09-10 10:00:42 UTC 
(rev 18321)
+++ branches/SAMBA_4_0/source/heimdal/lib/asn1/lex.c2006-09-10 10:02:10 UTC 
(rev 18322)
@@ -1,3 +1,4 @@
+#include config.h
 
 #line 3 lex.yy.c
 
@@ -1905,7 +1906,7 @@
 
/* Read in more data. */
YY_INPUT( 
(YY_CURRENT_BUFFER_LVALUE-yy_ch_buf[number_to_move]),
-   (yy_n_chars), num_to_read );
+   (yy_n_chars), (size_t) num_to_read );
 
YY_CURRENT_BUFFER_LVALUE-yy_n_chars = (yy_n_chars);
}

Modified: branches/SAMBA_4_0/source/heimdal/lib/com_err/lex.c
===
--- branches/SAMBA_4_0/source/heimdal/lib/com_err/lex.c 2006-09-10 10:00:42 UTC 
(rev 18321)
+++ branches/SAMBA_4_0/source/heimdal/lib/com_err/lex.c 2006-09-10 10:02:10 UTC 
(rev 18322)
@@ -1,3 +1,4 @@
+#include config.h
 
 #line 3 lex.yy.c
 

Modified: branches/SAMBA_4_0/source/script/lex_compile.sh
===
--- branches/SAMBA_4_0/source/script/lex_compile.sh 2006-09-10 10:00:42 UTC 
(rev 18321)
+++ branches/SAMBA_4_0/source/script/lex_compile.sh 2006-09-10 10:02:10 UTC 
(rev 18322)
@@ -19,7 +19,9 @@
 TOP=`pwd`
 if cd $dir  $LEX $file; then
if [ -r $base.yy.c ];then
-   sed '/^#/ s|$base.yy\.c|$DEST|' $base.yy.c  $base.c
+   # we must guarantee that config.h comes first
+   echo #include \config.h\  $base.c
+   sed '/^#/ s|$base.yy\.c|$DEST|' $base.yy.c  $base.c
rm -f $base.yy.c
fi
 fi



svn commit: samba r18323 - in branches/SAMBA_4_0/source/lib/samba3: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 10:30:10 + (Sun, 10 Sep 2006)
New Revision: 18323

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

Log:

this function returns a pointer, not a bool

Modified:
   branches/SAMBA_4_0/source/lib/samba3/smbpasswd.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/samba3/smbpasswd.c
===
--- branches/SAMBA_4_0/source/lib/samba3/smbpasswd.c2006-09-10 10:02:10 UTC 
(rev 18322)
+++ branches/SAMBA_4_0/source/lib/samba3/smbpasswd.c2006-09-10 10:30:10 UTC 
(rev 18323)
@@ -77,9 +77,8 @@
p1 = strchr_m(hexchars, hinybble);
p2 = strchr_m(hexchars, lonybble);

-   if (!p1 || !p2)
-   {
-return (False);
+   if (!p1 || !p2) {
+return NULL;
}

hinybble = PTR_DIFF(p1, hexchars);



svn commit: samba r18324 - in branches/SAMBA_4_0/source/lib/registry: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 10:30:33 + (Sun, 10 Sep 2006)
New Revision: 18324

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

Log:

fixed a uninitialised variable

Modified:
   branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c
===
--- branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c2006-09-10 
10:30:10 UTC (rev 18323)
+++ branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c2006-09-10 
10:30:33 UTC (rev 18324)
@@ -473,7 +473,7 @@
 {
DATA_BLOB data;
struct nk_block *nk = key-backend_data;
-   uint32_t key_off;
+   uint32_t key_off=0;
 
if (idx = nk-num_subkeys)
return WERR_NO_MORE_ITEMS;



svn commit: samba r18325 - in branches/SAMBA_4_0/source/torture: libnet rpc smb2

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 10:43:31 + (Sun, 10 Sep 2006)
New Revision: 18325

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

Log:

more warnings and one compile error on aix fixed

Modified:
   branches/SAMBA_4_0/source/torture/libnet/libnet_domain.c
   branches/SAMBA_4_0/source/torture/libnet/libnet_user.c
   branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c
   branches/SAMBA_4_0/source/torture/smb2/setinfo.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/libnet/libnet_domain.c
===
--- branches/SAMBA_4_0/source/torture/libnet/libnet_domain.c2006-09-10 
10:30:33 UTC (rev 18324)
+++ branches/SAMBA_4_0/source/torture/libnet/libnet_domain.c2006-09-10 
10:43:31 UTC (rev 18325)
@@ -180,7 +180,7 @@
 {
BOOL ret = True;
NTSTATUS status;
-   TALLOC_CTX *mem_ctx;
+   TALLOC_CTX *mem_ctx=NULL;
struct libnet_context *ctx;
struct lsa_String domain_name;
struct dcerpc_binding *binding;
@@ -254,7 +254,7 @@
NTSTATUS status;
const char *binding;
struct libnet_context *ctx;
-   struct event_context *evt_ctx;
+   struct event_context *evt_ctx=NULL;
TALLOC_CTX *mem_ctx;
struct policy_handle domain_handle, handle;
struct lsa_String name;
@@ -312,7 +312,7 @@
 {
BOOL ret = True;
NTSTATUS status;
-   TALLOC_CTX *mem_ctx;
+   TALLOC_CTX *mem_ctx=NULL;
struct libnet_context *ctx;
struct lsa_String domain_name;
struct dcerpc_binding *binding;

Modified: branches/SAMBA_4_0/source/torture/libnet/libnet_user.c
===
--- branches/SAMBA_4_0/source/torture/libnet/libnet_user.c  2006-09-10 
10:30:33 UTC (rev 18324)
+++ branches/SAMBA_4_0/source/torture/libnet/libnet_user.c  2006-09-10 
10:43:31 UTC (rev 18325)
@@ -524,7 +524,7 @@
const char *binding;
BOOL ret = True;
NTSTATUS status;
-   TALLOC_CTX *mem_ctx, *prep_mem_ctx;
+   TALLOC_CTX *mem_ctx=NULL, *prep_mem_ctx;
struct libnet_context *ctx;
struct dcerpc_pipe *p;
struct policy_handle h;

Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c
===
--- branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c   2006-09-10 10:30:33 UTC 
(rev 18324)
+++ branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c   2006-09-10 10:43:31 UTC 
(rev 18325)
@@ -1458,7 +1458,7 @@
if (!NT_STATUS_IS_OK(status)) {
printf(LookupNames failed - %s\n, nt_errstr(status));
talloc_free(tmp_ctx);
-   return False;
+   return NULL;
}
 
result = dom_sid_add_rid(mem_ctx, l.out.domains-domains[0].sid,

Modified: branches/SAMBA_4_0/source/torture/smb2/setinfo.c
===
--- branches/SAMBA_4_0/source/torture/smb2/setinfo.c2006-09-10 10:30:33 UTC 
(rev 18324)
+++ branches/SAMBA_4_0/source/torture/smb2/setinfo.c2006-09-10 10:43:31 UTC 
(rev 18325)
@@ -50,7 +50,7 @@
struct security_ace ace;
struct security_descriptor *sd;
struct dom_sid *test_sid;
-   NTSTATUS status, status2;
+   NTSTATUS status, status2=NT_STATUS_OK;
const char *call_name;
time_t basetime = (time(NULL) - 86400)  ~1;
int n = time(NULL) % 100;



svn commit: samba r18326 - in branches/SAMBA_4_0/source/lib/popt: .

2006-09-10 Thread metze
Author: metze
Date: 2006-09-10 10:58:15 + (Sun, 10 Sep 2006)
New Revision: 18326

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

Log:
these are not used anymore, I found the bug on *BSD
it's the broken BSD make again where we endup with this:

... -c torture/libnet/libnet_rpc.c -o libnet/libnet_rpc.o

metze
Modified:
   branches/SAMBA_4_0/source/lib/popt/samba.m4


Changeset:
Modified: branches/SAMBA_4_0/source/lib/popt/samba.m4
===
--- branches/SAMBA_4_0/source/lib/popt/samba.m4 2006-09-10 10:43:31 UTC (rev 
18325)
+++ branches/SAMBA_4_0/source/lib/popt/samba.m4 2006-09-10 10:58:15 UTC (rev 
18326)
@@ -1,11 +1,9 @@
 m4_include(lib/popt/libpopt.m4)
 
 if test x$POPTOBJ = x; then
-   echo LIBPOPT as EXT_LIB 
SMB_EXT_LIB(LIBPOPT, [${POPT_LIBS}])
SMB_ENABLE(LIBPOPT,YES)
 else
-   echo LIBPOPT as SUBSYSTEM 
SMB_SUBSYSTEM(LIBPOPT,
[lib/popt/findme.o lib/popt/popt.o lib/popt/poptconfig.o 
lib/popt/popthelp.o lib/popt/poptparse.o], [], [-Ilib/popt])
 fi



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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 11:16:09 + (Sun, 10 Sep 2006)
New Revision: 18327

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

Log:

'struct token' is defined on some hosts

Modified:
   branches/SAMBA_4_0/source/lib/ldb/tools/oLschema2ldif.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/tools/oLschema2ldif.c
===
--- branches/SAMBA_4_0/source/lib/ldb/tools/oLschema2ldif.c 2006-09-10 
10:58:15 UTC (rev 18326)
+++ branches/SAMBA_4_0/source/lib/ldb/tools/oLschema2ldif.c 2006-09-10 
11:16:09 UTC (rev 18327)
@@ -57,7 +57,7 @@
int failures;
 };
 
-struct token {
+struct schema_token {
int type;
char *value;
 };
@@ -135,14 +135,14 @@
return value;
 }
 
-static struct token *get_next_schema_token(TALLOC_CTX *ctx, char **string)
+static struct schema_token *get_next_schema_token(TALLOC_CTX *ctx, char 
**string)
 {
char *c = skip_spaces(*string);
char *type;
-   struct token *token;
+   struct schema_token *token;
int n;
 
-   token = talloc(ctx, struct token);
+   token = talloc(ctx, struct schema_token);
 
n = strcspn(c,  \t\n);
type = talloc_strndup(token, c, n);
@@ -333,7 +333,7 @@
 {
TALLOC_CTX *ctx;
struct ldb_message *msg;
-   struct token *token;
+   struct schema_token *token;
 char *c, *s;
 int n;
 



svn commit: samba r18328 - in branches/SAMBA_4_0/source/lib/registry: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 11:16:26 + (Sun, 10 Sep 2006)
New Revision: 18328

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

Log:

when we bail out early, set *offset to 0

Modified:
   branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c
===
--- branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c2006-09-10 
11:16:09 UTC (rev 18327)
+++ branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c2006-09-10 
11:16:26 UTC (rev 18328)
@@ -133,6 +133,8 @@
struct hbin_block *hbin = NULL;
int i;
 
+   *offset = 0;
+
if (size == 0)
return data_blob(NULL, 0);
 



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

2006-09-10 Thread metze
Author: metze
Date: 2006-09-10 11:23:29 + (Sun, 10 Sep 2006)
New Revision: 18329

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

Log:
print out special make variables when failing, to track down the
build failures on older BSD systems with broken make

metze
Modified:
   branches/SAMBA_4_0/source/main.mk


Changeset:
Modified: branches/SAMBA_4_0/source/main.mk
===
--- branches/SAMBA_4_0/source/main.mk   2006-09-10 11:16:26 UTC (rev 18328)
+++ branches/SAMBA_4_0/source/main.mk   2006-09-10 11:23:29 UTC (rev 18329)
@@ -339,6 +339,9 @@
@$(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] $(CFLAGS) 
$(PICFLAG) -c $ -o $@  exit 0;\
echo The following command failed: 12;\
echo $(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL 
PROTECTED] $(CFLAGS) $(PICFLAG) -c $ -o $@ 12;\
+   echo @: $@;\
+   echo : $;\
+   echo *: $*;\
$(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] 
$(CFLAGS) $(PICFLAG) -c $ -o $@ /dev/null 21
 
 .c.ho:



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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 11:32:31 + (Sun, 10 Sep 2006)
New Revision: 18330

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

Log:

don't mix pointer types in RPC replies

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


Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c
===
--- branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c2006-09-10 
11:23:29 UTC (rev 18329)
+++ branches/SAMBA_4_0/source/rpc_server/winreg/rpc_winreg.c2006-09-10 
11:32:31 UTC (rev 18330)
@@ -399,7 +399,11 @@
 
/* Just asking for the size of the buffer */
r-out.type = (enum winreg_Type *)val-data_type;
-   r-out.length = val-data.length;
+   r-out.length = talloc(mem_ctx, uint32_t);
+   if (!r-out.length) {
+   return WERR_NOMEM;
+   }
+   *r-out.length = val-data.length;
if (!r-in.data) {
r-out.size = talloc(mem_ctx, uint32_t);
*r-out.size = val-data.length;



svn commit: samba r18331 - in branches/SAMBA_4_0/source/wrepl_server: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 11:32:42 + (Sun, 10 Sep 2006)
New Revision: 18331

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

Log:

fixed a warning

Modified:
   branches/SAMBA_4_0/source/wrepl_server/wrepl_out_helpers.c


Changeset:
Modified: branches/SAMBA_4_0/source/wrepl_server/wrepl_out_helpers.c
===
--- branches/SAMBA_4_0/source/wrepl_server/wrepl_out_helpers.c  2006-09-10 
11:32:31 UTC (rev 18330)
+++ branches/SAMBA_4_0/source/wrepl_server/wrepl_out_helpers.c  2006-09-10 
11:32:42 UTC (rev 18331)
@@ -569,7 +569,7 @@
 
 static NTSTATUS wreplsrv_pull_cycle_next_owner_do_work(struct 
wreplsrv_pull_cycle_state *state)
 {
-   struct wreplsrv_owner *current_owner;
+   struct wreplsrv_owner *current_owner=NULL;
struct wreplsrv_owner *local_owner;
uint32_t i;
uint64_t old_max_version = 0;



svn commit: samba r18332 - in branches/SAMBA_4_0/source/lib/replace: . test

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 11:47:21 + (Sun, 10 Sep 2006)
New Revision: 18332

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

Log:

added back in our shared mmap test code

Added:
   branches/SAMBA_4_0/source/lib/replace/test/shared_mmap.c
Modified:
   branches/SAMBA_4_0/source/lib/replace/libreplace.m4


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4
===
--- branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-10 11:32:42 UTC 
(rev 18331)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-10 11:47:21 UTC 
(rev 18332)
@@ -42,7 +42,6 @@
 AC_CHECK_SIZEOF(off_t,cross)
 AC_CHECK_SIZEOF(size_t,cross)
 AC_CHECK_SIZEOF(ssize_t,cross)
-AC_FUNC_MMAP
 
 AC_CHECK_HEADERS([stdint.h inttypes.h])
 AC_CHECK_TYPE(uint_t, unsigned int)
@@ -83,9 +82,18 @@
 )
 
 
+AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
+AC_TRY_RUN([#include $libreplacedir/test/shared_mmap.c],
+   
samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
+if test x$samba_cv_HAVE_MMAP = xyes; then
+AC_DEFINE(HAVE_MMAP,1,[Whether mmap works])
+fi
+
+
 AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
 AC_TRY_RUN([
 #include stdio.h
+#include unistd.h
 #include sys/types.h
 #include netinet/in.h
 #ifdef HAVE_ARPA_INET_H

Added: branches/SAMBA_4_0/source/lib/replace/test/shared_mmap.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/shared_mmap.c2006-09-10 
11:32:42 UTC (rev 18331)
+++ branches/SAMBA_4_0/source/lib/replace/test/shared_mmap.c2006-09-10 
11:47:21 UTC (rev 18332)
@@ -0,0 +1,68 @@
+/* this tests whether we can use a shared writeable mmap on a file -
+   as needed for the mmap variant of FAST_SHARE_MODES */
+
+#if defined(HAVE_UNISTD_H)
+#include unistd.h
+#endif
+#include sys/mman.h
+#include sys/types.h
+#include sys/stat.h
+#include fcntl.h
+
+#define DATA conftest.mmap
+
+#ifndef MAP_FILE
+#define MAP_FILE 0
+#endif
+
+main()
+{
+   int *buf;
+   int i; 
+   int fd = open(DATA,O_RDWR|O_CREAT|O_TRUNC,0666);
+   int count=7;
+
+   if (fd == -1) exit(1);
+
+   for (i=0;i1;i++) {
+   write(fd,i,sizeof(i));
+   }
+
+   close(fd);
+
+   if (fork() == 0) {
+   fd = open(DATA,O_RDWR);
+   if (fd == -1) exit(1);
+
+   buf = (int *)mmap(NULL, 1*sizeof(int), 
+  (PROT_READ | PROT_WRITE), 
+  MAP_FILE | MAP_SHARED, 
+  fd, 0);
+
+   while (count--  buf[9124] != 55732) sleep(1);
+
+   if (count = 0) exit(1);
+
+   buf[1763] = 7268;
+   exit(0);
+   }
+
+   fd = open(DATA,O_RDWR);
+   if (fd == -1) exit(1);
+
+   buf = (int *)mmap(NULL, 1*sizeof(int), 
+  (PROT_READ | PROT_WRITE), 
+  MAP_FILE | MAP_SHARED, 
+  fd, 0);
+
+   if (buf == (int *)-1) exit(1);
+
+   buf[9124] = 55732;
+
+   while (count--  buf[1763] != 7268) sleep(1);
+
+   unlink(DATA);
+   
+   if (count  0) exit(0);
+   exit(1);
+}



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

2006-09-10 Thread metze
Author: metze
Date: 2006-09-10 11:53:44 + (Sun, 10 Sep 2006)
New Revision: 18333

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

Log:
$ is broken in older BSD version:
when $@ is foo/bar.o, $ could be torture/foo/bar.c
if it also exists. So better use $* which is foo/bar
to get foo/bar.c

metze
Modified:
   branches/SAMBA_4_0/source/main.mk


Changeset:
Modified: branches/SAMBA_4_0/source/main.mk
===
--- branches/SAMBA_4_0/source/main.mk   2006-09-10 11:47:21 UTC (rev 18332)
+++ branches/SAMBA_4_0/source/main.mk   2006-09-10 11:53:44 UTC (rev 18333)
@@ -330,26 +330,33 @@
@echo Generating dependencies for $
@$(CC) -M -MG -MT include/includes.h.gch -MT $@ $(CFLAGS) $ -o $@
 
+#
+# $ is broken in older BSD versions:
+# when $@ is foo/bar.o, $ could be torture/foo/bar.c
+# if it also exists. So better use $* which is foo/bar
+# and append .c manually to get foo/bar.c
+#
 .c.o:
@if test -n $(CC_CHECKER); then \
-   echo Checking  $ with '$(CC_CHECKER)'; \
-   $(CC_CHECKER) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL 
PROTECTED] $(CFLAGS) $(PICFLAG) -c $ -o $@; \
+   echo Checking  $*.c with '$(CC_CHECKER)'; \
+   $(CC_CHECKER) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL 
PROTECTED] $(CFLAGS) $(PICFLAG) -c $*.c -o $@; \
fi
-   @echo Compiling $
-   @$(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] $(CFLAGS) 
$(PICFLAG) -c $ -o $@  exit 0;\
+   @echo Compiling $*.c
+   @$(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] $(CFLAGS) 
$(PICFLAG) -c $*.c -o $@  exit 0;\
echo The following command failed: 12;\
-   echo $(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL 
PROTECTED] $(CFLAGS) $(PICFLAG) -c $ -o $@ 12;\
-   echo @: $@;\
-   echo : $;\
-   echo *: $*;\
-   $(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] 
$(CFLAGS) $(PICFLAG) -c $ -o $@ /dev/null 21
+   echo $(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL 
PROTECTED] $(CFLAGS) $(PICFLAG) -c $*.c -o $@ 12;\
+   echo @: $@ 12;\
+   echo : $ 12;\
+   echo *: $* 12;\
+   echo *.c: $*.c 12;\
+   $(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] 
$(CFLAGS) $(PICFLAG) -c $*.c -o $@ /dev/null 21
 
 .c.ho:
-   @echo Compiling $ with host compiler
-   @$(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] 
$(CFLAGS) -c $ -o $@  exit 0;\
+   @echo Compiling $*.c with host compiler
+   @$(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] 
$(CFLAGS) -c $*.c -o $@  exit 0;\
echo The following command failed: 12;\
-   echo $(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL 
PROTECTED] $(CFLAGS) -c $ -o $@ 12;\
-   $(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] 
$(CFLAGS) -c $ -o $@ /dev/null 21
+   echo $(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL 
PROTECTED] $(CFLAGS) -c $*.c -o $@ 12;\
+   $(HOSTCC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] 
$(CFLAGS) -c $*.c -o $@ /dev/null 21
 
 .h.h.gch:
@echo Precompiling $



svn commit: samba r18334 - in branches/SAMBA_4_0/source/scripting/libjs: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 12:12:24 + (Sun, 10 Sep 2006)
New Revision: 18334

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

Log:

AIX 5.1 doesn't have any of 'users', 'guest', 'other' or 'unknown'

it does have 'usr'

Modified:
   branches/SAMBA_4_0/source/scripting/libjs/provision.js


Changeset:
Modified: branches/SAMBA_4_0/source/scripting/libjs/provision.js
===
--- branches/SAMBA_4_0/source/scripting/libjs/provision.js  2006-09-10 
11:53:44 UTC (rev 18333)
+++ branches/SAMBA_4_0/source/scripting/libjs/provision.js  2006-09-10 
12:12:24 UTC (rev 18334)
@@ -616,7 +616,7 @@
subobj.NOGROUP  = findnss(nss.getgrnam, nogroup, nobody);
subobj.WHEEL= findnss(nss.getgrnam, wheel, root, staff, 
adm);
subobj.BACKUP   = findnss(nss.getgrnam, backup, wheel, root, 
staff);
-   subobj.USERS= findnss(nss.getgrnam, users, guest, other, 
unknown);
+   subobj.USERS= findnss(nss.getgrnam, users, guest, other, 
unknown, usr);
subobj.DNSDOMAIN= strlower(subobj.REALM);
subobj.DNSNAME  = sprintf(%s.%s, 
  strlower(subobj.HOSTNAME), 



svn commit: samba r18335 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 12:23:47 + (Sun, 10 Sep 2006)
New Revision: 18335

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

Log:

more portable bool tests

Modified:
   branches/SAMBA_4_0/source/lib/replace/libreplace.m4
   branches/SAMBA_4_0/source/lib/replace/replace.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4
===
--- branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-10 12:12:24 UTC 
(rev 18334)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-10 12:23:47 UTC 
(rev 18335)
@@ -81,7 +81,16 @@
 #endif]
 )
 
+AC_CHECK_TYPE(_Bool, 
+[AC_DEFINE(HAVE__Bool, 1, [Whether the _Bool type is available])],,
+[
+AC_INCLUDES_DEFAULT
+#ifdef HAVE_STDBOOL_H
+#include stdbool.h
+#endif]
+)
 
+
 AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
 AC_TRY_RUN([#include $libreplacedir/test/shared_mmap.c],

samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])

Modified: branches/SAMBA_4_0/source/lib/replace/replace.h
===
--- branches/SAMBA_4_0/source/lib/replace/replace.h 2006-09-10 12:12:24 UTC 
(rev 18334)
+++ branches/SAMBA_4_0/source/lib/replace/replace.h 2006-09-10 12:23:47 UTC 
(rev 18335)
@@ -310,12 +310,23 @@
 
 #ifdef HAVE_STDBOOL_H
 #include stdbool.h
-#elif !defined(HAVE_BOOL)
+#endif
+
+#if !defined(HAVE_BOOL)
+#ifdef HAVE__Bool
+#define bool _Bool
+#else
 #define __bool_true_false_are_defined
 typedef int bool;
-#define false (0)
+#endif
+#endif
+
+#ifndef true
 #define true (1)
 #endif
+#ifndef false
+#define false (0)
+#endif
 
 #ifndef HAVE_FUNCTION_MACRO
 #ifdef HAVE_func_MACRO



svn commit: samba r18336 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 12:38:32 + (Sun, 10 Sep 2006)
New Revision: 18336

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

Log:

autoconf tries to force on C89 mode on HP-UX, using the -Ae
flag. Unfortunately that flag conflicts with the -AC99 flag, and we
get lots of breakage.

This is a trick to force off the -Ae option

Modified:
   branches/SAMBA_4_0/source/lib/replace/libreplace.m4


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4
===
--- branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-10 12:23:47 UTC 
(rev 18335)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-10 12:38:32 UTC 
(rev 18336)
@@ -11,6 +11,10 @@
 LIBREPLACEOBJ=dlfcn.o getpass.o replace.o snprintf.o timegm.o
 AC_SUBST(LIBREPLACEOBJ)
 
+dnl stop the C89 attempt by autoconf - if autoconf detects -Ae it will enable 
it
+dnl which conflicts with C99 on HPUX
+ac_cv_prog_cc_Ae=no
+
 dnl needed before AC_TRY_COMPILE
 AC_ISC_POSIX
 AC_USE_SYSTEM_EXTENSIONS



svn commit: samba r18337 - in branches/SAMBA_4_0/source: build/m4 build/tests lib/replace

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 12:45:37 + (Sun, 10 Sep 2006)
New Revision: 18337

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

Log:

more -Ae tests in check_cc.m4

honor the MMAP_BLACKLIST

Modified:
   branches/SAMBA_4_0/source/build/m4/check_cc.m4
   branches/SAMBA_4_0/source/build/tests/shared_mmap.c
   branches/SAMBA_4_0/source/lib/replace/replace.h


Changeset:
Modified: branches/SAMBA_4_0/source/build/m4/check_cc.m4
===
--- branches/SAMBA_4_0/source/build/m4/check_cc.m4  2006-09-10 12:38:32 UTC 
(rev 18336)
+++ branches/SAMBA_4_0/source/build/m4/check_cc.m4  2006-09-10 12:45:37 UTC 
(rev 18337)
@@ -168,12 +168,8 @@
 case $host_os in
# Try to work out if this is the native HPUX compiler that uses the -Ae 
flag.
*hpux*)
-   AC_PROG_CC_FLAG(Ae)
# mmap on HPUX is completely broken...
AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken])
-   if test $ac_cv_prog_cc_Ae = yes; then
-   CPPFLAGS=$CPPFLAGS -Ae
-   fi
;;
 
*aix*)

Modified: branches/SAMBA_4_0/source/build/tests/shared_mmap.c
===
--- branches/SAMBA_4_0/source/build/tests/shared_mmap.c 2006-09-10 12:38:32 UTC 
(rev 18336)
+++ branches/SAMBA_4_0/source/build/tests/shared_mmap.c 2006-09-10 12:45:37 UTC 
(rev 18337)
@@ -39,6 +39,8 @@
   MAP_FILE | MAP_SHARED, 
   fd, 0);
 
+   if (buf == (int *)-1) exit(1);
+
while (count--  buf[9124] != 55732) sleep(1);
 
if (count = 0) exit(1);

Modified: branches/SAMBA_4_0/source/lib/replace/replace.h
===
--- branches/SAMBA_4_0/source/lib/replace/replace.h 2006-09-10 12:38:32 UTC 
(rev 18336)
+++ branches/SAMBA_4_0/source/lib/replace/replace.h 2006-09-10 12:45:37 UTC 
(rev 18337)
@@ -352,4 +352,8 @@
 #define __STRING(x)#x
 #endif
 
+#if MMAP_BLACKLIST
+#undef HAVE_MMAP
 #endif
+
+#endif



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

2006-09-10 Thread metze
Author: metze
Date: 2006-09-10 12:51:30 + (Sun, 10 Sep 2006)
New Revision: 18338

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

Log:
this isn't needed anymore

metze
Modified:
   branches/SAMBA_4_0/source/main.mk


Changeset:
Modified: branches/SAMBA_4_0/source/main.mk
===
--- branches/SAMBA_4_0/source/main.mk   2006-09-10 12:45:37 UTC (rev 18337)
+++ branches/SAMBA_4_0/source/main.mk   2006-09-10 12:51:30 UTC (rev 18338)
@@ -345,10 +345,6 @@
@$(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] $(CFLAGS) 
$(PICFLAG) -c $*.c -o $@  exit 0;\
echo The following command failed: 12;\
echo $(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL 
PROTECTED] $(CFLAGS) $(PICFLAG) -c $*.c -o $@ 12;\
-   echo @: $@ 12;\
-   echo : $ 12;\
-   echo *: $* 12;\
-   echo *.c: $*.c 12;\
$(CC) `$(PERL) $(srcdir)/script/cflags.pl [EMAIL PROTECTED] 
$(CFLAGS) $(PICFLAG) -c $*.c -o $@ /dev/null 21
 
 .c.ho:



svn commit: samba r18339 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 13:02:54 + (Sun, 10 Sep 2006)
New Revision: 18339

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

Log:

need these checks for roken.h on hpux

Modified:
   branches/SAMBA_4_0/source/lib/replace/libreplace.m4


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4
===
--- branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-10 12:51:30 UTC 
(rev 18338)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-10 13:02:54 UTC 
(rev 18339)
@@ -58,6 +58,17 @@
 AC_CHECK_TYPE(uint32_t, unsigned long)
 AC_CHECK_TYPE(ssize_t, int)
 
+dnl these are needed for heimdal roken.h
+AC_CHECK_TYPE(struct sockaddr, [], [], [
+AC_INCLUDES_DEFAULT
+#include sys/socket.h])
+AC_CHECK_TYPE(struct sockaddr_storage, [], [], [
+AC_INCLUDES_DEFAULT
+#include sys/socket.h])
+AC_CHECK_TYPE(struct addrinfo, [], [], [
+AC_INCLUDES_DEFAULT
+#include netdb.h])
+
 AC_TYPE_SIGNAL
 AC_TYPE_UID_T
 AC_TYPE_MODE_T



svn commit: samba r18340 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 13:16:27 + (Sun, 10 Sep 2006)
New Revision: 18340

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

Log:

some HPUX boxes don't have ptrdiff_t

Modified:
   branches/SAMBA_4_0/source/lib/replace/libreplace.m4


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4
===
--- branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-10 13:02:54 UTC 
(rev 18339)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-10 13:16:27 UTC 
(rev 18340)
@@ -57,6 +57,7 @@
 AC_CHECK_TYPE(intptr_t, unsigned long long)
 AC_CHECK_TYPE(uint32_t, unsigned long)
 AC_CHECK_TYPE(ssize_t, int)
+AC_CHECK_TYPE(ptrdiff_t, unsigned long long)
 
 dnl these are needed for heimdal roken.h
 AC_CHECK_TYPE(struct sockaddr, [], [], [



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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 13:48:42 + (Sun, 10 Sep 2006)
New Revision: 18341

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

Log:

ooh this gets subtle - this needed for xfs on linux

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


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_dirlist.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_dirlist.c2006-09-10 
13:16:27 UTC (rev 18340)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_dirlist.c2006-09-10 
13:48:42 UTC (rev 18341)
@@ -52,7 +52,7 @@
 */
 #define DIR_OFFSET_DOT0
 #define DIR_OFFSET_DOTDOT 1
-#define DIR_OFFSET_BASE   0x8002
+#define DIR_OFFSET_BASE   0x8022
 
 /*
   a special directory listing case where the pattern has no wildcard. We can 
just do a single stat()



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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 13:51:57 + (Sun, 10 Sep 2006)
New Revision: 18342

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

Log:

a bit more explanation of these strange values

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


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_dirlist.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_dirlist.c2006-09-10 
13:48:42 UTC (rev 18341)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_dirlist.c2006-09-10 
13:51:57 UTC (rev 18342)
@@ -49,6 +49,10 @@
interaction with the OS value for 'end of directory'. On IRIX
telldir() returns 0x at the end of a directory, and that
caused an infinite loop with the original values of 0,1,2
+
+   On XFS on linux telldir returns 0x7FFF at the end of a
+   directory. Thus the change from 0x8002, as otherwise
+   0x7FFF+0x8002==1==DIR_OFFSET_DOTDOT
 */
 #define DIR_OFFSET_DOT0
 #define DIR_OFFSET_DOTDOT 1



svn commit: samba r18343 - in branches/SAMBA_4_0/source: lib/replace lib/replace/test torture utils/net

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 14:19:38 + (Sun, 10 Sep 2006)
New Revision: 18343

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

Log:

fixed setlinebuf() prototype, added test for it, and use it in two
places to avoid a #ifdef

Modified:
   branches/SAMBA_4_0/source/lib/replace/replace.c
   branches/SAMBA_4_0/source/lib/replace/replace.h
   branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
   branches/SAMBA_4_0/source/torture/smbtorture.c
   branches/SAMBA_4_0/source/utils/net/net.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/replace.c
===
--- branches/SAMBA_4_0/source/lib/replace/replace.c 2006-09-10 13:51:57 UTC 
(rev 18342)
+++ branches/SAMBA_4_0/source/lib/replace/replace.c 2006-09-10 14:19:38 UTC 
(rev 18343)
@@ -338,9 +338,9 @@
 #endif
 
 #ifndef HAVE_SETLINEBUF
-int rep_setlinebuf(FILE *stream)
+void rep_setlinebuf(FILE *stream)
 {
-   return setvbuf(stream, (char *)NULL, _IOLBF, 0);
+   setvbuf(stream, (char *)NULL, _IOLBF, 0);
 }
 #endif /* HAVE_SETLINEBUF */
 

Modified: branches/SAMBA_4_0/source/lib/replace/replace.h
===
--- branches/SAMBA_4_0/source/lib/replace/replace.h 2006-09-10 13:51:57 UTC 
(rev 18342)
+++ branches/SAMBA_4_0/source/lib/replace/replace.h 2006-09-10 14:19:38 UTC 
(rev 18343)
@@ -140,7 +140,7 @@
 
 #ifndef HAVE_SETLINEBUF
 #define setlinebuf rep_setlinebuf
-int rep_setlinebuf(FILE *);
+void rep_setlinebuf(FILE *);
 #endif
 
 #ifndef HAVE_STRCASESTR

Modified: branches/SAMBA_4_0/source/lib/replace/test/testsuite.c
===
--- branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-10 
13:51:57 UTC (rev 18342)
+++ branches/SAMBA_4_0/source/lib/replace/test/testsuite.c  2006-09-10 
14:19:38 UTC (rev 18343)
@@ -146,7 +146,8 @@
 
 static int test_setlinebuf(void)
 {
-   /* FIXME */
+   printf(testing setlinebuf\n);
+   setlinebuf(stdout);
return true;
 }
 

Modified: branches/SAMBA_4_0/source/torture/smbtorture.c
===
--- branches/SAMBA_4_0/source/torture/smbtorture.c  2006-09-10 13:51:57 UTC 
(rev 18342)
+++ branches/SAMBA_4_0/source/torture/smbtorture.c  2006-09-10 14:19:38 UTC 
(rev 18343)
@@ -413,9 +413,7 @@
{ NULL }
};
 
-#ifdef HAVE_SETBUFFER
-   setbuffer(stdout, NULL, 0);
-#endif
+   setlinebuf(stdout);
 
/* we are never interested in SIGPIPE */
BlockSignals(True,SIGPIPE);

Modified: branches/SAMBA_4_0/source/utils/net/net.c
===
--- branches/SAMBA_4_0/source/utils/net/net.c   2006-09-10 13:51:57 UTC (rev 
18342)
+++ branches/SAMBA_4_0/source/utils/net/net.c   2006-09-10 14:19:38 UTC (rev 
18343)
@@ -151,9 +151,7 @@
{ NULL }
};
 
-#ifdef HAVE_SETBUFFER
-   setbuffer(stdout, NULL, 0);
-#endif
+   setlinebuf(stdout);
 
pc = poptGetContext(net, argc, (const char **) argv, long_options, 
POPT_CONTEXT_KEEP_FIRST);



svn commit: samba r18344 - in branches/SAMBA_4_0/source: librpc/idl torture/rpc

2006-09-10 Thread idra
Author: idra
Date: 2006-09-10 21:51:46 + (Sun, 10 Sep 2006)
New Revision: 18344

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

Log:

add a test to show hoe NetNameValidate behaves.
fix the misleading idl names


Modified:
   branches/SAMBA_4_0/source/librpc/idl/srvsvc.idl
   branches/SAMBA_4_0/source/torture/rpc/srvsvc.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/srvsvc.idl
===
--- branches/SAMBA_4_0/source/librpc/idl/srvsvc.idl 2006-09-10 14:19:38 UTC 
(rev 18343)
+++ branches/SAMBA_4_0/source/librpc/idl/srvsvc.idl 2006-09-10 21:51:46 UTC 
(rev 18344)
@@ -1348,9 +1348,9 @@
/* Function: 0x21 */
WERROR srvsvc_NetNameValidate(
[in]   [string,charset(UTF16)] uint16 *server_unc,
-   [in]   [string,charset(UTF16)] uint16 path[],
-   [in]uint32 pathtype,
-   [in]uint32 pathflags
+   [in]   [string,charset(UTF16)] uint16 name[],
+   [in]uint32 name_type,
+   [in]uint32 flags
);
 
/**/
@@ -1362,10 +1362,10 @@
/* Function: 0x23 */
WERROR srvsvc_NetPRNameCompare(
[in]   [string,charset(UTF16)] uint16 *server_unc,
-   [in]   [string,charset(UTF16)] uint16 path1[],
-   [in]   [string,charset(UTF16)] uint16 path2[],
-   [in]uint32 pathtype,
-   [in]uint32 pathflags
+   [in]   [string,charset(UTF16)] uint16 name1[],
+   [in]   [string,charset(UTF16)] uint16 name2[],
+   [in]uint32 name_type,
+   [in]uint32 flags
);
 
 /**/

Modified: branches/SAMBA_4_0/source/torture/rpc/srvsvc.c
===
--- branches/SAMBA_4_0/source/torture/rpc/srvsvc.c  2006-09-10 14:19:38 UTC 
(rev 18343)
+++ branches/SAMBA_4_0/source/torture/rpc/srvsvc.c  2006-09-10 21:51:46 UTC 
(rev 18344)
@@ -766,6 +766,78 @@
return ret;
 }
 
+/**/
+/* srvsvc_NetName */
+/**/
+
+static BOOL test_NetNameValidate(struct dcerpc_pipe *p,
+TALLOC_CTX *mem_ctx)
+{
+   NTSTATUS status;
+   struct srvsvc_NetNameValidate r;
+   char *invalidc;
+   int i, n;
+
+   r.in.server_unc = talloc_asprintf(mem_ctx, %s, 
dcerpc_server_name(p));
+   r.in.flags = 0x0;
+
+   printf(testing NetNameValidate\n);
+
+   /* valid path types only between 1 and 13 */
+   for (i = 1; i  14; i++) {
+
+   /* Find maximum length accepted by this type */
+   r.in.name_type = i;
+   r.in.name = talloc_strdup(mem_ctx, A);
+   n = 0;
+
+   while (W_ERROR_IS_OK(r.out.result)) {
+   status = dcerpc_srvsvc_NetNameValidate(p, mem_ctx, r);
+   if (!NT_STATUS_IS_OK(status)) {
+   printf(NetNameValidate failed while checking 
maximum size (%s)\n,
+   nt_errstr(status));
+   break;
+   }
+   
+   r.in.name = talloc_append_string(mem_ctx, r.in.name, 
A);
+   if (!r.in.name) {
+   printf(NetNameValidate: Out of memory!\n);
+   return False;
+   }
+   n++;
+   }
+
+   talloc_free(r.in.name);
+
+   printf(Maximum length for type %d: %d\n, i, n);
+
+   /* find invalid chars for this type check only ASCII between 
0x20 and 0x7e */
+
+   invalidc = NULL;
+
+   for (n = 0x20; n  0x7e; n++) {
+   r.in.name = talloc_asprintf(mem_ctx, %c, (char)n);
+
+   status = dcerpc_srvsvc_NetNameValidate(p, mem_ctx, r);
+   if (!NT_STATUS_IS_OK(status)) {
+   printf(NetNameValidate failed while checking 
valid chars (%s)\n,
+   nt_errstr(status));
+   break;
+   }
+
+   if (!W_ERROR_IS_OK(r.out.result)) {
+   invalidc = talloc_asprintf_append(invalidc, 
%c, (char)n);
+   }
+
+   talloc_free(r.in.name);
+   }
+
+   printf(Invalid chars for type %d: %s\n, i, invalidc);
+   }
+
+   return True;
+}
+
 BOOL torture_rpc_srvsvc(struct torture_context *torture)
 {
 NTSTATUS status;
@@ -795,7 +867,8 @@
ret = test_NetRemoteTOD(p, mem_ctx);
ret = test_NetShareEnum(p, mem_ctx, True);
ret = test_NetShareGetInfo(p, 

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

2006-09-10 Thread idra
Author: idra
Date: 2006-09-10 22:06:49 + (Sun, 10 Sep 2006)
New Revision: 18345

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

Log:

test also flags


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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/srvsvc.c
===
--- branches/SAMBA_4_0/source/torture/rpc/srvsvc.c  2006-09-10 21:51:46 UTC 
(rev 18344)
+++ branches/SAMBA_4_0/source/torture/rpc/srvsvc.c  2006-09-10 22:06:49 UTC 
(rev 18345)
@@ -786,6 +786,7 @@
/* valid path types only between 1 and 13 */
for (i = 1; i  14; i++) {
 
+again:
/* Find maximum length accepted by this type */
r.in.name_type = i;
r.in.name = talloc_strdup(mem_ctx, A);
@@ -809,7 +810,7 @@
 
talloc_free(r.in.name);
 
-   printf(Maximum length for type %d: %d\n, i, n);
+   printf(Maximum length for type %2d, flags %08x: %d\n, i, 
r.in.flags, n);
 
/* find invalid chars for this type check only ASCII between 
0x20 and 0x7e */
 
@@ -832,7 +833,15 @@
talloc_free(r.in.name);
}
 
-   printf(Invalid chars for type %d: %s\n, i, invalidc);
+   printf( Invalid chars for type %2d, flags %08x: \%s\\n, i, 
r.in.flags, invalidc);
+
+   /* only two values are accepted for flags: 0x0 and 0x8000 */
+   if (r.in.flags == 0x0) {
+   r.in.flags = 0x8000;
+   goto again;
+   }
+
+   r.in.flags = 0x0;
}
 
return True;



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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 22:45:45 + (Sun, 10 Sep 2006)
New Revision: 18346

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

Log:

make sure we kill off the slapd process

Added:
   branches/SAMBA_4_0/source/lib/ldb/tests/kill_slapd.sh
Modified:
   branches/SAMBA_4_0/source/lib/ldb/tests/test-ldap.sh


Changeset:
Added: branches/SAMBA_4_0/source/lib/ldb/tests/kill_slapd.sh
===
--- branches/SAMBA_4_0/source/lib/ldb/tests/kill_slapd.sh   2006-09-10 
22:06:49 UTC (rev 18345)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/kill_slapd.sh   2006-09-10 
22:45:45 UTC (rev 18346)
@@ -0,0 +1,12 @@
+#!/bin/sh 
+
+if [ -z $LDBDIR ]; then
+LDBDIR=`dirname $0`/..
+export LDBDIR
+fi
+
+if [ -f tests/tmp/slapd.pid ]; then
+echo killing slapd process `cat tests/tmp/slapd.pid`
+kill -9 `cat tests/tmp/slapd.pid`
+rm -f tests/tmp/slapd.pid
+fi


Property changes on: branches/SAMBA_4_0/source/lib/ldb/tests/kill_slapd.sh
___
Name: svn:executable
   + *

Modified: branches/SAMBA_4_0/source/lib/ldb/tests/test-ldap.sh
===
--- branches/SAMBA_4_0/source/lib/ldb/tests/test-ldap.sh2006-09-10 
22:06:49 UTC (rev 18345)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/test-ldap.sh2006-09-10 
22:45:45 UTC (rev 18346)
@@ -36,9 +36,19 @@
 PATH=bin:$PATH
 export PATH
 
-. $LDBDIR/tests/init_slapd.sh
-. $LDBDIR/tests/start_slapd.sh
-
 LDB_SPECIALS=0
 export LDB_SPECIALS
-. $LDBDIR/tests/test-generic.sh
+
+if $LDBDIR/tests/init_slapd.sh  
+   $LDBDIR/tests/start_slapd.sh 
+   $LDBDIR/tests/test-generic.sh; then
+echo ldap tests passed;
+ret=0
+else
+echo ldap tests failed;
+ret=$?
+fi
+
+$LDBDIR/tests/kill_slapd.sh
+
+exit $ret



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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-10 22:53:21 + (Sun, 10 Sep 2006)
New Revision: 18347

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

Log:

run slapd in the foreground so timelimit can kill it

Modified:
   branches/SAMBA_4_0/source/lib/ldb/tests/start_slapd.sh


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/tests/start_slapd.sh
===
--- branches/SAMBA_4_0/source/lib/ldb/tests/start_slapd.sh  2006-09-10 
22:45:45 UTC (rev 18346)
+++ branches/SAMBA_4_0/source/lib/ldb/tests/start_slapd.sh  2006-09-10 
22:53:21 UTC (rev 18347)
@@ -7,7 +7,8 @@
 
 mkdir -p $LDBDIR/tests/tmp/db
 
-# not having slapd isn't considered a ldb test failure
-slapd -f $LDBDIR/tests/slapd.conf -h `$LDBDIR/tests/ldapi_url.sh` $* || exit 0
+# running slapd with -d0 means it stays in the same process group, so it can be
+# killed by timelimit
+slapd -d0 -f $LDBDIR/tests/slapd.conf -h `$LDBDIR/tests/ldapi_url.sh` $* 
 
 sleep 2



Build status as of Mon Sep 11 00:00:01 2006

2006-09-10 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2006-09-10 
00:00:26.0 +
+++ /home/build/master/cache/broken_results.txt 2006-09-11 00:00:03.0 
+
@@ -1,21 +1,21 @@
-Build status as of Sun Sep 10 00:00:02 2006
+Build status as of Mon Sep 11 00:00:01 2006
 
 Build counts:
 Tree Total  Broken Panic 
 SOC  0  0  0 
 build_farm   0  0  0 
-ccache   42 9  0 
-distcc   42 7  0 
-ldb  39 9  0 
-libreplace   37 4  0 
-lorikeet-heimdal 4  1  0 
-ppp  19 0  0 
-rsync40 5  0 
+ccache   40 8  0 
+distcc   40 6  0 
+ldb  38 8  0 
+libreplace   36 3  0 
+lorikeet-heimdal 2  1  0 
+ppp  17 0  0 
+rsync38 4  0 
 samba1  0  0 
 samba-docs   0  0  0 
-samba4   46 23 6 
-samba_3_043 14 0 
+samba4   41 19 6 
+samba_3_041 35 21
 smb-build31 4  0 
-talloc   42 5  0 
-tdb  40 7  0 
+talloc   40 4  0 
+tdb  39 6  0 
 


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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-11 00:24:21 + (Mon, 11 Sep 2006)
New Revision: 18348

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

Log:

fixed a valgrind error in RPC-SRVSVC

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/srvsvc.c
===
--- branches/SAMBA_4_0/source/torture/rpc/srvsvc.c  2006-09-10 22:53:21 UTC 
(rev 18347)
+++ branches/SAMBA_4_0/source/torture/rpc/srvsvc.c  2006-09-11 00:24:21 UTC 
(rev 18348)
@@ -788,6 +788,7 @@
 
 again:
/* Find maximum length accepted by this type */
+   ZERO_STRUCT(r.out);
r.in.name_type = i;
r.in.name = talloc_strdup(mem_ctx, A);
n = 0;
@@ -814,7 +815,7 @@
 
/* find invalid chars for this type check only ASCII between 
0x20 and 0x7e */
 
-   invalidc = NULL;
+   invalidc = talloc_strdup(mem_ctx, );
 
for (n = 0x20; n  0x7e; n++) {
r.in.name = talloc_asprintf(mem_ctx, %c, (char)n);



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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-11 00:43:48 + (Mon, 11 Sep 2006)
New Revision: 18349

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

Log:

don't do validation when using valgrind. It's way too slow (can be
hours for a single test)

Modified:
   branches/SAMBA_4_0/source/script/tests/selftest.sh
   branches/SAMBA_4_0/source/script/tests/test_echo.sh
   branches/SAMBA_4_0/source/script/tests/test_net.sh
   branches/SAMBA_4_0/source/script/tests/test_rpc.sh
   branches/SAMBA_4_0/source/script/tests/test_rpc_quick.sh
   branches/SAMBA_4_0/source/script/tests/test_session_key.sh
   branches/SAMBA_4_0/source/script/tests/test_w2k3.sh


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/selftest.sh
===
--- branches/SAMBA_4_0/source/script/tests/selftest.sh  2006-09-11 00:24:21 UTC 
(rev 18348)
+++ branches/SAMBA_4_0/source/script/tests/selftest.sh  2006-09-11 00:43:48 UTC 
(rev 18349)
@@ -16,6 +16,13 @@
 TORTURE_MAXTIME=1200
 fi
 
+# disable rpc validation when using valgrind - its way too slow
+if [ -z $VALGRIND ]; then
+VALIDATE=validate;
+else
+VALIDATE=;
+fi
+
 OLD_PWD=`pwd`
 PREFIX=$ARG1
 PREFIX=`echo $PREFIX | sed s+//+/+`

Modified: branches/SAMBA_4_0/source/script/tests/test_echo.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_echo.sh 2006-09-11 00:24:21 UTC 
(rev 18348)
+++ branches/SAMBA_4_0/source/script/tests/test_echo.sh 2006-09-11 00:43:48 UTC 
(rev 18349)
@@ -26,7 +26,7 @@
 
 failed=0
 for transport in $transports; do
- for bindoptions in connect spnego spnego,sign spnego,seal validate padcheck 
bigendian bigendian,seal; do
+ for bindoptions in connect spnego spnego,sign spnego,seal $VALIDATE padcheck 
bigendian bigendian,seal; do
   for ntlmoptions in \
 --option=socket:testnonblock=True --option=torture:quick=yes; do
name=RPC-ECHO on $transport with $bindoptions and $ntlmoptions

Modified: branches/SAMBA_4_0/source/script/tests/test_net.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_net.sh  2006-09-11 00:24:21 UTC 
(rev 18348)
+++ branches/SAMBA_4_0/source/script/tests/test_net.sh  2006-09-11 00:43:48 UTC 
(rev 18349)
@@ -23,7 +23,7 @@
 . $incdir/test_functions.sh
 
 failed=0
-for bindoptions in seal,validate,padcheck bigendian; do
+for bindoptions in seal,padcheck $VALIDATE bigendian; do
  for transport in ncalrpc ncacn_np ncacn_ip_tcp; do
  case $transport in
 ncalrpc) tests=$ncalrpc_tests ;;

Modified: branches/SAMBA_4_0/source/script/tests/test_rpc.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_rpc.sh  2006-09-11 00:24:21 UTC 
(rev 18348)
+++ branches/SAMBA_4_0/source/script/tests/test_rpc.sh  2006-09-11 00:43:48 UTC 
(rev 18349)
@@ -26,7 +26,7 @@
 . $incdir/test_functions.sh
 
 failed=0
-for bindoptions in seal,validate,padcheck bigendian; do
+for bindoptions in seal,padcheck $VALIDATE bigendian; do
  for transport in ncalrpc ncacn_np ncacn_ip_tcp; do
  case $transport in
 ncalrpc) tests=$ncalrpc_tests ;;
@@ -40,7 +40,7 @@
  done
 done
 
-for bindoptions in connect validate ; do
+for bindoptions in connect $VALIDATE ; do
  for transport in ncalrpc; do
  case $transport in
 ncalrpc) tests=$slow_ncalrpc_tests ;;

Modified: branches/SAMBA_4_0/source/script/tests/test_rpc_quick.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_rpc_quick.sh2006-09-11 
00:24:21 UTC (rev 18348)
+++ branches/SAMBA_4_0/source/script/tests/test_rpc_quick.sh2006-09-11 
00:43:48 UTC (rev 18349)
@@ -23,7 +23,7 @@
 . $incdir/test_functions.sh
 
 failed=0
-for bindoptions in seal,validate,padcheck bigendian; do
+for bindoptions in seal,padcheck $VALIDATE bigendian; do
  for transport in ncalrpc ncacn_np ncacn_ip_tcp; do
case $transport in
 ncalrpc) tests=$ncalrpc_tests ;;

Modified: branches/SAMBA_4_0/source/script/tests/test_session_key.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_session_key.sh  2006-09-11 
00:24:21 UTC (rev 18348)
+++ branches/SAMBA_4_0/source/script/tests/test_session_key.sh  2006-09-11 
00:43:48 UTC (rev 18349)
@@ -19,7 +19,7 @@
 
 failed=0
 transport=ncacn_np
-for bindoptions in validate seal; do
+for bindoptions in $VALIDATE seal; do
  for keyexchange in yes no; do
  for ntlm2 in yes no; do
  for lm_key in yes no; do

Modified: branches/SAMBA_4_0/source/script/tests/test_w2k3.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_w2k3.sh 2006-09-11 00:24:21 UTC 
(rev 18348)
+++ branches/SAMBA_4_0/source/script/tests/test_w2k3.sh 2006-09-11 00:43:48 UTC 
(rev 18349)
@@ -31,7 +31,7 @@
 

svn commit: samba r18350 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-11 00:50:57 + (Mon, 11 Sep 2006)
New Revision: 18350

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

Log:

we have to check for lstat() to keep roken happen on hpux

Modified:
   branches/SAMBA_4_0/source/lib/replace/libreplace.m4


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4
===
--- branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-11 00:43:48 UTC 
(rev 18349)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-11 00:50:57 UTC 
(rev 18350)
@@ -84,7 +84,7 @@
 
 AC_FUNC_MEMCMP
 
-AC_CHECK_FUNCS(pipe strftime srandom random srand rand usleep setbuffer)
+AC_CHECK_FUNCS(pipe strftime srandom random srand rand usleep setbuffer lstat)
 
 AC_CHECK_HEADERS(stdbool.h stddef.h)
 



svn commit: samba r18351 - in branches/SAMBA_4_0/source/lib/crypto: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-11 00:59:31 + (Mon, 11 Sep 2006)
New Revision: 18351

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

Log:

functions as initialisers in structures doesn't work on some compilers

Modified:
   branches/SAMBA_4_0/source/lib/crypto/md4test.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/crypto/md4test.c
===
--- branches/SAMBA_4_0/source/lib/crypto/md4test.c  2006-09-11 00:50:57 UTC 
(rev 18350)
+++ branches/SAMBA_4_0/source/lib/crypto/md4test.c  2006-09-11 00:59:31 UTC 
(rev 18351)
@@ -31,50 +31,49 @@
BOOL ret = True;
uint32_t i;
struct {
-   DATA_BLOB data;
-   DATA_BLOB md4;
+   const char *data;
+   const char *md4;
} testarray[] = {
{
-   .data   = data_blob_string_const(),
-   .md4= 
strhex_to_data_blob(31d6cfe0d16ae931b73c59d7e0c089c0)
+   .data   = ,
+   .md4= 31d6cfe0d16ae931b73c59d7e0c089c0
},{
-   .data   = data_blob_string_const(a),
-   .md4= 
strhex_to_data_blob(bde52cb31de33e46245e05fbdbd6fb24)
+   .data   = a,
+   .md4= bde52cb31de33e46245e05fbdbd6fb24
},{
-   .data   = data_blob_string_const(abc),
-   .md4= 
strhex_to_data_blob(a448017aaf21d8525fc10ae87aa6729d)
+   .data   = abc,
+   .md4= a448017aaf21d8525fc10ae87aa6729d
},{
-   .data   = data_blob_string_const(message digest),
-   .md4= 
strhex_to_data_blob(d9130a8164549fe818874806e1c7014b)
+   .data   = message digest,
+   .md4= d9130a8164549fe818874806e1c7014b
},{
-   .data   = data_blob_string_const(abcdefghijklmnopqrstuvwxyz),
-   .md4= 
strhex_to_data_blob(d79e1c308aa5bbcdeea8ed63df412da9)
+   .data   = abcdefghijklmnopqrstuvwxyz,
+   .md4= d79e1c308aa5bbcdeea8ed63df412da9
},{
-   .data   = data_blob_string_const(ABCDEFGHIJKLMNOPQRSTUVWXYZ
-abcdefghijklmnopqrstuvwxyz
-0123456789),
-   .md4= 
strhex_to_data_blob(043f8582f241db351ce627e153e7f0e4)
+   .data   = 
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789,
+   .md4= 043f8582f241db351ce627e153e7f0e4
},{
-   .data   = 
data_blob_string_const(123456789012345678901234567890
-
123456789012345678901234567890
-12345678901234567890),
-   .md4= 
strhex_to_data_blob(e33b4ddc9c38f2199c3e7b164fcc0536)
+   .data   = 
12345678901234567890123456789012345678901234567890123456789012345678901234567890,
+   .md4= e33b4ddc9c38f2199c3e7b164fcc0536
}
};
 
for (i=0; i  ARRAY_SIZE(testarray); i++) {
uint8_t md4[16];
int e;
+   DATA_BLOB data;
+   DATA_BLOB md4blob;
 
-   mdfour(md4, testarray[i].data.data, testarray[i].data.length);
+   data = data_blob_string_const(testarray[i].data);
+   md4blob  = strhex_to_data_blob(testarray[i].md4);
 
-   e = memcmp(testarray[i].md4.data,
-  md4,
-  MIN(testarray[i].md4.length, sizeof(md4)));
+   mdfour(md4, data.data, data.length);
+
+   e = memcmp(md4blob.data, md4, MIN(md4blob.length, sizeof(md4)));
if (e != 0) {
printf(md4 test[%u]: failed\n, i);
-   dump_data(0, testarray[i].data.data, 
testarray[i].data.length);
-   dump_data(0, testarray[i].md4.data, 
testarray[i].md4.length);
+   dump_data(0, data.data, data.length);
+   dump_data(0, md4blob.data, md4blob.length);
dump_data(0, md4, sizeof(md4));
ret = False;
}



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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-11 01:22:28 + (Mon, 11 Sep 2006)
New Revision: 18352

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

Log:

printf(%s) is not safe for NULL strings on all platforms, but
d_printf() is. This fixes a crash on solaris

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/srvsvc.c
===
--- branches/SAMBA_4_0/source/torture/rpc/srvsvc.c  2006-09-11 00:59:31 UTC 
(rev 18351)
+++ branches/SAMBA_4_0/source/torture/rpc/srvsvc.c  2006-09-11 01:22:28 UTC 
(rev 18352)
@@ -43,17 +43,17 @@
for (i=0;iARRAY_SIZE(levels);i++) {
ZERO_STRUCT(r.out);
r.in.level = levels[i];
-   printf(testing NetCharDevGetInfo level %u on device '%s'\n,
+   d_printf(testing NetCharDevGetInfo level %u on device '%s'\n,
r.in.level, r.in.device_name);
status = dcerpc_srvsvc_NetCharDevGetInfo(p, mem_ctx, r);
if (!NT_STATUS_IS_OK(status)) {
-   printf(NetCharDevGetInfo level %u on device '%s' 
failed - %s\n,
+   d_printf(NetCharDevGetInfo level %u on device '%s' 
failed - %s\n,
r.in.level, r.in.device_name, 
nt_errstr(status));
ret = False;
continue;
}
if (!W_ERROR_IS_OK(r.out.result)) {
-   printf(NetCharDevGetInfo level %u on device '%s' 
failed - %s\n,
+   d_printf(NetCharDevGetInfo level %u on device '%s' 
failed - %s\n,
r.in.level, r.in.device_name, 
win_errstr(r.out.result));
continue;
}
@@ -77,16 +77,16 @@
for (i=0;iARRAY_SIZE(opcodes);i++) {
ZERO_STRUCT(r.out);
r.in.opcode = opcodes[i];
-   printf(testing NetCharDevControl opcode %u on device '%s'\n, 
+   d_printf(testing NetCharDevControl opcode %u on device 
'%s'\n, 
r.in.opcode, r.in.device_name);
status = dcerpc_srvsvc_NetCharDevControl(p, mem_ctx, r);
if (!NT_STATUS_IS_OK(status)) {
-   printf(NetCharDevControl opcode %u failed - %s\n, 
r.in.opcode, nt_errstr(status));
+   d_printf(NetCharDevControl opcode %u failed - %s\n, 
r.in.opcode, nt_errstr(status));
ret = False;
continue;
}
if (!W_ERROR_IS_OK(r.out.result)) {
-   printf(NetCharDevControl opcode %u failed - %s\n, 
r.in.opcode, win_errstr(r.out.result));
+   d_printf(NetCharDevControl opcode %u failed - %s\n, 
r.in.opcode, win_errstr(r.out.result));
continue;
}
}
@@ -120,12 +120,12 @@
printf(testing NetCharDevEnum level %u\n, r.in.level);
status = dcerpc_srvsvc_NetCharDevEnum(p, mem_ctx, r);
if (!NT_STATUS_IS_OK(status)) {
-   printf(NetCharDevEnum level %u failed - %s\n, 
r.in.level, nt_errstr(status));
+   d_printf(NetCharDevEnum level %u failed - %s\n, 
r.in.level, nt_errstr(status));
ret = False;
continue;
}
if (!W_ERROR_IS_OK(r.out.result)) {
-   printf(NetCharDevEnum level %u failed - %s\n, 
r.in.level, win_errstr(r.out.result));
+   d_printf(NetCharDevEnum level %u failed - %s\n, 
r.in.level, win_errstr(r.out.result));
continue;
}
 
@@ -166,11 +166,11 @@
for (i=0;iARRAY_SIZE(levels);i++) {
ZERO_STRUCT(r.out);
r.in.level = levels[i];
-   printf(testing NetCharDevQGetInfo level %u on devicequeue 
'%s'\n,
+   d_printf(testing NetCharDevQGetInfo level %u on devicequeue 
'%s'\n,
r.in.level, r.in.queue_name);
status = dcerpc_srvsvc_NetCharDevQGetInfo(p, mem_ctx, r);
if (!NT_STATUS_IS_OK(status)) {
-   printf(NetCharDevQGetInfo level %u on devicequeue '%s' 
failed - %s\n,
+   d_printf(NetCharDevQGetInfo level %u on devicequeue 
'%s' failed - %s\n,
r.in.level, r.in.queue_name, nt_errstr(status));
ret = False;
continue;
@@ -203,7 +203,7 @@
ZERO_STRUCT(r.out);
parm_error = 0;
r.in.level = levels[i];
-   printf(testing NetCharDevQSetInfo level %u on devicequeue 
'%s'\n, 
+   d_printf(testing NetCharDevQSetInfo level %u on devicequeue 
'%s'\n, 
r.in.level, 

svn commit: samba r18353 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-11 01:38:50 + (Mon, 11 Sep 2006)
New Revision: 18353

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

Log:

try to fix the assumption of NULL being handled in printf()
permanently by replacing printf() on systems that don't have a C99
printf lib

Modified:
   branches/SAMBA_4_0/source/lib/replace/snprintf.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/snprintf.c
===
--- branches/SAMBA_4_0/source/lib/replace/snprintf.c2006-09-11 01:22:28 UTC 
(rev 18352)
+++ branches/SAMBA_4_0/source/lib/replace/snprintf.c2006-09-11 01:38:50 UTC 
(rev 18353)
@@ -1209,6 +1209,27 @@
 }
 #endif
 
+#ifndef HAVE_C99_VSNPRINTF
+ int printf(const char *fmt, ...)
+{
+   va_list ap;
+   int ret;
+   char *s;
+
+   s = NULL;
+   va_start(ap, fmt);
+   ret = vasprintf(s, fmt, ap);
+   va_end(ap);
+
+   if (s) {
+   fwrite(s, 1, strlen(s), stdout);
+   }
+   free(s);
+
+   return ret;
+}
+#endif
+
 #endif 
 
 #ifndef HAVE_VASPRINTF



svn commit: samba r18354 - in branches/SAMBA_4_0/source/auth/gensec: .

2006-09-10 Thread abartlet
Author: abartlet
Date: 2006-09-11 01:42:13 + (Mon, 11 Sep 2006)
New Revision: 18354

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

Log:
It seems safe to enable the DIGEST-MD5 module now.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/auth/gensec/cyrus_sasl.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/gensec/cyrus_sasl.c
===
--- branches/SAMBA_4_0/source/auth/gensec/cyrus_sasl.c  2006-09-11 01:38:50 UTC 
(rev 18353)
+++ branches/SAMBA_4_0/source/auth/gensec/cyrus_sasl.c  2006-09-11 01:42:13 UTC 
(rev 18354)
@@ -308,7 +308,7 @@
.wrap_packets = gensec_sasl_wrap_packets,
.unwrap_packets   = gensec_sasl_unwrap_packets,
.have_feature = gensec_sasl_have_feature,
-   .enabled  = False,
+   .enabled  = True,
.priority = GENSEC_SASL
 };
 



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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-11 02:09:03 + (Mon, 11 Sep 2006)
New Revision: 18355

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

Log:

increase the delays waiting for all events to propogate in the
RAW-NOTIFY test.

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/notify.c
===
--- branches/SAMBA_4_0/source/torture/raw/notify.c  2006-09-11 01:42:13 UTC 
(rev 18354)
+++ branches/SAMBA_4_0/source/torture/raw/notify.c  2006-09-11 02:09:03 UTC 
(rev 18355)
@@ -215,7 +215,7 @@
 
/* and we now see the rest of the unlink calls on both directory 
handles */
notify.nttrans.in.file.fnum = fnum;
-   sleep(1);
+   sleep(3);
req = smb_raw_changenotify_send(cli-tree, notify);
status = smb_raw_changenotify_recv(req, mem_ctx, notify);
CHECK_STATUS(status, NT_STATUS_OK);
@@ -319,7 +319,7 @@
 
notify.nttrans.in.completion_filter = 0;
notify.nttrans.in.recursive = True;
-   msleep(10);
+   msleep(200);
req1 = smb_raw_changenotify_send(cli-tree, notify);
 
smbcli_rmdir(cli-tree, BASEDIR \\subdir-name\\subname1-r);
@@ -436,7 +436,7 @@
notify.nttrans.in.completion_filter = (1i); \
req = smb_raw_changenotify_send(cli-tree, notify); \
op \
-   msleep(10); smb_raw_ntcancel(req); \
+   msleep(200); smb_raw_ntcancel(req); \
status = smb_raw_changenotify_recv(req, mem_ctx, notify); \
cleanup \
smbcli_close(cli-tree, fnum); \
@@ -1054,7 +1054,7 @@
}
 
/* give a bit of time for all the events to propogate */
-   sleep(2);
+   sleep(4);
 
/* count events that have happened in each dir */
for (i=0;iARRAY_SIZE(dirs);i++) {



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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-11 02:58:45 + (Mon, 11 Sep 2006)
New Revision: 18356

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

Log:

doing 1000 of these requests can take over an hour under
valgrind. Reduce to 50, which is plenty for testing the code

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/lsa.c
===
--- branches/SAMBA_4_0/source/torture/rpc/lsa.c 2006-09-11 02:09:03 UTC (rev 
18355)
+++ branches/SAMBA_4_0/source/torture/rpc/lsa.c 2006-09-11 02:58:45 UTC (rev 
18356)
@@ -514,8 +514,6 @@
return True;
 }
 
-#define NUM_ASYNC_REQUESTS 1000
-
 static void lookupsids_cb(struct rpc_request *req)
 {
int *replies = (int *)req-async.private;
@@ -536,26 +534,29 @@
 {
struct lsa_SidArray sids;
struct lsa_SidPtr sidptr;
-
-   uint32_t count[NUM_ASYNC_REQUESTS];
-   struct lsa_TransNameArray names[NUM_ASYNC_REQUESTS];
-   struct lsa_LookupSids r[NUM_ASYNC_REQUESTS];
+   uint32_t *count;
+   struct lsa_TransNameArray *names;
+   struct lsa_LookupSids *r;
struct rpc_request **req;
-
int i, replies;
BOOL ret = True;
+   const int num_async_requests = 50;
 
-   printf(\nTesting %d async lookupsids request\n, 100);
+   count = talloc_array(mem_ctx, uint32_t, num_async_requests);
+   names = talloc_array(mem_ctx, struct lsa_TransNameArray, 
num_async_requests);
+   r = talloc_array(mem_ctx, struct lsa_LookupSids, num_async_requests);
 
-   req = talloc_array(mem_ctx, struct rpc_request *, NUM_ASYNC_REQUESTS);
+   printf(\nTesting %d async lookupsids request\n, num_async_requests);
 
+   req = talloc_array(mem_ctx, struct rpc_request *, num_async_requests);
+
sids.num_sids = 1;
sids.sids = sidptr;
sidptr.sid = dom_sid_parse_talloc(mem_ctx, S-1-5-32-545);
 
replies = 0;
 
-   for (i=0; iNUM_ASYNC_REQUESTS; i++) {
+   for (i=0; inum_async_requests; i++) {
count[i] = 0;
names[i].count = 0;
names[i].names = NULL;
@@ -578,7 +579,7 @@
req[i]-async.private = replies;
}
 
-   while (replies  NUM_ASYNC_REQUESTS) {
+   while (replies  num_async_requests) {
event_loop_once(p-conn-event_ctx);
if (replies  0) {
ret = False;



svn commit: samba r18357 - in branches/SAMBA_4_0/source/lib/crypto: .

2006-09-10 Thread abartlet
Author: abartlet
Date: 2006-09-11 04:18:16 + (Mon, 11 Sep 2006)
New Revision: 18357

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

Log:
Convert more crypto tests from using function results as initialisers.
(Fails on older Unix C compilers)

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/lib/crypto/hmacmd5test.c
   branches/SAMBA_4_0/source/lib/crypto/hmacsha1test.c
   branches/SAMBA_4_0/source/lib/crypto/md4test.c
   branches/SAMBA_4_0/source/lib/crypto/md5test.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/crypto/hmacmd5test.c
===
--- branches/SAMBA_4_0/source/lib/crypto/hmacmd5test.c  2006-09-11 02:58:45 UTC 
(rev 18356)
+++ branches/SAMBA_4_0/source/lib/crypto/hmacmd5test.c  2006-09-11 04:18:16 UTC 
(rev 18357)
@@ -40,40 +40,40 @@
DATA_BLOB key;
DATA_BLOB data;
DATA_BLOB md5;
-   } testarray[] = {
-   {
-   .key= data_blob_repeat_byte(0x0b, 16),
-   .data   = data_blob_string_const(Hi There),
-   .md5= 
strhex_to_data_blob(9294727a3638bb1c13f48ef8158bfc9d)
-   },{
-   .key= data_blob_string_const(Jefe),
-   .data   = data_blob_string_const(what do ya want for 
nothing?),
-   .md5= 
strhex_to_data_blob(750c783e6ab0b503eaa86e310a5db738)
-   },{
-   .key= data_blob_repeat_byte(0xaa, 16),
-   .data   = data_blob_repeat_byte(0xdd, 50),
-   .md5= 
strhex_to_data_blob(56be34521d144c88dbb8c733f0e8b3f6)
-   },{
-   .key= 
strhex_to_data_blob(0102030405060708090a0b0c0d0e0f10111213141516171819),
-   .data   = data_blob_repeat_byte(0xcd, 50),
-   .md5= 
strhex_to_data_blob(697eaf0aca3a3aea3a75164746ffaa79)
-   },{
-   .key= data_blob_repeat_byte(0x0c, 16),
-   .data   = data_blob_string_const(Test With Truncation),
-   .md5= 
strhex_to_data_blob(56461ef2342edc00f9bab995690efd4c)
-   },{
-   .key= data_blob_repeat_byte(0xaa, 80),
-   .data   = data_blob_string_const(Test Using Larger Than 
Block-Size Key - Hash Key First),
-   .md5= 
strhex_to_data_blob(6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd)
-   },{
-   .key= data_blob_repeat_byte(0xaa, 80),
-   .data   = data_blob_string_const(Test Using Larger Than 
Block-Size Key 
-and Larger Than One 
Block-Size Data),
-   .md5= 
strhex_to_data_blob(6f630fad67cda0ee1fb1f562db3aa53e)
-   }
-   };
+   } testarray[8];
 
-   for (i=0; i  ARRAY_SIZE(testarray); i++) {
+   testarray[0].key= data_blob_repeat_byte(0x0b, 16);
+   testarray[0].data   = data_blob_string_const(Hi There);
+   testarray[0].md5= 
strhex_to_data_blob(9294727a3638bb1c13f48ef8158bfc9d);
+
+   testarray[1].key= data_blob_string_const(Jefe);
+   testarray[1].data   = data_blob_string_const(what do ya want for 
nothing?);
+   testarray[1].md5= 
strhex_to_data_blob(750c783e6ab0b503eaa86e310a5db738);
+
+   testarray[2].key= data_blob_repeat_byte(0xaa, 16);
+   testarray[2].data   = data_blob_repeat_byte(0xdd, 50);
+   testarray[2].md5= 
strhex_to_data_blob(56be34521d144c88dbb8c733f0e8b3f6);
+
+   testarray[3].key= 
strhex_to_data_blob(0102030405060708090a0b0c0d0e0f10111213141516171819);
+   testarray[3].data   = data_blob_repeat_byte(0xcd, 50);
+   testarray[3].md5= 
strhex_to_data_blob(697eaf0aca3a3aea3a75164746ffaa79);
+
+   testarray[4].key= data_blob_repeat_byte(0x0c, 16);
+   testarray[4].data   = data_blob_string_const(Test With 
Truncation);
+   testarray[4].md5= 
strhex_to_data_blob(56461ef2342edc00f9bab995690efd4c);
+
+   testarray[5].key= data_blob_repeat_byte(0xaa, 80);
+   testarray[5].data   = data_blob_string_const(Test Using Larger 
Than Block-Size Key - Hash Key First);
+   testarray[5].md5= 
strhex_to_data_blob(6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd);
+
+   testarray[6].key= data_blob_repeat_byte(0xaa, 80);
+   testarray[6].data   = data_blob_string_const(Test Using Larger 
Than Block-Size Key 
+and Larger Than One 
Block-Size Data);
+   testarray[6].md5= 
strhex_to_data_blob(6f630fad67cda0ee1fb1f562db3aa53e);
+
+   testarray[7].key= data_blob(NULL, 0);
+
+   for (i=0; testarray[i].key.data; i++) {
HMACMD5Context ctx;
uint8_t md5[16];
int e;

Modified: branches/SAMBA_4_0/source/lib/crypto/hmacsha1test.c
===
--- 

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

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-11 04:28:34 + (Mon, 11 Sep 2006)
New Revision: 18358

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

Log:

handle errors in the RPC-LSA async test

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


Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/lsa.c
===
--- branches/SAMBA_4_0/source/torture/rpc/lsa.c 2006-09-11 04:18:16 UTC (rev 
18357)
+++ branches/SAMBA_4_0/source/torture/rpc/lsa.c 2006-09-11 04:28:34 UTC (rev 
18358)
@@ -525,7 +525,9 @@
*replies = -1;
}
 
-   *replies += 1;
+   if (*replies = 0) {
+   *replies += 1;
+   }
 }
 
 static BOOL test_LookupSids_async(struct dcerpc_pipe *p, 
@@ -579,16 +581,16 @@
req[i]-async.private = replies;
}
 
-   while (replies  num_async_requests) {
+   while (replies = 0  replies  num_async_requests) {
event_loop_once(p-conn-event_ctx);
-   if (replies  0) {
-   ret = False;
-   break;
-   }
}
 
talloc_free(req);
 
+   if (replies  0) {
+   ret = False;
+   }
+
return ret;
 }
 



svn commit: samba r18359 - in branches/SAMBA_4_0/source/lib/replace: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-11 04:47:48 + (Mon, 11 Sep 2006)
New Revision: 18359

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

Log:

better handling of child process killing in standard mode

Modified:
   branches/SAMBA_4_0/source/lib/replace/libreplace.m4


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4
===
--- branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-11 04:28:34 UTC 
(rev 18358)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace.m4 2006-09-11 04:47:48 UTC 
(rev 18359)
@@ -84,7 +84,7 @@
 
 AC_FUNC_MEMCMP
 
-AC_CHECK_FUNCS(pipe strftime srandom random srand rand usleep setbuffer lstat)
+AC_CHECK_FUNCS(pipe strftime srandom random srand rand usleep setbuffer lstat 
getpgrp)
 
 AC_CHECK_HEADERS(stdbool.h stddef.h)
 



svn commit: samba r18360 - in branches/SAMBA_4_0/source/smbd: .

2006-09-10 Thread tridge
Author: tridge
Date: 2006-09-11 04:47:56 + (Mon, 11 Sep 2006)
New Revision: 18360

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

Log:

better handling of child process killing in standard mode

Modified:
   branches/SAMBA_4_0/source/smbd/server.c


Changeset:
Modified: branches/SAMBA_4_0/source/smbd/server.c
===
--- branches/SAMBA_4_0/source/smbd/server.c 2006-09-11 04:47:48 UTC (rev 
18359)
+++ branches/SAMBA_4_0/source/smbd/server.c 2006-09-11 04:47:56 UTC (rev 
18360)
@@ -103,6 +103,19 @@
debug_schedule_reopen_logs();
 }
 
+static void sig_term(int sig)
+{
+#if HAVE_GETPGRP
+   static int done_sigterm;
+   if (done_sigterm == 0  getpgrp() == getpid()) {
+   DEBUG(0,(SIGTERM: killing children\n));
+   done_sigterm = 1;
+   kill(-getpgrp(), SIGTERM);
+   }
+#endif
+   exit(0);
+}
+
 /*
   setup signal masks
 */
@@ -130,6 +143,7 @@
BlockSignals(False, SIGTERM);
 
CatchSignal(SIGHUP, sig_hup);
+   CatchSignal(SIGTERM, sig_term);
 }
 
 /*
@@ -142,6 +156,11 @@
uint8_t c;
if (read(0, c, 1) == 0) {
DEBUG(0,(%s: EOF on stdin - terminating\n, binary_name));
+#if HAVE_GETPGRP
+   if (getpgrp() == getpid()) {
+   kill(-getpgrp(), SIGTERM);
+   }
+#endif
exit(0);
}
 }



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

2006-09-10 Thread abartlet
Author: abartlet
Date: 2006-09-11 05:11:10 + (Mon, 11 Sep 2006)
New Revision: 18361

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

Log:
Invert the way we handle LookupSids2/LookupSids3 and LookupNames3/LookupNames4

The latter calls don't supply a policy handle 

The latter calls now acquire a policy handle, then call the earlier
calls.  This means we still share the codepaths, but don't need to
fetch policy state when it is already provided.

Andrew Bartlett


Modified:
   branches/SAMBA_4_0/source/rpc_server/lsa/dcesrv_lsa.c


Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/lsa/dcesrv_lsa.c
===
--- branches/SAMBA_4_0/source/rpc_server/lsa/dcesrv_lsa.c   2006-09-11 
04:47:56 UTC (rev 18360)
+++ branches/SAMBA_4_0/source/rpc_server/lsa/dcesrv_lsa.c   2006-09-11 
05:11:10 UTC (rev 18361)
@@ -395,6 +395,9 @@
 
 /* 
   dssetup_DsRoleGetPrimaryDomainInformation 
+
+  This is not an LSA call, but is the only call left on the DSSETUP
+  pipe (after the pipe was truncated), and needs lsa_get_policy_state
 */
 static WERROR dssetup_DsRoleGetPrimaryDomainInformation(struct 
dcesrv_call_state *dce_call, 
 TALLOC_CTX *mem_ctx,
@@ -1554,11 +1557,11 @@
 
 
 /*
-  lsa_LookupSids3
+  lsa_LookupSids2
 */
-static NTSTATUS lsa_LookupSids3(struct dcesrv_call_state *dce_call,
+static NTSTATUS lsa_LookupSids2(struct dcesrv_call_state *dce_call,
TALLOC_CTX *mem_ctx,
-   struct lsa_LookupSids3 *r)
+   struct lsa_LookupSids2 *r)
 {
struct lsa_policy_state *state;
int i;
@@ -1640,32 +1643,56 @@
 
 
 /*
-  lsa_LookupSids2
+  lsa_LookupSids3
+
+  Identical to LookupSids2, but doesn't take a policy handle
+  
 */
-static NTSTATUS lsa_LookupSids2(struct dcesrv_call_state *dce_call,
+static NTSTATUS lsa_LookupSids3(struct dcesrv_call_state *dce_call,
TALLOC_CTX *mem_ctx,
-   struct lsa_LookupSids2 *r)
+   struct lsa_LookupSids3 *r)
 {
-   struct lsa_LookupSids3 r3;
+   struct lsa_LookupSids2 r2;
+   struct lsa_OpenPolicy2 pol;
NTSTATUS status;
+   struct dcesrv_handle *h;
 
-   r3.in.sids = r-in.sids;
-   r3.in.names= r-in.names;
-   r3.in.level= r-in.level;
-   r3.in.count= r-in.count;
-   r3.in.unknown1 = r-in.unknown1;
-   r3.in.unknown2 = r-in.unknown2;
-   r3.out.count   = r-out.count;
-   r3.out.names   = r-out.names;
+   /* No policy handle on the wire, so make one up here */
+   r2.in.handle = talloc(mem_ctx, struct policy_handle);
+   if (!r2.in.handle) {
+   return NT_STATUS_NO_MEMORY;
+   }
 
-   status = lsa_LookupSids3(dce_call, mem_ctx, r3);
+   pol.out.handle = r2.in.handle;
+   pol.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
+   pol.in.attr = NULL;
+   pol.in.system_name = NULL;
+   status = lsa_OpenPolicy2(dce_call, mem_ctx, pol);
+   if (!NT_STATUS_IS_OK(status)) {
+   return status;
+   }
+
+   /* ensure this handle goes away at the end of this call */
+   DCESRV_PULL_HANDLE(h, r2.in.handle, LSA_HANDLE_POLICY);
+   talloc_steal(mem_ctx, h);
+
+   r2.in.sids = r-in.sids;
+   r2.in.names= r-in.names;
+   r2.in.level= r-in.level;
+   r2.in.count= r-in.count;
+   r2.in.unknown1 = r-in.unknown1;
+   r2.in.unknown2 = r-in.unknown2;
+   r2.out.count   = r-out.count;
+   r2.out.names   = r-out.names;
+
+   status = lsa_LookupSids2(dce_call, mem_ctx, r2);
if (dce_call-fault_code != 0) {
return status;
}
 
-   r-out.domains = r3.out.domains;
-   r-out.names   = r3.out.names;
-   r-out.count   = r3.out.count;
+   r-out.domains = r2.out.domains;
+   r-out.names   = r2.out.names;
+   r-out.count   = r2.out.count;
 
return status;
 }
@@ -2987,21 +3014,21 @@
 
 
 /*
-  lsa_LookupNames4
+  lsa_LookupNames3
 */
-static NTSTATUS lsa_LookupNames4(struct dcesrv_call_state *dce_call,
+static NTSTATUS lsa_LookupNames3(struct dcesrv_call_state *dce_call,
 TALLOC_CTX *mem_ctx,
-struct lsa_LookupNames4 *r)
+struct lsa_LookupNames3 *r)
 {
-   struct lsa_policy_state *state;
+   struct lsa_policy_state *policy_state;
+   struct dcesrv_handle *policy_handle;
int i;
NTSTATUS status = NT_STATUS_OK;
 
-   status = lsa_get_policy_state(dce_call, mem_ctx, state);
-   if (!NT_STATUS_IS_OK(status)) {
-   return status;
-   }
+   DCESRV_PULL_HANDLE(policy_handle, r-in.handle, LSA_HANDLE_POLICY);
 
+   policy_state = policy_handle-data;
+
r-out.domains = NULL;