1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

Fix swat. Bug #5613.

Jeremy
This commit is contained in:
Jeremy Allison 2008-07-15 14:37:48 -07:00
parent 5076607069
commit 15920f8388
3 changed files with 18 additions and 23 deletions

View File

@ -6166,7 +6166,6 @@ bool lp_load_with_registry_shares(const char *pszFname,
bool save_defaults,
bool add_ipc,
bool initialize_globals);
void lp_resetnumservices(void);
int lp_numservices(void);
void lp_dump(FILE *f, bool show_defaults, int maxtoprint);
void lp_dump_one(FILE * f, bool show_defaults, int snum);

View File

@ -8902,15 +8902,6 @@ bool lp_load_with_registry_shares(const char *pszFname,
true);
}
/***************************************************************************
Reset the max number of services.
***************************************************************************/
void lp_resetnumservices(void)
{
iNumServices = 0;
}
/***************************************************************************
Return the max number of services.
***************************************************************************/

View File

@ -430,7 +430,6 @@ static void show_parameters(int snum, int allparameters, unsigned int parm_filte
****************************************************************************/
static bool load_config(bool save_def)
{
lp_resetnumservices();
return lp_load(get_dyn_CONFIGFILE(),False,save_def,False,True);
}
@ -740,12 +739,12 @@ static void wizard_page(void)
load_config(False);
lp_copy_service(GLOBAL_SECTION_SNUM, unix_share);
iNumNonAutoPrintServices = lp_numservices();
have_home = lp_servicenumber(HOMES_NAME);
lp_do_parameter( have_home, "read only", "No");
lp_do_parameter( have_home, "valid users", "%S");
lp_do_parameter( have_home, "browseable", "No");
commit_parameters(have_home);
save_reload(have_home);
}
/* Need to Delete Homes share? */
@ -908,6 +907,7 @@ static void shares_page(void)
if (cgi_variable("Commit") && snum >= 0) {
commit_parameters(snum);
save_reload(0);
snum = lp_servicenumber(share);
}
if (cgi_variable("Delete") && snum >= 0) {
@ -918,11 +918,14 @@ static void shares_page(void)
}
if (cgi_variable("createshare") && (share=cgi_variable("newshare"))) {
load_config(False);
lp_copy_service(GLOBAL_SECTION_SNUM, share);
iNumNonAutoPrintServices = lp_numservices();
save_reload(0);
snum = lp_servicenumber(share);
if (snum < 0) {
load_config(False);
lp_copy_service(GLOBAL_SECTION_SNUM, share);
snum = lp_servicenumber(share);
save_reload(snum);
snum = lp_servicenumber(share);
}
}
printf("<FORM name=\"swatform\" method=post>\n");
@ -958,7 +961,6 @@ static void shares_page(void)
(share && strcmp(share,s)==0)?"SELECTED":"",
utf8_s, utf8_s);
SAFE_FREE(utf8_s);
}
}
printf("</select></td>\n");
@ -1261,6 +1263,7 @@ static void printers_page(void)
save_reload(snum);
else
save_reload(0);
snum = lp_servicenumber(share);
}
if (cgi_variable("Delete") && snum >= 0) {
@ -1271,13 +1274,15 @@ static void printers_page(void)
}
if (cgi_variable("createshare") && (share=cgi_variable("newshare"))) {
load_config(False);
lp_copy_service(GLOBAL_SECTION_SNUM, share);
iNumNonAutoPrintServices = lp_numservices();
snum = lp_servicenumber(share);
lp_do_parameter(snum, "print ok", "Yes");
save_reload(0);
snum = lp_servicenumber(share);
if (snum < 0 || snum >= iNumNonAutoPrintServices) {
load_config(False);
lp_copy_service(GLOBAL_SECTION_SNUM, share);
snum = lp_servicenumber(share);
lp_do_parameter(snum, "print ok", "Yes");
save_reload(snum);
snum = lp_servicenumber(share);
}
}
printf("<FORM name=\"swatform\" method=post>\n");