[SCM] Samba Shared Repository - branch master updated
Michael Adam
obnox at samba.org
Mon Nov 30 16:57:16 MST 2009
The branch, master has been updated
via 6dd6000... s3:add split_tokens, a cmdline tool to test next_token_talloc()
via 92547d2... s3:fix linking of the t_str* test programs
via b82f685... s3:fix linking of libbigballofmud (on my box at least)
via 350352c... s3:torture: make t_stringoverflow.c compile at least (pstring is long gone)
from 8303bc4... Restructure the connect function code to always call down to NEXT-> before initializing. This allows us to do cleanup (by calling DISCONNECT) if initialization fails. Also fix vfs_acl_xattr which was failing to call the NEXT connect function. Jeremy.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 6dd60008c4bebf42795d4a030b3724ce610bbeeb
Author: Michael Adam <obnox at samba.org>
Date: Tue Dec 1 00:53:03 2009 +0100
s3:add split_tokens, a cmdline tool to test next_token_talloc()
Michael
commit 92547d2873b357b3d6ea21edff646a66f1d22368
Author: Michael Adam <obnox at samba.org>
Date: Fri Nov 20 18:25:27 2009 +0100
s3:fix linking of the t_str* test programs
Michael
commit b82f6855a2762df6240caf100fe775aa06392c40
Author: Michael Adam <obnox at samba.org>
Date: Fri Nov 20 18:24:53 2009 +0100
s3:fix linking of libbigballofmud (on my box at least)
Michael
commit 350352cf38bccfa6ef60db1840bd09a4798a392e
Author: Michael Adam <obnox at samba.org>
Date: Fri Nov 20 17:48:18 2009 +0100
s3:torture: make t_stringoverflow.c compile at least (pstring is long gone)
I don't know whether these t_* programs are used at all any more, but this
one was using pstrcpy...
Michael
-----------------------------------------------------------------------
Summary of changes:
source3/Makefile.in | 28 ++++++++++---
source3/torture/t_stringoverflow.c | 4 +-
source3/utils/split_tokens.c | 78 ++++++++++++++++++++++++++++++++++++
3 files changed, 101 insertions(+), 9 deletions(-)
create mode 100644 source3/utils/split_tokens.c
Changeset truncated at 500 lines:
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 29a5b3d..b1f1658 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1344,6 +1344,12 @@ DBWRAP_TORTURE_OBJ = utils/dbwrap_torture.o \
$(LIBSAMBA_OBJ) \
$(POPT_LIB_OBJ)
+SPLIT_TOKENS_OBJ = utils/split_tokens.o \
+ $(PARAM_OBJ) \
+ $(LIB_NONSMBD_OBJ) \
+ $(POPT_LIB_OBJ) \
+ $(LIBSAMBA_OBJ)
+
######################################################################
# now the rules...
######################################################################
@@ -2419,11 +2425,11 @@ showlibs:: showlibsmbsharemodes
#-------------------------------------------------------------------
# This is probably wrong for anything other than the GNU linker.
-bin/libbigballofmud. at SHLIBEXT@: $(BINARY_PREREQS) $(LIBBIGBALLOFMUD_OBJ) $(LIBTALLOC)
+bin/libbigballofmud. at SHLIBEXT@: $(BINARY_PREREQS) $(LIBBIGBALLOFMUD_OBJ) $(LIBTALLOC) $(LIBTDB) $(LIBWBCLIENT)
@echo Linking shared library $@
@$(SHLD) $(LDSHFLAGS) -o $@ $(LIBBIGBALLOFMUD_OBJ) \
- $(LIBS) $(LIBTALLOC_LIBS) \
- $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS) \
+ $(LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(LIBWBCLIENT_LIBS) \
+ $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS) -lz \
@SONAMEFLAG@`basename $@`.$(LIBBIGBALLOFMUD_MAJOR)
ln -snf libbigballofmud.so bin/libbigballofmud.so.0
@@ -2875,19 +2881,19 @@ bin/tdbtorture at EXEEXT@: $(BINARY_PREREQS) $(TDBTORTURE_OBJ) $(LIBTALLOC) $(LIBTD
bin/t_strcmp at EXEEXT@: $(BINARY_PREREQS) $(LIBTALLOC) bin/libbigballofmud. at SHLIBEXT@ torture/t_strcmp.o
$(CC) -o $@ $(DYNEXP) $(LIBS) $(LIBTALLOC_LIBS) \
- torture/t_strcmp.o -L ./bin -lbigballofmud
+ torture/t_strcmp.o -L ./bin -lbigballofmud $(LIBWBCLIENT_LIBS)
bin/t_strstr at EXEEXT@: $(BINARY_PREREQS) $(LIBTALLOC) bin/libbigballofmud. at SHLIBEXT@ torture/t_strstr.o
$(CC) -o $@ $(DYNEXP) $(LIBS) $(LIBTALLOC_LIBS) \
- torture/t_strstr.o -L ./bin -lbigballofmud
+ torture/t_strstr.o -L ./bin -lbigballofmud $(LIBWBCLIENT_LIBS)
bin/t_strappend at EXEEXT@: $(BINARY_PREREQS) $(LIBTALLOC) bin/libbigballofmud. at SHLIBEXT@ torture/t_strappend.o
$(CC) -o $@ $(DYNEXP) $(LIBS) $(LIBTALLOC_LIBS) \
- torture/t_strappend.o -L ./bin -lbigballofmud
+ torture/t_strappend.o -L ./bin -lbigballofmud $(LIBWBCLIENT_LIBS)
bin/t_stringoverflow at EXEEXT@: $(BINARY_PREREQS) bin/libbigballofmud. at SHLIBEXT@ torture/t_stringoverflow.o
$(CC) -o $@ $(DYNEXP) torture/t_stringoverflow.o \
- -L./bin -lbigballofmud
+ -L./bin -lbigballofmud $(LIBWBCLIENT_LIBS)
bin/timelimit at EXEEXT@: script/tests/timelimit.o
@echo Linking $@
@@ -2927,6 +2933,14 @@ bin/dbwrap_torture at EXEEXT@: $(DBWRAP_TORTURE_OBJ) $(LIBTALLOC) $(LIBTDB)
install-dbwrap_torture:: bin/dbwrap_torture at EXEEXT@
@$(SHELL) script/installbin.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(BINDIR) $<
+bin/split_tokens at EXEEXT@: $(BINARY_PREREQS) $(SPLIT_TOKENS_OBJ) @BUILD_POPT@ $(LIBTALLOC) $(LIBTDB)
+ @echo "Linking $@"
+ @$(CC) -o $@ $(SPLIT_TOKENS_OBJ) \
+ $(LDFLAGS) $(DYNEEXP) \
+ $(LIBS) $(POPT_LIBS) \
+ $(LDAP_LIBS) \
+ $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
+
install:: installservers installbin @INSTALL_CIFSMOUNT@ @INSTALL_CIFSUMOUNT@ @INSTALL_CIFSUPCALL@ installman \
installscripts installdat installmodules @SWAT_INSTALL_TARGETS@ \
@INSTALL_PAM_MODULES@ installlibs installmo
diff --git a/source3/torture/t_stringoverflow.c b/source3/torture/t_stringoverflow.c
index ec14d81..17765e6 100644
--- a/source3/torture/t_stringoverflow.c
+++ b/source3/torture/t_stringoverflow.c
@@ -2,7 +2,7 @@
int main(void)
{
- fstring dest;
+ char dest[100];
char *ptr = dest;
printf("running on valgrind? %d\n", RUNNING_ON_VALGRIND);
@@ -17,7 +17,7 @@
pstrcpy(dest, "hello");
#endif /* 0 */
- pstrcpy(ptr, "hello!");
+ fstrcpy(ptr, "hello!");
return 0;
}
diff --git a/source3/utils/split_tokens.c b/source3/utils/split_tokens.c
new file mode 100644
index 0000000..ac4f726
--- /dev/null
+++ b/source3/utils/split_tokens.c
@@ -0,0 +1,78 @@
+/*
+ Unix SMB/CIFS implementation.
+ test program for the next_token() function
+
+ Copyright (C) 2009 Michael Adam
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+/*
+ * Diagnostic output for "next_token()".
+ */
+
+#include "includes.h"
+
+extern bool AllowDebugChange;
+
+int main(int argc, const char *argv[])
+{
+ const char *config_file = get_dyn_CONFIGFILE();
+ const char *sequence = "";
+ poptContext pc;
+ char *buff;
+ TALLOC_CTX *ctx = talloc_stackframe();
+
+ struct poptOption long_options[] = {
+ POPT_AUTOHELP
+ POPT_COMMON_VERSION
+ POPT_TABLEEND
+ };
+
+ load_case_tables();
+
+ pc = poptGetContext(NULL, argc, argv, long_options,
+ POPT_CONTEXT_KEEP_FIRST);
+ poptSetOtherOptionHelp(pc, "[OPTION...] <sequence-string>");
+
+ while(poptGetNextOpt(pc) != -1);
+
+ setup_logging(poptGetArg(pc), true);
+
+ sequence = poptGetArg(pc);
+
+ if (sequence == NULL) {
+ fprintf(stderr, "ERROR: missing sequence string\n");
+ return 1;
+ }
+
+ dbf = x_stderr;
+ DEBUGLEVEL = 0;
+ AllowDebugChange = false;
+
+ if (!lp_load(config_file,false,true,false,true)) {
+ fprintf(stderr,"Error loading services.\n");
+ return 1;
+ }
+
+ while(next_token_talloc(ctx, &sequence, &buff, NULL)) {
+ printf("[%s]\n", buff);
+ }
+
+ talloc_free(ctx);
+
+ return 0;
+}
+
--
Samba Shared Repository
More information about the samba-cvs
mailing list