From 63c24977ba06dba46d7080400775f8937ecee108 Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Mon, 3 Feb 2014 15:46:08 +1300 Subject: [PATCH] param: rename lp function and variable from 'lockdir' to 'lock_directory' Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett Reviewed-by: Jeremy Allison --- lib/param/param_functions.c | 2 +- lib/param/param_table.c | 4 ++-- lib/param/util.c | 2 +- nsswitch/winbind_struct_protocol.h | 2 +- source3/lib/util.c | 2 +- source3/nmbd/nmbd.c | 4 ++-- source3/nmbd/nmbd_synclists.c | 2 +- source3/param/loadparm.c | 12 ++++++------ source3/smbd/oplock_irix.c | 2 +- source3/smbd/process.c | 2 +- source3/smbd/server.c | 4 ++-- source3/utils/testparm.c | 6 +++--- source3/winbindd/winbindd.c | 4 ++-- source4/librpc/rpc/dcerpc_connect.c | 2 +- source4/rpc_server/dcerpc_server.c | 2 +- source4/smbd/server.c | 4 ++-- 16 files changed, 28 insertions(+), 28 deletions(-) diff --git a/lib/param/param_functions.c b/lib/param/param_functions.c index 247a129c23d..7ce456a9f5d 100644 --- a/lib/param/param_functions.c +++ b/lib/param/param_functions.c @@ -244,7 +244,7 @@ FN_GLOBAL_CONST_STRING(dnsdomain, dnsdomain) FN_GLOBAL_CONST_STRING(dns_forwarder, dns_forwarder) FN_GLOBAL_CONST_STRING(dos_charset, dos_charset) FN_GLOBAL_CONST_STRING(guest_account, guest_account) -FN_GLOBAL_CONST_STRING(lockdir, lockdir) +FN_GLOBAL_CONST_STRING(lock_directory, lock_directory) FN_GLOBAL_CONST_STRING(logon_drive, logon_drive) FN_GLOBAL_CONST_STRING(logon_home, logon_home) FN_GLOBAL_CONST_STRING(logon_path, logon_path) diff --git a/lib/param/param_table.c b/lib/param/param_table.c index ebd1f438da9..def012673be 100644 --- a/lib/param/param_table.c +++ b/lib/param/param_table.c @@ -3298,7 +3298,7 @@ static struct parm_struct parm_table[] = { .label = "lock directory", .type = P_STRING, .p_class = P_GLOBAL, - .offset = GLOBAL_VAR(lockdir), + .offset = GLOBAL_VAR(lock_directory), .special = NULL, .enum_list = NULL, .flags = FLAG_ADVANCED, @@ -3307,7 +3307,7 @@ static struct parm_struct parm_table[] = { .label = "lock dir", .type = P_STRING, .p_class = P_GLOBAL, - .offset = GLOBAL_VAR(lockdir), + .offset = GLOBAL_VAR(lock_directory), .special = NULL, .enum_list = NULL, .flags = FLAG_HIDE, diff --git a/lib/param/util.c b/lib/param/util.c index 8c3badfcb96..35743ea18a9 100644 --- a/lib/param/util.c +++ b/lib/param/util.c @@ -114,7 +114,7 @@ static char *lpcfg_common_path(TALLOC_CTX* mem_ctx, char *lpcfg_lock_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx, const char *name) { - return lpcfg_common_path(mem_ctx, lpcfg_lockdir(lp_ctx), name); + return lpcfg_common_path(mem_ctx, lpcfg_lock_directory(lp_ctx), name); } /** diff --git a/nsswitch/winbind_struct_protocol.h b/nsswitch/winbind_struct_protocol.h index 4a41ba38438..69728b6231a 100644 --- a/nsswitch/winbind_struct_protocol.h +++ b/nsswitch/winbind_struct_protocol.h @@ -39,7 +39,7 @@ typedef char fstring[FSTRING_LEN]; */ #define WINBINDD_SOCKET_DIR_ENVVAR "WINBINDD_SOCKET_DIR" -#define WINBINDD_PRIV_SOCKET_SUBDIR "winbindd_privileged" /* name of subdirectory of lp_lockdir() to hold the 'privileged' pipe */ +#define WINBINDD_PRIV_SOCKET_SUBDIR "winbindd_privileged" /* name of subdirectory of lp_lock_directory() to hold the 'privileged' pipe */ #define WINBINDD_DOMAIN_ENV "WINBINDD_DOMAIN" /* Environment variables */ #define WINBINDD_DONT_ENV "_NO_WINBINDD" #define WINBINDD_LOCATOR_KDC_ADDRESS "WINBINDD_LOCATOR_KDC_ADDRESS" diff --git a/source3/lib/util.c b/source3/lib/util.c index 551beab8671..42fa79c1bec 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1517,7 +1517,7 @@ static char *xx_path(const char *name, const char *rootpath) char *lock_path(const char *name) { - return xx_path(name, lp_lockdir()); + return xx_path(name, lp_lock_directory()); } /** diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index f31de08d53c..2c1e8f02610 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -969,10 +969,10 @@ static bool open_sockets(bool isdaemon, int port) } #endif - ok = directory_create_or_exist(lp_lockdir(), geteuid(), 0755); + ok = directory_create_or_exist(lp_lock_directory(), geteuid(), 0755); if (!ok) { DEBUG(0, ("Failed to create directory %s for lock files - %s\n", - lp_lockdir(), strerror(errno))); + lp_lock_directory(), strerror(errno))); exit(1); } diff --git a/source3/nmbd/nmbd_synclists.c b/source3/nmbd/nmbd_synclists.c index d10b580a017..19e3ed0e2b1 100644 --- a/source3/nmbd/nmbd_synclists.c +++ b/source3/nmbd/nmbd_synclists.c @@ -157,7 +157,7 @@ done: unstrcpy(s->server, name); s->ip = ip; - if (asprintf(&s->fname, "%s/sync.%d", lp_lockdir(), counter++) < 0) { + if (asprintf(&s->fname, "%s/sync.%d", lp_lock_directory(), counter++) < 0) { SAFE_FREE(s); goto done; } diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index c7a95e16077..a40fa8ee912 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -768,7 +768,7 @@ 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.lock_directory, get_dyn_LOCKDIR()); string_set(&Globals.szStateDir, get_dyn_STATEDIR()); string_set(&Globals.szCacheDir, get_dyn_CACHEDIR()); string_set(&Globals.piddir, get_dyn_PIDDIR()); @@ -1172,15 +1172,15 @@ 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(). */ + * default to the value of lp_lock_directory(). */ 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) : ""); + return(*(char **)(&Globals.lock_directory) ? + *(char **)(&Globals.lock_directory) : ""); } const char *lp_cachedir(void) { if ((strcmp(get_dyn_CACHEDIR(), get_dyn_LOCKDIR()) != 0) || @@ -1188,8 +1188,8 @@ const char *lp_cachedir(void) { return(*(char **)(&Globals.szCacheDir) ? *(char **)(&Globals.szCacheDir) : ""); else - return(*(char **)(&Globals.lockdir) ? - *(char **)(&Globals.lockdir) : ""); + return(*(char **)(&Globals.lock_directory) ? + *(char **)(&Globals.lock_directory) : ""); } static FN_GLOBAL_INTEGER(winbind_max_domain_connections_int, winbindMaxDomainConnections) diff --git a/source3/smbd/oplock_irix.c b/source3/smbd/oplock_irix.c index 694ca086e38..75f34df1c20 100644 --- a/source3/smbd/oplock_irix.c +++ b/source3/smbd/oplock_irix.c @@ -49,7 +49,7 @@ static bool irix_oplocks_available(void) tmpname = talloc_asprintf(ctx, "%s/koplock.%d", - lp_lockdir(), + lp_lock_directory(), (int)getpid()); if (!tmpname) { TALLOC_FREE(ctx); diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 30323a22741..6d7af26a6e7 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -3088,7 +3088,7 @@ bool fork_echo_handler(struct smbd_server_connection *sconn) DEBUG(1, ("pipe() failed: %s\n", strerror(errno))); return false; } - sconn->smb1.echo_handler.socket_lock_fd = create_unlink_tmp(lp_lockdir()); + sconn->smb1.echo_handler.socket_lock_fd = create_unlink_tmp(lp_lock_directory()); if (sconn->smb1.echo_handler.socket_lock_fd == -1) { DEBUG(1, ("Could not create lock fd: %s\n", strerror(errno))); goto fail; diff --git a/source3/smbd/server.c b/source3/smbd/server.c index feb47daf502..81b66b7ee07 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1337,8 +1337,8 @@ extern void build_options(bool screen); setpgid( (pid_t)0, (pid_t)0); #endif - if (!directory_exist(lp_lockdir())) - mkdir(lp_lockdir(), 0755); + if (!directory_exist(lp_lock_directory())) + mkdir(lp_lock_directory(), 0755); if (!directory_exist(lp_piddir())) mkdir(lp_piddir(), 0755); diff --git a/source3/utils/testparm.c b/source3/utils/testparm.c index f905875a658..98806016c84 100644 --- a/source3/utils/testparm.c +++ b/source3/utils/testparm.c @@ -88,14 +88,14 @@ static int do_global_checks(void) "must differ.\n\n"); } - if (!directory_exist_stat(lp_lockdir(), &st)) { + if (!directory_exist_stat(lp_lock_directory(), &st)) { fprintf(stderr, "ERROR: lock directory %s does not exist\n\n", - lp_lockdir()); + lp_lock_directory()); ret = 1; } else if ((st.st_ex_mode & 0777) != 0755) { fprintf(stderr, "WARNING: lock directory %s should have " "permissions 0755 for browsing to work\n\n", - lp_lockdir()); + lp_lock_directory()); } if (!directory_exist_stat(lp_statedir(), &st)) { diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 8c480e523c9..65b30d3c530 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -1481,10 +1481,10 @@ int main(int argc, char **argv, char **envp) exit(1); } - ok = directory_create_or_exist(lp_lockdir(), geteuid(), 0755); + ok = directory_create_or_exist(lp_lock_directory(), geteuid(), 0755); if (!ok) { DEBUG(0, ("Failed to create directory %s for lock files - %s\n", - lp_lockdir(), strerror(errno))); + lp_lock_directory(), strerror(errno))); exit(1); } diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c index 857d1c3899a..15a3c3beb8b 100644 --- a/source4/librpc/rpc/dcerpc_connect.c +++ b/source4/librpc/rpc/dcerpc_connect.c @@ -823,7 +823,7 @@ _PUBLIC_ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent if (composite_nomem(s->pipe, c)) return c; if (DEBUGLEVEL >= 10) - s->pipe->conn->packet_log_dir = lpcfg_lockdir(lp_ctx); + s->pipe->conn->packet_log_dir = lpcfg_lock_directory(lp_ctx); /* store parameters in state structure */ s->binding = binding; diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index 6ab355f2fdb..85274c9dbe0 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -388,7 +388,7 @@ _PUBLIC_ NTSTATUS dcesrv_endpoint_connect(struct dcesrv_context *dce_ctx, p->dce_ctx = dce_ctx; p->endpoint = ep; - p->packet_log_dir = lpcfg_lockdir(dce_ctx->lp_ctx); + p->packet_log_dir = lpcfg_lock_directory(dce_ctx->lp_ctx); p->auth_state.session_info = session_info; p->auth_state.session_key = dcesrv_generic_session_key; p->event_ctx = event_ctx; diff --git a/source4/smbd/server.c b/source4/smbd/server.c index 79fe2eee9ee..da839c5e0ce 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -384,8 +384,8 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[ cleanup_tmp_files(cmdline_lp_ctx); - if (!directory_exist(lpcfg_lockdir(cmdline_lp_ctx))) { - mkdir(lpcfg_lockdir(cmdline_lp_ctx), 0755); + if (!directory_exist(lpcfg_lock_directory(cmdline_lp_ctx))) { + mkdir(lpcfg_lock_directory(cmdline_lp_ctx), 0755); } pidfile_create(lpcfg_piddir(cmdline_lp_ctx), binary_name);