The branch, master has been updated
       via  7e52436 s4-param Remove unused 'announce version'
       via  2240ac9 s3-param Remove #defines already in common loadparm.h
       via  4f3a155 s3-param Generate parameter tables
       via  d4ef70a param: Finish conversion from lp_wins_support() -> 
lp_we_are_a_wins_server()
       via  6d8cc41 s3-param remove unused bIdmapReadOnly
       via  b459a6d s3-param Remove unused bUpdateEncrypt
      from  bafd721 s3-net: use printing_migrate library, and eliminate 
duplicate code.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 7e52436673402095811eb081a0c036427fd31f84
Author: Andrew Bartlett <[email protected]>
Date:   Fri Jul 1 16:02:54 2011 +1000

    s4-param Remove unused 'announce version'
    
    Autobuild-User: Andrew Bartlett <[email protected]>
    Autobuild-Date: Sat Jul  2 05:42:37 CEST 2011 on sn-devel-104

commit 2240ac96c1dc328e8a57342a7cdc7766b972e2bc
Author: Andrew Bartlett <[email protected]>
Date:   Fri Jul 1 16:01:28 2011 +1000

    s3-param Remove #defines already in common loadparm.h

commit 4f3a155fb5e348abb76c5608dc7c765ef61a7781
Author: Andrew Bartlett <[email protected]>
Date:   Fri Jul 1 14:36:25 2011 +1000

    s3-param Generate parameter tables

commit d4ef70a7645fb2fb21c565566c20619ff5d1a7ec
Author: Andrew Bartlett <[email protected]>
Date:   Fri Jul 1 15:14:08 2011 +1000

    param: Finish conversion from lp_wins_support() -> lp_we_are_a_wins_server()
    
    Jermey started this in 1997 with 0aa493cc0303aa4177f289b9e4c797c8fa180672
    
    (avoiding the duplicate function makes it easier to generate the
    struct loadparm_globals).
    
    Andrew Bartlett

commit 6d8cc418ba9276c7aba0f5d07b420b2a79916d05
Author: Andrew Bartlett <[email protected]>
Date:   Fri Jul 1 14:37:16 2011 +1000

    s3-param remove unused bIdmapReadOnly

commit b459a6d7c605c77f5dc50b25c99f4cbca81652de
Author: Andrew Bartlett <[email protected]>
Date:   Fri Jul 1 14:19:05 2011 +1000

    s3-param Remove unused bUpdateEncrypt

-----------------------------------------------------------------------

Summary of changes:
 .gitignore                                |    2 +
 {source4/script => script}/mkparamdefs.pl |   66 +++--
 source3/Makefile.in                       |    8 +-
 source3/include/proto.h                   |    1 -
 source3/lib/wins_srv.c                    |    8 +-
 source3/nmbd/nmbd_namelistdb.c            |    2 +-
 source3/param/loadparm.c                  |  463 +++--------------------------
 source3/rpc_server/svcctl/srv_svcctl_nt.c |    2 +-
 source3/services/svc_wins.c               |    2 +-
 source3/utils/testparm.c                  |    2 +-
 source3/web/swat.c                        |    4 +-
 source3/wscript_build                     |   12 +-
 source4/nbt_server/query.c                |    2 +-
 source4/nbt_server/wins/winsserver.c      |    2 +-
 source4/param/loadparm.c                  |   14 +-
 source4/param/wscript_build               |    4 +-
 source4/wrepl_server/wrepl_server.c       |    2 +-
 17 files changed, 114 insertions(+), 482 deletions(-)
 rename {source4/script => script}/mkparamdefs.pl (81%)


Changeset truncated at 500 lines:

diff --git a/.gitignore b/.gitignore
index 383bb1e..4bf1bae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -90,6 +90,8 @@ source3/script/installbin.sh
 source3/script/uninstallbin.sh
 source3/smbadduser
 source3/smbd/build_options.c
+source3/param/param_global.h
+source3/param/param_local.h
 source3/setup
 pidl/blib
 pidl/cover_db
diff --git a/source4/script/mkparamdefs.pl b/script/mkparamdefs.pl
similarity index 81%
rename from source4/script/mkparamdefs.pl
rename to script/mkparamdefs.pl
index 9b255a8..d978420 100644
--- a/source4/script/mkparamdefs.pl
+++ b/script/mkparamdefs.pl
@@ -99,7 +99,7 @@ $file->("/* This file was automatically generated by 
mkparmdefs.pl. DO NOT EDIT
 $file->("{\n");
 }
 
-sub print_footer($$$) 
+sub print_footer($$$)
 {
        my ($file, $header_name, $generate_scope) = @_;
        $file->("LOADPARM_EXTRA_" . $generate_scope . "S\n");
@@ -107,32 +107,43 @@ sub print_footer($$$)
        $file->("\n#endif /* $header_name */\n\n");
 }
 
-sub handle_loadparm($$$) 
+sub handle_loadparm($$$)
 {
        my ($file,$line,$generate_scope) = @_;
 
+       my $scope;
+       my $type;
+       my $name;
+       my $var;
+
        if ($line =~ 
/^FN_(GLOBAL|LOCAL)_(CONST_STRING|STRING|BOOL|bool|CHAR|INTEGER|LIST)\((\w+),(.*)\)/o)
 {
-               my $scope = $1;
-               my $type = $2;
-               my $name = $3;
-               my $var = $4;
-
-               my %tmap = (
-                           "BOOL" => "int ",
-                           "CONST_STRING" => "char *",
-                           "STRING" => "char *",
-                           "INTEGER" => "int ",
-                           "CHAR" => "char ",
-                           "LIST" => "const char **",
-                           );
-
-               if ($scope eq $generate_scope) {
-                   $file->("\t$tmap{$type} $var;\n");
-               }
+               $scope = $1;
+               $type = $2;
+               $name = $3;
+               $var = $4;
+       } elsif ($line =~ 
/^FN_(GLOBAL|LOCAL)_PARM_(CONST_STRING|STRING|BOOL|bool|CHAR|INTEGER|LIST)\((\w+),(.*)\)/o)
 {
+               $scope = $1;
+               $type = $2;
+               $name = $3;
+               $var = $4;
+       } else {
+               return;
+       }
+       my %tmap = (
+           "BOOL" => "int ",
+           "CONST_STRING" => "char *",
+           "STRING" => "char *",
+           "INTEGER" => "int ",
+           "CHAR" => "char ",
+           "LIST" => "const char **",
+           );
+
+       if ($scope eq $generate_scope) {
+           $file->("\t$tmap{$type} $var;\n");
        }
 }
 
-sub process_file($$) 
+sub process_file($$)
 {
        my ($file, $filename) = @_;
 
@@ -146,8 +157,8 @@ sub process_file($$)
 
        my $comment = undef;
        my $incomment = 0;
-       while (my $line = <FH>) {             
-               if ($line =~ /^\/\*\*/) { 
+       while (my $line = <FH>) {
+               if ($line =~ /^\/\*\*/) {
                        $comment = "";
                        $incomment = 1;
                }
@@ -157,16 +168,18 @@ sub process_file($$)
                        if ($line =~ /\*\//) {
                                $incomment = 0;
                        }
-               } 
+               }
 
                # these are ordered for maximum speed
                next if ($line =~ /^\s/);
-             
+
                next unless ($line =~ /\(/);
 
                next if ($line =~ /^\/|[;]/);
 
-               if ($line =~ /^FN_/) {
+               if ($line =~ /^static (FN_.*)/) {
+                       handle_loadparm($file, $1, $generate_scope);
+               } elsif ($line =~ /^FN_/) {
                        handle_loadparm($file, $line, $generate_scope);
                }
                next;
@@ -186,7 +199,6 @@ if (not defined($file)) {
 }
 
 mkpath(dirname($file), 0, 0755);
-open(PUBLIC, ">$file") or die("Can't open `$file': $!"); 
+open(PUBLIC, ">$file") or die("Can't open `$file': $!");
 print PUBLIC "$$public_data";
 close(PUBLIC);
-
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 4839ab6..aaea79d 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1552,7 +1552,7 @@ all:: SHOWFLAGS basics libs $(SBIN_PROGS) $(BIN_PROGS) \
        $(MODULES) $(NSS_MODULES) $(PAM_MODULES) \
        $(EXTRA_ALL_TARGETS)
 
-basics:: samba3-idl
+basics:: samba3-idl mkparam
 
 nss_modules:: $(NSS_MODULES)
 
@@ -1629,6 +1629,10 @@ idl_full::
        @PIDL_OUTPUTDIR="librpc/gen_ndr" PIDL_ARGS="$(PIDL_ARGS)" CPP="$(CPP)" 
PIDL="../pidl/pidl" \
         srcdir="$(srcdir)" $(srcdir)/script/build_idl.sh --full $(IDL_FILES)
 
+mkparam:
+        $(PERL) ../script/mkparamdefs.pl $(srcdir)/param/loadparm.c --file 
param/param_local.h --generate-scope=LOCAL
+        $(PERL) ../script/mkparamdefs.pl $(srcdir)/param/loadparm.c --file 
param/param_global.h --generate-scope=GLOBAL
+
 #####################################################################
 
 
@@ -3377,6 +3381,8 @@ cleanlibs::
 clean:: cleanlibs
        -rm -f include/build_env.h
        -rm -f smbd/build_options.c
+       -rm -f param/param_local.h
+       -rm -f param/param_global.h
        -rm -f $(PRECOMPILED_HEADER)
        -rm -f core */*~ *~ \
                */*.o */*/*.o */*/*/*.o */*/*/*/*.o \
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 73bd9ba..36ba416 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1294,7 +1294,6 @@ bool lp_reset_on_zero_vc(void);
 bool lp_log_writeable_files_on_exit(void);
 bool lp_ms_add_printer_wizard(void);
 bool lp_dns_proxy(void);
-bool lp_wins_support(void);
 bool lp_we_are_a_wins_server(void);
 bool lp_wins_proxy(void);
 bool lp_local_master(void);
diff --git a/source3/lib/wins_srv.c b/source3/lib/wins_srv.c
index f9e8f3b..fb5587f 100644
--- a/source3/lib/wins_srv.c
+++ b/source3/lib/wins_srv.c
@@ -153,7 +153,7 @@ unsigned wins_srv_count(void)
        const char **list;
        int count = 0;
 
-       if (lp_wins_support()) {
+       if (lp_we_are_a_wins_server()) {
                /* simple - just talk to ourselves */
                return 1;
        }
@@ -210,7 +210,7 @@ char **wins_srv_tags(void)
        int count=0, i, j;
        const char **list;
 
-       if (lp_wins_support()) {
+       if (lp_we_are_a_wins_server()) {
                /* give the caller something to chew on. This makes
                   the rest of the logic simpler (ie. less special cases) */
                ret = SMB_MALLOC_ARRAY(char *, 2);
@@ -283,7 +283,7 @@ struct in_addr wins_srv_ip_tag(const char *tag, struct 
in_addr src_ip)
        struct tagged_ip t_ip;
 
        /* if we are a wins server then we always just talk to ourselves */
-       if (lp_wins_support()) {
+       if (lp_we_are_a_wins_server()) {
                struct in_addr loopback_ip;
                loopback_ip.s_addr = htonl(INADDR_LOOPBACK);
                return loopback_ip;
@@ -381,7 +381,7 @@ unsigned wins_srv_count_tag(const char *tag)
        int i, count=0;
 
        /* if we are a wins server then we always just talk to ourselves */
-       if (lp_wins_support()) {
+       if (lp_we_are_a_wins_server()) {
                return 1;
        }
 
diff --git a/source3/nmbd/nmbd_namelistdb.c b/source3/nmbd/nmbd_namelistdb.c
index c6315f6..61c1d78 100644
--- a/source3/nmbd/nmbd_namelistdb.c
+++ b/source3/nmbd/nmbd_namelistdb.c
@@ -33,7 +33,7 @@ uint16 samba_nb_type = 0; /* samba's NetBIOS name type */
 
 void set_samba_nb_type(void)
 {
-       if( lp_wins_support() || wins_srv_count() ) {
+       if( lp_we_are_a_wins_server() || wins_srv_count() ) {
                samba_nb_type = NB_HFLAG;               /* samba is a 'hybrid' 
node type. */
        } else {
                samba_nb_type = NB_BFLAG;           /* samba is broadcast-only 
node type. */
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 808774d..8bbc629 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -80,18 +80,6 @@ bool bLoaded = false;
 
 extern userdom_struct current_user_info;
 
-#ifndef GLOBAL_NAME
-#define GLOBAL_NAME "global"
-#endif
-
-#ifndef PRINTERS_NAME
-#define PRINTERS_NAME "printers"
-#endif
-
-#ifndef HOMES_NAME
-#define HOMES_NAME "homes"
-#endif
-
 /* the special value for the include parameter
  * to be interpreted not as a file name but to
  * trigger loading of the global smb.conf options
@@ -125,417 +113,44 @@ struct param_opt_struct {
        unsigned flags;
 };
 
-/*
- * This structure describes global (ie., server-wide) parameters.
- */
-struct loadparm_global {
-       int ConfigBackend;
-       char *smb_ports;
-       char *dos_charset;
-       char *unix_charset;
-       char *szPrintcapname;
-       char *szAddPortCommand;
-       char *szEnumPortsCommand;
-       char *szAddPrinterCommand;
-       char *szDeletePrinterCommand;
-       char *szOs2DriverMap;
-       char *szLockDir;
-       char *szStateDir;
-       char *szCacheDir;
-       char *szPidDir;
-       char *szRootdir;
-       char *szDefaultService;
-       char *szGetQuota;
-       char *szSetQuota;
-       char *szMsgCommand;
-       char *szServerString;
-       char *szAutoServices;
-       char *szPasswdProgram;
-       char *szPasswdChat;
-       char *szLogFile;
-       char *szConfigFile;
-       char *szSMBPasswdFile;
-       char *szPrivateDir;
-       char *szPassdbBackend;
-       char **szPreloadModules;
-       char *szPasswordServer;
-       char *szSocketOptions;
-       char *szRealm;
-       char *szRealmUpper;
-       char *szDnsDomain;
-       char *szAfsUsernameMap;
-       int iAfsTokenLifetime;
-       char *szLogNtTokenCommand;
-       char *szUsernameMap;
-       char *szLogonScript;
-       char *szLogonPath;
-       char *szLogonDrive;
-       char *szLogonHome;
-       char **szWINSservers;
-       char **szInterfaces;
-       char *szRemoteAnnounce;
-       char *szRemoteBrowseSync;
-       char *szSocketAddress;
-       bool bNmbdBindExplicitBroadcast;
-       char *szNISHomeMapName;
-       char *szWorkgroup;
-       char *szNetbiosName;
-       char **szNetbiosAliases;
-       char *szNetbiosScope;
-       char *szNameResolveOrder;
-       char *szPanicAction;
-       char *szAddUserScript;
-       char *szRenameUserScript;
-       char *szDelUserScript;
-       char *szAddGroupScript;
-       char *szDelGroupScript;
-       char *szAddUserToGroupScript;
-       char *szDelUserFromGroupScript;
-       char *szSetPrimaryGroupScript;
-       char *szAddMachineScript;
-       char *szShutdownScript;
-       char *szAbortShutdownScript;
-       char *szUsernameMapScript;
-       int iUsernameMapCacheTime;
-       char *szCheckPasswordScript;
-       char *szWINSHook;
-       char *szUtmpDir;
-       char *szWtmpDir;
-       bool bUtmp;
-       char *szIdmapUID;
-       char *szIdmapGID;
-       bool bPassdbExpandExplicit;
-       int AlgorithmicRidBase;
-       char *szTemplateHomedir;
-       char *szTemplateShell;
-       char *szWinbindSeparator;
-       bool bWinbindEnumUsers;
-       bool bWinbindEnumGroups;
-       bool bWinbindUseDefaultDomain;
-       bool bWinbindTrustedDomainsOnly;
-       bool bWinbindNestedGroups;
-       int  winbind_expand_groups;
-       bool bWinbindRefreshTickets;
-       bool bWinbindOfflineLogon;
-       bool bWinbindNormalizeNames;
-       bool bWinbindRpcOnly;
-       bool bCreateKrb5Conf;
-       int winbindMaxDomainConnections;
-       char *szIdmapBackend;
-       bool bIdmapReadOnly;
-       char *szAddShareCommand;
-       char *szChangeShareCommand;
-       char *szDeleteShareCommand;
-       char **szEventLogs;
-       char *szGuestaccount;
-       char *szManglingMethod;
-       char **szServicesList;
-       char *szUsersharePath;
-       char *szUsershareTemplateShare;
-       char **szUsersharePrefixAllowList;
-       char **szUsersharePrefixDenyList;
-       int mangle_prefix;
-       int max_log_size;
-       char *szLogLevel;
-       int max_xmit;
-       int max_mux;
-       int max_open_files;
-       int open_files_db_hash_size;
-       int pwordlevel;
-       int unamelevel;
-       int deadtime;
-       bool getwd_cache;
-       int maxprotocol;
-       int minprotocol;
-       int security;
-       char **AuthMethods;
-       bool paranoid_server_security;
-       int maxdisksize;
-       int lpqcachetime;
-       int iMaxSmbdProcesses;
-       bool bDisableSpoolss;
-       int syslog;
-       int os_level;
-       bool enhanced_browsing;
-       int max_ttl;
-       int max_wins_ttl;
-       int min_wins_ttl;
-       int lm_announce;
-       int lm_interval;
-       int machine_password_timeout;
-       int map_to_guest;
-       int oplock_break_wait_time;
-       int winbind_cache_time;
-       int winbind_reconnect_delay;
-       int winbind_max_clients;
-       char **szWinbindNssInfo;
-       int iLockSpinTime;
-       char *szLdapMachineSuffix;
-       char *szLdapUserSuffix;
-       char *szLdapIdmapSuffix;
-       char *szLdapGroupSuffix;
-       int ldap_ssl;
-       bool ldap_ssl_ads;
-       int ldap_deref;
-       int ldap_follow_referral;
-       char *szLdapSuffix;
-       char *szLdapAdminDn;
-       int ldap_debug_level;
-       int ldap_debug_threshold;
-       int iAclCompat;
-       char *szCupsServer;
-       int CupsEncrypt;
-       char *szIPrintServer;
-       char *ctdbdSocket;
-       char **szClusterAddresses;
-       bool clustering;
-       int ctdb_timeout;
-       int ctdb_locktime_warn_threshold;
-       int ldap_passwd_sync;
-       int ldap_replication_sleep;
-       int ldap_timeout; /* This is initialised in init_globals */
-       int ldap_connection_timeout;
-       int ldap_page_size;
-       bool ldap_delete_dn;
-       bool bMsAddPrinterWizard;
-       bool bDNSproxy;
-       bool bWINSsupport;
-       bool bWINSproxy;
-       bool bLocalMaster;
-       int  iPreferredMaster;
-       int iDomainMaster;
-       bool bDomainLogons;
-       char **szInitLogonDelayedHosts;
-       int InitLogonDelay;
-       bool bEncryptPasswords;
-       bool bUpdateEncrypt;
-       int  clientSchannel;
-       int  serverSchannel;
-       bool bNullPasswords;
-       bool bObeyPamRestrictions;
-       bool bLoadPrinters;
-       int PrintcapCacheTime;
-       bool bLargeReadwrite;
-       bool bReadRaw;
-       bool bWriteRaw;
-       bool bSyslogOnly;
-       bool bBrowseList;
-       bool bNISHomeMap;
-       bool bTimeServer;
-       bool bBindInterfacesOnly;
-       bool bPamPasswordChange;
-       bool bUnixPasswdSync;
-       bool bPasswdChatDebug;
-       int iPasswdChatTimeout;
-       bool bTimestampLogs;
-       bool bNTSmbSupport;
-       bool bNTPipeSupport;
-       bool bNTStatusSupport;
-       bool bStatCache;
-       int iMaxStatCacheSize;
-       bool bKernelOplocks;
-       bool bAllowTrustedDomains;
-       bool bLanmanAuth;
-       bool bNTLMAuth;
-       bool bUseSpnego;
-       bool bClientLanManAuth;
-       bool bClientNTLMv2Auth;
-       bool bClientPlaintextAuth;
-       bool bClientUseSpnego;
-       bool client_use_spnego_principal;
-       bool send_spnego_principal;
-       bool bDebugPrefixTimestamp;
-       bool bDebugHiresTimestamp;
-       bool bDebugPid;
-       bool bDebugUid;
-       bool bDebugClass;
-       bool bEnableCoreFiles;
-       bool bHostMSDfs;
-       bool bUseMmap;
-       bool bHostnameLookups;
-       bool bUnixExtensions;
-       bool bDisableNetbios;
-       char * szDedicatedKeytabFile;
-       int  iKerberosMethod;
-       bool bDeferSharingViolations;
-       bool bEnablePrivileges;
-       bool bASUSupport;
-       bool bUsershareOwnerOnly;
-       bool bUsershareAllowGuests;
-       bool bRegistryShares;
-       int restrict_anonymous;
-       int name_cache_timeout;
-       int client_signing;


-- 
Samba Shared Repository

Reply via email to