[SCM] Samba Shared Repository - branch master updated
Andrew Bartlett
abartlet at samba.org
Wed Jun 29 00:58:02 MDT 2011
The branch, master has been updated
via 8b04345 s4-param Handle BOOLREV parameters
via 489f528 param: Merge param headers into lib/param/loadparm.h
via ff13827 s3-param use C99 boolean for false
via f8c0a89 s3-param use C99 boolean for true
via 9adc0e9 s3-param Convert sDefault to C99 initialisers
via 3b0b0d3 s4-param Match source3's param: use C99 initialisers
via 7384a2b s4-param Merge struct parm_struct with version from source3/
via 658f55b s3-param Remove unused FLAG_DOS_STRING
via 7198d54 param: Merge struct parm_struct definitions
from 21756b7 s3-param Use .offset rather than .ptr when defining parameters
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 8b04345a0edc0131f6d8449b672278b31bd4b734
Author: Andrew Bartlett <abartlet at samba.org>
Date: Wed Jun 29 15:37:27 2011 +1000
s4-param Handle BOOLREV parameters
Autobuild-User: Andrew Bartlett <abartlet at samba.org>
Autobuild-Date: Wed Jun 29 08:57:27 CEST 2011 on sn-devel-104
commit 489f528857bfb4993cf44dd7a5391ac5196c0747
Author: Andrew Bartlett <abartlet at samba.org>
Date: Wed Jun 29 15:33:54 2011 +1000
param: Merge param headers into lib/param/loadparm.h
This defines a common table format, so we can in future define a
common table.
Andrew Bartlett
commit ff1382753736c08156bd4308b1cc742cb6dc87b9
Author: Andrew Bartlett <abartlet at samba.org>
Date: Wed Jun 29 15:06:49 2011 +1000
s3-param use C99 boolean for false
commit f8c0a89939a00239f52ffd1968459e4e900c3318
Author: Andrew Bartlett <abartlet at samba.org>
Date: Wed Jun 29 15:05:37 2011 +1000
s3-param use C99 boolean for true
commit 9adc0e9ed8f9d0ef6ca7cbd8613edb32c27ab8e1
Author: Andrew Bartlett <abartlet at samba.org>
Date: Wed Jun 29 15:03:24 2011 +1000
s3-param Convert sDefault to C99 initialisers
The conversion has been verified with gdb (p sDefaults before and after)
C99 booleans were helpfully provided by gdb, which was used to generate
the C99 format, and so have been kept.
Andrew Bartlett
commit 3b0b0d3c51f5aafbbcee8d02d996741e3d6fb9b8
Author: Andrew Bartlett <abartlet at samba.org>
Date: Wed Jun 29 14:15:52 2011 +1000
s4-param Match source3's param: use C99 initialisers
This makes it much easier to compare the parameter sets.
Andrew Bartlett
commit 7384a2b0b7c373b97b44705b994d0eb040300d5a
Author: Andrew Bartlett <abartlet at samba.org>
Date: Wed Jun 29 14:15:32 2011 +1000
s4-param Merge struct parm_struct with version from source3/
commit 658f55bbb73a199fa51fc945216660be76fffc1b
Author: Andrew Bartlett <abartlet at samba.org>
Date: Wed Jun 29 13:22:26 2011 +1000
s3-param Remove unused FLAG_DOS_STRING
commit 7198d540e8abc31f831e9c13a031b905604176c6
Author: Andrew Bartlett <abartlet at samba.org>
Date: Wed Jun 29 13:18:57 2011 +1000
param: Merge struct parm_struct definitions
This will allow the parameter tables to be shared between source3 and
source4.
Andrew Bartlett
-----------------------------------------------------------------------
Summary of changes:
{source4 => lib}/param/loadparm.h | 52 +-
source3/include/local.h | 29 -
source3/include/proto.h | 3 +
source3/include/smb.h | 49 --
source3/modules/nfs4_acls.c | 1 +
source3/modules/vfs_audit.c | 1 +
source3/modules/vfs_extd_audit.c | 1 +
source3/modules/vfs_full_audit.c | 1 +
source3/param/loadparm.c | 769 +++++++++++-----------
source3/param/service.c | 1 +
source3/printing/load.c | 1 +
source3/printing/printing.c | 1 +
source3/smbd/msdfs.c | 1 +
source3/smbd/server_reload.c | 1 +
source3/smbd/service.c | 1 +
source3/smbd/smb2_tcon.c | 1 +
source3/utils/net_conf.c | 1 +
source3/utils/testparm.c | 1 +
source3/web/swat.c | 1 +
source4/param/loadparm.c | 1305 ++++++++++++++++++++++++++++++++-----
source4/param/pyparam.c | 2 +-
21 files changed, 1564 insertions(+), 659 deletions(-)
rename {source4 => lib}/param/loadparm.h (60%)
Changeset truncated at 500 lines:
diff --git a/source4/param/loadparm.h b/lib/param/loadparm.h
similarity index 60%
rename from source4/param/loadparm.h
rename to lib/param/loadparm.h
index 7a76321..2627727 100644
--- a/source4/param/loadparm.h
+++ b/lib/param/loadparm.h
@@ -1,6 +1,6 @@
-/*
+/*
Unix SMB/CIFS implementation.
-
+
type definitions for loadparm
Copyright (C) Karl Auer 1993-1998
@@ -12,28 +12,30 @@
Copyright (C) Stefan (metze) Metzmacher 2002
Copyright (C) Jim McDonough (jmcd at us.ibm.com) 2003.
Copyright (C) James Myers 2003 <myersjj at 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/>.
*/
/* the following are used by loadparm for option lists */
+/* the following are used by loadparm for option lists */
typedef enum {
- P_BOOL,P_INTEGER,P_OCTAL,P_BYTES,P_LIST,P_CMDLIST,P_STRING,P_USTRING,P_ENUM
+ P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL,P_LIST,
+ P_STRING,P_USTRING,P_ENUM,P_BYTES,P_CMDLIST,P_SEP
} parm_type;
typedef enum {
- P_LOCAL,P_GLOBAL,P_NONE
+ P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE
} parm_class;
struct enum_list {
@@ -41,31 +43,49 @@ struct enum_list {
const char *name;
};
+struct loadparm_service;
struct loadparm_context;
struct parm_struct {
const char *label;
parm_type type;
- parm_class pclass;
- int offset;
- bool (*special)(struct loadparm_context *, const char *, char **);
+ parm_class p_class;
+ offset_t offset;
+ bool (*special)(struct loadparm_context *lpcfg_ctx,
+ int snum, const char *, char **);
const struct enum_list *enum_list;
+ unsigned flags;
union {
- int bvalue;
+ bool bvalue;
int ivalue;
char *svalue;
char cvalue;
- const char **lvalue;
+ char **lvalue;
} def;
};
-#define FLAG_DEFAULT 0x0001 /* this option was a default */
-#define FLAG_CMDLINE 0x0002 /* this option was set from the command line */
-
+/* The following flags are used in SWAT */
+#define FLAG_BASIC 0x0001 /* Display only in BASIC view */
+#define FLAG_SHARE 0x0002 /* file sharing options */
+#define FLAG_PRINT 0x0004 /* printing options */
+#define FLAG_GLOBAL 0x0008 /* local options that should be globally settable in SWAT */
+#define FLAG_WIZARD 0x0010 /* Parameters that the wizard will operate on */
+#define FLAG_ADVANCED 0x0020 /* Parameters that will be visible in advanced view */
+#define FLAG_DEVELOPER 0x0040 /* No longer used */
+#define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */
+#define FLAG_HIDE 0x2000 /* options that should be hidden in SWAT */
+#define FLAG_META 0x8000 /* A meta directive - not a real parameter */
+#define FLAG_CMDLINE 0x10000 /* option has been overridden */
+#define FLAG_DEFAULT 0x20000 /* this option was a default */
+
+/* This defines the section name in the configuration file that will
+ refer to the special "printers" service */
#ifndef PRINTERS_NAME
#define PRINTERS_NAME "printers"
#endif
+/* This defines the section name in the configuration file that will
+ refer to the special "homes" service */
#ifndef HOMES_NAME
#define HOMES_NAME "homes"
#endif
@@ -95,5 +115,3 @@ struct parm_struct {
#ifndef PRINT_MAX_JOBID
#define PRINT_MAX_JOBID 10000
#endif
-
-
diff --git a/source3/include/local.h b/source3/include/local.h
index 680631c..594f700 100644
--- a/source3/include/local.h
+++ b/source3/include/local.h
@@ -5,26 +5,6 @@
#ifndef _LOCAL_H
#define _LOCAL_H
-/* The default workgroup - usually overridden in smb.conf */
-#ifndef WORKGROUP
-#define WORKGROUP "WORKGROUP"
-#endif
-
-/* This defines the section name in the configuration file that will contain */
-/* global parameters - that is, parameters relating to the whole server, not */
-/* just services. This name is then reserved, and may not be used as a */
-/* a service name. It will default to "global" if not defined here. */
-#define GLOBAL_NAME "global"
-#define GLOBAL_NAME2 "globals"
-
-/* This defines the section name in the configuration file that will
- refer to the special "homes" service */
-#define HOMES_NAME "homes"
-
-/* This defines the section name in the configuration file that will
- refer to the special "printers" service */
-#define PRINTERS_NAME "printers"
-
/* Yves Gaige <yvesg at hptnodur.grenoble.hp.com> requested this set this */
/* to a maximum of 8 if old smb clients break because of long printer names. */
#define MAXPRINTERLEN 15
@@ -171,12 +151,6 @@
it are worked out */
#define USE_READ_PREDICTION 0
-/*
- * Default passwd chat script.
- */
-
-#define DEFAULT_PASSWD_CHAT "*new*password* %n\\n *new*password* %n\\n *changed*"
-
/* Minimum length of allowed password when changing UNIX password. */
#define MINPASSWDLENGTH 5
@@ -212,9 +186,6 @@
/* this enables the "rabbit pellet" fix for SMBwritebraw */
#define RABBIT_PELLET_FIX 1
-/* Max number of jobs per print queue. */
-#define PRINT_MAX_JOBID 10000
-
/* Max number of open RPC pipes. */
#define MAX_OPEN_PIPES 2048
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 20b5c0e..73bd9ba 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1545,6 +1545,7 @@ const char **lp_parm_string_list(int snum, const char *type, const char *option,
int lp_parm_int(int snum, const char *type, const char *option, int def);
unsigned long lp_parm_ulong(int snum, const char *type, const char *option, unsigned long def);
bool lp_parm_bool(int snum, const char *type, const char *option, bool def);
+struct enum_list;
int lp_parm_enum(int snum, const char *type, const char *option,
const struct enum_list *_enum, int def);
char *canonicalize_servicename(TALLOC_CTX *ctx, const char *src);
@@ -1577,6 +1578,8 @@ const char *lp_ldap_machine_suffix(void);
const char *lp_ldap_user_suffix(void);
const char *lp_ldap_group_suffix(void);
const char *lp_ldap_idmap_suffix(void);
+struct loadparm_service;
+struct parm_struct;
void *lp_parm_ptr(struct loadparm_service *service, struct parm_struct *parm);
void *lp_local_ptr_by_snum(int snum, struct parm_struct *parm);
bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 25e3bac..c867d60 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -709,55 +709,6 @@ struct connections_data {
uint32 unused_compatitibility_field;
};
-
-/* the following are used by loadparm for option lists */
-typedef enum {
- P_BOOL,P_BOOLREV,P_CHAR,P_INTEGER,P_OCTAL,P_LIST,
- P_STRING,P_USTRING,P_ENUM,P_SEP
-} parm_type;
-
-typedef enum {
- P_LOCAL,P_GLOBAL,P_SEPARATOR,P_NONE
-} parm_class;
-
-struct enum_list {
- int value;
- const char *name;
-};
-
-struct loadparm_service;
-
-struct parm_struct {
- const char *label;
- parm_type type;
- parm_class p_class;
- offset_t offset;
- bool (*special)(int snum, const char *, char **);
- const struct enum_list *enum_list;
- unsigned flags;
- union {
- bool bvalue;
- int ivalue;
- char *svalue;
- char cvalue;
- char **lvalue;
- } def;
-};
-
-/* The following flags are used in SWAT */
-#define FLAG_BASIC 0x0001 /* Display only in BASIC view */
-#define FLAG_SHARE 0x0002 /* file sharing options */
-#define FLAG_PRINT 0x0004 /* printing options */
-#define FLAG_GLOBAL 0x0008 /* local options that should be globally settable in SWAT */
-#define FLAG_WIZARD 0x0010 /* Parameters that the wizard will operate on */
-#define FLAG_ADVANCED 0x0020 /* Parameters that will be visible in advanced view */
-#define FLAG_DEVELOPER 0x0040 /* No longer used */
-#define FLAG_DEPRECATED 0x1000 /* options that should no longer be used */
-#define FLAG_HIDE 0x2000 /* options that should be hidden in SWAT */
-#define FLAG_DOS_STRING 0x4000 /* convert from UNIX to DOS codepage when reading this string. */
-#define FLAG_META 0x8000 /* A meta directive - not a real parameter */
-#define FLAG_CMDLINE 0x10000 /* option has been overridden */
-
struct bitmap {
uint32 *b;
unsigned int n;
diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index dbfa36e..09ef522 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -27,6 +27,7 @@
#include "system/filesys.h"
#include "passdb/lookup_sid.h"
#include "util_tdb.h"
+#include "lib/param/loadparm.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_ACLS
diff --git a/source3/modules/vfs_audit.c b/source3/modules/vfs_audit.c
index 8213baf..eeeea8a 100644
--- a/source3/modules/vfs_audit.c
+++ b/source3/modules/vfs_audit.c
@@ -25,6 +25,7 @@
#include "system/filesys.h"
#include "system/syslog.h"
#include "smbd/smbd.h"
+#include "lib/param/loadparm.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS
diff --git a/source3/modules/vfs_extd_audit.c b/source3/modules/vfs_extd_audit.c
index 192b075..fa8e9b1 100644
--- a/source3/modules/vfs_extd_audit.c
+++ b/source3/modules/vfs_extd_audit.c
@@ -26,6 +26,7 @@
#include "system/filesys.h"
#include "system/syslog.h"
#include "smbd/smbd.h"
+#include "lib/param/loadparm.h"
static int vfs_extd_audit_debug_level = DBGC_VFS;
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index e8129f4..362749a 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -64,6 +64,7 @@
#include "../librpc/gen_ndr/ndr_netlogon.h"
#include "auth.h"
#include "ntioctl.h"
+#include "lib/param/loadparm.h"
static int vfs_full_audit_debug_level = DBGC_VFS;
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 430c2de..808774d 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -59,6 +59,7 @@
#include "printing.h"
#include "lib/smbconf/smbconf.h"
#include "lib/smbconf/smbconf_init.h"
+#include "lib/param/loadparm.h"
#include "ads.h"
#include "../librpc/gen_ndr/svcctl.h"
@@ -75,7 +76,7 @@
#include <cups/http.h>
#endif
-bool bLoaded = False;
+bool bLoaded = false;
extern userdom_struct current_user_info;
@@ -99,7 +100,7 @@ extern userdom_struct current_user_info;
#define INCLUDE_REGISTRY_NAME "registry"
#endif
-static bool in_client = False; /* Not in the client by default */
+static bool in_client = false; /* Not in the client by default */
static struct smbconf_csn conf_last_csn;
#define CONFIG_BACKEND_FILE 0
@@ -114,7 +115,7 @@ static int config_backend = CONFIG_BACKEND_FILE;
#define USERSHARE_VALID 1
#define USERSHARE_PENDING_DELETE 2
-static bool defaults_saved = False;
+static bool defaults_saved = false;
struct param_opt_struct {
struct param_opt_struct *prev, *next;
@@ -537,151 +538,151 @@ struct loadparm_service {
/* This is a default service used to prime a services structure */
-static struct loadparm_service sDefault = {
- True, /* valid */
- False, /* not autoloaded */
- 0, /* not a usershare */
- {0, }, /* No last mod time */
- NULL, /* szService */
- NULL, /* szPath */
- NULL, /* szUsername */
- NULL, /* szInvalidUsers */
- NULL, /* szValidUsers */
- NULL, /* szAdminUsers */
- NULL, /* szCopy */
- NULL, /* szInclude */
- NULL, /* szPreExec */
- NULL, /* szPostExec */
- NULL, /* szRootPreExec */
- NULL, /* szRootPostExec */
- NULL, /* szCupsOptions */
- NULL, /* szPrintcommand */
- NULL, /* szLpqcommand */
- NULL, /* szLprmcommand */
- NULL, /* szLppausecommand */
- NULL, /* szLpresumecommand */
- NULL, /* szQueuepausecommand */
- NULL, /* szQueueresumecommand */
- NULL, /* szPrintername */
- NULL, /* szPrintjobUsername */
- NULL, /* szDontdescend */
- NULL, /* szHostsallow */
- NULL, /* szHostsdeny */
- NULL, /* szMagicScript */
- NULL, /* szMagicOutput */
- NULL, /* szVetoFiles */
- NULL, /* szHideFiles */
- NULL, /* szVetoOplockFiles */
- NULL, /* comment */
- NULL, /* force user */
- NULL, /* force group */
- NULL, /* readlist */
- NULL, /* writelist */
- NULL, /* printer admin */
- NULL, /* volume */
- NULL, /* fstype */
- NULL, /* vfs objects */
- NULL, /* szMSDfsProxy */
- NULL, /* szAioWriteBehind */
- NULL, /* szDfree */
- 0, /* iMinPrintSpace */
- 1000, /* iMaxPrintJobs */
- 0, /* iMaxReportedPrintJobs */
- 0, /* iWriteCacheSize */
- 0744, /* iCreate_mask */
- 0000, /* iCreate_force_mode */
- 0777, /* iSecurity_mask */
- 0, /* iSecurity_force_mode */
- 0755, /* iDir_mask */
- 0000, /* iDir_force_mode */
- 0777, /* iDir_Security_mask */
- 0, /* iDir_Security_force_mode */
- 0, /* iMaxConnections */
- CASE_LOWER, /* iDefaultCase */
- DEFAULT_PRINTING, /* iPrinting */
- 2, /* iOplockContentionLimit */
- 0, /* iCSCPolicy */
- 1024, /* iBlock_size */
- 0, /* iDfreeCacheTime */
- False, /* bPreexecClose */
- False, /* bRootpreexecClose */
- Auto, /* case sensitive */
- True, /* case preserve */
- True, /* short case preserve */
- True, /* bHideDotFiles */
- False, /* bHideSpecialFiles */
- False, /* bHideUnReadable */
- False, /* bHideUnWriteableFiles */
- True, /* bBrowseable */
- False, /* bAccessBasedShareEnum */
- True, /* bAvailable */
- True, /* bRead_only */
- True, /* bNo_set_dir */
- False, /* bGuest_only */
- False, /* bAdministrative_share */
- False, /* bGuest_ok */
- False, /* bPrint_ok */
- True, /* bPrintNotifyBackchannel */
- False, /* bMap_system */
- False, /* bMap_hidden */
- True, /* bMap_archive */
- False, /* bStoreDosAttributes */
- False, /* bDmapiSupport */
- True, /* bLocking */
- Auto, /* iStrictLocking */
- True, /* bPosixLocking */
- True, /* bShareModes */
- True, /* bOpLocks */
- True, /* bLevel2OpLocks */
- False, /* bOnlyUser */
- True, /* bMangledNames */
- false, /* bWidelinks */
- True, /* bSymlinks */
- False, /* bSyncAlways */
- False, /* bStrictAllocate */
- False, /* bStrictSync */
- '~', /* magic char */
- NULL, /* copymap */
- False, /* bDeleteReadonly */
- False, /* bFakeOplocks */
- False, /* bDeleteVetoFiles */
- False, /* bDosFilemode */
- True, /* bDosFiletimes */
- False, /* bDosFiletimeResolution */
- False, /* bFakeDirCreateTimes */
- True, /* bBlockingLocks */
- False, /* bInheritPerms */
- False, /* bInheritACLS */
- False, /* bInheritOwner */
- False, /* bMSDfsRoot */
- False, /* bUseClientDriver */
- True, /* bDefaultDevmode */
- False, /* bForcePrintername */
- True, /* bNTAclSupport */
- False, /* bForceUnknownAclUser */
- False, /* bUseSendfile */
- False, /* bProfileAcls */
- False, /* bMap_acl_inherit */
- False, /* bAfs_Share */
- False, /* bEASupport */
- True, /* bAclCheckPermissions */
- True, /* bAclMapFullControl */
- False, /* bAclGroupControl */
- True, /* bChangeNotify */
- True, /* bKernelChangeNotify */
- SMB_ROUNDUP_ALLOCATION_SIZE, /* iallocation_roundup_size */
- 0, /* iAioReadSize */
- 0, /* iAioWriteSize */
- MAP_READONLY_YES, /* iMap_readonly */
+static struct loadparm_service sDefault =
+{
+ .valid = true,
+ .autoloaded = false,
+ .usershare = 0,
+ .usershare_last_mod = {0, 0},
+ .szService = NULL,
+ .szPath = NULL,
+ .szUsername = NULL,
+ .szInvalidUsers = NULL,
+ .szValidUsers = NULL,
+ .szAdminUsers = NULL,
+ .szCopy = NULL,
+ .szInclude = NULL,
+ .szPreExec = NULL,
+ .szPostExec = NULL,
+ .szRootPreExec = NULL,
+ .szRootPostExec = NULL,
+ .szCupsOptions = NULL,
+ .szPrintcommand = NULL,
+ .szLpqcommand = NULL,
+ .szLprmcommand = NULL,
--
Samba Shared Repository
More information about the samba-cvs
mailing list