diff options
author | Volker Lendecke <vl@sernet.de> | 2007-11-01 18:13:00 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-11-09 15:11:54 +0100 |
commit | 814bed029efa391e664ac432d0d68dfeab26381f (patch) | |
tree | 2ba51d31cd4563cf30dae26604365e57388e6021 /source | |
parent | 0ee896827215a24e70a4ac6bde5ded13f9497296 (diff) | |
download | samba-814bed029efa391e664ac432d0d68dfeab26381f.tar.gz samba-814bed029efa391e664ac432d0d68dfeab26381f.tar.xz samba-814bed029efa391e664ac432d0d68dfeab26381f.zip |
Remove the silly "user_socket_options" global variable
This is better done with a 'lp_do_parameter(-1, "socket options", ..);
Diffstat (limited to 'source')
-rw-r--r-- | source/client/smbmount.c | 3 | ||||
-rw-r--r-- | source/lib/popt_common.c | 3 | ||||
-rw-r--r-- | source/lib/util.c | 1 | ||||
-rw-r--r-- | source/libsmb/cliconnect.c | 6 | ||||
-rw-r--r-- | source/param/loadparm.c | 6 | ||||
-rw-r--r-- | source/smbd/server.c | 14 | ||||
-rw-r--r-- | source/torture/rpctorture.c | 5 | ||||
-rw-r--r-- | source/torture/vfstest.c | 5 |
8 files changed, 18 insertions, 25 deletions
diff --git a/source/client/smbmount.c b/source/client/smbmount.c index 7befd6ef3c6..5e69cf92a36 100644 --- a/source/client/smbmount.c +++ b/source/client/smbmount.c @@ -24,7 +24,6 @@ #include <linux/smb_fs.h> extern bool in_client; -extern pstring user_socket_options; extern char *optarg; extern int optind; @@ -807,7 +806,7 @@ static void parse_mount_smb(int argc, char **argv) } else if(!strcmp(opts, "workgroup")) { pstrcpy(workgroup,opteq+1); } else if(!strcmp(opts, "sockopt")) { - pstrcpy(user_socket_options,opteq+1); + lp_do_parameter(-1, "socket options", opteq+1); } else if(!strcmp(opts, "scope")) { set_global_scope(opteq+1); } else { diff --git a/source/lib/popt_common.c b/source/lib/popt_common.c index ec05762cdf0..7cc066d6677 100644 --- a/source/lib/popt_common.c +++ b/source/lib/popt_common.c @@ -33,7 +33,6 @@ * -i,--scope */ -extern pstring user_socket_options; extern bool AllowDebugChange; extern bool override_logfile; @@ -92,7 +91,7 @@ static void popt_common_callback(poptContext con, case 'O': if (arg) { - pstrcpy(user_socket_options,arg); + lp_do_parameter(-1, "socket options", arg); } break; diff --git a/source/lib/util.c b/source/lib/util.c index fd79a7eb46c..7f0ec0b1326 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -68,7 +68,6 @@ int chain_size = 0; int trans_num = 0; static enum remote_arch_types ra_type = RA_UNKNOWN; -pstring user_socket_options=DEFAULT_SOCKET_OPTIONS; /*********************************************************************** Definitions for all names. diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c index 8b180f01358..2fdd1223f0e 100644 --- a/source/libsmb/cliconnect.c +++ b/source/libsmb/cliconnect.c @@ -20,8 +20,6 @@ #include "includes.h" -extern pstring user_socket_options; - static const struct { int prot; const char *name; @@ -1382,7 +1380,7 @@ bool cli_session_request(struct cli_state *cli, DEBUG(3,("Retargeted\n")); - set_socket_options(cli->fd,user_socket_options); + set_socket_options(cli->fd, lp_socket_options()); /* Try again */ { @@ -1469,7 +1467,7 @@ NTSTATUS cli_connect(struct cli_state *cli, return map_nt_error_from_unix(errno); } - set_socket_options(cli->fd,user_socket_options); + set_socket_options(cli->fd, lp_socket_options()); return NT_STATUS_OK; } diff --git a/source/param/loadparm.c b/source/param/loadparm.c index 07f8dc4144b..94f1c0e5b6c 100644 --- a/source/param/loadparm.c +++ b/source/param/loadparm.c @@ -55,7 +55,6 @@ bool in_client = False; /* Not in the client by default */ bool bLoaded = False; -extern pstring user_socket_options; extern enum protocol_types Protocol; extern userdom_struct current_user_info; @@ -1052,7 +1051,7 @@ static struct parm_struct parm_table[] = { {"max open files", P_INTEGER, P_GLOBAL, &Globals.max_open_files, NULL, NULL, FLAG_ADVANCED}, {"min print space", P_INTEGER, P_LOCAL, &sDefault.iMinPrintSpace, NULL, NULL, FLAG_ADVANCED | FLAG_PRINT}, - {"socket options", P_GSTRING, P_GLOBAL, user_socket_options, NULL, NULL, FLAG_ADVANCED}, + {"socket options", P_STRING, P_GLOBAL, &Globals.szSocketOptions, NULL, NULL, FLAG_ADVANCED}, {"strict allocate", P_BOOL, P_LOCAL, &sDefault.bStrictAllocate, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"strict sync", P_BOOL, P_LOCAL, &sDefault.bStrictSync, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, {"sync always", P_BOOL, P_LOCAL, &sDefault.bSyncAlways, NULL, NULL, FLAG_ADVANCED | FLAG_SHARE}, @@ -1505,7 +1504,7 @@ static void init_globals(bool first_time_only) string_set(&Globals.szPanicAction, "/bin/sleep 999999999"); #endif - pstrcpy(user_socket_options, DEFAULT_SOCKET_OPTIONS); + string_set(&Globals.szSocketOptions, DEFAULT_SOCKET_OPTIONS); string_set(&Globals.szLogonDrive, ""); /* %N is the NIS auto.home server if -DAUTOHOME is used, else same as %L */ @@ -2032,6 +2031,7 @@ FN_GLOBAL_INTEGER(lp_map_to_guest, &Globals.map_to_guest) FN_GLOBAL_INTEGER(lp_oplock_break_wait_time, &Globals.oplock_break_wait_time) FN_GLOBAL_INTEGER(lp_lock_spin_time, &Globals.iLockSpinTime) FN_GLOBAL_INTEGER(lp_usershare_max_shares, &Globals.iUsershareMaxShares) +FN_GLOBAL_CONST_STRING(lp_socket_options, &Globals.szSocketOptions) FN_LOCAL_STRING(lp_preexec, szPreExec) FN_LOCAL_STRING(lp_postexec, szPostExec) diff --git a/source/smbd/server.c b/source/smbd/server.c index fbf886ee678..547e9c6e816 100644 --- a/source/smbd/server.c +++ b/source/smbd/server.c @@ -34,7 +34,6 @@ int last_message = -1; #define LAST_MESSAGE() smb_fn_name(last_message) extern struct auth_context *negprot_global_auth_context; -extern pstring user_socket_options; extern SIG_ATOMIC_T got_sig_term; extern SIG_ATOMIC_T reload_after_sighup; static SIG_ATOMIC_T got_sig_cld; @@ -186,7 +185,7 @@ static bool open_sockets_inetd(void) close_low_fds(False); /* Don't close stderr */ set_socket_options(smbd_server_fd(),"SO_KEEPALIVE"); - set_socket_options(smbd_server_fd(), user_socket_options); + set_socket_options(smbd_server_fd(), lp_socket_options()); return True; } @@ -380,7 +379,8 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_ /* ready to listen */ set_socket_options(s,"SO_KEEPALIVE"); - set_socket_options(s,user_socket_options); + set_socket_options(smbd_server_fd(), + lp_socket_options()); /* Set server socket to * non-blocking for the accept. */ @@ -446,7 +446,8 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_ /* ready to listen */ set_socket_options(s,"SO_KEEPALIVE"); - set_socket_options(s,user_socket_options); + set_socket_options(smbd_server_fd(), + lp_socket_options()); /* Set server socket to non-blocking * for the accept. */ @@ -623,7 +624,8 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_ am_parent = 0; set_socket_options(smbd_server_fd(),"SO_KEEPALIVE"); - set_socket_options(smbd_server_fd(),user_socket_options); + set_socket_options(smbd_server_fd(), + lp_socket_options()); /* this is needed so that we get decent entries in smbstatus for port 445 connects */ @@ -758,7 +760,7 @@ bool reload_services(bool test) if (smbd_server_fd() != -1) { set_socket_options(smbd_server_fd(),"SO_KEEPALIVE"); - set_socket_options(smbd_server_fd(), user_socket_options); + set_socket_options(smbd_server_fd(), lp_socket_options()); } mangle_reset_cache(); diff --git a/source/torture/rpctorture.c b/source/torture/rpctorture.c index 64e7b580f3c..a9748ba9059 100644 --- a/source/torture/rpctorture.c +++ b/source/torture/rpctorture.c @@ -25,9 +25,6 @@ extern pstring global_myname; -extern pstring user_socket_options; - - extern file_info def_finfo; #define CNV_LANG(s) dos2unix_format(s,False) @@ -360,7 +357,7 @@ enum client_action case 'O': { - pstrcpy(user_socket_options,optarg); + lp_do_parameter(-1, "socket options", optarg); break; } diff --git a/source/torture/vfstest.c b/source/torture/vfstest.c index 0633d0c2e7c..daecf3c2d1d 100644 --- a/source/torture/vfstest.c +++ b/source/torture/vfstest.c @@ -32,8 +32,6 @@ static struct cmd_list { struct cmd_set *cmd_set; } *cmd_list; -extern pstring user_socket_options; - int get_client_fd(void) { return -1; @@ -470,7 +468,8 @@ bool reload_services(bool test) { if (smbd_server_fd() != -1) { set_socket_options(smbd_server_fd(),"SO_KEEPALIVE"); - set_socket_options(smbd_server_fd(), user_socket_options); + set_socket_options(smbd_server_fd(), + lp_socket_options()); } } |