diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/Makefile.in | 14 | ||||
-rw-r--r-- | source3/build/wscript | 2 | ||||
-rw-r--r-- | source3/dynconfig.c | 86 | ||||
-rw-r--r-- | source3/include/dynconfig.h | 100 | ||||
-rw-r--r-- | source3/include/includes.h | 2 | ||||
-rw-r--r-- | source3/script/mkbuildoptions-waf.awk | 2 | ||||
-rw-r--r-- | source3/script/mkbuildoptions.awk | 2 | ||||
-rw-r--r-- | source3/web/startstop.c | 2 |
8 files changed, 12 insertions, 198 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in index baac3cdcaf..ae275f808c 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -140,6 +140,7 @@ CONFIGDIR = @configdir@ VARDIR = @localstatedir@ MANDIR = @mandir@ DATADIR = @datadir@ +SETUPDIR = @datadir@/setup # The permissions to give the executables and other data INSTALLPERMS_BIN = 0755 @@ -210,7 +211,9 @@ PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \ -DCACHEDIR=\"$(CACHEDIR)\" \ -DSTATEDIR=\"$(STATEDIR)\" \ -DNMBDSOCKETDIR=\"$(NMBDSOCKETDIR)\" \ - -DLOCALEDIR=\"$(LOCALEDIR)\" + -DLOCALEDIR=\"$(LOCALEDIR)\" \ + -DDATADIR=\"$(DATADIR)\" \ + -DSETUPDIR=\"$(SETUPDIR)\" # Note that all executable programs now provide for an optional executable suffix. @@ -485,7 +488,7 @@ READLINE_OBJ = ../libcli/smbreadline/smbreadline.o # Be sure to include them into your application POPT_LIB_OBJ = lib/popt_common.o -PARAM_WITHOUT_REG_OBJ = dynconfig.o param/loadparm.o param/loadparm_server_role.o param/util.o lib/sharesec.o lib/ldap_debug_handler.o +PARAM_WITHOUT_REG_OBJ = ../dynconfig/dynconfig.o param/loadparm.o param/loadparm_server_role.o param/util.o lib/sharesec.o lib/ldap_debug_handler.o PARAM_REG_ADD_OBJ = $(REG_SMBCONF_OBJ) $(LIBSMBCONF_OBJ) $(PRIVILEGES_BASIC_OBJ) PARAM_OBJ = $(PARAM_WITHOUT_REG_OBJ) $(PARAM_REG_ADD_OBJ) @@ -1697,7 +1700,7 @@ BINARY_PREREQS = bin/.dummy # but since we also require "make install prefix=/opt/samba" *not* to # rebuild it's a bit hard. -dynconfig.o: dynconfig.c Makefile +../dynconfig/dynconfig.o: ../dynconfig/dynconfig.c Makefile @echo Compiling $*.c @$(COMPILE_CC_PATH) && exit 0;\ echo "The following command failed:" 1>&2;\ @@ -3302,16 +3305,13 @@ uninstallpammodules:: rm -f "$(DESTDIR)/$(PAMMODULESDIR)/$${module}.@SHLIBEXT@"; \ done -# Toplevel clean files -TOPFILES=dynconfig.o localedir.o - cleanlibs:: -rm -f ../lib/*/*.o ../lib/*/*/*.o \ ../lib/*/*.ho \ ../libcli/*.o ../libcli/*/*.o ../libcli/*/*/*.o \ ../librpc/*/*.o \ ../libgpo/*.o ../libgpo/*/*.o \ - ../libds/*.o ../libds/*/*.o + ../libds/*.o ../libds/*/*.o ../dynconfig/*.o clean:: cleanlibs -rm -f include/build_env.h diff --git a/source3/build/wscript b/source3/build/wscript index d370daf899..b9c6bd264c 100644 --- a/source3/build/wscript +++ b/source3/build/wscript @@ -42,7 +42,7 @@ def configure(conf): def build(bld): cflags = dynconfig_cflags(bld) bld.SAMBA3_SUBSYSTEM('DYNCONFIG', - '../dynconfig.c', + '../../dynconfig/dynconfig.c', deps='replace talloc tdb popt', cflags=cflags) diff --git a/source3/dynconfig.c b/source3/dynconfig.c deleted file mode 100644 index 32f64a6e22..0000000000 --- a/source3/dynconfig.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Copyright (C) 2001 by Martin Pool <mbp@samba.org> - Copyright (C) 2003 by Jim McDonough <jmcd@us.ibm.com> - Copyright (C) 2007 by Jeremy Allison <jra@samba.org> - - 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 3 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, see <http://www.gnu.org/licenses/>. -*/ - -#include "includes.h" - -/** - * @file dynconfig.c - * - * @brief Global configurations, initialized to configured defaults. - * - * This file should be the only file that depends on path - * configuration (--prefix, etc), so that if ./configure is re-run, - * all programs will be appropriately updated. Everything else in - * Samba should import extern variables from here, rather than relying - * on preprocessor macros. - * - * Eventually some of these may become even more variable, so that - * they can for example consistently be set across the whole of Samba - * by command-line parameters, config file entries, or environment - * variables. - * - * @todo Perhaps eventually these should be merged into the parameter - * table? There's kind of a chicken-and-egg situation there... - **/ - -#define DEFINE_DYN_CONFIG_PARAM(name) \ -static char *dyn_##name; \ -\ - const char *get_dyn_##name(void) \ -{\ - if (dyn_##name == NULL) {\ - return name;\ - }\ - return dyn_##name;\ -}\ -\ - const char *set_dyn_##name(const char *newpath) \ -{\ - if (dyn_##name) {\ - SAFE_FREE(dyn_##name);\ - }\ - dyn_##name = SMB_STRDUP(newpath);\ - return dyn_##name;\ -}\ -\ - bool is_default_dyn_##name(void) \ -{\ - return (dyn_##name == NULL);\ -} - -DEFINE_DYN_CONFIG_PARAM(SBINDIR) -DEFINE_DYN_CONFIG_PARAM(BINDIR) -DEFINE_DYN_CONFIG_PARAM(SWATDIR) -DEFINE_DYN_CONFIG_PARAM(CONFIGFILE) /**< Location of smb.conf file. **/ -DEFINE_DYN_CONFIG_PARAM(LOGFILEBASE) /** Log file directory. **/ -DEFINE_DYN_CONFIG_PARAM(LMHOSTSFILE) /** Statically configured LanMan hosts. **/ -DEFINE_DYN_CONFIG_PARAM(CODEPAGEDIR) -DEFINE_DYN_CONFIG_PARAM(LIBDIR) -DEFINE_DYN_CONFIG_PARAM(MODULESDIR) -DEFINE_DYN_CONFIG_PARAM(SHLIBEXT) -DEFINE_DYN_CONFIG_PARAM(LOCKDIR) -DEFINE_DYN_CONFIG_PARAM(STATEDIR) /** Persistent state files. Default LOCKDIR */ -DEFINE_DYN_CONFIG_PARAM(CACHEDIR) /** Temporary cache files. Default LOCKDIR */ -DEFINE_DYN_CONFIG_PARAM(PIDDIR) -DEFINE_DYN_CONFIG_PARAM(NMBDSOCKETDIR) -DEFINE_DYN_CONFIG_PARAM(NCALRPCDIR) -DEFINE_DYN_CONFIG_PARAM(SMB_PASSWD_FILE) -DEFINE_DYN_CONFIG_PARAM(PRIVATE_DIR) -DEFINE_DYN_CONFIG_PARAM(LOCALEDIR) diff --git a/source3/include/dynconfig.h b/source3/include/dynconfig.h deleted file mode 100644 index d0e42dc9f5..0000000000 --- a/source3/include/dynconfig.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - Unix SMB/CIFS implementation. - Copyright (C) 2001 by Martin Pool <mbp@samba.org> - Copyright (C) 2003 by Jim McDonough <jmcd@us.ibm.com> - - 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 3 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, see <http://www.gnu.org/licenses/>. -*/ - -/** - * @file dynconfig.h - * - * @brief Exported global configurations. - **/ - -const char *get_dyn_SBINDIR(void); -const char *set_dyn_SBINDIR(const char *newpath); -bool is_default_dyn_SBINDIR(void); - -const char *get_dyn_BINDIR(void); -const char *set_dyn_BINDIR(const char *newpath); -bool is_default_dyn_BINDIR(void); - -const char *get_dyn_SWATDIR(void); -const char *set_dyn_SWATDIR(const char *newpath); -bool is_default_dyn_SWATDIR(void); - -const char *get_dyn_CONFIGFILE(void); -const char *set_dyn_CONFIGFILE(const char *newpath); -bool is_default_dyn_CONFIGFILE(void); - -const char *get_dyn_LOGFILEBASE(void); -const char *set_dyn_LOGFILEBASE(const char *newpath); -bool is_default_dyn_LOGFILEBASE(void); - -const char *get_dyn_LMHOSTSFILE(void); -const char *set_dyn_LMHOSTSFILE(const char *newpath); -bool is_default_dyn_LMHOSTSFILE(void); - -const char *get_dyn_CODEPAGEDIR(void); -const char *set_dyn_CODEPAGEDIR(const char *newpath); -bool is_default_dyn_CODEPAGEDIR(void); - -const char *get_dyn_LIBDIR(void); -const char *set_dyn_LIBDIR(const char *newpath); -bool is_default_dyn_LIBDIR(void); - -const char *get_dyn_MODULESDIR(void); -const char *set_dyn_MODULESDIR(const char *newpath); -bool is_default_dyn_MODULESDIR(void); - -const char *get_dyn_SHLIBEXT(void); -const char *set_dyn_SHLIBEXT(const char *newpath); -bool is_default_dyn_SHLIBEXT(void); - -const char *get_dyn_LOCKDIR(void); -const char *set_dyn_LOCKDIR(const char *newpath); -bool is_default_dyn_LOCKDIR(void); - -const char *get_dyn_STATEDIR(void); -const char *set_dyn_STATEDIR(const char *newpath); -bool is_default_dyn_STATEDIR(void); - -const char *get_dyn_CACHEDIR(void); -const char *set_dyn_CACHEDIR(const char *newpath); -bool is_default_dyn_CACHEDIR(void); - -const char *get_dyn_PIDDIR(void); -const char *set_dyn_PIDDIR(const char *newpath); -bool is_default_dyn_PIDDIR(void); - -const char *get_dyn_NMBDSOCKETDIR(void); -const char *set_dyn_NMBDSOCKETDIR(const char *newpath); -bool is_default_dyn_NMBDSOCKETDIR(void); - -const char *get_dyn_NCALRPCDIR(void); -const char *set_dyn_NCALRPCDIR(const char *newpath); -bool is_default_dyn_NCALRPCDIR(void); - -const char *get_dyn_SMB_PASSWD_FILE(void); -const char *set_dyn_SMB_PASSWD_FILE(const char *newpath); -bool is_default_dyn_SMB_PASSWD_FILE(void); - -const char *get_dyn_PRIVATE_DIR(void); -const char *set_dyn_PRIVATE_DIR(const char *newpath); -bool is_default_dyn_PRIVATE_DIR(void); - -const char *get_dyn_LOCALEDIR(void); -const char *set_dyn_LOCALEDIR(const char *newpath); -bool is_default_dyn_LOCALEDIR(void); diff --git a/source3/include/includes.h b/source3/include/includes.h index 8f220dfaec..014d1d44bd 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -532,7 +532,7 @@ typedef char fstring[FSTRING_LEN]; #include "libads/ads_status.h" #include "../libcli/util/error.h" #include "../lib/util/charset/charset.h" -#include "dynconfig.h" +#include "dynconfig/dynconfig.h" #include "locking.h" #include "smb_perfcount.h" #include "smb.h" diff --git a/source3/script/mkbuildoptions-waf.awk b/source3/script/mkbuildoptions-waf.awk index ddb3f6527a..2d7063a79e 100644 --- a/source3/script/mkbuildoptions-waf.awk +++ b/source3/script/mkbuildoptions-waf.awk @@ -21,7 +21,7 @@ BEGIN { print ""; print "#include \"includes.h\""; print "#include \"build_env.h\""; - print "#include \"dynconfig.h\""; + print "#include \"dynconfig/dynconfig.h\""; print ""; print "static int output(bool screen, const char *format, ...) PRINTF_ATTRIBUTE(2,3);"; print "void build_options(bool screen);"; diff --git a/source3/script/mkbuildoptions.awk b/source3/script/mkbuildoptions.awk index 1955a80b46..3cd0dace21 100644 --- a/source3/script/mkbuildoptions.awk +++ b/source3/script/mkbuildoptions.awk @@ -21,7 +21,7 @@ BEGIN { print ""; print "#include \"includes.h\""; print "#include \"build_env.h\""; - print "#include \"dynconfig.h\""; + print "#include \"dynconfig/dynconfig.h\""; print ""; print "static int output(bool screen, const char *format, ...) PRINTF_ATTRIBUTE(2,3);"; print "void build_options(bool screen);"; diff --git a/source3/web/startstop.c b/source3/web/startstop.c index 81350e62f5..e23acf8931 100644 --- a/source3/web/startstop.c +++ b/source3/web/startstop.c @@ -19,7 +19,7 @@ #include "includes.h" #include "web/swat_proto.h" -#include "dynconfig.h" +#include "dynconfig/dynconfig.h" /** Startup smbd from web interface. */ |