[SCM] Samba Shared Repository - branch master updated
Andrew Tridgell
tridge at samba.org
Mon Mar 29 04:35:53 MDT 2010
The branch, master has been updated
via 686221e... s4-waf: use the libreplace strerror_r if needed
via 7ed349c... pytalloc: allow for using a system libtalloc-dev with pytalloc
via 08faa3a... talloc: testsuite should use <talloc.h> not "talloc.h"
via b60da39... s4: added a simple implementation of bin/samba -b
from 61106c0... s3-selftest: Don't log to stdout, use logfiles instead.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 686221eae28ff58fb048fdc7132e1413dedb6eb9
Author: Andrew Tridgell <tridge at samba.org>
Date: Mon Mar 29 20:53:16 2010 +1100
s4-waf: use the libreplace strerror_r if needed
commit 7ed349caceed2524d897d957cee98ad1cdc4704c
Author: Andrew Tridgell <tridge at samba.org>
Date: Mon Mar 29 08:35:30 2010 +1100
pytalloc: allow for using a system libtalloc-dev with pytalloc
When we have a system talloc library, we still need to grab pytalloc.h
from lib/talloc. We don't want to just use -Ilib/talloc, as otherwise
we'll get the in-tree talloc.h which may not be compatible with the
system talloc.h
So we need to give the path to pytalloc.h
commit 08faa3a43c26f8cc637969d2b216f2efea9099d9
Author: Andrew Tridgell <tridge at samba.org>
Date: Mon Mar 29 18:48:29 2010 +1100
talloc: testsuite should use <talloc.h> not "talloc.h"
if we are using the system talloc, the testsuite needs to use the
system talloc.h
commit b60da39da6e1d1025de4bb200f39f9821f01c1d6
Author: Andrew Tridgell <tridge at samba.org>
Date: Mon Mar 29 20:20:25 2010 +1100
s4: added a simple implementation of bin/samba -b
this shows the config paths. Useful for debugging --enable-fhs
-----------------------------------------------------------------------
Summary of changes:
lib/replace/replace.c | 13 ++++++--
lib/replace/replace.h | 4 +-
lib/talloc/pytalloc.c | 2 +-
lib/talloc/testsuite.c | 2 +-
source4/auth/credentials/pycredentials.h | 2 +-
source4/auth/gensec/pygensec.c | 2 +-
source4/auth/pyauth.h | 2 +-
source4/heimdal_build/internal.mk | 1 -
source4/heimdal_build/roken.h | 9 ++++++
source4/lib/registry/pyregistry.c | 2 +-
source4/param/pyparam.c | 2 +-
source4/param/pyparam_util.c | 2 +-
source4/smbd/server.c | 45 +++++++++++++++++++++++++++++-
13 files changed, 72 insertions(+), 16 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index 6a32540..12716ea 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -748,10 +748,15 @@ char *rep_get_current_dir_name(void)
}
#endif
-#ifndef HAVE_STRERROR_R
-char *rep_strerror_r(int errnum, char *buf, size_t buflen)
+#if !defined(HAVE_STRERROR_R) || !defined(STRERROR_R_PROTO_COMPATIBLE)
+int rep_strerror_r(int errnum, char *buf, size_t buflen)
{
- strncpy(buf, strerror(errnum), buflen);
- return buf;
+ char *s = strerror(errnum);
+ if (strlen(s)+1 > buflen) {
+ errno = ERANGE;
+ return -1;
+ }
+ strncpy(buf, s, buflen);
+ return 0;
}
#endif
diff --git a/lib/replace/replace.h b/lib/replace/replace.h
index 9eb6604..7adc224 100644
--- a/lib/replace/replace.h
+++ b/lib/replace/replace.h
@@ -512,9 +512,9 @@ ssize_t rep_pwrite(int __fd, const void *__buf, size_t __nbytes, off_t __offset)
char *rep_get_current_dir_name(void);
#endif
-#ifndef HAVE_STRERROR_R
+#if !defined(HAVE_STRERROR_R) || !defined(STRERROR_R_PROTO_COMPATIBLE)
#define strerror_r rep_strerror_r
-char *rep_strerror_r(int errnum, char *buf, size_t buflen);
+int rep_strerror_r(int errnum, char *buf, size_t buflen);
#endif
#ifdef HAVE_LIMITS_H
diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c
index ad595a1..5ed88ec 100644
--- a/lib/talloc/pytalloc.c
+++ b/lib/talloc/pytalloc.c
@@ -20,7 +20,7 @@
#include <Python.h>
#include "replace.h"
#include <talloc.h>
-#include <pytalloc.h>
+#include "pytalloc.h"
/**
* Simple dealloc for talloc-wrapping PyObjects
diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c
index 08aa208..f33805d 100644
--- a/lib/talloc/testsuite.c
+++ b/lib/talloc/testsuite.c
@@ -25,7 +25,7 @@
#include "replace.h"
#include "system/time.h"
-#include "talloc.h"
+#include <talloc.h>
static struct timeval timeval_current(void)
{
diff --git a/source4/auth/credentials/pycredentials.h b/source4/auth/credentials/pycredentials.h
index b1040c6..6d03ca1 100644
--- a/source4/auth/credentials/pycredentials.h
+++ b/source4/auth/credentials/pycredentials.h
@@ -20,7 +20,7 @@
#define _PYCREDENTIALS_H_
#include "auth/credentials/credentials.h"
-#include "pytalloc.h"
+#include "lib/talloc/pytalloc.h"
PyAPI_DATA(PyTypeObject) PyCredentials;
PyAPI_DATA(PyTypeObject) PyCredentialCacheContainer;
diff --git a/source4/auth/gensec/pygensec.c b/source4/auth/gensec/pygensec.c
index 21acff8..381938c 100644
--- a/source4/auth/gensec/pygensec.c
+++ b/source4/auth/gensec/pygensec.c
@@ -22,7 +22,7 @@
#include "auth/gensec/gensec.h"
#include "libcli/util/pyerrors.h"
#include "scripting/python/modules.h"
-#include "pytalloc.h"
+#include "lib/talloc/pytalloc.h"
#include <tevent.h>
static PyObject *py_get_name_by_authtype(PyObject *self, PyObject *args)
diff --git a/source4/auth/pyauth.h b/source4/auth/pyauth.h
index f5c6339..f3c9cea 100644
--- a/source4/auth/pyauth.h
+++ b/source4/auth/pyauth.h
@@ -20,7 +20,7 @@
#ifndef _PYAUTH_H_
#define _PYAUTH_H_
-#include "pytalloc.h"
+#include "lib/talloc/pytalloc.h"
#include "auth/session.h"
PyAPI_DATA(PyTypeObject) PyAuthSession;
diff --git a/source4/heimdal_build/internal.mk b/source4/heimdal_build/internal.mk
index 6c6bfce..8b834ab 100644
--- a/source4/heimdal_build/internal.mk
+++ b/source4/heimdal_build/internal.mk
@@ -640,7 +640,6 @@ HEIMDAL_ROKEN_OBJ_FILES = \
$(heimdalsrcdir)/lib/roken/erealloc.o \
$(heimdalsrcdir)/lib/roken/simple_exec.o \
$(heimdalsrcdir)/lib/roken/strcollect.o \
- $(heimdalsrcdir)/lib/roken/strerror_r.o \
$(heimdalsrcdir)/lib/roken/rtbl.o \
$(heimdalsrcdir)/lib/roken/cloexec.o \
$(heimdalsrcdir)/lib/roken/xfree.o \
diff --git a/source4/heimdal_build/roken.h b/source4/heimdal_build/roken.h
index c95e6df..172dc76 100644
--- a/source4/heimdal_build/roken.h
+++ b/source4/heimdal_build/roken.h
@@ -111,6 +111,15 @@
#define HAVE_GETTIMEOFDAY
#endif
+/* force the use of the libreplace strerror_r */
+#ifndef HAVE_STRERROR_R
+#define HAVE_STRERROR_R
+#endif
+#ifndef STRERROR_R_PROTO_COMPATIBLE
+#define STRERROR_R_PROTO_COMPATIBLE
+#endif
+
+
/* we lie about having pidfile() so that NetBSD5 can compile. Nothing
in the parts of heimdal we use actually uses pidfile(), and we
don't use it in Samba, so this works, although its ugly */
diff --git a/source4/lib/registry/pyregistry.c b/source4/lib/registry/pyregistry.c
index 53580bd..d2302af 100644
--- a/source4/lib/registry/pyregistry.c
+++ b/source4/lib/registry/pyregistry.c
@@ -23,7 +23,7 @@
#include "libcli/util/pyerrors.h"
#include "lib/registry/registry.h"
#include "scripting/python/modules.h" /* for py_iconv_convenience() */
-#include <pytalloc.h>
+#include "lib/talloc/pytalloc.h"
#include "auth/credentials/pycredentials.h"
#include "param/pyparam.h"
diff --git a/source4/param/pyparam.c b/source4/param/pyparam.c
index 4b534fb..40d25f7 100644
--- a/source4/param/pyparam.c
+++ b/source4/param/pyparam.c
@@ -21,7 +21,7 @@
#include "includes.h"
#include "param/param.h"
#include "param/loadparm.h"
-#include "pytalloc.h"
+#include "lib/talloc/pytalloc.h"
/* There's no Py_ssize_t in 2.4, apparently */
#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 5
diff --git a/source4/param/pyparam_util.c b/source4/param/pyparam_util.c
index e5c416b..cc84395 100644
--- a/source4/param/pyparam_util.c
+++ b/source4/param/pyparam_util.c
@@ -21,7 +21,7 @@
#include "includes.h"
#include "param/param.h"
#include "param/loadparm.h"
-#include "pytalloc.h"
+#include "lib/talloc/pytalloc.h"
#define PyLoadparmContext_AsLoadparmContext(obj) py_talloc_get_type(obj, struct loadparm_context)
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index a09da3c..13b5608 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -40,6 +40,7 @@
#include "lib/messaging/irpc.h"
#include "librpc/gen_ndr/ndr_irpc.h"
#include "cluster/cluster.h"
+#include "dynconfig/dynconfig.h"
/*
recursively delete a directory tree
@@ -232,6 +233,43 @@ static NTSTATUS setup_parent_messaging(struct tevent_context *event_ctx,
}
+/*
+ show build info
+ */
+static void show_build(void)
+{
+#define CONFIG_OPTION(n) { #n, dyn_ ## n }
+ struct {
+ const char *name;
+ const char *value;
+ } config_options[] = {
+ CONFIG_OPTION(BINDIR),
+ CONFIG_OPTION(SBINDIR),
+ CONFIG_OPTION(CONFIGFILE),
+ CONFIG_OPTION(NCALRPCDIR),
+ CONFIG_OPTION(LOGFILEBASE),
+ CONFIG_OPTION(LMHOSTSFILE),
+ CONFIG_OPTION(DATADIR),
+ CONFIG_OPTION(MODULESDIR),
+ CONFIG_OPTION(LOCKDIR),
+ CONFIG_OPTION(PIDDIR),
+ CONFIG_OPTION(PRIVATE_DIR),
+ CONFIG_OPTION(SWATDIR),
+ CONFIG_OPTION(SETUPDIR),
+ CONFIG_OPTION(WINBINDD_SOCKET_DIR),
+ CONFIG_OPTION(WINBINDD_PRIVILEGED_SOCKET_DIR),
+ CONFIG_OPTION(NTP_SIGND_SOCKET_DIR),
+ { NULL, NULL}
+ };
+ int i;
+
+ printf("Paths:\n");
+ for (i=0; config_options[i].name; i++) {
+ printf(" %s: %s\n", config_options[i].name, config_options[i].value);
+ }
+
+ exit(0);
+}
/*
main server.
@@ -268,7 +306,8 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
enum {
OPT_DAEMON = 1000,
OPT_INTERACTIVE,
- OPT_PROCESS_MODEL
+ OPT_PROCESS_MODEL,
+ OPT_SHOW_BUILD
};
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -280,6 +319,7 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
"Select process model", "MODEL"},
{"maximum-runtime",0, POPT_ARG_INT, &max_runtime, 0,
"set maximum runtime of the server process, till autotermination", "seconds"},
+ {"show-build", 'b', POPT_ARG_NONE, NULL, OPT_SHOW_BUILD, "show build info", NULL },
POPT_COMMON_SAMBA
POPT_COMMON_VERSION
{ NULL }
@@ -297,6 +337,9 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
case OPT_PROCESS_MODEL:
model = poptGetOptArg(pc);
break;
+ case OPT_SHOW_BUILD:
+ show_build();
+ break;
default:
fprintf(stderr, "\nInvalid option %s: %s\n\n",
poptBadOption(pc, 0), poptStrerror(opt));
--
Samba Shared Repository
More information about the samba-cvs
mailing list