lib/param: Add new parameter "old password allowed period"
[kai/samba-autobuild/.git] / source3 / param / loadparm.c
index 4a9e0d70ec9516c5adf4386b0a8f5082acf3ec13..8006167fe519c4e9e01a2fd4e392633b6291c6b4 100644 (file)
 #include <cups/http.h>
 #endif
 
-#ifdef CLUSTER_SUPPORT
-#include "ctdb_private.h"
-#endif
-
 bool bLoaded = false;
 
 extern userdom_struct current_user_info;
@@ -108,33 +104,7 @@ static int config_backend = CONFIG_BACKEND_FILE;
 
 static bool defaults_saved = false;
 
-#define LOADPARM_EXTRA_GLOBALS \
-       struct parmlist_entry *param_opt;                               \
-       char *realm_original;                                           \
-       char *loglevel;                                                 \
-       int iminreceivefile;                                            \
-       char *szPrintcapname;                                           \
-       int CupsEncrypt;                                                \
-       int  iPreferredMaster;                                          \
-       char *szLdapMachineSuffix;                                      \
-       char *szLdapUserSuffix;                                         \
-       char *szLdapIdmapSuffix;                                        \
-       char *szLdapGroupSuffix;                                        \
-       char *szStateDir;                                               \
-       char *szCacheDir;                                               \
-       char *szUsershareTemplateShare;                                 \
-       char *szIdmapUID;                                               \
-       char *szIdmapGID;                                               \
-       char *szIdmapBackend;                                           \
-       int winbindMaxDomainConnections;                                \
-       int ismb2_max_credits;                                          \
-       char *tls_keyfile;                                              \
-       char *tls_certfile;                                             \
-       char *tls_cafile;                                               \
-       char *tls_crlfile;                                              \
-       char *tls_dhpfile;
-
-#include "param/param_global.h"
+#include "lib/param/param_global.h"
 
 static struct loadparm_global Globals;
 
@@ -146,7 +116,7 @@ static struct loadparm_service sDefault =
        .usershare = 0,
        .usershare_last_mod = {0, 0},
        .szService = NULL,
-       .pathname = NULL,
+       .path = NULL,
        .username = NULL,
        .invalid_users = NULL,
        .valid_users = NULL,
@@ -155,69 +125,69 @@ static struct loadparm_service sDefault =
        .szInclude = NULL,
        .preexec = NULL,
        .postexec = NULL,
-       .rootpreexec = NULL,
-       .rootpostexec = NULL,
+       .root_preexec = NULL,
+       .root_postexec = NULL,
        .cups_options = NULL,
-       .printcommand = NULL,
-       .lpqcommand = NULL,
-       .lprmcommand = NULL,
-       .lppausecommand = NULL,
-       .lpresumecommand = NULL,
-       .queuepausecommand = NULL,
-       .queueresumecommand = NULL,
-       .szPrintername = NULL,
+       .print_command = NULL,
+       .lpq_command = NULL,
+       .lprm_command = NULL,
+       .lppause_command = NULL,
+       .lpresume_command = NULL,
+       .queuepause_command = NULL,
+       .queueresume_command = NULL,
+       ._printername = NULL,
        .printjob_username = NULL,
-       .dontdescend = NULL,
-       .hostsallow = NULL,
-       .hostsdeny = NULL,
-       .magicscript = NULL,
-       .magicoutput = NULL,
+       .dont_descend = NULL,
+       .hosts_allow = NULL,
+       .hosts_deny = NULL,
+       .magic_script = NULL,
+       .magic_output = NULL,
        .veto_files = NULL,
        .hide_files = NULL,
-       .veto_oplocks = NULL,
+       .veto_oplock_files = NULL,
        .comment = NULL,
        .force_user = NULL,
        .force_group = NULL,
-       .readlist = NULL,
-       .writelist = NULL,
+       .read_list = NULL,
+       .write_list = NULL,
        .volume = NULL,
        .fstype = NULL,
        .vfs_objects = NULL,
        .msdfs_proxy = NULL,
        .aio_write_behind = NULL,
        .dfree_command = NULL,
-       .minprintspace = 0,
+       .min_print_space = 0,
        .iMaxPrintJobs = 1000,
-       .max_reported_jobs = 0,
+       .max_reported_print_jobs = 0,
        .write_cache_size = 0,
        .create_mask = 0744,
        .force_create_mode = 0,
-       .dir_mask = 0755,
-       .force_dir_mode = 0,
+       .directory_mask = 0755,
+       .force_directory_mode = 0,
        .max_connections = 0,
-       .defaultcase = CASE_LOWER,
+       .default_case = CASE_LOWER,
        .printing = DEFAULT_PRINTING,
        .oplock_contention_limit = 2,
        .csc_policy = 0,
        .block_size = 1024,
        .dfree_cache_time = 0,
        .preexec_close = false,
-       .rootpreexec_close = false,
-       .casesensitive = Auto,
-       .preservecase = true,
-       .shortpreservecase = true,
+       .root_preexec_close = false,
+       .case_sensitive = Auto,
+       .preserve_case = true,
+       .short_preserve_case = true,
        .hide_dot_files = true,
        .hide_special_files = false,
-       .hideunreadable = false,
-       .hideunwriteable_files = false,
+       .hide_unreadable = false,
+       .hide_unwriteable_files = false,
        .browseable = true,
        .access_based_share_enum = false,
        .bAvailable = true,
-       .readonly = true,
+       .read_only = true,
        .guest_only = false,
        .administrative_share = false,
        .guest_ok = false,
-       .print_ok = false,
+       .printable = false,
        .print_notify_backchannel = false,
        .map_system = false,
        .map_hidden = false,
@@ -230,24 +200,24 @@ static struct loadparm_service sDefault =
        .oplocks = true,
        .kernel_oplocks = false,
        .level2_oplocks = true,
-       .onlyuser = false,
-       .manglednames = true,
+       .only_user = false,
+       .mangled_names = true,
        .bWidelinks = false,
-       .symlinks = true,
-       .syncalways = false,
+       .follow_symlinks = true,
+       .sync_always = false,
        .strict_allocate = false,
        .strict_sync = false,
-       .magicchar = '~',
+       .mangling_char = '~',
        .copymap = NULL,
        .delete_readonly = false,
        .fake_oplocks = false,
-       .recursive_veto_delete = false,
+       .delete_veto_files = false,
        .dos_filemode = false,
        .dos_filetimes = true,
        .dos_filetime_resolution = false,
-       .fake_dir_create_times = false,
+       .fake_directory_create_times = false,
        .blocking_locks = true,
-       .inherit_perms = false,
+       .inherit_permissions = false,
        .inherit_acls = false,
        .inherit_owner = false,
        .msdfs_root = false,
@@ -271,11 +241,7 @@ static struct loadparm_service sDefault =
        .aio_read_size = 0,
        .aio_write_size = 0,
        .map_readonly = MAP_READONLY_YES,
-#ifdef BROKEN_DIRECTORY_HANDLING
-       .directory_name_cache_size = 0,
-#else
        .directory_name_cache_size = 100,
-#endif
        .smb_encrypt = SMB_SIGNING_DEFAULT,
        .kernel_share_modes = true,
        .durable_handles = true,
@@ -385,52 +351,52 @@ static void init_printer_values(struct loadparm_service *pService)
                case PRINT_AIX:
                case PRINT_LPRNT:
                case PRINT_LPROS2:
-                       string_set(&pService->lpqcommand, "lpq -P'%p'");
-                       string_set(&pService->lprmcommand, "lprm -P'%p' %j");
-                       string_set(&pService->printcommand, "lpr -r -P'%p' %s");
+                       string_set(&pService->lpq_command, "lpq -P'%p'");
+                       string_set(&pService->lprm_command, "lprm -P'%p' %j");
+                       string_set(&pService->print_command, "lpr -r -P'%p' %s");
                        break;
 
                case PRINT_LPRNG:
                case PRINT_PLP:
-                       string_set(&pService->lpqcommand, "lpq -P'%p'");
-                       string_set(&pService->lprmcommand, "lprm -P'%p' %j");
-                       string_set(&pService->printcommand, "lpr -r -P'%p' %s");
-                       string_set(&pService->queuepausecommand, "lpc stop '%p'");
-                       string_set(&pService->queueresumecommand, "lpc start '%p'");
-                       string_set(&pService->lppausecommand, "lpc hold '%p' %j");
-                       string_set(&pService->lpresumecommand, "lpc release '%p' %j");
+                       string_set(&pService->lpq_command, "lpq -P'%p'");
+                       string_set(&pService->lprm_command, "lprm -P'%p' %j");
+                       string_set(&pService->print_command, "lpr -r -P'%p' %s");
+                       string_set(&pService->queuepause_command, "lpc stop '%p'");
+                       string_set(&pService->queueresume_command, "lpc start '%p'");
+                       string_set(&pService->lppause_command, "lpc hold '%p' %j");
+                       string_set(&pService->lpresume_command, "lpc release '%p' %j");
                        break;
 
                case PRINT_CUPS:
                case PRINT_IPRINT:
                        /* set the lpq command to contain the destination printer
                           name only.  This is used by cups_queue_get() */
-                       string_set(&pService->lpqcommand, "%p");
-                       string_set(&pService->lprmcommand, "");
-                       string_set(&pService->printcommand, "");
-                       string_set(&pService->lppausecommand, "");
-                       string_set(&pService->lpresumecommand, "");
-                       string_set(&pService->queuepausecommand, "");
-                       string_set(&pService->queueresumecommand, "");
+                       string_set(&pService->lpq_command, "%p");
+                       string_set(&pService->lprm_command, "");
+                       string_set(&pService->print_command, "");
+                       string_set(&pService->lppause_command, "");
+                       string_set(&pService->lpresume_command, "");
+                       string_set(&pService->queuepause_command, "");
+                       string_set(&pService->queueresume_command, "");
                        break;
 
                case PRINT_SYSV:
                case PRINT_HPUX:
-                       string_set(&pService->lpqcommand, "lpstat -o%p");
-                       string_set(&pService->lprmcommand, "cancel %p-%j");
-                       string_set(&pService->printcommand, "lp -c -d%p %s; rm %s");
-                       string_set(&pService->queuepausecommand, "disable %p");
-                       string_set(&pService->queueresumecommand, "enable %p");
+                       string_set(&pService->lpq_command, "lpstat -o%p");
+                       string_set(&pService->lprm_command, "cancel %p-%j");
+                       string_set(&pService->print_command, "lp -c -d%p %s; rm %s");
+                       string_set(&pService->queuepause_command, "disable %p");
+                       string_set(&pService->queueresume_command, "enable %p");
 #ifndef HPUX
-                       string_set(&pService->lppausecommand, "lp -i %p-%j -H hold");
-                       string_set(&pService->lpresumecommand, "lp -i %p-%j -H resume");
+                       string_set(&pService->lppause_command, "lp -i %p-%j -H hold");
+                       string_set(&pService->lpresume_command, "lp -i %p-%j -H resume");
 #endif /* HPUX */
                        break;
 
                case PRINT_QNX:
-                       string_set(&pService->lpqcommand, "lpq -P%p");
-                       string_set(&pService->lprmcommand, "lprm -P%p %j");
-                       string_set(&pService->printcommand, "lp -r -P%p %s");
+                       string_set(&pService->lpq_command, "lpq -P%p");
+                       string_set(&pService->lprm_command, "lprm -P%p %j");
+                       string_set(&pService->print_command, "lp -r -P%p %s");
                        break;
 
 #if defined(DEVELOPER) || defined(ENABLE_SELFTEST)
@@ -451,37 +417,37 @@ static void init_printer_values(struct loadparm_service *pService)
 
                tmp = talloc_asprintf(tmp_ctx, "vlp %s print %%p %%s",
                                      tdbfile);
-               string_set(&pService->printcommand,
+               string_set(&pService->print_command,
                           tmp ? tmp : "vlp print %p %s");
 
                tmp = talloc_asprintf(tmp_ctx, "vlp %s lpq %%p",
                                      tdbfile);
-               string_set(&pService->lpqcommand,
+               string_set(&pService->lpq_command,
                           tmp ? tmp : "vlp lpq %p");
 
                tmp = talloc_asprintf(tmp_ctx, "vlp %s lprm %%p %%j",
                                      tdbfile);
-               string_set(&pService->lprmcommand,
+               string_set(&pService->lprm_command,
                           tmp ? tmp : "vlp lprm %p %j");
 
                tmp = talloc_asprintf(tmp_ctx, "vlp %s lppause %%p %%j",
                                      tdbfile);
-               string_set(&pService->lppausecommand,
+               string_set(&pService->lppause_command,
                           tmp ? tmp : "vlp lppause %p %j");
 
                tmp = talloc_asprintf(tmp_ctx, "vlp %s lpresume %%p %%j",
                                      tdbfile);
-               string_set(&pService->lpresumecommand,
+               string_set(&pService->lpresume_command,
                           tmp ? tmp : "vlp lpresume %p %j");
 
                tmp = talloc_asprintf(tmp_ctx, "vlp %s queuepause %%p",
                                      tdbfile);
-               string_set(&pService->queuepausecommand,
+               string_set(&pService->queuepause_command,
                           tmp ? tmp : "vlp queuepause %p");
 
                tmp = talloc_asprintf(tmp_ctx, "vlp %s queueresume %%p",
                                      tdbfile);
-               string_set(&pService->queueresumecommand,
+               string_set(&pService->queueresume_command,
                           tmp ? tmp : "vlp queueresume %p");
                TALLOC_FREE(tmp_ctx);
 
@@ -756,7 +722,7 @@ static void init_globals(bool reinit_globals)
        string_set(&Globals.mangling_method, "hash2");
        Globals.mangle_prefix = 1;
 
-       string_set(&Globals.guestaccount, GUEST_ACCOUNT);
+       string_set(&Globals.guest_account, GUEST_ACCOUNT);
 
        /* using UTF8 by default allows us to support all chars */
        string_set(&Globals.unix_charset, DEFAULT_UNIX_CHARSET);
@@ -772,10 +738,10 @@ static void init_globals(bool reinit_globals)
        string_set(&Globals.workgroup, DEFAULT_WORKGROUP);
 
        string_set(&Globals.passwd_program, "");
-       string_set(&Globals.lockdir, get_dyn_LOCKDIR());
-       string_set(&Globals.szStateDir, get_dyn_STATEDIR());
-       string_set(&Globals.szCacheDir, get_dyn_CACHEDIR());
-       string_set(&Globals.piddir, get_dyn_PIDDIR());
+       string_set(&Globals.lock_directory, get_dyn_LOCKDIR());
+       string_set(&Globals.state_directory, get_dyn_STATEDIR());
+       string_set(&Globals.cache_directory, get_dyn_CACHEDIR());
+       string_set(&Globals.pid_directory, get_dyn_PIDDIR());
        string_set(&Globals.nbt_client_socket_address, "0.0.0.0");
        /*
         * By default support explicit binding to broadcast
@@ -786,7 +752,7 @@ static void init_globals(bool reinit_globals)
        if (asprintf(&s, "Samba %s", samba_version_string()) < 0) {
                smb_panic("init_globals: ENOMEM");
        }
-       string_set(&Globals.serverstring, s);
+       string_set(&Globals.server_string, s);
        SAFE_FREE(s);
 #ifdef DEVELOPER
        string_set(&Globals.panic_action, "/bin/sleep 999999999");
@@ -800,7 +766,7 @@ static void init_globals(bool reinit_globals)
        string_set(&Globals.logon_path, "\\\\%N\\%U\\profile");
 
        Globals.name_resolve_order = (const char **)str_list_make_v3(NULL, "lmhosts wins host bcast", NULL);
-       string_set(&Globals.passwordserver, "*");
+       string_set(&Globals.password_server, "*");
 
        Globals.algorithmic_rid_base = BASE_RID;
 
@@ -808,40 +774,40 @@ static void init_globals(bool reinit_globals)
        Globals.printcap_cache_time = 750;      /* 12.5 minutes */
 
        Globals.config_backend = config_backend;
-       Globals.server_role = ROLE_AUTO;
+       Globals._server_role = ROLE_AUTO;
 
        /* Was 65535 (0xFFFF). 0x4101 matches W2K and causes major speed improvements... */
        /* Discovered by 2 days of pain by Don McCall @ HP :-). */
        Globals.max_xmit = 0x4104;
-       Globals.maxmux = 50;    /* This is *needed* for profile support. */
-       Globals.lpqcachetime = 30;      /* changed to handle large print servers better -- jerry */
+       Globals.max_mux = 50;   /* This is *needed* for profile support. */
+       Globals.lpq_cache_time = 30;    /* changed to handle large print servers better -- jerry */
        Globals._disable_spoolss = false;
        Globals.max_smbd_processes = 0;/* no limit specified */
-       Globals.usernamelevel = 0;
+       Globals.username_level = 0;
        Globals.deadtime = 0;
        Globals.getwd_cache = true;
        Globals.large_readwrite = true;
        Globals.max_log_size = 5000;
        Globals.max_open_files = max_open_files();
-       Globals.open_files_db_hash_size = SMB_OPEN_DATABASE_TDB_HASH_SIZE;
-       Globals.srv_maxprotocol = PROTOCOL_SMB3_00;
-       Globals.srv_minprotocol = PROTOCOL_LANMAN1;
-       Globals.cli_maxprotocol = PROTOCOL_NT1;
-       Globals.cli_minprotocol = PROTOCOL_CORE;
-       Globals.security = SEC_USER;
-       Globals.encrypted_passwords = true;
+       Globals.server_max_protocol = PROTOCOL_SMB3_00;
+       Globals.server_min_protocol = PROTOCOL_LANMAN1;
+       Globals.client_max_protocol = PROTOCOL_NT1;
+       Globals.client_min_protocol = PROTOCOL_CORE;
+       Globals._security = SEC_AUTO;
+       Globals.encrypt_passwords = true;
        Globals.client_schannel = Auto;
        Globals.winbind_sealed_pipes = true;
        Globals.require_strong_key = true;
        Globals.server_schannel = Auto;
-       Globals.bReadRaw = true;
-       Globals.bWriteRaw = true;
+       Globals.read_raw = true;
+       Globals.write_raw = true;
        Globals.null_passwords = false;
+       Globals.old_password_allowed_period = 60;
        Globals.obey_pam_restrictions = false;
        Globals.syslog = 1;
        Globals.syslog_only = false;
        Globals.timestamp_logs = true;
-       string_set(&Globals.loglevel, "0");
+       string_set(&Globals.log_level, "0");
        Globals.debug_prefix_timestamp = false;
        Globals.debug_hires_timestamp = true;
        Globals.debug_pid = false;
@@ -855,11 +821,11 @@ static void init_globals(bool reinit_globals)
        Globals.lm_announce = Auto;     /* = Auto: send only if LM clients found */
        Globals.lm_interval = 60;
 #if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT))
-       Globals.nis_home_map = false;
+       Globals.nis_homedir = false;
 #ifdef WITH_NISPLUS_HOME
-       string_set(&Globals.nis_home_map_name, "auto_home.org_dir");
+       string_set(&Globals.homedir_map, "auto_home.org_dir");
 #else
-       string_set(&Globals.nis_home_map_name, "auto.home");
+       string_set(&Globals.homedir_map, "auto.home");
 #endif
 #endif
        Globals.time_server = false;
@@ -940,7 +906,7 @@ static void init_globals(bool reinit_globals)
 
 */
 
-       Globals.ms_add_printer_wizard = true;
+       Globals.show_add_printer_wizard = true;
        Globals.os_level = 20;
        Globals.local_master = true;
        Globals._domain_master = Auto;  /* depending on _domain_logons */
@@ -965,11 +931,7 @@ static void init_globals(bool reinit_globals)
        string_set(&Globals.cups_server, "");
        string_set(&Globals.iprint_server, "");
 
-#ifdef CLUSTER_SUPPORT
-       string_set(&Globals.ctdbd_socket, CTDB_PATH);
-#else
-       string_set(&Globals.ctdbd_socket, "");
-#endif
+       string_set(&Globals._ctdbd_socket, "");
 
        Globals.cluster_addresses = NULL;
        Globals.clustering = false;
@@ -1015,7 +977,7 @@ static void init_globals(bool reinit_globals)
        }
        string_set(&Globals.usershare_path, s);
        SAFE_FREE(s);
-       string_set(&Globals.szUsershareTemplateShare, "");
+       string_set(&Globals.usershare_template_share, "");
        Globals.usershare_max_shares = 0;
        /* By default disallow sharing of directories not owned by the sharer. */
        Globals.usershare_owner_only = true;
@@ -1045,9 +1007,9 @@ static void init_globals(bool reinit_globals)
 
        Globals.tls_enabled = true;
 
-       string_set(&Globals.tls_keyfile, "tls/key.pem");
-       string_set(&Globals.tls_certfile, "tls/cert.pem");
-       string_set(&Globals.tls_cafile, "tls/ca.pem");
+       string_set(&Globals._tls_keyfile, "tls/key.pem");
+       string_set(&Globals._tls_certfile, "tls/cert.pem");
+       string_set(&Globals._tls_cafile, "tls/ca.pem");
 
        string_set(&Globals.share_backend, "classic");
 
@@ -1103,7 +1065,7 @@ static void init_globals(bool reinit_globals)
  callers without affecting the source string.
 ********************************************************************/
 
-static char *lp_string(TALLOC_CTX *ctx, const char *s)
+char *lp_string(TALLOC_CTX *ctx, const char *s)
 {
        char *ret;
 
@@ -1171,31 +1133,6 @@ char *lp_ ## fn_name(TALLOC_CTX *ctx,int i) {return(lp_string((ctx), (LP_SNUM_OK
 #define FN_LOCAL_PARM_CHAR(fn_name,val) \
  char lp_ ## fn_name(const struct share_params *p) {return(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);}
 
-
-static FN_GLOBAL_BOOL(_readraw, bReadRaw)
-static FN_GLOBAL_BOOL(_writeraw, bWriteRaw)
-
-/* If lp_statedir() and lp_cachedir() are explicitely set during the
- * build process or in smb.conf, we use that value.  Otherwise they
- * default to the value of lp_lockdir(). */
-const char *lp_statedir(void) {
-       if ((strcmp(get_dyn_STATEDIR(), get_dyn_LOCKDIR()) != 0) ||
-           (strcmp(get_dyn_STATEDIR(), Globals.szStateDir) != 0))
-               return(*(char **)(&Globals.szStateDir) ?
-                      *(char **)(&Globals.szStateDir) : "");
-       else
-               return(*(char **)(&Globals.lockdir) ?
-                      *(char **)(&Globals.lockdir) : "");
-}
-const char *lp_cachedir(void) {
-       if ((strcmp(get_dyn_CACHEDIR(), get_dyn_LOCKDIR()) != 0) ||
-           (strcmp(get_dyn_CACHEDIR(), Globals.szCacheDir) != 0))
-               return(*(char **)(&Globals.szCacheDir) ?
-                      *(char **)(&Globals.szCacheDir) : "");
-       else
-               return(*(char **)(&Globals.lockdir) ?
-                      *(char **)(&Globals.lockdir) : "");
-}
 static FN_GLOBAL_INTEGER(winbind_max_domain_connections_int,
                  winbindMaxDomainConnections)
 
@@ -1238,13 +1175,14 @@ int lp_cups_encrypt(void)
 
 /* These functions remain in source3/param for now */
 
-FN_GLOBAL_STRING(configfile, szConfigFile)
-
 #include "lib/param/param_functions.c"
 
 FN_LOCAL_STRING(servicename, szService)
 FN_LOCAL_CONST_STRING(const_servicename, szService)
 
+/* These functions cannot be auto-generated */
+FN_LOCAL_BOOL(autoloaded, autoloaded)
+
 /* local prototypes */
 
 static int map_parameter_canonical(const char *pszParmName, bool *inverse);
@@ -1731,10 +1669,10 @@ bool lp_add_home(const char *pszHomename, int iDefaultService,
        if (i < 0)
                return false;
 
-       if (!(*(ServicePtrs[iDefaultService]->pathname))
-           || strequal(ServicePtrs[iDefaultService]->pathname,
-                       lp_pathname(talloc_tos(), GLOBAL_SECTION_SNUM))) {
-               string_set(&ServicePtrs[i]->pathname, pszHomedir);
+       if (!(*(ServicePtrs[iDefaultService]->path))
+           || strequal(ServicePtrs[iDefaultService]->path,
+                       lp_path(talloc_tos(), GLOBAL_SECTION_SNUM))) {
+               string_set(&ServicePtrs[i]->path, pszHomedir);
        }
 
        if (!(*(ServicePtrs[i]->comment))) {
@@ -1754,7 +1692,7 @@ bool lp_add_home(const char *pszHomename, int iDefaultService,
        ServicePtrs[i]->autoloaded = true;
 
        DEBUG(3, ("adding home's share [%s] for user '%s' at '%s'\n", pszHomename, 
-              user, ServicePtrs[i]->pathname ));
+              user, ServicePtrs[i]->path ));
 
        return true;
 }
@@ -1785,21 +1723,21 @@ static bool lp_add_ipc(const char *ipc_name, bool guest_ok)
                return false;
 
        if (asprintf(&comment, "IPC Service (%s)",
-                               Globals.serverstring) < 0) {
+                               Globals.server_string) < 0) {
                return false;
        }
 
-       string_set(&ServicePtrs[i]->pathname, tmpdir());
+       string_set(&ServicePtrs[i]->path, tmpdir());
        string_set(&ServicePtrs[i]->username, "");
        string_set(&ServicePtrs[i]->comment, comment);
        string_set(&ServicePtrs[i]->fstype, "IPC");
        ServicePtrs[i]->max_connections = 0;
        ServicePtrs[i]->bAvailable = true;
-       ServicePtrs[i]->readonly = true;
+       ServicePtrs[i]->read_only = true;
        ServicePtrs[i]->guest_only = false;
        ServicePtrs[i]->administrative_share = true;
        ServicePtrs[i]->guest_ok = guest_ok;
-       ServicePtrs[i]->print_ok = false;
+       ServicePtrs[i]->printable = false;
        ServicePtrs[i]->browseable = sDefault.browseable;
 
        DEBUG(3, ("adding IPC service\n"));
@@ -1826,18 +1764,18 @@ bool lp_add_printer(const char *pszPrintername, int iDefaultService)
        /* entry (if/when the 'available' keyword is implemented!).    */
 
        /* the printer name is set to the service name. */
-       string_set(&ServicePtrs[i]->szPrintername, pszPrintername);
+       string_set(&ServicePtrs[i]->_printername, pszPrintername);
        string_set(&ServicePtrs[i]->comment, comment);
 
        /* set the browseable flag from the gloabl default */
        ServicePtrs[i]->browseable = sDefault.browseable;
 
        /* Printers cannot be read_only. */
-       ServicePtrs[i]->readonly = false;
+       ServicePtrs[i]->read_only = false;
        /* No oplocks on printer services. */
        ServicePtrs[i]->oplocks = false;
        /* Printer services must be printable. */
-       ServicePtrs[i]->print_ok = true;
+       ServicePtrs[i]->printable = true;
 
        DEBUG(3, ("adding printer service %s\n", pszPrintername));
 
@@ -2365,17 +2303,17 @@ bool service_ok(int iService)
        /* The [printers] entry MUST be printable. I'm all for flexibility, but */
        /* I can't see why you'd want a non-printable printer service...        */
        if (strwicmp(ServicePtrs[iService]->szService, PRINTERS_NAME) == 0) {
-               if (!ServicePtrs[iService]->print_ok) {
+               if (!ServicePtrs[iService]->printable) {
                        DEBUG(0, ("WARNING: [%s] service MUST be printable!\n",
                               ServicePtrs[iService]->szService));
-                       ServicePtrs[iService]->print_ok = true;
+                       ServicePtrs[iService]->printable = true;
                }
                /* [printers] service must also be non-browsable. */
                if (ServicePtrs[iService]->browseable)
                        ServicePtrs[iService]->browseable = false;
        }
 
-       if (ServicePtrs[iService]->pathname[0] == '\0' &&
+       if (ServicePtrs[iService]->path[0] == '\0' &&
            strwicmp(ServicePtrs[iService]->szService, HOMES_NAME) != 0 &&
            ServicePtrs[iService]->msdfs_proxy[0] == '\0'
            ) {
@@ -4011,7 +3949,7 @@ enum usershare_err parse_usershare_file(TALLOC_CTX *ctx,
                }
        }
 
-       if (snum != -1 && (strcmp(sharepath, ServicePtrs[snum]->pathname) == 0)) {
+       if (snum != -1 && (strcmp(sharepath, ServicePtrs[snum]->path) == 0)) {
                /* Path didn't change, no checks needed. */
                *pp_sharepath = sharepath;
                *pp_comment = comment;
@@ -4260,7 +4198,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i
                added_service = true;
 
                /* Read only is controlled by usershare ACL below. */
-               ServicePtrs[iService]->readonly = false;
+               ServicePtrs[iService]->read_only = false;
        }
 
        /* Write the ACL of the new/modified share. */
@@ -4284,7 +4222,7 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i
 
        /* And note when it was loaded. */
        ServicePtrs[iService]->usershare_last_mod = sbuf.st_ex_mtime;
-       string_set(&ServicePtrs[iService]->pathname, sharepath);
+       string_set(&ServicePtrs[iService]->path, sharepath);
        string_set(&ServicePtrs[iService]->comment, comment);
 
        ret = iService;
@@ -4375,13 +4313,13 @@ int load_usershare_service(const char *servicename)
        }
 
        /* Ensure the template share exists if it's set. */
-       if (Globals.szUsershareTemplateShare[0]) {
+       if (Globals.usershare_template_share[0]) {
                /* We can't use lp_servicenumber here as we are recommending that
                   template shares have -valid=false set. */
                for (snum_template = iNumServices - 1; snum_template >= 0; snum_template--) {
                        if (ServicePtrs[snum_template]->szService &&
                                        strequal(ServicePtrs[snum_template]->szService,
-                                               Globals.szUsershareTemplateShare)) {
+                                               Globals.usershare_template_share)) {
                                break;
                        }
                }
@@ -4389,7 +4327,7 @@ int load_usershare_service(const char *servicename)
                if (snum_template == -1) {
                        DEBUG(0,("load_usershare_service: usershare template share %s "
                                "does not exist.\n",
-                               Globals.szUsershareTemplateShare ));
+                               Globals.usershare_template_share ));
                        return -1;
                }
        }
@@ -4448,13 +4386,13 @@ int load_usershare_shares(struct smbd_server_connection *sconn,
        }
 
        /* Ensure the template share exists if it's set. */
-       if (Globals.szUsershareTemplateShare[0]) {
+       if (Globals.usershare_template_share[0]) {
                /* We can't use lp_servicenumber here as we are recommending that
                   template shares have -valid=false set. */
                for (snum_template = iNumServices - 1; snum_template >= 0; snum_template--) {
                        if (ServicePtrs[snum_template]->szService &&
                                        strequal(ServicePtrs[snum_template]->szService,
-                                               Globals.szUsershareTemplateShare)) {
+                                               Globals.usershare_template_share)) {
                                break;
                        }
                }
@@ -4462,7 +4400,7 @@ int load_usershare_shares(struct smbd_server_connection *sconn,
                if (snum_template == -1) {
                        DEBUG(0,("load_usershare_shares: usershare template share %s "
                                "does not exist.\n",
-                               Globals.szUsershareTemplateShare ));
+                               Globals.usershare_template_share ));
                        return ret;
                }
        }
@@ -4726,9 +4664,9 @@ static bool lp_load_ex(const char *pszFname,
 
        set_allowed_client_auth();
 
-       if (lp_security() == SEC_ADS && strchr(lp_passwordserver(), ':')) {
+       if (lp_security() == SEC_ADS && strchr(lp_password_server(), ':')) {
                DEBUG(1, ("WARNING: The optional ':port' in password server = %s is deprecated\n",
-                         lp_passwordserver()));
+                         lp_password_server()));
        }
 
        bLoaded = true;
@@ -5259,7 +5197,7 @@ int lp_min_receive_file_size(void)
        if (Globals.iminreceivefile < 0) {
                return 0;
        }
-       return MIN(Globals.iminreceivefile, BUFFER_SIZE);
+       return Globals.iminreceivefile;
 }
 
 /*******************************************************************
@@ -5276,7 +5214,7 @@ static bool lp_widelinks_internal(int snum)
 
 void widelinks_warning(int snum)
 {
-       if (lp_allow_insecure_widelinks()) {
+       if (lp_allow_insecure_wide_links()) {
                return;
        }
 
@@ -5296,7 +5234,7 @@ bool lp_widelinks(int snum)
                 * Unless we have "allow insecure widelinks"
                 * turned on.
                 */
-               if (!lp_allow_insecure_widelinks()) {
+               if (!lp_allow_insecure_wide_links()) {
                        return false;
                }
        }
@@ -5304,22 +5242,6 @@ bool lp_widelinks(int snum)
        return lp_widelinks_internal(snum);
 }
 
-bool lp_writeraw(void)
-{
-       if (lp_async_smb_echo_handler()) {
-               return false;
-       }
-       return lp__writeraw();
-}
-
-bool lp_readraw(void)
-{
-       if (lp_async_smb_echo_handler()) {
-               return false;
-       }
-       return lp__readraw();
-}
-
 int lp_server_role(void)
 {
        return lp_find_server_role(lp__server_role(),
@@ -5333,3 +5255,8 @@ int lp_security(void)
        return lp_find_security(lp__server_role(),
                                lp__security());
 }
+
+struct loadparm_global * get_globals(void)
+{
+       return &Globals;
+}