mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +03:00
r23750: Change the behaviour of net conf import when there is a global section
in the current registry and there is no global section in the input file (or only global options with default values): In that case the existing global section is now not touched. Before, it would have been deleted and recreated empty. The new behaviour is how other shares are treated too. Note that since the input file is parsed by lp_load, there is currently no way to distinguish between a section with only default parameters and a non-existing section in net conf import. Michael PS: A couple of trailing white-spaces have been eliminated and a line was broken to be not longer than 80 chars, too. (This used to be commit ec21a0cf9f01986d333b50b883f2105e32cf7fc9)
This commit is contained in:
parent
1bea19c127
commit
a5946cb46a
@ -583,6 +583,19 @@ done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* return True iff there are nondefault globals */
|
||||
static BOOL globals_exist(void)
|
||||
{
|
||||
int i = 0;
|
||||
struct parm_struct *parm;
|
||||
|
||||
while ((parm = lp_next_parameter(GLOBAL_SECTION_SNUM, &i, 0)) != NULL) {
|
||||
if (parm->type != P_SEP) {
|
||||
return True;
|
||||
}
|
||||
}
|
||||
return False;
|
||||
}
|
||||
|
||||
/*
|
||||
* the conf functions
|
||||
@ -700,10 +713,13 @@ int net_conf_import(int argc, const char **argv)
|
||||
}
|
||||
|
||||
if (opt_testmode) {
|
||||
d_printf("\nTEST MODE - would import the following configuration:\n\n");
|
||||
d_printf("\nTEST MODE - "
|
||||
"would import the following configuration:\n\n");
|
||||
}
|
||||
|
||||
if ((servicename == NULL) || strequal(servicename, GLOBAL_NAME)) {
|
||||
if (((servicename == NULL) && globals_exist()) ||
|
||||
strequal(servicename, GLOBAL_NAME))
|
||||
{
|
||||
service_found = True;
|
||||
if (import_process_service(ctx, &global_share) != 0) {
|
||||
goto done;
|
||||
|
Loading…
x
Reference in New Issue
Block a user