svn commit: samba r15880 - in branches/SAMBA_4_0/source/ntvfs/ipc: .

2006-05-24 Thread tridge
Author: tridge
Date: 2006-05-25 04:46:38 + (Thu, 25 May 2006)
New Revision: 15880

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

Log:

the ntvfs_handle changes broke rpc on big-endian boxes, as the
uint16_t fnum was being byte order converted twice in the ipc server.

Metze, can you have a look at this? This change does make rpc work
again, but perhaps you might like to approach it differently

Modified:
   branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c
===
--- branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c   2006-05-25 02:09:00 UTC 
(rev 15879)
+++ branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c   2006-05-25 04:46:38 UTC 
(rev 15880)
@@ -658,9 +658,11 @@
struct ipc_private *private = ntvfs->private_data;
NTSTATUS status;
DATA_BLOB fnum_key;
+   uint16_t fnum;
 
-   /* the fnum is in setup[1] */
-   fnum_key = data_blob_const(&trans->in.setup[1], 
sizeof(trans->in.setup[1]));
+   /* the fnum is in setup[1], a 16 bit value */
+   SSVAL(&fnum, 0, trans->in.setup[1]);
+   fnum_key = data_blob_const(&fnum, 2);
 
p = pipe_state_find_key(private, req, &fnum_key);
if (!p) {



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

2006-05-24 Thread jerry
Author: jerry
Date: 2006-05-25 03:27:14 + (Thu, 25 May 2006)
New Revision: 991

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

Log:
announcing 3.0.23rc1 on the web site
Modified:
   trunk/index.html


Changeset:
Modified: trunk/index.html
===
--- trunk/index.html2006-05-19 04:18:58 UTC (rev 990)
+++ trunk/index.html2006-05-25 03:27:14 UTC (rev 991)
@@ -15,23 +15,24 @@
 
 Current Release
 
-23 Apr 2006
-Samba 3.0.23pre1 Available for Download
+24 May 2006
+Samba 3.0.23rc1 Available for Download
 
-This is a preview release of the Samba 3.0.23 code base and
-   is provided for testing only.  This release is *not* intended
-   for production servers.  There has been a substantial amount
+This is the first release candidate of the 3.0.23 code base and is
+   provided for testing purposes only.  While close to the final stable
+   release, this snapshot is not intended for production servers.
+   There has been a substantial amount
of development since the 3.0.21 series of stable releases.
We would like to ask the Samba community for help in testing
these changes as we work towards the next significant production
upgrade Samba 3.0 release.  Please read the specific changes in the
-   Release Notes.
+   Release Notes.
 
-The Samba 3.0.23pre1
+The Samba 3.0.23rc1
source code can be downloaded now.  The GnuPG
+   href="/samba/ftp/rc/samba-3.0.23rc1.tar.asc">GnuPG
signature for the uncompressed tarball is also available.
-   Precompiled packages for RedHat 9 & Fedora Core 4 available in the
+   Precompiled packages for RedHat 9 & Fedora Core 4 available in the
Binary_Packages
download area.  Packages for other platforms will be available
shortly.



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

2006-05-24 Thread tridge
Author: tridge
Date: 2006-05-25 02:09:00 + (Thu, 25 May 2006)
New Revision: 15879

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

Log:

strtok_r() replacement, for solaris

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/config.m4
===
--- branches/SAMBA_4_0/source/lib/replace/config.m4 2006-05-24 23:09:29 UTC 
(rev 15878)
+++ branches/SAMBA_4_0/source/lib/replace/config.m4 2006-05-25 02:09:00 UTC 
(rev 15879)
@@ -48,7 +48,7 @@
 AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror)
 AC_CHECK_FUNCS(timegm setenv vsyslog setlinebuf mktime ftruncate chsize rename)
 AC_CHECK_FUNCS(waitpid strnlen strlcpy strlcat innetgr initgroups memmove 
strdup)
-AC_CHECK_FUNCS(pread pwrite strndup strcasestr)
+AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r)
 AC_HAVE_DECL(setresuid, [#include ])
 AC_HAVE_DECL(setresgid, [#include ])
 AC_HAVE_DECL(errno, [#include ])

Modified: branches/SAMBA_4_0/source/lib/replace/replace.c
===
--- branches/SAMBA_4_0/source/lib/replace/replace.c 2006-05-24 23:09:29 UTC 
(rev 15878)
+++ branches/SAMBA_4_0/source/lib/replace/replace.c 2006-05-25 02:09:00 UTC 
(rev 15879)
@@ -549,3 +549,30 @@
return NULL;
 }
 #endif
+
+#ifndef HAVE_STRTOK_R
+/* based on GLIBC version, copyright Free Software Foundation */
+char *strtok_r(char *s, const char *delim, char **save_ptr)
+{
+   char *token;
+
+   if (s == NULL) s = *save_ptr;
+
+   s += strspn(s, delim);
+   if (*s == '\0') {
+   *save_ptr = s;
+   return NULL;
+   }
+
+   token = s;
+   s = strpbrk(token, delim);
+   if (s == NULL) {
+   *save_ptr = token + strlen(token);
+   } else {
+   *s = '\0';
+   *save_ptr = s + 1;
+   }
+
+   return token;
+}
+#endif



Build status as of Thu May 25 00:00:02 2006

2006-05-24 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2006-05-24 
00:00:03.0 +
+++ /home/build/master/cache/broken_results.txt 2006-05-25 00:00:46.0 
+
@@ -1,17 +1,17 @@
-Build status as of Wed May 24 00:00:01 2006
+Build status as of Thu May 25 00:00:02 2006
 
 Build counts:
 Tree Total  Broken Panic 
-ccache   31 3  0 
-distcc   32 3  0 
-lorikeet-heimdal 32 24 0 
-ppp  20 0  0 
-rsync33 2  0 
-samba3  2  0 
+ccache   36 6  0 
+distcc   37 5  0 
+lorikeet-heimdal 37 28 0 
+ppp  21 0  0 
+rsync38 2  0 
+samba5  4  0 
 samba-docs   0  0  0 
-samba4   40 29 10
-samba_3_035 13 0 
-smb-build28 1  0 
-talloc   30 15 0 
-tdb  22 2  0 
+samba4   42 29 6 
+samba_3_041 18 0 
+smb-build30 0  0 
+talloc   35 15 0 
+tdb  27 2  0 
 


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

2006-05-24 Thread jelmer
Author: jelmer
Date: 2006-05-24 23:09:29 + (Wed, 24 May 2006)
New Revision: 15878

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

Log:
Add explicit initialization to make the IBM checker happy.

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-05-24 
22:57:14 UTC (rev 15877)
+++ branches/SAMBA_4_0/source/lib/registry/reg_backend_nt4.c2006-05-24 
23:09:29 UTC (rev 15878)
@@ -903,11 +903,11 @@
uint32_t ret;
struct lf_block lf;
 
+   ZERO_STRUCT(lf);
+
/* Add to subkeys list */
if (list_offset == -1) { /* Need to create subkeys list */
lf.header = "lf";
-   lf.key_count = 0;
-   lf.hr = NULL;
} else {
if (!hbin_get_tdr(regf, list_offset, regf, 
(tdr_pull_fn_t)tdr_pull_lf_block, &lf)) {
DEBUG(0, ("Can't get subkeys list\n"));



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

2006-05-24 Thread jelmer
Author: jelmer
Date: 2006-05-24 22:57:14 + (Wed, 24 May 2006)
New Revision: 15877

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

Log:
Fix error message - caught by the IBM checker

Modified:
   branches/SAMBA_4_0/source/lib/registry/tools/regtree.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/registry/tools/regtree.c
===
--- branches/SAMBA_4_0/source/lib/registry/tools/regtree.c  2006-05-24 
22:17:01 UTC (rev 15876)
+++ branches/SAMBA_4_0/source/lib/registry/tools/regtree.c  2006-05-24 
22:57:14 UTC (rev 15877)
@@ -108,16 +108,29 @@
 
if (remote) {
error = reg_open_remote(&h, NULL, cmdline_credentials, remote, 
NULL);
+
+   if(!W_ERROR_IS_OK(error)) {
+   fprintf(stderr, "Unable to open remote registry at 
%s:%s \n", remote, win_errstr(error));
+   return 1;
+   }
+
} else if (backend) {
error = reg_open_hive(NULL, backend, poptGetArg(pc), NULL, 
cmdline_credentials, &root);
+   
+   if(!W_ERROR_IS_OK(error)) {
+   fprintf(stderr, "Unable to open '%s' with backend 
'%s':%s \n", poptGetArg(pc), backend, win_errstr(error));
+   return 1;
+   }
} else {
error = reg_open_local (&h, NULL, cmdline_credentials);
+
+   if(!W_ERROR_IS_OK(error)) {
+   fprintf(stderr, "Unable to open local registry:%s \n", 
win_errstr(error));
+   return 1;
+   }
+
}
 
-   if(!W_ERROR_IS_OK(error)) {
-   fprintf(stderr, "Unable to open '%s' with backend '%s':%s \n", 
poptGetArg(pc), backend, win_errstr(error));
-   return 1;
-   }
poptFreeContext(pc);
 
error = WERR_OK;



svn commit: samba r15876 - in branches/SAMBA_4_0/source/auth/kerberos: .

2006-05-24 Thread jelmer
Author: jelmer
Date: 2006-05-24 22:17:01 + (Wed, 24 May 2006)
New Revision: 15876

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

Log:
Fix build on IPv6-less systems.

Modified:
   branches/SAMBA_4_0/source/auth/kerberos/krb5_init_context.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/kerberos/krb5_init_context.c
===
--- branches/SAMBA_4_0/source/auth/kerberos/krb5_init_context.c 2006-05-24 
22:15:03 UTC (rev 15875)
+++ branches/SAMBA_4_0/source/auth/kerberos/krb5_init_context.c 2006-05-24 
22:17:01 UTC (rev 15876)
@@ -257,9 +257,11 @@
case PF_INET:
name = "ipv4";
break;
+#ifdef PF_INET6
case PF_INET6:
name = "ipv6";
break;
+#endif
default:
talloc_free(smb_krb5);
return EINVAL;



svn commit: samba r15875 - in branches/SAMBA_4_0/source: client script/tests

2006-05-24 Thread jelmer
Author: jelmer
Date: 2006-05-24 22:15:03 + (Wed, 24 May 2006)
New Revision: 15875

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

Log:
Fix bug in smbclients 'put' command tridge found a while ago. Add tests 
for 'put' and 'get' commands so we don't break them again.

Fixes #3742

Modified:
   branches/SAMBA_4_0/source/client/client.c
   branches/SAMBA_4_0/source/script/tests/test_smbclient.sh


Changeset:
Modified: branches/SAMBA_4_0/source/client/client.c
===
--- branches/SAMBA_4_0/source/client/client.c   2006-05-24 20:20:28 UTC (rev 
15874)
+++ branches/SAMBA_4_0/source/client/client.c   2006-05-24 22:15:03 UTC (rev 
15875)
@@ -1194,16 +1194,16 @@
char *rname;

if (!args[1]) {
-   d_printf("put \n");
+   d_printf("put  []\n");
return 1;
}
 
-   lname = talloc_asprintf(ctx, "%s\\%s", ctx->remote_cur_dir, args[1]);
+   lname = talloc_strdup(ctx, args[1]);
   
if (args[2])
rname = talloc_strdup(ctx, args[2]);
else
-   rname = talloc_strdup(ctx, lname);
+   rname = talloc_asprintf(ctx, "%s\\%s", ctx->remote_cur_dir, 
lname);

dos_clean_name(rname);
 

Modified: branches/SAMBA_4_0/source/script/tests/test_smbclient.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_smbclient.sh2006-05-24 
20:20:28 UTC (rev 15874)
+++ branches/SAMBA_4_0/source/script/tests/test_smbclient.sh2006-05-24 
22:15:03 UTC (rev 15875)
@@ -32,14 +32,14 @@
 
 
 # put that file
-echo mput tmpfile | runcmd "Putting file" || failed=`expr $failed + 1`
+echo mput tmpfile | runcmd "MPutting file" || failed=`expr $failed + 1`
 # check file info
 echo altname tmpfile | runcmd "Getting alternative name" || failed=`expr 
$failed + 1`
 # run allinfo on that file
 echo allinfo tmpfile | runcmd "Checking info on file" || failed=`expr $failed 
+ 1`
 # get that file
 mv tmpfile tmpfile-old
-echo mget tmpfile | runcmd "Getting file" || failed=`expr $failed + 1`
+echo mget tmpfile | runcmd "MGetting file" || failed=`expr $failed + 1`
 # remove that file
 echo rm tmpfile | runcmd "Removing file" || failed=`expr $failed + 1`
 # compare locally
@@ -61,6 +61,24 @@
 # run fsinfo
 echo fsinfo objectid | runcmd "Getting file system info" || failed=`expr 
$failed + 1`
 
-rm -f tmpfile tmpfile-old
+# put that file
+echo put tmpfile | runcmd "Putting file" || failed=`expr $failed + 1`
+# get that file
+mv tmpfile tmpfile-old
+echo get tmpfile | runcmd "Getting file" || failed=`expr $failed + 1`
+# remove that file
+echo rm tmpfile | runcmd "Removing file" || failed=`expr $failed + 1`
+# compare locally
+testit "Comparing files" diff tmpfile-old tmpfile || failed=`expr $failed + 1`
+# put that file
+echo put tmpfile tmpfilex | runcmd "Putting file with different name" || 
failed=`expr $failed + 1`
+# get that file
+echo get tmpfilex | runcmd "Getting file again" || failed=`expr $failed + 1`
+# compare locally
+testit "Comparing files" diff tmpfilex tmpfile || failed=`expr $failed + 1`
+# remove that file
+echo rm tmpfilex | runcmd "Removing file" || failed=`expr $failed + 1`
 
+rm -f tmpfile tmpfile-old tmpfilex
+
 testok $0 $failed



svn commit: samba r15874 - in trunk/source/script/tests: .

2006-05-24 Thread jmcd
Author: jmcd
Date: 2006-05-24 20:20:28 + (Wed, 24 May 2006)
New Revision: 15874

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

Log:
merge make test fixes for aix/ksh

Modified:
   trunk/source/script/tests/test_functions.sh


Changeset:
Modified: trunk/source/script/tests/test_functions.sh
===
--- trunk/source/script/tests/test_functions.sh 2006-05-24 20:06:06 UTC (rev 
15873)
+++ trunk/source/script/tests/test_functions.sh 2006-05-24 20:20:28 UTC (rev 
15874)
@@ -19,8 +19,8 @@
 samba3_check_or_start() {
if [ -n "$SERVER_TEST_FIFO" ];then
 
-   trap samba3_stop_sig_kill SIGINT SIGQUIT
-   trap samba3_stop_sig_kill SIGTERM
+   trap samba3_stop_sig_kill INT QUIT
+   trap samba3_stop_sig_kill TERM
 
if [ -p "$SERVER_TEST_FIFO" ];then
return 0;
@@ -40,7 +40,7 @@
rm -f $NMBD_TEST_LOG
echo -n "STARTING NMBD..."
((
-   if [ -z "$NMBD_MAXTIME" ]; then
+   if ! test -n "$NMBD_MAXTIME"; then
NMBD_MAXTIME=2700
fi
timelimit $NMBD_MAXTIME $NMBD_VALGRIND $SRCDIR/bin/nmbd 
-F -S --no-process-group -d0 -s $SERVERCONFFILE > $NMBD_TEST_LOG 2>&1 &
@@ -69,7 +69,7 @@
rm -f $SMBD_TEST_LOG
echo -n "STARTING SMBD..."
((
-   if [ -z "$SMBD_MAXTIME" ]; then
+   if ! test -n "$SMBD_MAXTIME"; then
SMBD_MAXTIME=2700
fi
timelimit $SMBD_MAXTIME $SMBD_VALGRIND $SRCDIR/bin/smbd 
-F -S --no-process-group -d0 -s $SERVERCONFFILE > $SMBD_TEST_LOG 2>&1 &



svn commit: samba r15873 - in branches/SAMBA_3_0/source/script/tests: .

2006-05-24 Thread jmcd
Author: jmcd
Date: 2006-05-24 20:06:06 + (Wed, 24 May 2006)
New Revision: 15873

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

Log:
Use short signal names to placate ksh trap.  bash seems to accept either
and even uses them on the manpage.  this should now enable make test on
AIX.

Modified:
   branches/SAMBA_3_0/source/script/tests/test_functions.sh


Changeset:
Modified: branches/SAMBA_3_0/source/script/tests/test_functions.sh
===
--- branches/SAMBA_3_0/source/script/tests/test_functions.sh2006-05-24 
19:07:21 UTC (rev 15872)
+++ branches/SAMBA_3_0/source/script/tests/test_functions.sh2006-05-24 
20:06:06 UTC (rev 15873)
@@ -19,8 +19,8 @@
 samba3_check_or_start() {
if [ -n "$SERVER_TEST_FIFO" ];then
 
-   trap samba3_stop_sig_kill SIGINT SIGQUIT
-   trap samba3_stop_sig_kill SIGTERM
+   trap samba3_stop_sig_kill INT QUIT
+   trap samba3_stop_sig_kill TERM
 
if [ -p "$SERVER_TEST_FIFO" ];then
return 0;



svn commit: samba r15872 - in branches/SAMBA_3_0/source/script/tests: .

2006-05-24 Thread jmcd
Author: jmcd
Date: 2006-05-24 19:07:21 + (Wed, 24 May 2006)
New Revision: 15872

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

Log:
Take one step toward getting this working on AIX.  the [-z ] stuff
doesn't work there.

Modified:
   branches/SAMBA_3_0/source/script/tests/test_functions.sh


Changeset:
Modified: branches/SAMBA_3_0/source/script/tests/test_functions.sh
===
--- branches/SAMBA_3_0/source/script/tests/test_functions.sh2006-05-24 
18:23:57 UTC (rev 15871)
+++ branches/SAMBA_3_0/source/script/tests/test_functions.sh2006-05-24 
19:07:21 UTC (rev 15872)
@@ -40,7 +40,7 @@
rm -f $NMBD_TEST_LOG
echo -n "STARTING NMBD..."
((
-   if [ -z "$NMBD_MAXTIME" ]; then
+   if ! test -n "$NMBD_MAXTIME"; then
NMBD_MAXTIME=2700
fi
timelimit $NMBD_MAXTIME $NMBD_VALGRIND $SRCDIR/bin/nmbd 
-F -S --no-process-group -d0 -s $SERVERCONFFILE > $NMBD_TEST_LOG 2>&1 &
@@ -69,7 +69,7 @@
rm -f $SMBD_TEST_LOG
echo -n "STARTING SMBD..."
((
-   if [ -z "$SMBD_MAXTIME" ]; then
+   if ! test -n "$SMBD_MAXTIME"; then
SMBD_MAXTIME=2700
fi
timelimit $SMBD_MAXTIME $SMBD_VALGRIND $SRCDIR/bin/smbd 
-F -S --no-process-group -d0 -s $SERVERCONFFILE > $SMBD_TEST_LOG 2>&1 &



svn commit: samba r15871 - in branches/SAMBA_4_0/source/lib/charset: .

2006-05-24 Thread jelmer
Author: jelmer
Date: 2006-05-24 18:23:57 + (Wed, 24 May 2006)
New Revision: 15871

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

Log:
Fix systems with native iconv

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/charset/config.m4
===
--- branches/SAMBA_4_0/source/lib/charset/config.m4 2006-05-24 17:57:54 UTC 
(rev 15870)
+++ branches/SAMBA_4_0/source/lib/charset/config.m4 2006-05-24 18:23:57 UTC 
(rev 15871)
@@ -49,7 +49,7 @@
 ])
 
 if test x$ICONV_FOUND = xno; then
-   SMB_CHECK_ICONV(iconv.h,[ICONV_FOUND=yes])
+   SMB_CHECK_ICONV(iconv.h,[AC_DEFINE(HAVE_ICONV_H,1,[Whether iconv.h is 
present]) ICONV_FOUND=yes])
 fi
 
 for i in $LOOK_DIRS ; do
@@ -58,7 +58,7 @@
fi

SMB_CHECK_ICONV_DIR($i, [
-   ICONV_FOUND=yes; 
+   ICONV_FOUND=yes
ICONV_CPPFLAGS="$CPPFLAGS"
ICONV_LIBS="$LIBS"
ICONV_LDFLAGS="$LDFLAGS"



svn commit: samba r15870 - in branches/SAMBA_4_0/source: include/system lib/charset

2006-05-24 Thread jelmer
Author: jelmer
Date: 2006-05-24 17:57:54 + (Wed, 24 May 2006)
New Revision: 15870

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

Log:
Improve detection of iconv - should prevent HAVE_ICONV_H being
defined when the installed iconv library doesn't match our criteria as 
well as some other minor fixes.

Modified:
   branches/SAMBA_4_0/source/include/system/iconv.h
   branches/SAMBA_4_0/source/lib/charset/config.m4


Changeset:
Modified: branches/SAMBA_4_0/source/include/system/iconv.h
===
--- branches/SAMBA_4_0/source/include/system/iconv.h2006-05-24 17:47:40 UTC 
(rev 15869)
+++ branches/SAMBA_4_0/source/include/system/iconv.h2006-05-24 17:57:54 UTC 
(rev 15870)
@@ -20,12 +20,14 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#ifdef HAVE_NATIVE_ICONV
 #ifdef HAVE_ICONV_H
 #include 
 #endif
 #ifdef HAVE_GICONV_H
 #include 
 #endif
+#endif
 
 /* needed for some systems without iconv. Doesn't really matter
what error code we use */

Modified: branches/SAMBA_4_0/source/lib/charset/config.m4
===
--- branches/SAMBA_4_0/source/lib/charset/config.m4 2006-05-24 17:47:40 UTC 
(rev 15869)
+++ branches/SAMBA_4_0/source/lib/charset/config.m4 2006-05-24 17:57:54 UTC 
(rev 15870)
@@ -1,14 +1,7 @@
 dnl SMB_CHECK_ICONV(action-if-found,action-if-not-found)
 AC_DEFUN(SMB_CHECK_ICONV,[
-  AC_CHECK_HEADERS(iconv.h giconv.h)
-
   AC_TRY_RUN([#include 
-#ifdef HAVE_GICONV_H
-#include 
-#endif
-#ifdef HAVE_ICONV_H
-#include 
-#endif
+#include <$1>
 
 int main()
 {
@@ -16,29 +9,24 @@
if (cd == 0 || cd == (iconv_t)-1) return -1;
return 0;
 } 
-   ],[$1],[$2])
+   ],[$2],[$3])
 ])
 
 dnl SMB_CHECK_ICONV_DIR(dir,action-if-found,action-if-not-found)
 AC_DEFUN(SMB_CHECK_ICONV_DIR,
 [
-if test -f "$1/include/iconv.h" -o -f "$1/include/giconv.h"; then
CPPFLAGS="-I$1/include"
LDFLAGS="-L$1/lib"
LIBS=-liconv
 
-   SMB_CHECK_ICONV([$2], 
-   [
-LIBS=-lgiconv
-SMB_CHECK_ICONV([$2],[$3])
+   SMB_CHECK_ICONV(iconv.h,[ AC_DEFINE(HAVE_ICONV_H,1,[Whether iconv.h is 
present]) $2 ], [
+LIBS=-lgiconv
+SMB_CHECK_ICONV(giconv.h,[AC_DEFINE(HAVE_GICONV_H,1,[Whether giconv.h 
is present]) $2],[$3])
])
 
CPPFLAGS=$save_CPPFLAGS
LDFLAGS=$save_LDFLAGS
LIBS=$save_LIBS
-else
-   $2
-fi
 ])
 
 ICONV_FOUND=no
@@ -61,7 +49,7 @@
 ])
 
 if test x$ICONV_FOUND = xno; then
-   SMB_CHECK_ICONV([ICONV_FOUND=yes])
+   SMB_CHECK_ICONV(iconv.h,[ICONV_FOUND=yes])
 fi
 
 for i in $LOOK_DIRS ; do



svn commit: samba r15869 - in branches/SAMBA_4_0/source/lib/charset: .

2006-05-24 Thread jmcd
Author: jmcd
Date: 2006-05-24 17:47:40 + (Wed, 24 May 2006)
New Revision: 15869

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

Log:
Fix loop var to search paths for iconv

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/charset/config.m4
===
--- branches/SAMBA_4_0/source/lib/charset/config.m4 2006-05-24 17:21:37 UTC 
(rev 15868)
+++ branches/SAMBA_4_0/source/lib/charset/config.m4 2006-05-24 17:47:40 UTC 
(rev 15869)
@@ -69,7 +69,7 @@
break
fi

-   SMB_CHECK_ICONV_DIR($withval, [
+   SMB_CHECK_ICONV_DIR($i, [
ICONV_FOUND=yes; 
ICONV_CPPFLAGS="$CPPFLAGS"
ICONV_LIBS="$LIBS"



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

2006-05-24 Thread jelmer
Author: jelmer
Date: 2006-05-24 17:21:37 + (Wed, 24 May 2006)
New Revision: 15868

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

Log:
Add replacement macro for __STRING()

Modified:
   branches/SAMBA_4_0/source/lib/replace/README
   branches/SAMBA_4_0/source/lib/replace/replace.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/README
===
--- branches/SAMBA_4_0/source/lib/replace/README2006-05-24 15:40:51 UTC 
(rev 15867)
+++ branches/SAMBA_4_0/source/lib/replace/README2006-05-24 17:21:37 UTC 
(rev 15868)
@@ -69,6 +69,7 @@
 Macros:
 va_copy
 __FUNCTION__
+__STRING
 MIN
 MAX
 

Modified: branches/SAMBA_4_0/source/lib/replace/replace.h
===
--- branches/SAMBA_4_0/source/lib/replace/replace.h 2006-05-24 15:40:51 UTC 
(rev 15867)
+++ branches/SAMBA_4_0/source/lib/replace/replace.h 2006-05-24 17:21:37 UTC 
(rev 15868)
@@ -231,6 +231,8 @@
 #define MAX(a,b) ((a)>(b)?(a):(b))
 #endif
 
+#ifndef __STRING
+#define __STRING(x)#x
+#endif
 
-
 #endif



svn commit: samba-docs r960 - in tags: .

2006-05-24 Thread jerry
Author: jerry
Date: 2006-05-24 15:40:53 + (Wed, 24 May 2006)
New Revision: 960

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

Log:
tagging 3.0.23rc1
Added:
   tags/release-3-0-23rc1/


Changeset:
Copied: tags/release-3-0-23rc1 (from rev 959, trunk)



svn commit: samba r15867 - in tags: .

2006-05-24 Thread jerry
Author: jerry
Date: 2006-05-24 15:40:51 + (Wed, 24 May 2006)
New Revision: 15867

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

Log:
tagging 3.0.23rc1
Added:
   tags/release-3-0-23rc1/


Changeset:
Copied: tags/release-3-0-23rc1 (from rev 15866, branches/SAMBA_3_0_RELEASE)



svn commit: samba r15866 - in branches/SAMBA_3_0_RELEASE/source/include: .

2006-05-24 Thread jerry
Author: jerry
Date: 2006-05-24 15:34:18 + (Wed, 24 May 2006)
New Revision: 15866

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

Log:
merge build fixes for HP-UX 11.11 and IRIX 6.4
Modified:
   branches/SAMBA_3_0_RELEASE/source/include/includes.h


Changeset:
Modified: branches/SAMBA_3_0_RELEASE/source/include/includes.h
===
--- branches/SAMBA_3_0_RELEASE/source/include/includes.h2006-05-24 
14:45:07 UTC (rev 15865)
+++ branches/SAMBA_3_0_RELEASE/source/include/includes.h2006-05-24 
15:34:18 UTC (rev 15866)
@@ -30,7 +30,11 @@
 #include "config.h"
 #endif
 
-#ifndef __cplusplus
+/* only do the C++ reserved word check when we compile
+   to include --with-developer since too many systems
+   still have comflicts with their header files (e.g. IRIX 6.4) */
+
+#if !defined(__cplusplus) && defined(DEVELOPER)
 #define class #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
 #define private #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
 #define public #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
@@ -596,11 +600,13 @@
 #endif
 
 #if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)
-#if (SIZEOF_SHORT == 4)
-#define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
-#else /* SIZEOF_SHORT != 4 */
-#define int16 short
-#endif /* SIZEOF_SHORT != 4 */
+#  if (SIZEOF_SHORT == 4)
+#define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
+#  else /* SIZEOF_SHORT != 4 */
+#define int16 short
+#  endif /* SIZEOF_SHORT != 4 */
+   /* needed to work around compile issue on HP-UX 11.x */
+#  define _INT16   1
 #endif
 
 /*
@@ -617,17 +623,19 @@
 #endif
 
 #if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)
-#if (SIZEOF_INT == 4)
-#define int32 int
-#elif (SIZEOF_LONG == 4)
-#define int32 long
-#elif (SIZEOF_SHORT == 4)
-#define int32 short
-#else
-/* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
-#define int32 int
+#  if (SIZEOF_INT == 4)
+#define int32 int
+#  elif (SIZEOF_LONG == 4)
+#define int32 long
+#  elif (SIZEOF_SHORT == 4)
+#define int32 short
+#  else
+ /* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
+#define int32 int
+#  endif
+   /* needed to work around compile issue on HP-UX 11.x */
+#  define _INT32   1
 #endif
-#endif
 
 /*
  * Note we duplicate the size tests in the unsigned 



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

2006-05-24 Thread metze
Author: metze
Date: 2006-05-24 14:45:07 + (Wed, 24 May 2006)
New Revision: 15865

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

Log:
using dirname for a variable isn't that good,
but making it a global symbol is really bad...

fix linking on sun1 in the build-farm

metze
Modified:
   branches/SAMBA_4_0/source/torture/basic/base.c
   branches/SAMBA_4_0/source/torture/basic/delete.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/basic/base.c
===
--- branches/SAMBA_4_0/source/torture/basic/base.c  2006-05-24 14:38:11 UTC 
(rev 15864)
+++ branches/SAMBA_4_0/source/torture/basic/base.c  2006-05-24 14:45:07 UTC 
(rev 15865)
@@ -1619,7 +1619,7 @@
BOOL result = False;
int fnum;
const char *os2_fname = ".+,;=[].";
-   const char *dirname = "samba3_errordir";
+   const char *dname = "samba3_errordir";
union smb_open io;
TALLOC_CTX *mem_ctx = talloc_init(NULL);
NTSTATUS status;
@@ -1656,10 +1656,10 @@
}
 
smbcli_unlink(cli_nt->tree, os2_fname);
-   smbcli_rmdir(cli_nt->tree, dirname);
+   smbcli_rmdir(cli_nt->tree, dname);
 
-   if (!NT_STATUS_IS_OK(smbcli_mkdir(cli_nt->tree, dirname))) {
-   printf("smbcli_mkdir(%s) failed: %s\n", dirname,
+   if (!NT_STATUS_IS_OK(smbcli_mkdir(cli_nt->tree, dname))) {
+   printf("smbcli_mkdir(%s) failed: %s\n", dname,
   smbcli_errstr(cli_nt->tree));
goto fail;
}
@@ -1675,7 +1675,7 @@
io.ntcreatex.in.create_options = 0;
io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
io.ntcreatex.in.security_flags = 0;
-   io.ntcreatex.in.fname = dirname;
+   io.ntcreatex.in.fname = dname;
 
status = smb_raw_open(cli_nt->tree, mem_ctx, &io);
if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
@@ -1692,14 +1692,14 @@
goto fail;
}
 
-   status = smbcli_mkdir(cli_nt->tree, dirname);
+   status = smbcli_mkdir(cli_nt->tree, dname);
if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
printf("(%s) incorrect status %s should be %s\n",
   __location__, nt_errstr(status),
   nt_errstr(NT_STATUS_OBJECT_NAME_COLLISION));
goto fail;
}
-   status = smbcli_mkdir(cli_dos->tree, dirname);
+   status = smbcli_mkdir(cli_dos->tree, dname);
if (!NT_STATUS_EQUAL(status, NT_STATUS_DOS(ERRDOS, ERRnoaccess))) {
printf("(%s) incorrect status %s should be %s\n",
   __location__, nt_errstr(status),

Modified: branches/SAMBA_4_0/source/torture/basic/delete.c
===
--- branches/SAMBA_4_0/source/torture/basic/delete.c2006-05-24 14:38:11 UTC 
(rev 15864)
+++ branches/SAMBA_4_0/source/torture/basic/delete.c2006-05-24 14:45:07 UTC 
(rev 15865)
@@ -145,13 +145,13 @@
goto fail; \
}} while (0)
 
-const char *fname = "\\delete.file";
-const char *fname_new = "\\delete.new";
-const char *dirname = "\\delete.dir";
+static const char *fname = "\\delete.file";
+static const char *fname_new = "\\delete.new";
+static const char *dname = "\\delete.dir";
 
 static void del_clean_area(struct smbcli_state *cli1, struct smbcli_state 
*cli2)
 {
-   smbcli_deltree(cli1->tree, dirname);
+   smbcli_deltree(cli1->tree, dname);
smbcli_setatr(cli1->tree, fname, 0, 0);
smbcli_unlink(cli1->tree, fname);
smbcli_setatr(cli1->tree, fname_new, 0, 0);
@@ -886,7 +886,7 @@
 
/* Test 14 -- directory */
 
-   dnum1 = smbcli_nt_create_full(cli1->tree, dirname, 0,
+   dnum1 = smbcli_nt_create_full(cli1->tree, dname, 0,
  SEC_FILE_READ_DATA|
  SEC_FILE_WRITE_DATA|
  SEC_STD_DELETE,
@@ -897,24 +897,24 @@
  NTCREATEX_DISP_CREATE, 0, 0);
if (dnum1 == -1) {
printf("(%s) open of %s failed: %s!\n", 
-  __location__, dirname, smbcli_errstr(cli1->tree));
+  __location__, dname, smbcli_errstr(cli1->tree));
correct = False;
goto fail;
}
 
-   correct &= check_delete_on_close(cli1, dnum1, dirname, False, 
__location__);
+   correct &= check_delete_on_close(cli1, dnum1, dname, False, 
__location__);
if (NT_STATUS_IS_ERR(smbcli_nt_delete_on_close(cli1->tree, dnum1, 
True))) {
printf("(%s) setting delete_on_close on file failed !\n",
   __location__);
correct = False;
goto fail;
}
-   correct &= check_delete_on_close(cli1, dnum1, dirname, True, 
__location__);
+   co

svn commit: samba r15864 - branches/SAMBA_3_0/source/include trunk/source/include

2006-05-24 Thread jerry
Author: jerry
Date: 2006-05-24 14:38:11 + (Wed, 24 May 2006)
New Revision: 15864

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

Log:
build fixes for IRIX 6.4 in the build farm; only enable the C++ reserved word 
check when we selecte --enable-developer
Modified:
   branches/SAMBA_3_0/source/include/includes.h
   trunk/source/include/includes.h


Changeset:
Modified: branches/SAMBA_3_0/source/include/includes.h
===
--- branches/SAMBA_3_0/source/include/includes.h2006-05-24 14:26:34 UTC 
(rev 15863)
+++ branches/SAMBA_3_0/source/include/includes.h2006-05-24 14:38:11 UTC 
(rev 15864)
@@ -30,7 +30,11 @@
 #include "config.h"
 #endif
 
-#ifndef __cplusplus
+/* only do the C++ reserved word check when we compile
+   to include --with-developer since too many systems
+   still have comflicts with their header files (e.g. IRIX 6.4) */
+
+#if !defined(__cplusplus) && defined(DEVELOPER)
 #define class #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
 #define private #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
 #define public #error DONT_USE_CPLUSPLUS_RESERVED_NAMES

Modified: trunk/source/include/includes.h
===
--- trunk/source/include/includes.h 2006-05-24 14:26:34 UTC (rev 15863)
+++ trunk/source/include/includes.h 2006-05-24 14:38:11 UTC (rev 15864)
@@ -30,7 +30,11 @@
 #include "config.h"
 #endif
 
-#ifndef __cplusplus
+/* only do the C++ reserved word check when we compile
+   to include --with-developer since too many systems
+   still have comflicts with their header files (e.g. IRIX 6.4) */
+
+#if !defined(__cplusplus) && defined(DEVELOPER)
 #define class #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
 #define private #error DONT_USE_CPLUSPLUS_RESERVED_NAMES
 #define public #error DONT_USE_CPLUSPLUS_RESERVED_NAMES



svn commit: samba r15863 - branches/SAMBA_3_0/source/include trunk/source/include

2006-05-24 Thread jerry
Author: jerry
Date: 2006-05-24 14:26:34 + (Wed, 24 May 2006)
New Revision: 15863

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

Log:
trying to fix a compile issue on HP-UX 11.x caused by conflicts of int16 and 
int32 definitions in internal and system headers
Modified:
   branches/SAMBA_3_0/source/include/includes.h
   trunk/source/include/includes.h


Changeset:
Modified: branches/SAMBA_3_0/source/include/includes.h
===
--- branches/SAMBA_3_0/source/include/includes.h2006-05-24 14:19:34 UTC 
(rev 15862)
+++ branches/SAMBA_3_0/source/include/includes.h2006-05-24 14:26:34 UTC 
(rev 15863)
@@ -596,11 +596,13 @@
 #endif
 
 #if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)
-#if (SIZEOF_SHORT == 4)
-#define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
-#else /* SIZEOF_SHORT != 4 */
-#define int16 short
-#endif /* SIZEOF_SHORT != 4 */
+#  if (SIZEOF_SHORT == 4)
+#define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
+#  else /* SIZEOF_SHORT != 4 */
+#define int16 short
+#  endif /* SIZEOF_SHORT != 4 */
+   /* needed to work around compile issue on HP-UX 11.x */
+#  define _INT16   1
 #endif
 
 /*
@@ -617,17 +619,19 @@
 #endif
 
 #if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)
-#if (SIZEOF_INT == 4)
-#define int32 int
-#elif (SIZEOF_LONG == 4)
-#define int32 long
-#elif (SIZEOF_SHORT == 4)
-#define int32 short
-#else
-/* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
-#define int32 int
+#  if (SIZEOF_INT == 4)
+#define int32 int
+#  elif (SIZEOF_LONG == 4)
+#define int32 long
+#  elif (SIZEOF_SHORT == 4)
+#define int32 short
+#  else
+ /* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
+#define int32 int
+#  endif
+   /* needed to work around compile issue on HP-UX 11.x */
+#  define _INT32   1
 #endif
-#endif
 
 /*
  * Note we duplicate the size tests in the unsigned 

Modified: trunk/source/include/includes.h
===
--- trunk/source/include/includes.h 2006-05-24 14:19:34 UTC (rev 15862)
+++ trunk/source/include/includes.h 2006-05-24 14:26:34 UTC (rev 15863)
@@ -596,11 +596,13 @@
 #endif
 
 #if !defined(int16) && !defined(HAVE_INT16_FROM_RPC_RPC_H)
-#if (SIZEOF_SHORT == 4)
-#define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
-#else /* SIZEOF_SHORT != 4 */
-#define int16 short
-#endif /* SIZEOF_SHORT != 4 */
+#  if (SIZEOF_SHORT == 4)
+#define int16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
+#  else /* SIZEOF_SHORT != 4 */
+#define int16 short
+#  endif /* SIZEOF_SHORT != 4 */
+   /* needed to work around compile issue on HP-UX 11.x */
+#  define _INT16   1
 #endif
 
 /*
@@ -617,17 +619,19 @@
 #endif
 
 #if !defined(int32) && !defined(HAVE_INT32_FROM_RPC_RPC_H)
-#if (SIZEOF_INT == 4)
-#define int32 int
-#elif (SIZEOF_LONG == 4)
-#define int32 long
-#elif (SIZEOF_SHORT == 4)
-#define int32 short
-#else
-/* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
-#define int32 int
+#  if (SIZEOF_INT == 4)
+#define int32 int
+#  elif (SIZEOF_LONG == 4)
+#define int32 long
+#  elif (SIZEOF_SHORT == 4)
+#define int32 short
+#  else
+ /* uggh - no 32 bit type?? probably a CRAY. just hope this works ... */
+#define int32 int
+#  endif
+   /* needed to work around compile issue on HP-UX 11.x */
+#  define _INT32   1
 #endif
-#endif
 
 /*
  * Note we duplicate the size tests in the unsigned 



svn commit: samba r15862 - in branches/SAMBA_4_0/source: script/tests torture torture/local

2006-05-24 Thread metze
Author: metze
Date: 2006-05-24 14:19:34 + (Wed, 24 May 2006)
New Revision: 15862

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

Log:
add a LOCAL-EVENT torture test

- it currently tests the standard events code
- with epoll enabled and disabled

metze
Added:
   branches/SAMBA_4_0/source/torture/local/event.c
Modified:
   branches/SAMBA_4_0/source/script/tests/test_local.sh
   branches/SAMBA_4_0/source/torture/local/config.mk
   branches/SAMBA_4_0/source/torture/torture.c


Changeset:
Modified: branches/SAMBA_4_0/source/script/tests/test_local.sh
===
--- branches/SAMBA_4_0/source/script/tests/test_local.sh2006-05-24 
14:15:10 UTC (rev 15861)
+++ branches/SAMBA_4_0/source/script/tests/test_local.sh2006-05-24 
14:19:34 UTC (rev 15862)
@@ -1,6 +1,9 @@
 #!/bin/sh
 
-local_tests="LOCAL-NTLMSSP LOCAL-TALLOC LOCAL-MESSAGING LOCAL-IRPC 
LOCAL-BINDING LOCAL-IDTREE LOCAL-SOCKET LOCAL-PAC LOCAL-STRLIST LOCAL-SDDL 
LOCAL-NDR"
+local_tests="LOCAL-NTLMSSP LOCAL-TALLOC LOCAL-MESSAGING LOCAL-IRPC"
+local_tests="$local_tests LOCAL-BINDING LOCAL-IDTREE LOCAL-SOCKET"
+local_tests="$local_tests LOCAL-PAC LOCAL-STRLIST LOCAL-SDDL LOCAL-NDR"
+local_tests="$local_tests LOCAL-EVENT"
 
 if [ $# -lt 0 ]; then
 cat < 5) {
+   printf("got more than fde 5 events - bug!\n");
+   talloc_free(fde);
+   fde = NULL;
+   return;
+   }
+
+   event_set_fd_flags(fde, 0);
+   fde_count++;
+}
+
+static void timed_handler(struct event_context *ev_ctx, struct timed_event *te,
+ struct timeval tval, void *private)
+{
+   printf("timed_handler called[%d]\n", te_count);
+   if (te_count > 2) {
+   close(write_fd);
+   write_fd = -1;
+   }
+   if (te_count > 5) {
+   printf("remove fd event!\n");
+   talloc_free(fde);
+   fde = NULL;
+   return;
+   }
+   te_count++;
+   event_add_timed(ev_ctx, ev_ctx, timeval_current_ofs(0,500), 
timed_handler, private);
+}
+
+
+static BOOL test_event_context(struct event_context *ev_ctx, const char 
*comment)
+{
+   int fd[2] = { -1, -1 };
+
+   printf("Testing '%s'\n", comment);
+
+   /* reset globals */
+   write_fd = -1;
+   read_fd = -1;
+   fde = NULL;
+   te_count = 0;
+   fde_count = 0;
+   ret = True;
+
+   /* create a pipe */
+   pipe(fd);
+   read_fd = fd[0];
+   write_fd = fd[1];
+
+   fde = event_add_fd(ev_ctx, ev_ctx, read_fd, EVENT_FD_READ, fde_handler, 
&read_fd);
+
+   event_add_timed(ev_ctx, ev_ctx, timeval_current_ofs(0,500), 
timed_handler, fde);
+
+   event_loop_wait(ev_ctx);
+
+   close(read_fd);
+   close(write_fd);
+
+   return ret;
+}
+
+BOOL torture_local_event(struct torture_context *torture) 
+{
+   struct event_context *ev_ctx;
+   BOOL try_epoll;
+   BOOL retv = True;
+
+   try_epoll = False;
+   ev_ctx = event_context_init_ops(NULL, event_standard_get_ops(), 
&try_epoll);
+   retv &= test_event_context(ev_ctx, "standard with select");
+   talloc_free(ev_ctx);
+
+   try_epoll = True;
+   ev_ctx = event_context_init_ops(NULL, event_standard_get_ops(), 
&try_epoll);
+   retv &= test_event_context(ev_ctx, "standard try epool (or select)");
+   talloc_free(ev_ctx);
+
+   return retv;
+}

Modified: branches/SAMBA_4_0/source/torture/torture.c
===
--- branches/SAMBA_4_0/source/torture/torture.c 2006-05-24 14:15:10 UTC (rev 
15861)
+++ branches/SAMBA_4_0/source/torture/torture.c 2006-05-24 14:19:34 UTC (rev 
15862)
@@ -652,6 +652,7 @@
{"LOCAL-RESOLVE", torture_local_resolve, 0},
{"LOCAL-SDDL", torture_local_sddl, 0},
{"LOCAL-NDR", torture_local_ndr, 0},
+   {"LOCAL-EVENT", torture_local_event, 0},
 
/* ldap testers */
{"LDAP-BASIC", torture_ldap_basic, 0},



svn commit: samba-docs r959 - in tags: .

2006-05-24 Thread jerry
Author: jerry
Date: 2006-05-24 14:15:33 + (Wed, 24 May 2006)
New Revision: 959

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

Log:
too quick to tag
Removed:
   tags/release-3-0-23rc1/


Changeset:


svn commit: samba r15861 - in tags: .

2006-05-24 Thread jerry
Author: jerry
Date: 2006-05-24 14:15:10 + (Wed, 24 May 2006)
New Revision: 15861

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

Log:
too quick to tag
Removed:
   tags/release-3-0-23rc1/


Changeset:


svn commit: samba r15860 - in branches/SAMBA_3_0_RELEASE: . source/nsswitch

2006-05-24 Thread jerry
Author: jerry
Date: 2006-05-24 14:11:27 + (Wed, 24 May 2006)
New Revision: 15860

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

Log:
grab r15845 from vl (fix crash in child winbindd process
Modified:
   branches/SAMBA_3_0_RELEASE/WHATSNEW.txt
   branches/SAMBA_3_0_RELEASE/source/nsswitch/winbindd_cm.c


Changeset:
Modified: branches/SAMBA_3_0_RELEASE/WHATSNEW.txt
===
--- branches/SAMBA_3_0_RELEASE/WHATSNEW.txt 2006-05-24 12:33:06 UTC (rev 
15859)
+++ branches/SAMBA_3_0_RELEASE/WHATSNEW.txt 2006-05-24 14:11:27 UTC (rev 
15860)
@@ -187,6 +187,8 @@
 * BUG 3435: Fix 'msdfs root = yes' in [homes].
 * Instruct winbindd to find a trusted DC on its own when runing on 
   a Samba DC.
+* Fix segv in child winbindd processes caused by a failed tconX 
+  to the DC.
 
 
 o   Jim McDonough <[EMAIL PROTECTED]>

Modified: branches/SAMBA_3_0_RELEASE/source/nsswitch/winbindd_cm.c
===
--- branches/SAMBA_3_0_RELEASE/source/nsswitch/winbindd_cm.c2006-05-24 
12:33:06 UTC (rev 15859)
+++ branches/SAMBA_3_0_RELEASE/source/nsswitch/winbindd_cm.c2006-05-24 
14:11:27 UTC (rev 15860)
@@ -372,6 +372,7 @@
result = NT_STATUS_UNSUCCESSFUL;
 
cli_shutdown(*cli);
+   *cli = NULL;
goto done;
}
 



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

2006-05-24 Thread tridge
Author: tridge
Date: 2006-05-24 12:33:06 + (Wed, 24 May 2006)
New Revision: 15859

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

Log:

fixed a crash bug in the ldb password_hash module. This one is quite
sublte - please have a look at the change if you are not certain you
know the semantics of constant arrays declared on the stack (they must
be static if you return them from the function)

Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c
===
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c
2006-05-24 11:46:19 UTC (rev 15858)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c
2006-05-24 12:33:06 UTC (rev 15859)
@@ -1145,7 +1145,10 @@
 static int build_domain_data_request(struct ph_async_context *ac,
 struct dom_sid *sid)
 {
-   const char * const attrs[] = { "pwdProperties", "pwdHistoryLength", 
"dnsDomain", NULL };
+   /* attrs[] is returned from this function in
+  ac->dom_req->op.search.attrs, so it must be static, as
+  otherwise the compiler can put it on the stack */
+   static const char * const attrs[] = { "pwdProperties", 
"pwdHistoryLength", "dnsDomain", NULL };
char *filter;
 
ac->dom_req = talloc_zero(ac, struct ldb_request);



svn commit: samba r15858 - in branches/SAMBA_4_0/source/libnet: .

2006-05-24 Thread metze
Author: metze
Date: 2006-05-24 11:46:19 + (Wed, 24 May 2006)
New Revision: 15858

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

Log:
- initialize s->r.out
- don't check for mem_ctx, ctx and r, we should crash when they're wrong
  as it's a programmer error!
- pass the error string to the caller

metze
Modified:
   branches/SAMBA_4_0/source/libnet/libnet_rpc.c


Changeset:
Modified: branches/SAMBA_4_0/source/libnet/libnet_rpc.c
===
--- branches/SAMBA_4_0/source/libnet/libnet_rpc.c   2006-05-24 11:32:17 UTC 
(rev 15857)
+++ branches/SAMBA_4_0/source/libnet/libnet_rpc.c   2006-05-24 11:46:19 UTC 
(rev 15858)
@@ -65,6 +65,7 @@
c->event_ctx = ctx->event_ctx;
 
s->r = *r;
+   ZERO_STRUCT(s->r.out);
 
/* prepare binding string */
switch (r->level) {
@@ -131,10 +132,12 @@
  TALLOC_CTX *mem_ctx,
  struct libnet_RpcConnect *r)
 {
-   struct rpc_connect_srv_state *s;
-   NTSTATUS status = composite_wait(c);
+   NTSTATUS status;
+   struct rpc_connect_srv_state *s = talloc_get_type(c->private_data,
+ struct rpc_connect_srv_state);
 
-   if (NT_STATUS_IS_OK(status) && ctx && mem_ctx && r) {
+   status = composite_wait(c);
+   if (NT_STATUS_IS_OK(status)) {
/* move the returned rpc pipe between memory contexts */
s = talloc_get_type(c->private_data, struct 
rpc_connect_srv_state);
r->out.dcerpc_pipe = talloc_steal(mem_ctx, 
s->r.out.dcerpc_pipe);
@@ -147,6 +150,8 @@
} else {
ctx->pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
}
+   } else {
+   r->out.error_string = talloc_steal(mem_ctx, 
s->r.out.error_string);
}
 
talloc_free(c);
@@ -195,8 +200,9 @@
c->private_data = s;
c->event_ctx = ctx->event_ctx;
 
+   s->ctx = ctx;
s->r   = *r;
-   s->ctx = ctx;
+   ZERO_STRUCT(s->r.out);
 
switch (r->level) {
case LIBNET_RPC_CONNECT_PDC:
@@ -302,13 +308,12 @@
 struct libnet_RpcConnect *r)
 {
NTSTATUS status;
-   struct rpc_connect_dc_state *s;
-   
+   struct rpc_connect_dc_state *s = talloc_get_type(c->private_data,
+struct rpc_connect_dc_state);
+
status = composite_wait(c);
-
-   if (NT_STATUS_IS_OK(status) && ctx && mem_ctx && r) {
+   if (NT_STATUS_IS_OK(status)) {
/* move connected rpc pipe between memory contexts */
-   s = talloc_get_type(c->private_data, struct 
rpc_connect_dc_state);
r->out.dcerpc_pipe = talloc_steal(mem_ctx, 
s->r.out.dcerpc_pipe);
 
/* reference created pipe structure to long-term libnet_context
@@ -319,6 +324,8 @@
} else {
ctx->pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
}
+   } else {
+   r->out.error_string = talloc_steal(mem_ctx, 
s->r.out.error_string);
}
 
talloc_free(c);
@@ -379,8 +386,9 @@
c->private_data = s;
c->event_ctx = ctx->event_ctx;
 
+   s->ctx = ctx;
s->r   = *r;
-   s->ctx = ctx;
+   ZERO_STRUCT(s->r.out);
 
/* proceed to pure rpc connection if the binding string is provided,
   otherwise try to connect domain controller */
@@ -646,12 +654,11 @@
 TALLOC_CTX *mem_ctx, struct 
libnet_RpcConnect *r)
 {
NTSTATUS status;
-   struct rpc_connect_dci_state *s;
+   struct rpc_connect_dci_state *s = talloc_get_type(c->private_data,
+ struct rpc_connect_dci_state);
 
status = composite_wait(c);
if (NT_STATUS_IS_OK(status)) {
-   s = talloc_get_type(c->private_data, struct 
rpc_connect_dci_state);
-
r->out.realm= talloc_steal(mem_ctx, s->r.out.realm);
r->out.guid = talloc_steal(mem_ctx, s->r.out.guid);
r->out.domain_name  = talloc_steal(mem_ctx, 
s->r.out.domain_name);
@@ -667,6 +674,8 @@
} else {
ctx->pipe = talloc_reference(ctx, r->out.dcerpc_pipe);
}
+   } else {
+   r->out.error_string = talloc_steal(mem_ctx, 
s->r.out.error_string);
}
 
talloc_free(c);
@@ -740,6 +749,7 @@
return libnet_RpcConnectDCInfo_recv(c, ctx, mem_ctx, r);
 
default:
+   ZERO_STRUCT(r->out);
return NT_STATUS_INVALID_LEVEL;
}
 }



svn commit: samba r15857 - in branches/SAMBA_4_0/source/libnet: .

2006-05-24 Thread metze
Author: metze
Date: 2006-05-24 11:32:17 + (Wed, 24 May 2006)
New Revision: 15857

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

Log:
don't clear the error string after setting it

metze
Modified:
   branches/SAMBA_4_0/source/libnet/libnet_user.c


Changeset:
Modified: branches/SAMBA_4_0/source/libnet/libnet_user.c
===
--- branches/SAMBA_4_0/source/libnet/libnet_user.c  2006-05-24 07:45:19 UTC 
(rev 15856)
+++ branches/SAMBA_4_0/source/libnet/libnet_user.c  2006-05-24 11:32:17 UTC 
(rev 15857)
@@ -159,12 +159,13 @@
struct create_user_state *s;
 
status = composite_wait(c);
-   if (!NT_STATUS_IS_OK(status)) {
+   if (NT_STATUS_IS_OK(status)) {
+   r->out.error_string = NULL;
+   } else {
s = talloc_get_type(c->private_data, struct create_user_state);
r->out.error_string = talloc_steal(mem_ctx, 
s->r.out.error_string);
}
 
-   r->out.error_string = NULL;
return status;
 }
 
@@ -307,12 +308,13 @@
struct delete_user_state *s;
 
status = composite_wait(c);
-   if (!NT_STATUS_IS_OK(status)) {
+   if (NT_STATUS_IS_OK(status)) {
+   r->out.error_string = NULL;
+   } else {
s = talloc_get_type(c->private_data, struct delete_user_state);
r->out.error_string = talloc_steal(mem_ctx, 
s->r.out.error_string);
}

-   r->out.error_string = NULL;
return status;
 }
 



svn commit: samba r15856 - in branches/SAMBA_4_0/source/lib/talloc: .

2006-05-24 Thread tridge
Author: tridge
Date: 2006-05-24 07:45:19 + (Wed, 24 May 2006)
New Revision: 15856

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

Log:

fixed talloc_asprintf_append() on solaris

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


Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c
===
--- branches/SAMBA_4_0/source/lib/talloc/talloc.c   2006-05-24 07:35:06 UTC 
(rev 15855)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.c   2006-05-24 07:45:19 UTC 
(rev 15856)
@@ -1066,6 +1066,7 @@
struct talloc_chunk *tc;
int len, s_len;
va_list ap2;
+   char c;
 
if (s == NULL) {
return talloc_vasprintf(NULL, fmt, ap);
@@ -1076,7 +1077,7 @@
va_copy(ap2, ap);
 
s_len = tc->size - 1;
-   if ((len = vsnprintf(NULL, 0, fmt, ap2)) <= 0) {
+   if ((len = vsnprintf(&c, 1, fmt, ap2)) <= 0) {
/* Either the vsnprintf failed or the format resulted in
 * no characters being formatted. In the former case, we
 * ought to return NULL, in the latter we ought to return



svn commit: samba r15855 - in branches/SAMBA_4_0/source: ntvfs/posix ntvfs/sysdep rpc_server rpc_server/srvsvc smb_server web_server wrepl_server

2006-05-24 Thread tridge
Author: tridge
Date: 2006-05-24 07:35:06 + (Wed, 24 May 2006)
New Revision: 15855

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

Log:

more talloc_set_destructor() typesafe fixes. nearly done ...

Modified:
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_wait.c
   branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
   branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c
   branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c
   branches/SAMBA_4_0/source/rpc_server/handles.c
   branches/SAMBA_4_0/source/rpc_server/srvsvc/srvsvc_ntvfs.c
   branches/SAMBA_4_0/source/smb_server/handle.c
   branches/SAMBA_4_0/source/smb_server/session.c
   branches/SAMBA_4_0/source/smb_server/tcon.c
   branches/SAMBA_4_0/source/web_server/http.c
   branches/SAMBA_4_0/source/web_server/web_server.c
   branches/SAMBA_4_0/source/wrepl_server/wrepl_in_connection.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c 2006-05-24 07:34:11 UTC 
(rev 15854)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_search.c 2006-05-24 07:35:06 UTC 
(rev 15855)
@@ -35,9 +35,8 @@
 /*
   destroy an open search
 */
-static int pvfs_search_destructor(void *ptr)
+static int pvfs_search_destructor(struct pvfs_search_state *search)
 {
-   struct pvfs_search_state *search = ptr;
DLIST_REMOVE(search->pvfs->search.list, search);
idr_remove(search->pvfs->search.idtree, search->handle);
return 0;

Modified: branches/SAMBA_4_0/source/ntvfs/posix/pvfs_wait.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/pvfs_wait.c   2006-05-24 07:34:11 UTC 
(rev 15854)
+++ branches/SAMBA_4_0/source/ntvfs/posix/pvfs_wait.c   2006-05-24 07:35:06 UTC 
(rev 15855)
@@ -102,9 +102,8 @@
 /*
   destroy a pending wait
  */
-static int pvfs_wait_destructor(void *ptr)
+static int pvfs_wait_destructor(struct pvfs_wait *pwait)
 {
-   struct pvfs_wait *pwait = ptr;
if (pwait->msg_type != -1) {
messaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait);
}

Modified: branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c
===
--- branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c   2006-05-24 07:34:11 UTC 
(rev 15854)
+++ branches/SAMBA_4_0/source/ntvfs/posix/vfs_posix.c   2006-05-24 07:35:06 UTC 
(rev 15855)
@@ -104,9 +104,8 @@
}
 }
 
-static int pvfs_state_destructor(void *ptr)
+static int pvfs_state_destructor(struct pvfs_state *pvfs)
 {
-   struct pvfs_state *pvfs = talloc_get_type(ptr, struct pvfs_state);
struct pvfs_file *f, *fn;
struct pvfs_search_state *s, *sn;
 

Modified: branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c
===
--- branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c2006-05-24 07:34:11 UTC 
(rev 15854)
+++ branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c2006-05-24 07:35:06 UTC 
(rev 15855)
@@ -82,9 +82,8 @@
 /*
   destroy the inotify private context
 */
-static int inotify_destructor(void *ptr)
+static int inotify_destructor(struct inotify_private *in)
 {
-   struct inotify_private *in = talloc_get_type(ptr, struct 
inotify_private);
close(in->fd);
return 0;
 }
@@ -308,9 +307,8 @@
 /*
   destroy a watch
 */
-static int watch_destructor(void *ptr)
+static int watch_destructor(struct watch_context *w)
 {
-   struct watch_context *w = talloc_get_type(ptr, struct watch_context);
struct inotify_private *in = w->in;
int wd = w->wd;
DLIST_REMOVE(w->in->watches, w);

Modified: branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c
===
--- branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c2006-05-24 
07:34:11 UTC (rev 15854)
+++ branches/SAMBA_4_0/source/rpc_server/dcerpc_server.c2006-05-24 
07:35:06 UTC (rev 15855)
@@ -266,10 +266,8 @@
 /*
   destroy a link to an endpoint
 */
-static int dcesrv_endpoint_destructor(void *ptr)
+static int dcesrv_endpoint_destructor(struct dcesrv_connection *p)
 {
-   struct dcesrv_connection *p = ptr;
-
while (p->contexts) {
struct dcesrv_connection_context *c = p->contexts;
 

Modified: branches/SAMBA_4_0/source/rpc_server/handles.c
===
--- branches/SAMBA_4_0/source/rpc_server/handles.c  2006-05-24 07:34:11 UTC 
(rev 15854)
+++ branches/SAMBA_4_0/source/rpc_server/handles.c  2006-05-24 07:35:06 UTC 
(rev 15855)
@@ -27,9 +27,8 @@
 /*
   destroy a rpc handle
 */
-static int dcesrv_handle_destructor(void *ptr)
+static int dcesrv_handle_destructor(struct dcesrv_handle *h)
 {
-   struct dcesrv_handle *h = ptr;
  

svn commit: samba r15854 - in branches/SAMBA_4_0/source: lib/events lib/ldb/ldb_ldap lib/ldb/ldb_sqlite3 lib/ldb/ldb_tdb lib/ldb/modules lib/messaging lib/registry lib/socket lib/stream lib/tls lib/ut

2006-05-24 Thread tridge
Author: tridge
Date: 2006-05-24 07:34:11 + (Wed, 24 May 2006)
New Revision: 15854

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

Log:

more talloc_set_destructor() typesafe fixes

Modified:
   branches/SAMBA_4_0/source/lib/events/events_liboop.c
   branches/SAMBA_4_0/source/lib/events/events_standard.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_ldap/ldb_ldap.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_sqlite3/ldb_sqlite3.c
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
   branches/SAMBA_4_0/source/lib/ldb/modules/paged_results.c
   branches/SAMBA_4_0/source/lib/ldb/modules/skel.c
   branches/SAMBA_4_0/source/lib/messaging/messaging.c
   branches/SAMBA_4_0/source/lib/registry/reg_backend_ldb.c
   branches/SAMBA_4_0/source/lib/socket/socket.c
   branches/SAMBA_4_0/source/lib/stream/packet.c
   branches/SAMBA_4_0/source/lib/tls/tls.c
   branches/SAMBA_4_0/source/lib/util/unix_privs.c
   branches/SAMBA_4_0/source/libcli/cldap/cldap.c
   branches/SAMBA_4_0/source/libcli/dgram/mailslot.c
   branches/SAMBA_4_0/source/libcli/ldap/ldap_client.c
   branches/SAMBA_4_0/source/libcli/nbt/nbtsocket.c
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c
   branches/SAMBA_4_0/source/libcli/resolve/host.c
   branches/SAMBA_4_0/source/libcli/smb2/transport.c
   branches/SAMBA_4_0/source/libcli/wrepl/winsrepl.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c
   branches/SAMBA_4_0/source/ntvfs/cifs/vfs_cifs.c
   branches/SAMBA_4_0/source/ntvfs/common/notify.c
   branches/SAMBA_4_0/source/ntvfs/common/opendb.c
   branches/SAMBA_4_0/source/ntvfs/ipc/vfs_ipc.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_dirlist.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_notify.c
   branches/SAMBA_4_0/source/ntvfs/posix/pvfs_open.c


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


svn commit: samba r15853 - in branches/SAMBA_4_0/source: auth/credentials auth/gensec auth/kerberos gtk/common kdc lib

2006-05-24 Thread tridge
Author: tridge
Date: 2006-05-24 07:32:17 + (Wed, 24 May 2006)
New Revision: 15853

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

Log:

started the process of removing the warnings now that
talloc_set_destructor() is type safe. The end result will be lots less
use of void*, and less calls to talloc_get_type()

Modified:
   branches/SAMBA_4_0/source/auth/credentials/credentials_krb5.c
   branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c
   branches/SAMBA_4_0/source/auth/gensec/gensec_krb5.c
   branches/SAMBA_4_0/source/auth/kerberos/kerberos_util.c
   branches/SAMBA_4_0/source/auth/kerberos/krb5_init_context.c
   branches/SAMBA_4_0/source/gtk/common/gtk_events.c
   branches/SAMBA_4_0/source/kdc/hdb-ldb.c
   branches/SAMBA_4_0/source/lib/db_wrap.c


Changeset:
Modified: branches/SAMBA_4_0/source/auth/credentials/credentials_krb5.c
===
--- branches/SAMBA_4_0/source/auth/credentials/credentials_krb5.c   
2006-05-24 07:31:02 UTC (rev 15852)
+++ branches/SAMBA_4_0/source/auth/credentials/credentials_krb5.c   
2006-05-24 07:32:17 UTC (rev 15853)
@@ -104,16 +104,15 @@
 }
 
 /* Free a memory ccache */
-static int free_mccache(void *ptr) {
-   struct ccache_container *ccc = ptr;
+static int free_mccache(struct ccache_container *ccc)
+{
krb5_cc_destroy(ccc->smb_krb5_context->krb5_context, ccc->ccache);
 
return 0;
 }
 
 /* Free a disk-based ccache */
-static int free_dccache(void *ptr) {
-   struct ccache_container *ccc = ptr;
+static int free_dccache(struct ccache_container *ccc) {
krb5_cc_close(ccc->smb_krb5_context->krb5_context, ccc->ccache);
 
return 0;
@@ -273,11 +272,10 @@
return ret;
 }
 
-static int free_gssapi_creds(void *ptr) {
+static int free_gssapi_creds(struct gssapi_creds_container *gcc)
+{
OM_uint32 min_stat, maj_stat;
-   struct gssapi_creds_container *gcc = ptr;
-   maj_stat = gss_release_cred(&min_stat, 
-   &gcc->creds);
+   maj_stat = gss_release_cred(&min_stat, &gcc->creds);
return 0;
 }
 

Modified: branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c
===
--- branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c   2006-05-24 
07:31:02 UTC (rev 15852)
+++ branches/SAMBA_4_0/source/auth/gensec/gensec_gssapi.c   2006-05-24 
07:32:17 UTC (rev 15853)
@@ -95,9 +95,8 @@
 }
 
 
-static int gensec_gssapi_destory(void *ptr) 
+static int gensec_gssapi_destory(struct gensec_gssapi_state 
*gensec_gssapi_state)
 {
-   struct gensec_gssapi_state *gensec_gssapi_state = ptr;
OM_uint32 maj_stat, min_stat;

if (gensec_gssapi_state->delegated_cred_handle != GSS_C_NO_CREDENTIAL) {

Modified: branches/SAMBA_4_0/source/auth/gensec/gensec_krb5.c
===
--- branches/SAMBA_4_0/source/auth/gensec/gensec_krb5.c 2006-05-24 07:31:02 UTC 
(rev 15852)
+++ branches/SAMBA_4_0/source/auth/gensec/gensec_krb5.c 2006-05-24 07:32:17 UTC 
(rev 15853)
@@ -54,10 +54,8 @@
BOOL gssapi;
 };
 
-static int gensec_krb5_destroy(void *ptr) 
+static int gensec_krb5_destroy(struct gensec_krb5_state *gensec_krb5_state)
 {
-   struct gensec_krb5_state *gensec_krb5_state = ptr;
-
if (!gensec_krb5_state->smb_krb5_context) {
/* We can't clean anything else up unless we started up this 
far */
return 0;

Modified: branches/SAMBA_4_0/source/auth/kerberos/kerberos_util.c
===
--- branches/SAMBA_4_0/source/auth/kerberos/kerberos_util.c 2006-05-24 
07:31:02 UTC (rev 15852)
+++ branches/SAMBA_4_0/source/auth/kerberos/kerberos_util.c 2006-05-24 
07:32:17 UTC (rev 15853)
@@ -31,8 +31,8 @@
krb5_principal principal;
 };
 
-static int free_principal(void *ptr) {
-   struct principal_container *pc = ptr;
+static int free_principal(struct principal_container *pc)
+{
/* current heimdal - 0.6.3, which we need anyway, fixes segfaults here 
*/
krb5_free_principal(pc->smb_krb5_context->krb5_context, pc->principal);
 
@@ -227,8 +227,8 @@
return 0;
 }
 
-static int free_keytab(void *ptr) {
-   struct keytab_container *ktc = ptr;
+static int free_keytab(struct keytab_container *ktc)
+{
krb5_kt_close(ktc->smb_krb5_context->krb5_context, ktc->keytab);
 
return 0;
@@ -265,8 +265,8 @@
krb5_enctype *enctypes;
 };
 
-static int free_enctypes(void *ptr) {
-   struct enctypes_container *etc = ptr;
+static int free_enctypes(struct enctypes_container *etc)
+{
free_kerberos_etypes(etc->smb_krb5_context->krb5_context, 
etc->enctypes);
return 0;
 }

Modified: branches/SAMBA_4_0/source/auth/kerberos/krb5_init_context.c
===
--- branches/SA

svn commit: samba r15852 - in branches/SAMBA_4_0/source/lib/talloc: .

2006-05-24 Thread tridge
Author: tridge
Date: 2006-05-24 07:31:02 + (Wed, 24 May 2006)
New Revision: 15852

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

Log:

patch from Rusty to make talloc_set_destructor() and talloc_steal()
type safe. This only works on recent gcc versions. With other
compilers it reverts to a non-typesafe cast

The patch also ensures that talloc_free() does not change error on
systems where free() can change errno

Modified:
   branches/SAMBA_4_0/source/lib/talloc/talloc.c
   branches/SAMBA_4_0/source/lib/talloc/talloc.h
   branches/SAMBA_4_0/source/lib/talloc/testsuite.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c
===
--- branches/SAMBA_4_0/source/lib/talloc/talloc.c   2006-05-24 06:36:17 UTC 
(rev 15851)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.c   2006-05-24 07:31:02 UTC 
(rev 15852)
@@ -30,12 +30,12 @@
   inspired by http://swapped.cc/halloc/
 */
 
-
 #include "config.h"
 
 #include 
 #include 
 #include 
+#include 
 
 #ifdef HAVE_SYS_TYPES_H
 #include 
@@ -218,7 +218,7 @@
   if the destructor fails then the free is failed, and the memory can
   be continued to be used
 */
-void talloc_set_destructor(const void *ptr, int (*destructor)(void *))
+void _talloc_set_destructor(const void *ptr, int (*destructor)(void *))
 {
struct talloc_chunk *tc = talloc_chunk_from_ptr(ptr);
tc->destructor = destructor;
@@ -235,10 +235,9 @@
 /*
   helper for talloc_reference()
 */
-static int talloc_reference_destructor(void *ptr)
+static int talloc_reference_destructor(struct talloc_reference_handle *handle)
 {
-   struct talloc_reference_handle *handle = ptr;
-   struct talloc_chunk *tc1 = talloc_chunk_from_ptr(ptr);
+   struct talloc_chunk *tc1 = talloc_chunk_from_ptr(handle);
struct talloc_chunk *tc2 = talloc_chunk_from_ptr(handle->ptr);
if (tc1->destructor != (talloc_destructor_t)-1) {
tc1->destructor = NULL;
@@ -534,6 +533,7 @@
 int talloc_free(void *ptr)
 {
struct talloc_chunk *tc;
+   int old_errno;
 
if (ptr == NULL) {
return -1;
@@ -586,7 +586,9 @@
 
tc->flags |= TALLOC_FLAG_FREE;
 
+   old_errno = errno;
free(tc);
+   errno = old_errno;
return 0;
 }
 
@@ -667,7 +669,7 @@
ptr on success, or NULL if it could not be transferred.
passing NULL as ptr will always return NULL with no side effects.
 */
-void *talloc_steal(const void *new_ctx, const void *ptr)
+void *_talloc_steal(const void *new_ctx, const void *ptr)
 {
struct talloc_chunk *tc, *new_tc;
 

Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.h
===
--- branches/SAMBA_4_0/source/lib/talloc/talloc.h   2006-05-24 06:36:17 UTC 
(rev 15851)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.h   2006-05-24 07:31:02 UTC 
(rev 15852)
@@ -40,6 +40,34 @@
 #define TALLOC_DEPRECATED 0
 #endif
 
+#ifndef PRINTF_ATTRIBUTE
+#if (__GNUC__ >= 3)
+/** Use gcc attribute to check printf fns.  a1 is the 1-based index of
+ * the parameter containing the format, and a2 the index of the first
+ * argument. Note that some gcc 2.x versions don't handle this
+ * properly **/
+#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
+#else
+#define PRINTF_ATTRIBUTE(a1, a2)
+#endif
+#endif
+
+/* try to make talloc_set_destructor() and talloc_steal() type safe,
+   if we have a recent gcc */
+#if (__GNUC__ >= 3)
+#define _TALLOC_TYPEOF(ptr) __typeof__(ptr)
+#define talloc_set_destructor(ptr, function) \
+   do {  \
+   int (*_talloc_destructor_fn)(typeof(ptr)) = (function);   \
+   _talloc_set_destructor((ptr), (void *)_talloc_destructor_fn); \
+   } while(0)
+#define _TALLOC_CHECK_TYPE(type,val) 
+#else
+#define talloc_set_destructor(ptr, function) \
+   _talloc_set_destructor((ptr), (int (*)(void *))(function))
+#define _TALLOC_TYPEOF(ptr) void *
+#endif
+
 /* useful macros for creating type checked pointers */
 #define talloc(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type)
 #define talloc_size(ctx, size) talloc_named_const(ctx, size, __location__)
@@ -70,8 +98,8 @@
 #define talloc_get_type(ptr, type) (type *)talloc_check_name(ptr, #type)
 
 #define talloc_find_parent_bytype(ptr, type) (type 
*)talloc_find_parent_byname(ptr, #type)
+#define talloc_steal(ctx, ptr) (_TALLOC_TYPEOF(ptr))_talloc_steal((ctx),(ptr))
 
-
 #if TALLOC_DEPRECATED
 #define talloc_zero_p(ctx, type) talloc_zero(ctx, type)
 #define talloc_p(ctx, type) talloc(ctx, type)
@@ -80,22 +108,9 @@
 #define talloc_destroy(ctx) talloc_free(ctx)
 #endif
 
-#ifndef PRINTF_ATTRIBUTE
-#if (__GNUC__ >= 3)
-/** Use gcc attribute to check printf fns.  a1 is the 1-based index of
- * the parameter containing th