Implemented "Allow clone" configuration setting

This commit is contained in:
ritt 2019-12-09 13:13:43 +01:00
parent 57bea22e7b
commit 7367647d40
2 changed files with 21 additions and 7 deletions

View File

@ -3025,7 +3025,11 @@ elogd -C http://master.your.domain
<pre> <pre>
elogd -C https://master.your.domain elogd -C https://master.your.domain
</pre> </pre>
for a remote server running under the SSL protocol. for a remote server running under the SSL protocol. Note that you
have to put "Allow clone = 1" temporarily into the elogd.cfg file of
your existing server to allow cloning. This opens a password-free
access to your existing server, so remove it immediately after you
finished cloning.
<p> <p>
This command tells elogd to retrieve the configuration file, and This command tells elogd to retrieve the configuration file, and
optionally all logbook entries and password files from the master optionally all logbook entries and password files from the master

View File

@ -22908,10 +22908,10 @@ void submit_elog(LOGBOOK *lbs) {
} else } else
n_attr = lbs->n_attr; n_attr = lbs->n_attr;
/* check for editing interval */ /* check for editing interval */
if (!check_edit_time(lbs, atoi(getparam("edit_id")))) if (isparam("edit_id"))
return; if (!check_edit_time(lbs, atoi(getparam("edit_id"))))
return;
/* check for required attributs */ /* check for required attributs */
missing = 0; missing = 0;
@ -24037,7 +24037,7 @@ int is_inline_attachment(char *encoding, int message_id, char *text, int i, char
strlcpy(att_enc, att, sizeof(att_enc)); strlcpy(att_enc, att, sizeof(att_enc));
att_enc[13] = '/'; att_enc[13] = '/';
pt = text; pt = text;
while (stristr(pt, att_enc)) { while (*pt && stristr(pt, att_enc)) {
/* make sure that it's really an inline image */ /* make sure that it's really an inline image */
for (p = stristr(pt, att_enc); p > pt; p--) for (p = stristr(pt, att_enc); p > pt; p--)
if (*p == '<') if (*p == '<')
@ -24051,7 +24051,7 @@ int is_inline_attachment(char *encoding, int message_id, char *text, int i, char
} }
retrieve_domain(domain, sizeof(domain)); retrieve_domain(domain, sizeof(domain));
sprintf(str, "cid:att%d@%s", i, domain); sprintf(str, "cid:att%d@%s", i, domain);
if (stristr(text, str)) if (*text && stristr(text, str))
return 1; return 1;
} }
@ -29102,7 +29102,17 @@ int process_http_request(const char *request, int i_conn) {
} }
if (!logbook[0] && global_cmd[0] && stricmp(global_cmd, "GetConfig") == 0) { if (!logbook[0] && global_cmd[0] && stricmp(global_cmd, "GetConfig") == 0) {
download_config(); char allow[256];
allow[0] = 0;
getcfg("global", "Allow clone", allow, sizeof(allow));
if (atoi(allow) == 1)
download_config();
else {
show_http_header(NULL, FALSE, NULL);
rsputs(loc("Cloning not allowed. Set \"Allow clone = 1\" to enable cloning."));
rsputs("\r\n");
return 1;
}
} else if (stricmp(global_cmd, "gettimedate") == 0) { } else if (stricmp(global_cmd, "gettimedate") == 0) {
if (!getcfg(logbook, "Time format", format, sizeof(format))) if (!getcfg(logbook, "Time format", format, sizeof(format)))
strcpy(format, DEFAULT_TIME_FORMAT); strcpy(format, DEFAULT_TIME_FORMAT);