mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-14 20:33:48 +00:00
Prevent crash if logbook "global" is accessed
SVN revision: 1746
This commit is contained in:
parent
e8a8c76860
commit
8a6096353a
@ -24504,7 +24504,7 @@ void server_loop(void)
|
|||||||
for (i = 0;; i++) {
|
for (i = 0;; i++) {
|
||||||
if (!enumgrp(i, str))
|
if (!enumgrp(i, str))
|
||||||
break;
|
break;
|
||||||
if (strieq(logbook, str))
|
if (strieq(logbook, str) && !strieq(logbook, "global"))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25677,6 +25677,10 @@ int main(int argc, char *argv[])
|
|||||||
if (!logbook_dir[0])
|
if (!logbook_dir[0])
|
||||||
strcpy(logbook_dir, "logbooks");
|
strcpy(logbook_dir, "logbooks");
|
||||||
|
|
||||||
|
/* strip trailing dir separator */
|
||||||
|
if (logbook_dir[strlen(logbook_dir)-1] == DIR_SEPARATOR)
|
||||||
|
logbook_dir[strlen(logbook_dir)-1] = 0;
|
||||||
|
|
||||||
/* check for directories */
|
/* check for directories */
|
||||||
if (logbook_dir[0] && stat(logbook_dir, &finfo) < 0) {
|
if (logbook_dir[0] && stat(logbook_dir, &finfo) < 0) {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user