Changeset 740 for vendor/current/source3/param
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- Location:
- vendor/current/source3/param
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/param/loadparm.c
r597 r740 11 11 Copyright (C) Jim McDonough <jmcd@us.ibm.com> 2003 12 12 Copyright (C) Michael Adam 2008 13 13 14 14 This program is free software; you can redistribute it and/or modify 15 15 it under the terms of the GNU General Public License as published by 16 16 the Free Software Foundation; either version 3 of the License, or 17 17 (at your option) any later version. 18 18 19 19 This program is distributed in the hope that it will be useful, 20 20 but WITHOUT ANY WARRANTY; without even the implied warranty of 21 21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 22 GNU General Public License for more details. 23 23 24 24 You should have received a copy of the GNU General Public License 25 25 along with this program. If not, see <http://www.gnu.org/licenses/>. … … 53 53 54 54 #include "includes.h" 55 #include "system/filesys.h" 56 #include "util_tdb.h" 55 57 #include "printing.h" 58 #include "lib/smbconf/smbconf.h" 59 #include "lib/smbconf/smbconf_init.h" 60 61 #include "ads.h" 62 #include "../librpc/gen_ndr/svcctl.h" 63 #include "intl.h" 64 #include "smb_signing.h" 65 #include "dbwrap.h" 66 #include "smbldap.h" 56 67 57 68 #ifdef HAVE_SYS_SYSCTL_H … … 109 120 char *value; 110 121 char **list; 122 unsigned flags; 111 123 }; 112 124 … … 182 194 char *szAbortShutdownScript; 183 195 char *szUsernameMapScript; 196 int iUsernameMapCacheTime; 184 197 char *szCheckPasswordScript; 185 198 char *szWINSHook; … … 205 218 bool bWinbindRpcOnly; 206 219 bool bCreateKrb5Conf; 220 int winbindMaxDomainConnections; 207 221 char *szIdmapBackend; 208 char *szIdmapAllocBackend;222 bool bIdmapReadOnly; 209 223 char *szAddShareCommand; 210 224 char *szChangeShareCommand; … … 252 266 int winbind_cache_time; 253 267 int winbind_reconnect_delay; 254 int winbind_max_ idle_children;268 int winbind_max_clients; 255 269 char **szWinbindNssInfo; 256 270 int iLockSpinTime; … … 275 289 bool clustering; 276 290 int ctdb_timeout; 291 int ctdb_locktime_warn_threshold; 277 292 int ldap_passwd_sync; 278 293 int ldap_replication_sleep; … … 327 342 bool bClientUseSpnego; 328 343 bool client_use_spnego_principal; 344 bool send_spnego_principal; 329 345 bool bDebugPrefixTimestamp; 330 346 bool bDebugHiresTimestamp; … … 355 371 int iIdmapNegativeCacheTime; 356 372 bool bResetOnZeroVC; 373 bool bLogWriteableFilesOnExit; 357 374 int iKeepalive; 358 375 int iminreceivefile; … … 361 378 char *szSMBPerfcountModule; 362 379 bool bMapUntrustedToDomain; 380 bool bAsyncSMBEchoHandler; 381 bool bMulticastDnsRegister; 382 int ismb2_max_read; 383 int ismb2_max_write; 384 int ismb2_max_trans; 385 int ismb2_max_credits; 386 char *ncalrpc_dir; 363 387 }; 364 388 … … 452 476 bool bGuest_ok; 453 477 bool bPrint_ok; 478 bool bPrintNotifyBackchannel; 454 479 bool bMap_system; 455 480 bool bMap_hidden; … … 596 621 False, /* bGuest_ok */ 597 622 False, /* bPrint_ok */ 623 True, /* bPrintNotifyBackchannel */ 598 624 False, /* bMap_system */ 599 625 False, /* bMap_hidden */ … … 667 693 static bool bInGlobalSection = True; 668 694 static bool bGlobalOnly = False; 669 static int server_role;670 695 static int default_server_announce; 671 696 … … 676 701 static bool handle_copy( int snum, const char *pszParmValue, char **ptr); 677 702 static bool handle_netbios_name( int snum, const char *pszParmValue, char **ptr); 703 static bool handle_idmap_backend(int snum, const char *pszParmValue, char **ptr); 678 704 static bool handle_idmap_uid( int snum, const char *pszParmValue, char **ptr); 679 705 static bool handle_idmap_gid( int snum, const char *pszParmValue, char **ptr); … … 683 709 static bool handle_netbios_scope( int snum, const char *pszParmValue, char **ptr ); 684 710 static bool handle_charset( int snum, const char *pszParmValue, char **ptr ); 711 static bool handle_dos_charset( int snum, const char *pszParmValue, char **ptr ); 685 712 static bool handle_printing( int snum, const char *pszParmValue, char **ptr); 686 713 static bool handle_ldap_debug_level( int snum, const char *pszParmValue, char **ptr); 687 714 688 static void set_server_role(void);689 715 static void set_default_server_announce_type(void); 690 716 static void set_allowed_client_auth(void); … … 693 719 694 720 static void add_to_file_list(const char *fname, const char *subfname); 721 static bool lp_set_cmdline_helper(const char *pszParmName, const char *pszParmValue, bool store_values); 695 722 696 723 static const struct enum_list enum_protocol[] = { … … 728 755 {PRINT_LPRNT, "nt"}, 729 756 {PRINT_LPROS2, "os2"}, 730 #if def DEVELOPER757 #if defined(DEVELOPER) || defined(ENABLE_BUILD_FARM_HACKS) 731 758 {PRINT_TEST, "test"}, 732 759 {PRINT_VLP, "vlp"}, … … 818 845 {-1, NULL} 819 846 }; 820 821 /* Client-side offline caching policy types */822 #define CSC_POLICY_MANUAL 0823 #define CSC_POLICY_DOCUMENTS 1824 #define CSC_POLICY_PROGRAMS 2825 #define CSC_POLICY_DISABLE 3826 847 827 848 static const struct enum_list enum_csc_policy[] = { … … 936 957 .p_class = P_GLOBAL, 937 958 .ptr = &Globals.dos_charset, 938 .special = handle_ charset,959 .special = handle_dos_charset, 939 960 .enum_list = NULL, 940 961 .flags = FLAG_ADVANCED … … 1099 1120 }, 1100 1121 { 1101 .label = "update encrypted",1102 .type = P_BOOL,1103 .p_class = P_GLOBAL,1104 .ptr = &Globals.bUpdateEncrypt,1105 .special = NULL,1106 .enum_list = NULL,1107 .flags = FLAG_ADVANCED,1108 },1109 {1110 1122 .label = "client schannel", 1111 1123 .type = P_ENUM, … … 1150 1162 .special = NULL, 1151 1163 .enum_list = NULL, 1152 .flags = FLAG_ADVANCED ,1164 .flags = FLAG_ADVANCED | FLAG_DEPRECATED, 1153 1165 }, 1154 1166 { … … 1249 1261 .special = NULL, 1250 1262 .enum_list = NULL, 1251 .flags = FLAG_ADVANCED ,1263 .flags = FLAG_ADVANCED | FLAG_DEPRECATED, 1252 1264 }, 1253 1265 … … 1322 1334 .special = NULL, 1323 1335 .enum_list = NULL, 1324 .flags = FLAG_ADVANCED ,1336 .flags = FLAG_ADVANCED | FLAG_DEPRECATED, 1325 1337 }, 1326 1338 { … … 1406 1418 }, 1407 1419 { 1420 .label = "send spnego principal", 1421 .type = P_BOOL, 1422 .p_class = P_GLOBAL, 1423 .ptr = &Globals.send_spnego_principal, 1424 .special = NULL, 1425 .enum_list = NULL, 1426 .flags = FLAG_ADVANCED, 1427 }, 1428 { 1408 1429 .label = "username", 1409 1430 .type = P_STRING, … … 1412 1433 .special = NULL, 1413 1434 .enum_list = NULL, 1414 .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE ,1435 .flags = FLAG_ADVANCED | FLAG_GLOBAL | FLAG_SHARE | FLAG_DEPRECATED, 1415 1436 }, 1416 1437 { … … 2089 2110 }, 2090 2111 { 2112 .label = "log writeable files on exit", 2113 .type = P_BOOL, 2114 .p_class = P_GLOBAL, 2115 .ptr = &Globals.bLogWriteableFilesOnExit, 2116 .special = NULL, 2117 .enum_list = NULL, 2118 .flags = FLAG_ADVANCED, 2119 }, 2120 { 2091 2121 .label = "acl compatibility", 2092 2122 .type = P_ENUM, … … 2266 2296 .special = NULL, 2267 2297 .enum_list = NULL, 2268 .flags = FLAG_ADVANCED ,2298 .flags = FLAG_ADVANCED | FLAG_DEPRECATED, 2269 2299 }, 2270 2300 { … … 2577 2607 .flags = FLAG_ADVANCED | FLAG_GLOBAL, 2578 2608 }, 2609 { 2610 .label = "ctdb locktime warn threshold", 2611 .type = P_INTEGER, 2612 .p_class = P_GLOBAL, 2613 .ptr = &Globals.ctdb_locktime_warn_threshold, 2614 .special = NULL, 2615 .enum_list = NULL, 2616 .flags = FLAG_ADVANCED | FLAG_GLOBAL, 2617 }, 2618 { 2619 .label = "smb2 max read", 2620 .type = P_INTEGER, 2621 .p_class = P_GLOBAL, 2622 .ptr = &Globals.ismb2_max_read, 2623 .special = NULL, 2624 .enum_list = NULL, 2625 .flags = FLAG_ADVANCED, 2626 }, 2627 { 2628 .label = "smb2 max write", 2629 .type = P_INTEGER, 2630 .p_class = P_GLOBAL, 2631 .ptr = &Globals.ismb2_max_write, 2632 .special = NULL, 2633 .enum_list = NULL, 2634 .flags = FLAG_ADVANCED, 2635 }, 2636 { 2637 .label = "smb2 max trans", 2638 .type = P_INTEGER, 2639 .p_class = P_GLOBAL, 2640 .ptr = &Globals.ismb2_max_trans, 2641 .special = NULL, 2642 .enum_list = NULL, 2643 .flags = FLAG_ADVANCED, 2644 }, 2645 { 2646 .label = "smb2 max credits", 2647 .type = P_INTEGER, 2648 .p_class = P_GLOBAL, 2649 .ptr = &Globals.ismb2_max_credits, 2650 .special = NULL, 2651 .enum_list = NULL, 2652 .flags = FLAG_ADVANCED, 2653 }, 2579 2654 2580 2655 {N_("Printing Options"), P_SEP, P_SEPARATOR}, … … 2642 2717 .enum_list = NULL, 2643 2718 .flags = FLAG_ADVANCED | FLAG_PRINT, 2719 }, 2720 { 2721 .label = "print notify backchannel", 2722 .type = P_BOOL, 2723 .p_class = P_LOCAL, 2724 .ptr = &sDefault.bPrintNotifyBackchannel, 2725 .special = NULL, 2726 .enum_list = NULL, 2727 .flags = FLAG_ADVANCED, 2644 2728 }, 2645 2729 { … … 3251 3335 }, 3252 3336 { 3337 .label = "username map cache time", 3338 .type = P_INTEGER, 3339 .p_class = P_GLOBAL, 3340 .ptr = &Globals.iUsernameMapCacheTime, 3341 .special = NULL, 3342 .enum_list = NULL, 3343 .flags = FLAG_ADVANCED, 3344 }, 3345 { 3253 3346 .label = "logon script", 3254 3347 .type = P_STRING, … … 4054 4147 .special = NULL, 4055 4148 .enum_list = NULL, 4056 .flags = FLAG_ADVANCED ,4149 .flags = FLAG_ADVANCED | FLAG_DEPRECATED, 4057 4150 }, 4058 4151 { … … 4354 4447 }, 4355 4448 { 4449 .label = "async smb echo handler", 4450 .type = P_BOOL, 4451 .p_class = P_GLOBAL, 4452 .ptr = &Globals.bAsyncSMBEchoHandler, 4453 .special = NULL, 4454 .enum_list = NULL, 4455 .flags = FLAG_ADVANCED | FLAG_GLOBAL, 4456 }, 4457 { 4458 .label = "multicast dns register", 4459 .type = P_BOOL, 4460 .p_class = P_GLOBAL, 4461 .ptr = &Globals.bMulticastDnsRegister, 4462 .special = NULL, 4463 .enum_list = NULL, 4464 .flags = FLAG_ADVANCED | FLAG_GLOBAL, 4465 }, 4466 { 4356 4467 .label = "panic action", 4357 4468 .type = P_STRING, … … 4440 4551 .p_class = P_GLOBAL, 4441 4552 .ptr = &Globals.szIdmapBackend, 4442 .special = NULL, 4443 .enum_list = NULL, 4444 .flags = FLAG_ADVANCED, 4445 }, 4446 { 4447 .label = "idmap alloc backend", 4448 .type = P_STRING, 4449 .p_class = P_GLOBAL, 4450 .ptr = &Globals.szIdmapAllocBackend, 4451 .special = NULL, 4452 .enum_list = NULL, 4453 .flags = FLAG_ADVANCED, 4553 .special = handle_idmap_backend, 4554 .enum_list = NULL, 4555 .flags = FLAG_ADVANCED | FLAG_DEPRECATED, 4454 4556 }, 4455 4557 { … … 4478 4580 .special = handle_idmap_uid, 4479 4581 .enum_list = NULL, 4480 .flags = FLAG_ADVANCED ,4582 .flags = FLAG_ADVANCED | FLAG_DEPRECATED, 4481 4583 }, 4482 4584 { … … 4496 4598 .special = handle_idmap_gid, 4497 4599 .enum_list = NULL, 4498 .flags = FLAG_ADVANCED ,4600 .flags = FLAG_ADVANCED | FLAG_DEPRECATED, 4499 4601 }, 4500 4602 { … … 4553 4655 }, 4554 4656 { 4657 .label = "winbind max clients", 4658 .type = P_INTEGER, 4659 .p_class = P_GLOBAL, 4660 .ptr = &Globals.winbind_max_clients, 4661 .special = NULL, 4662 .enum_list = NULL, 4663 .flags = FLAG_ADVANCED, 4664 }, 4665 { 4555 4666 .label = "winbind enum users", 4556 4667 .type = P_BOOL, … … 4656 4767 .p_class = P_GLOBAL, 4657 4768 .ptr = &Globals.bCreateKrb5Conf, 4769 .special = NULL, 4770 .enum_list = NULL, 4771 .flags = FLAG_ADVANCED, 4772 }, 4773 { 4774 .label = "ncalrpc dir", 4775 .type = P_STRING, 4776 .p_class = P_GLOBAL, 4777 .ptr = &Globals.ncalrpc_dir, 4778 .special = NULL, 4779 .enum_list = NULL, 4780 .flags = FLAG_ADVANCED, 4781 }, 4782 { 4783 .label = "winbind max domain connections", 4784 .type = P_INTEGER, 4785 .p_class = P_GLOBAL, 4786 .ptr = &Globals.winbindMaxDomainConnections, 4658 4787 .special = NULL, 4659 4788 .enum_list = NULL, … … 4734 4863 break; 4735 4864 4736 #ifdef DEVELOPER 4865 #if defined(DEVELOPER) || defined(ENABLE_BUILD_FARM_HACKS) 4866 4737 4867 case PRINT_TEST: 4738 case PRINT_VLP: 4739 string_set(&pService->szPrintcommand, "vlp print %p %s"); 4740 string_set(&pService->szLpqcommand, "vlp lpq %p"); 4741 string_set(&pService->szLprmcommand, "vlp lprm %p %j"); 4742 string_set(&pService->szLppausecommand, "vlp lppause %p %j"); 4743 string_set(&pService->szLpresumecommand, "vlp lpresume %p %j"); 4744 string_set(&pService->szQueuepausecommand, "vlp queuepause %p"); 4745 string_set(&pService->szQueueresumecommand, "vlp queueresume %p"); 4868 case PRINT_VLP: { 4869 const char *tdbfile; 4870 char *tmp; 4871 4872 tdbfile = talloc_asprintf( 4873 talloc_tos(), "tdbfile=%s", 4874 lp_parm_const_string(-1, "vlp", "tdbfile", 4875 "/tmp/vlp.tdb")); 4876 if (tdbfile == NULL) { 4877 tdbfile="tdbfile=/tmp/vlp.tdb"; 4878 } 4879 4880 tmp = talloc_asprintf(talloc_tos(), "vlp %s print %%p %%s", 4881 tdbfile); 4882 string_set(&pService->szPrintcommand, 4883 tmp ? tmp : "vlp print %p %s"); 4884 TALLOC_FREE(tmp); 4885 4886 tmp = talloc_asprintf(talloc_tos(), "vlp %s lpq %%p", 4887 tdbfile); 4888 string_set(&pService->szLpqcommand, 4889 tmp ? tmp : "vlp lpq %p"); 4890 TALLOC_FREE(tmp); 4891 4892 tmp = talloc_asprintf(talloc_tos(), "vlp %s lprm %%p %%j", 4893 tdbfile); 4894 string_set(&pService->szLprmcommand, 4895 tmp ? tmp : "vlp lprm %p %j"); 4896 TALLOC_FREE(tmp); 4897 4898 tmp = talloc_asprintf(talloc_tos(), "vlp %s lppause %%p %%j", 4899 tdbfile); 4900 string_set(&pService->szLppausecommand, 4901 tmp ? tmp : "vlp lppause %p %j"); 4902 TALLOC_FREE(tmp); 4903 4904 tmp = talloc_asprintf(talloc_tos(), "vlp %s lpresume %%p %%j", 4905 tdbfile); 4906 string_set(&pService->szLpresumecommand, 4907 tmp ? tmp : "vlp lpresume %p %j"); 4908 TALLOC_FREE(tmp); 4909 4910 tmp = talloc_asprintf(talloc_tos(), "vlp %s queuepause %%p", 4911 tdbfile); 4912 string_set(&pService->szQueuepausecommand, 4913 tmp ? tmp : "vlp queuepause %p"); 4914 TALLOC_FREE(tmp); 4915 4916 tmp = talloc_asprintf(talloc_tos(), "vlp %s queueresume %%p", 4917 tdbfile); 4918 string_set(&pService->szQueueresumecommand, 4919 tmp ? tmp : "vlp queueresume %p"); 4920 TALLOC_FREE(tmp); 4921 4746 4922 break; 4923 } 4747 4924 #endif /* DEVELOPER */ 4748 4925 … … 4780 4957 if(rl.rlim_cur == RLIM_INFINITY) 4781 4958 rlimit_max = MAX_OPEN_FILES; 4782 }4783 4959 #endif 4960 } 4784 4961 #endif 4785 4962 … … 4893 5070 } 4894 5071 5072 static int map_parameter(const char *pszParmName); 5073 5074 struct lp_stored_option { 5075 struct lp_stored_option *prev, *next; 5076 const char *label; 5077 const char *value; 5078 }; 5079 5080 static struct lp_stored_option *stored_options; 5081 5082 /* 5083 save options set by lp_set_cmdline() into a list. This list is 5084 re-applied when we do a globals reset, so that cmdline set options 5085 are sticky across reloads of smb.conf 5086 */ 5087 static bool store_lp_set_cmdline(const char *pszParmName, const char *pszParmValue) 5088 { 5089 struct lp_stored_option *entry, *entry_next; 5090 for (entry = stored_options; entry != NULL; entry = entry_next) { 5091 entry_next = entry->next; 5092 if (strcmp(pszParmName, entry->label) == 0) { 5093 DLIST_REMOVE(stored_options, entry); 5094 talloc_free(entry); 5095 break; 5096 } 5097 } 5098 5099 entry = talloc(NULL, struct lp_stored_option); 5100 if (!entry) { 5101 return false; 5102 } 5103 5104 entry->label = talloc_strdup(entry, pszParmName); 5105 if (!entry->label) { 5106 talloc_free(entry); 5107 return false; 5108 } 5109 5110 entry->value = talloc_strdup(entry, pszParmValue); 5111 if (!entry->value) { 5112 talloc_free(entry); 5113 return false; 5114 } 5115 5116 DLIST_ADD_END(stored_options, entry, struct lp_stored_option); 5117 5118 return true; 5119 } 5120 5121 static bool apply_lp_set_cmdline(void) 5122 { 5123 struct lp_stored_option *entry = NULL; 5124 for (entry = stored_options; entry != NULL; entry = entry->next) { 5125 if (!lp_set_cmdline_helper(entry->label, entry->value, false)) { 5126 DEBUG(0, ("Failed to re-apply cmdline parameter %s = %s\n", 5127 entry->label, entry->value)); 5128 return false; 5129 } 5130 } 5131 return true; 5132 } 5133 4895 5134 /*************************************************************************** 4896 5135 Initialise the global parameter structure. 4897 5136 ***************************************************************************/ 4898 5137 4899 static void init_globals(bool first_time_only)5138 static void init_globals(bool reinit_globals) 4900 5139 { 4901 5140 static bool done_init = False; … … 4904 5143 4905 5144 /* If requested to initialize only once and we've already done it... */ 4906 if ( first_time_only&& done_init) {5145 if (!reinit_globals && done_init) { 4907 5146 /* ... then we have nothing more to do */ 4908 5147 return; … … 4920 5159 } 4921 5160 5161 /* This memset and the free_global_parameters() above will 5162 * wipe out smb.conf options set with lp_set_cmdline(). The 5163 * apply_lp_set_cmdline() call puts these values back in the 5164 * table once the defaults are set */ 4922 5165 memset((void *)&Globals, '\0', sizeof(Globals)); 4923 5166 … … 4981 5224 /* 4982 5225 * By default support explicit binding to broadcast 4983 * addresses.4984 */5226 * addresses. 5227 */ 4985 5228 Globals.bNmbdBindExplicitBroadcast = true; 4986 5229 … … 5084 5327 Globals.bLanmanAuth = False; /* Do NOT use the LanMan hash, even if it is supplied */ 5085 5328 Globals.bNTLMAuth = True; /* Do use NTLMv1 if it is supplied by the client (otherwise NTLMv2) */ 5086 Globals.bClientNTLMv2Auth = False; /* Client should not use NTLMv2, as we can't tell that the server supports it.*/5087 /* Note, that we will use NTLM2 session security (which is different), if it is available */5329 Globals.bClientNTLMv2Auth = True; /* Client should always use use NTLMv2, as we can't tell that the server supports it, but most modern servers do */ 5330 /* Note, that we will also use NTLM2 session security (which is different), if it is available */ 5088 5331 5089 5332 Globals.map_to_guest = 0; /* By Default, "Never" */ … … 5098 5341 Globals.bUnixExtensions = True; 5099 5342 Globals.bResetOnZeroVC = False; 5343 Globals.bLogWriteableFilesOnExit = False; 5100 5344 Globals.bCreateKrb5Conf = true; 5345 Globals.winbindMaxDomainConnections = 1; 5101 5346 5102 5347 /* hostname lookups can be very expensive and are broken on … … 5163 5408 Globals.bAllowTrustedDomains = True; 5164 5409 string_set(&Globals.szIdmapBackend, "tdb"); 5410 Globals.bIdmapReadOnly = false; 5165 5411 5166 5412 string_set(&Globals.szTemplateShell, "/bin/false"); … … 5175 5421 Globals.clustering = False; 5176 5422 Globals.ctdb_timeout = 0; 5423 Globals.ctdb_locktime_warn_threshold = 0; 5177 5424 5178 5425 Globals.winbind_cache_time = 300; /* 5 minutes */ 5179 5426 Globals.winbind_reconnect_delay = 30; /* 30 seconds */ 5427 Globals.winbind_max_clients = 200; 5180 5428 Globals.bWinbindEnumUsers = False; 5181 5429 Globals.bWinbindEnumGroups = False; … … 5184 5432 Globals.bWinbindNestedGroups = True; 5185 5433 Globals.winbind_expand_groups = 1; 5186 Globals.szWinbindNssInfo = str_list_make_v3( talloc_autofree_context(), "template", NULL);5434 Globals.szWinbindNssInfo = str_list_make_v3(NULL, "template", NULL); 5187 5435 Globals.bWinbindRefreshTickets = False; 5188 5436 Globals.bWinbindOfflineLogon = False; … … 5229 5477 5230 5478 Globals.bMapUntrustedToDomain = false; 5479 Globals.bMulticastDnsRegister = true; 5480 5481 Globals.ismb2_max_read = DEFAULT_SMB2_MAX_READ; 5482 Globals.ismb2_max_write = DEFAULT_SMB2_MAX_WRITE; 5483 Globals.ismb2_max_trans = DEFAULT_SMB2_MAX_TRANSACT; 5484 Globals.ismb2_max_credits = DEFAULT_SMB2_MAX_CREDITS; 5485 5486 string_set(&Globals.ncalrpc_dir, get_dyn_NCALRPCDIR()); 5487 5488 /* Now put back the settings that were set with lp_set_cmdline() */ 5489 apply_lp_set_cmdline(); 5231 5490 } 5232 5491 … … 5303 5562 #define FN_LOCAL_PARM_INTEGER(fn_name,val) \ 5304 5563 int fn_name(const struct share_params *p) {return(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);} 5305 #define FN_LOCAL_PARM_STRING(fn_name,val) \5306 char *fn_name(const struct share_params *p) {return(lp_string((LP_SNUM_OK(p->service) && ServicePtrs[(p->service)]->val) ? ServicePtrs[(p->service)]->val : sDefault.val));}5307 5564 #define FN_LOCAL_CHAR(fn_name,val) \ 5308 5565 char fn_name(const struct share_params *p) {return(LP_SNUM_OK(p->service)? ServicePtrs[(p->service)]->val : sDefault.val);} … … 5439 5696 FN_GLOBAL_STRING(lp_abort_shutdown_script, &Globals.szAbortShutdownScript) 5440 5697 FN_GLOBAL_STRING(lp_username_map_script, &Globals.szUsernameMapScript) 5698 FN_GLOBAL_INTEGER(lp_username_map_cache_time, &Globals.iUsernameMapCacheTime) 5441 5699 5442 5700 FN_GLOBAL_STRING(lp_check_password_script, &Globals.szCheckPasswordScript) … … 5458 5716 FN_GLOBAL_BOOL(lp_winbind_rpc_only, &Globals.bWinbindRpcOnly) 5459 5717 FN_GLOBAL_BOOL(lp_create_krb5_conf, &Globals.bCreateKrb5Conf) 5718 static FN_GLOBAL_INTEGER(lp_winbind_max_domain_connections_int, 5719 &Globals.winbindMaxDomainConnections) 5720 5721 int lp_winbind_max_domain_connections(void) 5722 { 5723 if (lp_winbind_offline_logon() && 5724 lp_winbind_max_domain_connections_int() > 1) { 5725 DEBUG(1, ("offline logons active, restricting max domain " 5726 "connections to 1\n")); 5727 return 1; 5728 } 5729 return MAX(1, lp_winbind_max_domain_connections_int()); 5730 } 5460 5731 5461 5732 FN_GLOBAL_CONST_STRING(lp_idmap_backend, &Globals.szIdmapBackend) 5462 FN_GLOBAL_STRING(lp_idmap_alloc_backend, &Globals.szIdmapAllocBackend)5463 5733 FN_GLOBAL_INTEGER(lp_idmap_cache_time, &Globals.iIdmapCacheTime) 5464 5734 FN_GLOBAL_INTEGER(lp_idmap_negative_cache_time, &Globals.iIdmapNegativeCacheTime) … … 5494 5764 FN_GLOBAL_BOOL(lp_disable_netbios, &Globals.bDisableNetbios) 5495 5765 FN_GLOBAL_BOOL(lp_reset_on_zero_vc, &Globals.bResetOnZeroVC) 5766 FN_GLOBAL_BOOL(lp_log_writeable_files_on_exit, 5767 &Globals.bLogWriteableFilesOnExit) 5496 5768 FN_GLOBAL_BOOL(lp_ms_add_printer_wizard, &Globals.bMsAddPrinterWizard) 5497 5769 FN_GLOBAL_BOOL(lp_dns_proxy, &Globals.bDNSproxy) … … 5504 5776 FN_GLOBAL_INTEGER(lp_init_logon_delay, &Globals.InitLogonDelay) 5505 5777 FN_GLOBAL_BOOL(lp_load_printers, &Globals.bLoadPrinters) 5506 FN_GLOBAL_BOOL( lp_readraw, &Globals.bReadRaw)5778 FN_GLOBAL_BOOL(_lp_readraw, &Globals.bReadRaw) 5507 5779 FN_GLOBAL_BOOL(lp_large_readwrite, &Globals.bLargeReadwrite) 5508 FN_GLOBAL_BOOL( lp_writeraw, &Globals.bWriteRaw)5780 FN_GLOBAL_BOOL(_lp_writeraw, &Globals.bWriteRaw) 5509 5781 FN_GLOBAL_BOOL(lp_null_passwords, &Globals.bNullPasswords) 5510 5782 FN_GLOBAL_BOOL(lp_obey_pam_restrictions, &Globals.bObeyPamRestrictions) 5511 5783 FN_GLOBAL_BOOL(lp_encrypted_passwords, &Globals.bEncryptPasswords) 5512 FN_GLOBAL_BOOL(lp_update_encrypted, &Globals.bUpdateEncrypt)5513 5784 FN_GLOBAL_INTEGER(lp_client_schannel, &Globals.clientSchannel) 5514 5785 FN_GLOBAL_INTEGER(lp_server_schannel, &Globals.serverSchannel) … … 5549 5820 FN_GLOBAL_BOOL(lp_client_use_spnego, &Globals.bClientUseSpnego) 5550 5821 FN_GLOBAL_BOOL(lp_client_use_spnego_principal, &Globals.client_use_spnego_principal) 5822 FN_GLOBAL_BOOL(lp_send_spnego_principal, &Globals.send_spnego_principal) 5551 5823 FN_GLOBAL_BOOL(lp_hostname_lookups, &Globals.bHostnameLookups) 5552 5824 FN_LOCAL_PARM_BOOL(lp_change_notify, bChangeNotify) … … 5570 5842 FN_GLOBAL_INTEGER(lp_deadtime, &Globals.deadtime) 5571 5843 FN_GLOBAL_BOOL(lp_getwd_cache, &Globals.getwd_cache) 5572 FN_GLOBAL_INTEGER(lp_maxprotocol, &Globals.maxprotocol) 5844 static FN_GLOBAL_INTEGER(_lp_maxprotocol, &Globals.maxprotocol) 5845 int lp_maxprotocol(void) 5846 { 5847 int ret = _lp_maxprotocol(); 5848 if ((ret == PROTOCOL_SMB2) && (lp_security() == SEC_SHARE)) { 5849 DEBUG(2,("WARNING!!: \"security = share\" is incompatible " 5850 "with the SMB2 protocol. Resetting to SMB1.\n" )); 5851 lp_do_parameter(-1, "max protocol", "NT1"); 5852 return PROTOCOL_NT1; 5853 } 5854 return ret; 5855 } 5573 5856 FN_GLOBAL_INTEGER(lp_minprotocol, &Globals.minprotocol) 5574 5857 FN_GLOBAL_INTEGER(lp_security, &Globals.security) … … 5590 5873 FN_GLOBAL_CONST_STRING(lp_socket_options, &Globals.szSocketOptions) 5591 5874 FN_GLOBAL_INTEGER(lp_config_backend, &Globals.ConfigBackend) 5592 5875 FN_GLOBAL_INTEGER(lp_smb2_max_read, &Globals.ismb2_max_read) 5876 FN_GLOBAL_INTEGER(lp_smb2_max_write, &Globals.ismb2_max_write) 5877 FN_GLOBAL_INTEGER(lp_smb2_max_trans, &Globals.ismb2_max_trans) 5878 int lp_smb2_max_credits(void) 5879 { 5880 if (Globals.ismb2_max_credits == 0) { 5881 Globals.ismb2_max_credits = DEFAULT_SMB2_MAX_CREDITS; 5882 } 5883 return Globals.ismb2_max_credits; 5884 } 5593 5885 FN_LOCAL_STRING(lp_preexec, szPreExec) 5594 5886 FN_LOCAL_STRING(lp_postexec, szPostExec) … … 5630 5922 FN_GLOBAL_BOOL(lp_clustering, &Globals.clustering) 5631 5923 FN_GLOBAL_INTEGER(lp_ctdb_timeout, &Globals.ctdb_timeout) 5924 FN_GLOBAL_INTEGER(lp_ctdb_locktime_warn_threshold, &Globals.ctdb_locktime_warn_threshold) 5632 5925 FN_LOCAL_STRING(lp_printcommand, szPrintcommand) 5633 5926 FN_LOCAL_STRING(lp_lpqcommand, szLpqcommand) … … 5677 5970 FN_LOCAL_BOOL(lp_administrative_share, bAdministrative_share) 5678 5971 FN_LOCAL_BOOL(lp_print_ok, bPrint_ok) 5972 FN_LOCAL_BOOL(lp_print_notify_backchannel, bPrintNotifyBackchannel) 5679 5973 FN_LOCAL_BOOL(lp_map_hidden, bMap_hidden) 5680 5974 FN_LOCAL_BOOL(lp_map_archive, bMap_archive) … … 5701 5995 FN_LOCAL_BOOL(lp_dos_filetime_resolution, bDosFiletimeResolution) 5702 5996 FN_LOCAL_BOOL(lp_fake_dir_create_times, bFakeDirCreateTimes) 5997 FN_GLOBAL_BOOL(lp_async_smb_echo_handler, &Globals.bAsyncSMBEchoHandler) 5998 FN_GLOBAL_BOOL(lp_multicast_dns_register, &Globals.bMulticastDnsRegister) 5703 5999 FN_LOCAL_BOOL(lp_blocking_locks, bBlockingLocks) 5704 6000 FN_LOCAL_BOOL(lp_inherit_perms, bInheritPerms) … … 5745 6041 FN_GLOBAL_INTEGER(lp_winbind_cache_time, &Globals.winbind_cache_time) 5746 6042 FN_GLOBAL_INTEGER(lp_winbind_reconnect_delay, &Globals.winbind_reconnect_delay) 6043 FN_GLOBAL_INTEGER(lp_winbind_max_clients, &Globals.winbind_max_clients) 5747 6044 FN_GLOBAL_LIST(lp_winbind_nss_info, &Globals.szWinbindNssInfo) 5748 6045 FN_GLOBAL_INTEGER(lp_algorithmic_rid_base, &Globals.AlgorithmicRidBase) … … 5752 6049 FN_GLOBAL_INTEGER(lp_client_ldap_sasl_wrapping, &Globals.client_ldap_sasl_wrapping) 5753 6050 6051 FN_GLOBAL_STRING(lp_ncalrpc_dir, &Globals.ncalrpc_dir) 6052 5754 6053 /* local prototypes */ 5755 6054 5756 static int map_parameter(const char *pszParmName);5757 6055 static int map_parameter_canonical(const char *pszParmName, bool *inverse); 5758 6056 static const char *get_boolean(bool bool_value); … … 5769 6067 static void free_service_byindex(int iService); 5770 6068 static void free_param_opts(struct param_opt_struct **popts); 5771 static char * canonicalize_servicename(const char *name);5772 6069 static void show_parameter(int parmIndex); 5773 6070 static bool is_synonym_of(int parm1, int parm2, bool *inverse); … … 5784 6081 char* param_key; 5785 6082 struct param_opt_struct *data; 5786 6083 5787 6084 if (snum >= iNumServices) return NULL; 5788 6085 5789 6086 if (snum < 0) { 5790 6087 data = Globals.param_opt; … … 5793 6090 data = ServicePtrs[snum]->param_opt; 5794 6091 } 5795 6092 5796 6093 if (asprintf(¶m_key, "%s:%s", type, option) == -1) { 5797 6094 DEBUG(0,("asprintf failed!\n")); … … 5821 6118 5822 6119 string_free(¶m_key); 5823 6120 5824 6121 return NULL; 5825 6122 } … … 5868 6165 return False; 5869 6166 } 5870 6167 5871 6168 if (!set_boolean(s, &ret)) { 5872 6169 DEBUG(0,("lp_bool(%s): value is not boolean!\n",s)); … … 5888 6185 return (-1); 5889 6186 } 5890 6187 5891 6188 for (i=0; _enum[i].name; i++) { 5892 6189 if (strequal(_enum[i].name,s)) … … 5918 6215 { 5919 6216 struct param_opt_struct *data = get_parametrics(snum, type, option); 5920 6217 5921 6218 if (data == NULL||data->value==NULL) { 5922 6219 if (def) { … … 5935 6232 { 5936 6233 struct param_opt_struct *data = get_parametrics(snum, type, option); 5937 6234 5938 6235 if (data == NULL||data->value==NULL) 5939 6236 return def; 5940 6237 5941 6238 return data->value; 5942 6239 } … … 5951 6248 if (data == NULL||data->value==NULL) 5952 6249 return (const char **)def; 5953 6250 5954 6251 if (data->list==NULL) { 5955 data->list = str_list_make_v3( talloc_autofree_context(), data->value, NULL);6252 data->list = str_list_make_v3(NULL, data->value, NULL); 5956 6253 } 5957 6254 … … 5965 6262 { 5966 6263 struct param_opt_struct *data = get_parametrics(snum, type, option); 5967 6264 5968 6265 if (data && data->value && *data->value) 5969 6266 return lp_int(data->value); … … 5978 6275 { 5979 6276 struct param_opt_struct *data = get_parametrics(snum, type, option); 5980 6277 5981 6278 if (data && data->value && *data->value) 5982 6279 return lp_ulong(data->value); … … 5991 6288 { 5992 6289 struct param_opt_struct *data = get_parametrics(snum, type, option); 5993 6290 5994 6291 if (data && data->value && *data->value) 5995 6292 return lp_bool(data->value); … … 6005 6302 { 6006 6303 struct param_opt_struct *data = get_parametrics(snum, type, option); 6007 6304 6008 6305 if (data && data->value && *data->value && _enum) 6009 6306 return lp_enum(data->value, _enum); … … 6069 6366 6070 6367 string_free(&pservice->szService); 6071 bitmap_free(pservice->copymap);6368 TALLOC_FREE(pservice->copymap); 6072 6369 6073 6370 free_param_opts(&pservice->param_opt); … … 6094 6391 if (ServicePtrs[idx]->szService) { 6095 6392 char *canon_name = canonicalize_servicename( 6393 talloc_tos(), 6096 6394 ServicePtrs[idx]->szService ); 6097 6395 6098 6396 dbwrap_delete_bystring(ServiceHash, canon_name ); 6099 6397 TALLOC_FREE(canon_name); … … 6120 6418 i = getservicebyname(name, NULL); 6121 6419 if (i >= 0) { 6122 /* Clean all parametric options for service */6123 /* They will be added during parsing again */6124 free_param_opts(&ServicePtrs[i]->param_opt);6125 6420 return (i); 6126 6421 } … … 6137 6432 struct service **tsp; 6138 6433 int *tinvalid; 6139 6434 6140 6435 tsp = SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(ServicePtrs, struct service *, num_to_alloc); 6141 6436 if (tsp == NULL) { … … 6170 6465 if (name) 6171 6466 string_set(&ServicePtrs[i]->szService, name); 6172 6467 6173 6468 DEBUG(8,("add_a_service: Creating snum = %d for %s\n", 6174 6469 i, ServicePtrs[i]->szService)); … … 6177 6472 return (-1); 6178 6473 } 6179 6474 6180 6475 return (i); 6181 6476 } … … 6185 6480 ***************************************************************************/ 6186 6481 6187 static char *canonicalize_servicename(const char *src)6482 char *canonicalize_servicename(TALLOC_CTX *ctx, const char *src) 6188 6483 { 6189 6484 char *result; … … 6194 6489 } 6195 6490 6196 result = talloc_strdup( talloc_tos(), src);6491 result = talloc_strdup(ctx, src); 6197 6492 SMB_ASSERT(result != NULL); 6198 6493 … … 6221 6516 idx, name)); 6222 6517 6223 canon_name = canonicalize_servicename( name );6518 canon_name = canonicalize_servicename(talloc_tos(), name ); 6224 6519 6225 6520 dbwrap_store_bystring(ServiceHash, canon_name, … … 6360 6655 /* Printer services must be printable. */ 6361 6656 ServicePtrs[i]->bPrint_ok = True; 6362 6657 6363 6658 DEBUG(3, ("adding printer service %s\n", pszPrintername)); 6364 6659 … … 6728 7023 } 6729 7024 6730 canon_name = canonicalize_servicename( pszServiceName);7025 canon_name = canonicalize_servicename(talloc_tos(), pszServiceName); 6731 7026 6732 7027 data = dbwrap_fetch_bystring(ServiceHash, canon_name, canon_name); … … 6757 7052 static void set_param_opt(struct param_opt_struct **opt_list, 6758 7053 const char *opt_name, 6759 const char *opt_value) 7054 const char *opt_value, 7055 unsigned flags) 6760 7056 { 6761 7057 struct param_opt_struct *new_opt, *opt; … … 6773 7069 /* If we already have same option, override it */ 6774 7070 if (strwicmp(opt->key, opt_name) == 0) { 7071 if ((opt->flags & FLAG_CMDLINE) && 7072 !(flags & FLAG_CMDLINE)) { 7073 /* it's been marked as not to be 7074 overridden */ 7075 return; 7076 } 6775 7077 string_free(&opt->value); 6776 7078 TALLOC_FREE(opt->list); 6777 7079 opt->value = SMB_STRDUP(opt_value); 7080 opt->flags = flags; 6778 7081 not_added = false; 6779 7082 break; … … 6786 7089 new_opt->value = SMB_STRDUP(opt_value); 6787 7090 new_opt->list = NULL; 7091 new_opt->flags = flags; 6788 7092 DLIST_ADD(*opt_list, new_opt); 6789 7093 } … … 6850 7154 pserviceSource->copymap); 6851 7155 } 6852 7156 6853 7157 data = pserviceSource->param_opt; 6854 7158 while (data) { 6855 set_param_opt(&pserviceDest->param_opt, data->key, data->value );7159 set_param_opt(&pserviceDest->param_opt, data->key, data->value, data->flags); 6856 7160 data = data->next; 6857 7161 } … … 6906 7210 static struct smbconf_ctx *lp_smbconf_ctx(void) 6907 7211 { 6908 WERROR werr;7212 sbcErr err; 6909 7213 static struct smbconf_ctx *conf_ctx = NULL; 6910 7214 6911 7215 if (conf_ctx == NULL) { 6912 werr = smbconf_init(NULL, &conf_ctx, "registry:");6913 if (! W_ERROR_IS_OK(werr)) {7216 err = smbconf_init(NULL, &conf_ctx, "registry:"); 7217 if (!SBC_ERROR_IS_OK(err)) { 6914 7218 DEBUG(1, ("error initializing registry configuration: " 6915 "%s\n", win_errstr(werr)));7219 "%s\n", sbcErrorString(err))); 6916 7220 conf_ctx = NULL; 6917 7221 } … … 6953 7257 bool process_registry_service(const char *service_name) 6954 7258 { 6955 WERROR werr;7259 sbcErr err; 6956 7260 struct smbconf_service *service = NULL; 6957 7261 TALLOC_CTX *mem_ctx = talloc_stackframe(); … … 6974 7278 } 6975 7279 6976 werr = smbconf_get_share(conf_ctx, mem_ctx, service_name, &service);6977 if (! W_ERROR_IS_OK(werr)) {7280 err = smbconf_get_share(conf_ctx, mem_ctx, service_name, &service); 7281 if (!SBC_ERROR_IS_OK(err)) { 6978 7282 goto done; 6979 7283 } … … 7011 7315 bool process_registry_shares(void) 7012 7316 { 7013 WERROR werr;7317 sbcErr err; 7014 7318 uint32_t count; 7015 7319 struct smbconf_service **service = NULL; … … 7023 7327 } 7024 7328 7025 werr = smbconf_get_config(conf_ctx, mem_ctx, &num_shares, &service);7026 if (! W_ERROR_IS_OK(werr)) {7329 err = smbconf_get_config(conf_ctx, mem_ctx, &num_shares, &service); 7330 if (!SBC_ERROR_IS_OK(err)) { 7027 7331 goto done; 7028 7332 } … … 7047 7351 return ret; 7048 7352 } 7353 7354 /** 7355 * reload those shares from registry that are already 7356 * activated in the services array. 7357 */ 7358 static bool reload_registry_shares(void) 7359 { 7360 int i; 7361 bool ret = true; 7362 7363 for (i = 0; i < iNumServices; i++) { 7364 if (!VALID(i)) { 7365 continue; 7366 } 7367 7368 if (ServicePtrs[i]->usershare == USERSHARE_VALID) { 7369 continue; 7370 } 7371 7372 ret = process_registry_service(ServicePtrs[i]->szService); 7373 if (!ret) { 7374 goto done; 7375 } 7376 } 7377 7378 done: 7379 return ret; 7380 } 7381 7049 7382 7050 7383 #define MAX_INCLUDE_DEPTH 100 … … 7086 7419 f->subfname = SMB_STRDUP(subfname); 7087 7420 if (!f->subfname) { 7421 SAFE_FREE(f->name); 7088 7422 SAFE_FREE(f); 7089 7423 return; … … 7096 7430 f->modtime = t; 7097 7431 } 7432 return; 7098 7433 } 7099 7434 … … 7145 7480 7146 7481 while (f) { 7147 char *n2 = NULL;7148 7482 time_t mod_time; 7149 7483 … … 7161 7495 } 7162 7496 } else { 7163 n2 = alloc_sub_basic(get_current_username(), 7164 current_user_info.domain, 7165 f->name); 7497 char *n2 = NULL; 7498 n2 = talloc_sub_basic(talloc_tos(), 7499 get_current_username(), 7500 current_user_info.domain, 7501 f->name); 7166 7502 if (!n2) { 7167 7503 return false; … … 7182 7518 f->modtime = mod_time; 7183 7519 SAFE_FREE(f->subfname); 7184 f->subfname = n2; /* Passing ownership of 7185 return from alloc_sub_basic 7186 above. */ 7520 f->subfname = SMB_STRDUP(n2); 7521 TALLOC_FREE(n2); 7187 7522 return true; 7188 7523 } 7189 SAFE_FREE(n2);7524 TALLOC_FREE(n2); 7190 7525 } 7191 7526 f = f->next; … … 7204 7539 { 7205 7540 bool ret; 7206 char *netbios_name = alloc_sub_basic(get_current_username(),7207 7208 7541 char *netbios_name = talloc_sub_basic( 7542 talloc_tos(), get_current_username(), current_user_info.domain, 7543 pszParmValue); 7209 7544 7210 7545 ret = set_global_myname(netbios_name); 7211 SAFE_FREE(netbios_name);7546 TALLOC_FREE(netbios_name); 7212 7547 string_set(&Globals.szNetbiosName,global_myname()); 7213 7548 … … 7227 7562 } 7228 7563 7564 static bool handle_dos_charset(int snum, const char *pszParmValue, char **ptr) 7565 { 7566 bool is_utf8 = false; 7567 size_t len = strlen(pszParmValue); 7568 7569 if (len == 4 || len == 5) { 7570 /* Don't use StrCaseCmp here as we don't want to 7571 initialize iconv. */ 7572 if ((toupper_m(pszParmValue[0]) == 'U') && 7573 (toupper_m(pszParmValue[1]) == 'T') && 7574 (toupper_m(pszParmValue[2]) == 'F')) { 7575 if (len == 4) { 7576 if (pszParmValue[3] == '8') { 7577 is_utf8 = true; 7578 } 7579 } else { 7580 if (pszParmValue[3] == '-' && 7581 pszParmValue[4] == '8') { 7582 is_utf8 = true; 7583 } 7584 } 7585 } 7586 } 7587 7588 if (strcmp(*ptr, pszParmValue) != 0) { 7589 if (is_utf8) { 7590 DEBUG(0,("ERROR: invalid DOS charset: 'dos charset' must not " 7591 "be UTF8, using (default value) %s instead.\n", 7592 DEFAULT_DOS_CHARSET)); 7593 pszParmValue = DEFAULT_DOS_CHARSET; 7594 } 7595 string_set(ptr, pszParmValue); 7596 init_iconv(); 7597 } 7598 return True; 7599 } 7600 7229 7601 7230 7602 … … 7232 7604 { 7233 7605 bool ret; 7234 7606 7235 7607 ret = set_global_myworkgroup(pszParmValue); 7236 7608 string_set(&Globals.szWorkgroup,lp_workgroup()); 7237 7609 7238 7610 return ret; 7239 7611 } … … 7242 7614 { 7243 7615 bool ret; 7244 7616 7245 7617 ret = set_global_scope(pszParmValue); 7246 7618 string_set(&Globals.szNetbiosScope,global_scope()); … … 7252 7624 { 7253 7625 TALLOC_FREE(Globals.szNetbiosAliases); 7254 Globals.szNetbiosAliases = str_list_make_v3( talloc_autofree_context(), pszParmValue, NULL);7626 Globals.szNetbiosAliases = str_list_make_v3(NULL, pszParmValue, NULL); 7255 7627 return set_netbios_aliases((const char **)Globals.szNetbiosAliases); 7256 7628 } … … 7288 7660 } 7289 7661 7290 fname = alloc_sub_basic(get_current_username(),7291 current_user_info.domain,7292 pszParmValue);7662 fname = talloc_sub_basic(talloc_tos(), get_current_username(), 7663 current_user_info.domain, 7664 pszParmValue); 7293 7665 7294 7666 add_to_file_list(pszParmValue, fname); … … 7301 7673 ret = pm_process(fname, do_section, do_parameter, NULL); 7302 7674 include_depth--; 7303 SAFE_FREE(fname);7675 TALLOC_FREE(fname); 7304 7676 return ret; 7305 7677 } 7306 7678 7307 7679 DEBUG(2, ("Can't find include file %s\n", fname)); 7308 SAFE_FREE(fname);7680 TALLOC_FREE(fname); 7309 7681 return true; 7310 7682 } … … 7400 7772 } 7401 7773 7774 static bool handle_idmap_backend(int snum, const char *pszParmValue, char **ptr) 7775 { 7776 lp_do_parameter(snum, "idmap config * : backend", pszParmValue); 7777 7778 return true; 7779 } 7780 7402 7781 /* Do some simple checks on "idmap [ug]id" parameter values */ 7403 7782 7404 7783 static bool handle_idmap_uid(int snum, const char *pszParmValue, char **ptr) 7405 7784 { 7406 uint32 low, high; 7407 7408 if (sscanf(pszParmValue, "%u - %u", &low, &high) != 2 || high < low) 7409 return False; 7410 7411 /* Parse OK */ 7412 7413 string_set(ptr, pszParmValue); 7414 7415 idmap_uid_low = low; 7416 idmap_uid_high = high; 7785 lp_do_parameter(snum, "idmap config * : range", pszParmValue); 7417 7786 7418 7787 return True; … … 7421 7790 static bool handle_idmap_gid(int snum, const char *pszParmValue, char **ptr) 7422 7791 { 7423 uint32 low, high; 7424 7425 if (sscanf(pszParmValue, "%u - %u", &low, &high) != 2 || high < low) 7426 return False; 7427 7428 /* Parse OK */ 7429 7430 string_set(ptr, pszParmValue); 7431 7432 idmap_gid_low = low; 7433 idmap_gid_high = high; 7792 lp_do_parameter(snum, "idmap config * : range", pszParmValue); 7434 7793 7435 7794 return True; … … 7547 7906 { 7548 7907 int i; 7549 if (pservice->copymap) { 7550 bitmap_free(pservice->copymap);7551 } 7552 pservice->copymap = bitmap_ allocate(NUMPARAMETERS);7908 7909 TALLOC_FREE(pservice->copymap); 7910 7911 pservice->copymap = bitmap_talloc(NULL, NUMPARAMETERS); 7553 7912 if (!pservice->copymap) 7554 7913 DEBUG(0, … … 7607 7966 opt_list = (snum < 0) 7608 7967 ? &Globals.param_opt : &ServicePtrs[snum]->param_opt; 7609 set_param_opt(opt_list, pszParmName, pszParmValue );7968 set_param_opt(opt_list, pszParmName, pszParmValue, 0); 7610 7969 7611 7970 return (True); 7971 } 7972 7973 /* if it's already been set by the command line, then we don't 7974 override here */ 7975 if (parm_table[parmnum].flags & FLAG_CMDLINE) { 7976 return true; 7612 7977 } 7613 7978 … … 7678 8043 TALLOC_FREE(*((char ***)parm_ptr)); 7679 8044 *(char ***)parm_ptr = str_list_make_v3( 7680 talloc_autofree_context(), pszParmValue, NULL);8045 NULL, pszParmValue, NULL); 7681 8046 break; 7682 8047 … … 7701 8066 7702 8067 /*************************************************************************** 8068 set a parameter, marking it with FLAG_CMDLINE. Parameters marked as 8069 FLAG_CMDLINE won't be overridden by loads from smb.conf. 8070 ***************************************************************************/ 8071 8072 static bool lp_set_cmdline_helper(const char *pszParmName, const char *pszParmValue, bool store_values) 8073 { 8074 int parmnum, i; 8075 parmnum = map_parameter(pszParmName); 8076 if (parmnum >= 0) { 8077 parm_table[parmnum].flags &= ~FLAG_CMDLINE; 8078 if (!lp_do_parameter(-1, pszParmName, pszParmValue)) { 8079 return false; 8080 } 8081 parm_table[parmnum].flags |= FLAG_CMDLINE; 8082 8083 /* we have to also set FLAG_CMDLINE on aliases. Aliases must 8084 * be grouped in the table, so we don't have to search the 8085 * whole table */ 8086 for (i=parmnum-1;i>=0 && parm_table[i].ptr == parm_table[parmnum].ptr;i--) { 8087 parm_table[i].flags |= FLAG_CMDLINE; 8088 } 8089 for (i=parmnum+1;i<NUMPARAMETERS && parm_table[i].ptr == parm_table[parmnum].ptr;i++) { 8090 parm_table[i].flags |= FLAG_CMDLINE; 8091 } 8092 8093 if (store_values) { 8094 store_lp_set_cmdline(pszParmName, pszParmValue); 8095 } 8096 return true; 8097 } 8098 8099 /* it might be parametric */ 8100 if (strchr(pszParmName, ':') != NULL) { 8101 set_param_opt(&Globals.param_opt, pszParmName, pszParmValue, FLAG_CMDLINE); 8102 if (store_values) { 8103 store_lp_set_cmdline(pszParmName, pszParmValue); 8104 } 8105 return true; 8106 } 8107 8108 DEBUG(0, ("Ignoring unknown parameter \"%s\"\n", pszParmName)); 8109 return true; 8110 } 8111 8112 bool lp_set_cmdline(const char *pszParmName, const char *pszParmValue) 8113 { 8114 return lp_set_cmdline_helper(pszParmName, pszParmValue, true); 8115 } 8116 8117 /*************************************************************************** 7703 8118 Process a parameter. 7704 8119 ***************************************************************************/ … … 7716 8131 } 7717 8132 7718 /*************************************************************************** 8133 /* 8134 set a option from the commandline in 'a=b' format. Use to support --option 8135 */ 8136 bool lp_set_option(const char *option) 8137 { 8138 char *p, *s; 8139 bool ret; 8140 8141 s = talloc_strdup(NULL, option); 8142 if (!s) { 8143 return false; 8144 } 8145 8146 p = strchr(s, '='); 8147 if (!p) { 8148 talloc_free(s); 8149 return false; 8150 } 8151 8152 *p = 0; 8153 8154 /* skip white spaces after the = sign */ 8155 do { 8156 p++; 8157 } while (*p == ' '); 8158 8159 ret = lp_set_cmdline(s, p); 8160 talloc_free(s); 8161 return ret; 8162 } 8163 8164 /************************************************************************** 7719 8165 Print a parameter of the specified type. 7720 8166 ***************************************************************************/ … … 7875 8321 return (False); 7876 8322 } 8323 /* Clean all parametric options for service */ 8324 /* They will be added during parsing again */ 8325 free_param_opts(&ServicePtrs[iServiceIndex]->param_opt); 7877 8326 } 7878 8327 … … 7923 8372 int i; 7924 8373 struct param_opt_struct *data; 7925 8374 7926 8375 fprintf(f, "[global]\n"); 7927 8376 … … 7968 8417 int i; 7969 8418 struct param_opt_struct *data; 7970 8419 7971 8420 if (pService != &sDefault) 7972 8421 fprintf(f, "[%s]\n", pService->szService); … … 7980 8429 (i == 0 || (parm_table[i].ptr != parm_table[i - 1].ptr))) 7981 8430 { 7982 7983 8431 int pdiff = PTR_DIFF(parm_table[i].ptr, &sDefault); 7984 8432 … … 8117 8565 parm_table[(*i) - 1].ptr)) 8118 8566 continue; 8119 8567 8120 8568 if (is_default(*i) && !allparameters) 8121 8569 continue; … … 8230 8678 ***************************************************************************/ 8231 8679 8232 void lp_add_one_printer(const char *name, const char *comment, void *pdata) 8680 void lp_add_one_printer(const char *name, const char *comment, 8681 const char *location, void *pdata) 8233 8682 { 8234 8683 int printers = lp_servicenumber(PRINTERS_NAME); … … 8342 8791 } 8343 8792 8344 /*******************************************************************8345 Set the server type we will announce as via nmbd.8346 ********************************************************************/8347 8348 static const struct srv_role_tab {8349 uint32 role;8350 const char *role_str;8351 } srv_role_tab [] = {8352 { ROLE_STANDALONE, "ROLE_STANDALONE" },8353 { ROLE_DOMAIN_MEMBER, "ROLE_DOMAIN_MEMBER" },8354 { ROLE_DOMAIN_BDC, "ROLE_DOMAIN_BDC" },8355 { ROLE_DOMAIN_PDC, "ROLE_DOMAIN_PDC" },8356 { 0, NULL }8357 };8358 8359 const char* server_role_str(uint32 role)8360 {8361 int i = 0;8362 for (i=0; srv_role_tab[i].role_str; i++) {8363 if (role == srv_role_tab[i].role) {8364 return srv_role_tab[i].role_str;8365 }8366 }8367 return NULL;8368 }8369 8370 static void set_server_role(void)8371 {8372 server_role = ROLE_STANDALONE;8373 8374 switch (lp_security()) {8375 case SEC_SHARE:8376 if (lp_domain_logons())8377 DEBUG(0, ("Server's Role (logon server) conflicts with share-level security\n"));8378 break;8379 case SEC_SERVER:8380 if (lp_domain_logons())8381 DEBUG(0, ("Server's Role (logon server) conflicts with server-level security\n"));8382 /* this used to be considered ROLE_DOMAIN_MEMBER but that's just wrong */8383 server_role = ROLE_STANDALONE;8384 break;8385 case SEC_DOMAIN:8386 if (lp_domain_logons()) {8387 DEBUG(1, ("Server's Role (logon server) NOT ADVISED with domain-level security\n"));8388 server_role = ROLE_DOMAIN_BDC;8389 break;8390 }8391 server_role = ROLE_DOMAIN_MEMBER;8392 break;8393 case SEC_ADS:8394 if (lp_domain_logons()) {8395 server_role = ROLE_DOMAIN_PDC;8396 break;8397 }8398 server_role = ROLE_DOMAIN_MEMBER;8399 break;8400 case SEC_USER:8401 if (lp_domain_logons()) {8402 8403 if (Globals.iDomainMaster) /* auto or yes */8404 server_role = ROLE_DOMAIN_PDC;8405 else8406 server_role = ROLE_DOMAIN_BDC;8407 }8408 break;8409 default:8410 DEBUG(0, ("Server's Role undefined due to unknown security mode\n"));8411 break;8412 }8413 8414 DEBUG(10, ("set_server_role: role = %s\n", server_role_str(server_role)));8415 }8416 8417 8793 /*********************************************************** 8418 8794 If we should send plaintext/LANMAN passwords in the clinet … … 8490 8866 char **pp_sharepath, 8491 8867 char **pp_comment, 8492 SEC_DESC **ppsd, 8868 char **pp_cp_servicename, 8869 struct security_descriptor **ppsd, 8493 8870 bool *pallow_guest) 8494 8871 { … … 8556 8933 if (lines[4][9] == 'y') { 8557 8934 *pallow_guest = True; 8935 } 8936 8937 /* Backwards compatible extension to file version #2. */ 8938 if (numlines > 5) { 8939 if (strncmp(lines[5], "sharename=", 10) != 0) { 8940 return USERSHARE_MALFORMED_SHARENAME_DEF; 8941 } 8942 if (!strequal(&lines[5][10], servicename)) { 8943 return USERSHARE_BAD_SHARENAME; 8944 } 8945 *pp_cp_servicename = talloc_strdup(ctx, &lines[5][10]); 8946 if (!*pp_cp_servicename) { 8947 return USERSHARE_POSIX_ERR; 8948 } 8949 } 8950 } 8951 8952 if (*pp_cp_servicename == NULL) { 8953 *pp_cp_servicename = talloc_strdup(ctx, servicename); 8954 if (!*pp_cp_servicename) { 8955 return USERSHARE_POSIX_ERR; 8558 8956 } 8559 8957 } … … 8668 9066 char *sharepath = NULL; 8669 9067 char *comment = NULL; 8670 fstring service_name;9068 char *cp_service_name = NULL; 8671 9069 char **lines = NULL; 8672 9070 int numlines = 0; 8673 9071 int fd = -1; 8674 9072 int iService = -1; 8675 TALLOC_CTX *ctx = NULL;8676 SEC_DESC*psd = NULL;9073 TALLOC_CTX *ctx = talloc_stackframe(); 9074 struct security_descriptor *psd = NULL; 8677 9075 bool guest_ok = False; 9076 char *canon_name = NULL; 9077 bool added_service = false; 9078 int ret = -1; 8678 9079 8679 9080 /* Ensure share name doesn't contain invalid characters. */ … … 8682 9083 "invalid characters (any of %s)\n", 8683 9084 file_name, INVALID_SHARENAME_CHARS )); 8684 return -1; 8685 } 8686 8687 fstrcpy(service_name, file_name); 8688 8689 if (asprintf(&fname, "%s/%s", dir_name, file_name) < 0) { 9085 goto out; 9086 } 9087 9088 canon_name = canonicalize_servicename(ctx, file_name); 9089 if (!canon_name) { 9090 goto out; 9091 } 9092 9093 fname = talloc_asprintf(ctx, "%s/%s", dir_name, file_name); 9094 if (!fname) { 9095 goto out; 8690 9096 } 8691 9097 … … 8696 9102 DEBUG(0,("process_usershare_file: stat of %s failed. %s\n", 8697 9103 fname, strerror(errno) )); 8698 SAFE_FREE(fname); 8699 return -1; 9104 goto out; 8700 9105 } 8701 9106 … … 8703 9108 other strange filetype. */ 8704 9109 if (!check_usershare_stat(fname, &lsbuf)) { 8705 SAFE_FREE(fname); 8706 return -1; 8707 } 8708 8709 { 8710 char *canon_name = canonicalize_servicename(service_name); 9110 goto out; 9111 } 9112 9113 { 8711 9114 TDB_DATA data = dbwrap_fetch_bystring( 8712 9115 ServiceHash, canon_name, canon_name); … … 8717 9120 iService = *(int *)data.dptr; 8718 9121 } 8719 TALLOC_FREE(canon_name);8720 9122 } 8721 9123 … … 8725 9127 /* Nothing changed - Mark valid and return. */ 8726 9128 DEBUG(10,("process_usershare_file: service %s not changed.\n", 8727 service_name ));9129 canon_name )); 8728 9130 ServicePtrs[iService]->usershare = USERSHARE_VALID; 8729 SAFE_FREE(fname);8730 return iService;9131 ret = iService; 9132 goto out; 8731 9133 } 8732 9134 … … 8741 9143 DEBUG(0,("process_usershare_file: unable to open %s. %s\n", 8742 9144 fname, strerror(errno) )); 8743 SAFE_FREE(fname); 8744 return -1; 9145 goto out; 8745 9146 } 8746 9147 … … 8750 9151 DEBUG(0,("process_usershare_file: fstat of %s failed. %s\n", 8751 9152 fname, strerror(errno) )); 8752 SAFE_FREE(fname); 8753 return -1; 9153 goto out; 8754 9154 } 8755 9155 … … 8759 9159 DEBUG(0,("process_usershare_file: fstat of %s is a different file from lstat. " 8760 9160 "Symlink spoofing going on ?\n", fname )); 8761 SAFE_FREE(fname); 8762 return -1; 9161 goto out; 8763 9162 } 8764 9163 … … 8766 9165 other strange filetype. */ 8767 9166 if (!check_usershare_stat(fname, &sbuf)) { 8768 SAFE_FREE(fname); 8769 return -1; 9167 goto out; 8770 9168 } 8771 9169 … … 8776 9174 DEBUG(0,("process_usershare_file: loading file %s owned by %u failed.\n", 8777 9175 fname, (unsigned int)sbuf.st_ex_uid )); 8778 SAFE_FREE(fname); 8779 return -1; 8780 } 8781 8782 SAFE_FREE(fname); 8783 8784 /* Should we allow printers to be shared... ? */ 8785 ctx = talloc_init("usershare_sd_xctx"); 8786 if (!ctx) { 8787 TALLOC_FREE(lines); 8788 return 1; 8789 } 8790 8791 if (parse_usershare_file(ctx, &sbuf, service_name, 9176 goto out; 9177 } 9178 9179 if (parse_usershare_file(ctx, &sbuf, file_name, 8792 9180 iService, lines, numlines, &sharepath, 8793 &comment, &psd, &guest_ok) != USERSHARE_OK) { 8794 talloc_destroy(ctx); 8795 TALLOC_FREE(lines); 8796 return -1; 8797 } 8798 8799 TALLOC_FREE(lines); 9181 &comment, &cp_service_name, 9182 &psd, &guest_ok) != USERSHARE_OK) { 9183 goto out; 9184 } 8800 9185 8801 9186 /* Everything ok - add the service possibly using a template. */ … … 8806 9191 } 8807 9192 8808 if ((iService = add_a_service(sp, service_name)) < 0) {9193 if ((iService = add_a_service(sp, cp_service_name)) < 0) { 8809 9194 DEBUG(0, ("process_usershare_file: Failed to add " 8810 "new service %s\n", service_name)); 8811 talloc_destroy(ctx); 8812 return -1; 9195 "new service %s\n", cp_service_name)); 9196 goto out; 8813 9197 } 9198 9199 added_service = true; 8814 9200 8815 9201 /* Read only is controlled by usershare ACL below. */ … … 8818 9204 8819 9205 /* Write the ACL of the new/modified share. */ 8820 if (!set_share_security( service_name, psd)) {9206 if (!set_share_security(canon_name, psd)) { 8821 9207 DEBUG(0, ("process_usershare_file: Failed to set share " 8822 9208 "security for user share %s\n", 8823 service_name )); 8824 lp_remove_service(iService); 8825 talloc_destroy(ctx); 8826 return -1; 9209 canon_name )); 9210 goto out; 8827 9211 } 8828 9212 … … 8843 9227 string_set(&ServicePtrs[iService]->comment, comment); 8844 9228 8845 talloc_destroy(ctx); 8846 8847 return iService; 9229 ret = iService; 9230 9231 out: 9232 9233 if (ret == -1 && iService != -1 && added_service) { 9234 lp_remove_service(iService); 9235 } 9236 9237 TALLOC_FREE(lines); 9238 TALLOC_FREE(ctx); 9239 return ret; 8848 9240 } 8849 9241 … … 9154 9546 ***************************************************************************/ 9155 9547 9156 bool lp_load_ex(const char *pszFname,9157 bool global_only,9158 bool save_defaults,9159 bool add_ipc,9160 bool initialize_globals,9161 bool allow_include_registry,9162 bool allow_registry_shares)9548 static bool lp_load_ex(const char *pszFname, 9549 bool global_only, 9550 bool save_defaults, 9551 bool add_ipc, 9552 bool initialize_globals, 9553 bool allow_include_registry, 9554 bool allow_registry_shares) 9163 9555 { 9164 9556 char *n2 = NULL; … … 9173 9565 bAllowIncludeRegistry = allow_include_registry; 9174 9566 9175 init_globals(! initialize_globals); 9176 debug_init(); 9567 init_globals(initialize_globals); 9177 9568 9178 9569 free_file_list(); … … 9185 9576 free_param_opts(&Globals.param_opt); 9186 9577 9578 lp_do_parameter(-1, "idmap config * : backend", Globals.szIdmapBackend); 9579 9187 9580 /* We get sections first, so have to start 'behind' to make up */ 9188 9581 iServiceIndex = -1; 9189 9582 9190 9583 if (lp_config_backend_is_file()) { 9191 n2 = alloc_sub_basic(get_current_username(),9584 n2 = talloc_sub_basic(talloc_tos(), get_current_username(), 9192 9585 current_user_info.domain, 9193 9586 pszFname); … … 9199 9592 9200 9593 bRetval = pm_process(n2, do_section, do_parameter, NULL); 9201 SAFE_FREE(n2);9594 TALLOC_FREE(n2); 9202 9595 9203 9596 /* finish up the last section */ … … 9221 9614 DEBUG(1, ("lp_load_ex: changing to config backend " 9222 9615 "registry\n")); 9223 init_globals( false);9616 init_globals(true); 9224 9617 lp_kill_all_services(); 9225 9618 return lp_load_ex(pszFname, global_only, save_defaults, … … 9236 9629 } 9237 9630 9238 if (bRetval && lp_registry_shares() && allow_registry_shares) { 9239 bRetval = process_registry_shares(); 9631 if (bRetval && lp_registry_shares()) { 9632 if (allow_registry_shares) { 9633 bRetval = process_registry_shares(); 9634 } else { 9635 bRetval = reload_registry_shares(); 9636 } 9240 9637 } 9241 9638 … … 9255 9652 set_allowed_client_auth(); 9256 9653 9654 if (lp_security() == SEC_SHARE) { 9655 DEBUG(1, ("WARNING: The security=share option is deprecated\n")); 9656 } else if (lp_security() == SEC_SERVER) { 9657 DEBUG(1, ("WARNING: The security=server option is deprecated\n")); 9658 } 9659 9660 if (lp_security() == SEC_ADS && strchr(lp_passwordserver(), ':')) { 9661 DEBUG(1, ("WARNING: The optional ':port' in password server = %s is deprecated\n", 9662 lp_passwordserver())); 9663 } 9664 9257 9665 bLoaded = True; 9258 9666 … … 9281 9689 add_ipc, 9282 9690 initialize_globals, 9283 true, false); 9691 true, /* allow_include_registry */ 9692 false); /* allow_registry_shares*/ 9284 9693 } 9285 9694 … … 9287 9696 { 9288 9697 return lp_load_ex(pszFname, 9289 true, 9290 false, 9291 false, 9292 true, 9293 false, 9294 false); 9698 true, /* global only */ 9699 false, /* save_defaults */ 9700 false, /* add_ipc */ 9701 true, /* initialize_globals */ 9702 false, /* allow_include_registry */ 9703 false); /* allow_registry_shares*/ 9295 9704 } 9296 9705 … … 9306 9715 add_ipc, 9307 9716 initialize_globals, 9308 true, 9309 true); 9717 true, /* allow_include_registry */ 9718 true); /* allow_registry_shares*/ 9310 9719 } 9311 9720 … … 9364 9773 int iService; 9365 9774 fstring serviceName; 9366 9775 9367 9776 if (!pszServiceName) { 9368 9777 return GLOBAL_SECTION_SNUM; 9369 9778 } 9370 9779 9371 9780 for (iService = iNumServices - 1; iService >= 0; iService--) { 9372 9781 if (VALID(iService) && ServicePtrs[iService]->szService) { … … 9424 9833 { 9425 9834 struct share_params *result; 9426 char *sname ;9835 char *sname = NULL; 9427 9836 int snum; 9428 9837 9429 if (!(sname = SMB_STRDUP(sharename))) { 9430 return NULL; 9431 } 9432 9433 snum = find_service(sname); 9434 SAFE_FREE(sname); 9435 9436 if (snum < 0) { 9838 snum = find_service(mem_ctx, sharename, &sname); 9839 if (snum < 0 || sname == NULL) { 9437 9840 return NULL; 9438 9841 } … … 9518 9921 label = lp_servicename(snum); 9519 9922 } 9520 9923 9521 9924 /* This returns a 33 byte guarenteed null terminated string. */ 9522 9925 ret = talloc_strndup(talloc_tos(), label, 32); … … 9583 9986 9584 9987 /*********************************************************** 9585 returns role of Samba server9988 If we are PDC then prefer us as DMB 9586 9989 ************************************************************/ 9587 9990 9588 int lp_server_role(void) 9589 { 9590 return server_role; 9991 bool lp_domain_master(void) 9992 { 9993 if (Globals.iDomainMaster == Auto) 9994 return (lp_server_role() == ROLE_DOMAIN_PDC); 9995 9996 return (bool)Globals.iDomainMaster; 9591 9997 } 9592 9998 … … 9595 10001 ************************************************************/ 9596 10002 9597 bool lp_domain_master (void)9598 { 9599 if (Globals.iDomainMaster == Auto)9600 return (lp_server_role() == ROLE_DOMAIN_PDC);9601 9602 return (bool)Globals.iDomainMaster;10003 bool lp_domain_master_true_or_auto(void) 10004 { 10005 if (Globals.iDomainMaster) /* auto or yes */ 10006 return true; 10007 10008 return false; 9603 10009 } 9604 10010 … … 9891 10297 { 9892 10298 char *sock_addr = Globals.szSocketAddress; 9893 10299 9894 10300 if (sock_addr[0] == '\0'){ 9895 10301 string_set(&Globals.szSocketAddress, "0.0.0.0"); … … 9934 10340 return lp_widelinks_internal(snum); 9935 10341 } 10342 10343 bool lp_writeraw(void) 10344 { 10345 if (lp_async_smb_echo_handler()) { 10346 return false; 10347 } 10348 return _lp_writeraw(); 10349 } 10350 10351 bool lp_readraw(void) 10352 { 10353 if (lp_async_smb_echo_handler()) { 10354 return false; 10355 } 10356 return _lp_readraw(); 10357 } -
vendor/current/source3/param/test_lp_load.c
r414 r740 19 19 20 20 #include "includes.h" 21 22 extern bool AllowDebugChange; 21 #include "popt_common.h" 23 22 24 23 int main(int argc, const char **argv) … … 41 40 42 41 load_case_tables(); 43 DEBUGLEVEL_CLASS[DBGC_ALL] = 0;42 lp_set_cmdline("log level", "0"); 44 43 45 44 pc = poptGetContext(NULL, argc, argv, long_options, … … 49 48 while(poptGetNextOpt(pc) != -1); 50 49 51 setup_logging(poptGetArg(pc), True);50 setup_logging(poptGetArg(pc), DEBUG_STDERR); 52 51 53 52 if (poptPeekArg(pc)) { … … 60 59 count = atoi(count_str); 61 60 } 62 63 dbf = x_stderr;64 /* Don't let the debuglevel be changed by smb.conf. */65 AllowDebugChange = False;66 61 67 62 for (i=0; i < count; i++) {
Note:
See TracChangeset
for help on using the changeset viewer.