Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 198 of 796  Not logged in ELOG logo
ID Date Icon Author Author Email Category OS ELOG Versiondown Subject
  68824   Thu Jun 14 13:12:02 2018 Question Stefano Lacaprarastefano.lacaprara@pd.infn.itQuestionLinux3.1.3edit templates from config page
Dear all,
  I have some logbook which uses preset text depending on some option values, and uses text files for this.

something similar to:

Options Type = Start of shift{1}, 2h{2}, 4h{3}, 6h{4}, End of shift {5}

{1} Preset text = MCProdStart.txt
{2} Preset text = MCProd2h.txt
{3} Preset text = MCProd4h.txt
{4} Preset text = MCProd6h.txt
{5} Preset text = MCProdEnd.txt

I wonder if there is a way to change/edit the text files from the web interface if you are admin of that logbook, or if the only way is to change the files directly in the elog server.

thanks Stefano
  68825   Thu Jun 14 13:17:33 2018 Reply Stefan Rittstefan.ritt@psi.chRequestLinux3.1.3Re: number of entries in Login user list

Well, many arrays based on MAX_N_LIST are created on the heap memory, and if you exceed that, elogd simply crashes. There are compile options to increase the stack and heap size, but that depends on the operating system and the compiler. The value of 100 has been proven to work everywhere. If you increase it, you're on your own.

Stefan

Janusz Szuba wrote:

Thanks, good point, I was not sure that in case of other lists which will be changed as well, there will not be any problems, like overflow, etc. 

Regarding admin list, now I remember, that was the limit to send email notification in case of registration requests. But actually it is not important right now.

best

Janusz

Andreas Luedeke wrote:

Hi Janusz,

You can change the following line in elogd.h and recompile:

#define MAX_N_LIST      100
That'll change the login user list limit. But it'll change other list length as well - which should not do harm unless you are very short of memory.

I don't see the Admin user list limit of 10 - aparently that is hard coded somewhere deep within (or I've just missed it).

Cheers, Andreas

Janusz Szuba wrote:

Hi, 

could it be possible to increase the limit of entries in Login user list from 100 to somewhat reasonably higher? Like twice or 3 times as much. Similar limit exist also on Admin user list, which is afair 10, could this also be increased?

best

Janusz

 

 

 

  68826   Thu Jun 14 13:20:26 2018 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux3.1.3Re: edit templates from config page
> Dear all,
>   I have some logbook which uses preset text depending on some option values, and uses text files for this.
> 
> something similar to:
> 
> Options Type = Start of shift{1}, 2h{2}, 4h{3}, 6h{4}, End of shift {5}
> 
> {1} Preset text = MCProdStart.txt
> {2} Preset text = MCProd2h.txt
> {3} Preset text = MCProd4h.txt
> {4} Preset text = MCProd6h.txt
> {5} Preset text = MCProdEnd.txt
> 
> I wonder if there is a way to change/edit the text files from the web interface if you are admin of that logbook, or if the only way is to change the files directly in the elog server.
> 
> thanks Stefano

No, you can only edit this on the file level.

Stefan
  68827   Thu Jun 14 18:17:07 2018 Reply Andreas Luedekeandreas.luedeke@psi.chQuestionLinux3.1.3Re: edit templates from config page
> Dear all,
>   I have some logbook which uses preset text depending on some option values, and uses text files for this.
> 
> something similar to:
> 
> Options Type = Start of shift{1}, 2h{2}, 4h{3}, 6h{4}, End of shift {5}
> 
> {1} Preset text = MCProdStart.txt
> {2} Preset text = MCProd2h.txt
> {3} Preset text = MCProd4h.txt
> {4} Preset text = MCProd6h.txt
> {5} Preset text = MCProdEnd.txt
> 
> I wonder if there is a way to change/edit the text files from the web interface if you are admin of that logbook, or if the only way is to change the files directly in the elog server.
> 
> thanks Stefano

Hi Stefano,

it is not directly foreseen in the web functionality of ELOG, but it can be done like this:

You could have a second logbook that has the content of these files each in one logbook entry. 
You call a script "Execute edit =" that runs on the server and converts the specific ELOG entry into a file on the server.
Of course this is a security vulnerability, but you can confine the possibilities of the script.
E.g. to a hard-coded list of ELOG entries and files in a specific directory.
Still, someone could place a file on the server and then calls that file with an "Execute edit=" himself.
But if you do all this within a protected network that should be okay.

I do like the idea, thank you for the question! If you manage to do it please post it under Contributions :-)

Cheers, Andreas
  68828   Thu Jun 14 19:17:41 2018 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux3.1.3Re: edit templates from config page
As always, Andreas has clever ideas. Never thought about this possibility.

Stefan
  68834   Thu Aug 16 13:33:39 2018 Question Gino Guenzburgergino.guenzburger@empa.chQuestionWindows3.1.3Changing of entries after expired time restriction by synchronisation

I'm working on setting up an elog as lab-journal in our group with the following set-up:

  • The elog is running on a server, with no back-end access for the users.
  • Multiple people will use it, all loging in with the same user-name and password.
  • The entries submitted to the log-book can only be edited for 24hours, as defined by the "Restrict edit time= 24" setting in the configuration file.

Now I encountered the following problem in my set-up: Entries that do not have attachments can be changed after these 24hours have passed, by the following set-up: If a user (in the current case me during testing) sets up a local elog on his computer and activates the synchronisation with the elog on the server, he can switch off the time-restriction for editing on his local elog, and if he synchronises the two log-books, the changed entry from the local elog will overwrite the original one from the server-elog.

Obviously this is not very desirable. Therefore I wanted to ask, whether anyone sees a possibility to prevent the editing of entries, which are older than the restricted edit time. A specific function or a change in the synchronisation behaviour would of course be the completest solution, but in my case the problem would also be solved if I could just prohibit the synchronisation. It is not needed, so no harm will be done if it is not possible.

 

  68839   Tue Sep 11 19:46:40 2018 Warning Allen TuttleAllenEmail@wavecable.comBug reportLinux3.1.3Compile issues on Fedora withe current elog source

Tried compiling on FC27 and 28, both result in binaries but with serious issues; writing data larger than then allowed.
Example output:

make 
gcc -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -DHAVE_SSL -c -o mxml.o mxml/mxml.c
gcc -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -DHAVE_SSL -w -c -o crypt.o src/crypt.c
gcc -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -DHAVE_SSL -w -c -o regex.o src/regex.c
gcc -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -DHAVE_SSL -c -o strlcpy.o mxml/strlcpy.c
gcc -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -DHAVE_SSL -o elog src/elog.c mxml.o crypt.o regex.o strlcpy.o -lssl
gcc -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -DHAVE_SSL -w -c -o auth.o src/auth.c
gcc -O3 -funroll-loops -fomit-frame-pointer -W -Wall -Wno-deprecated-declarations -Imxml -DHAVE_SSL -o elogd src/elogd.c auth.o mxml.o crypt.o regex.o strlcpy.o -lssl
src/elogd.c: In function ‘el_retrieve’:
src/elogd.c:4503:26: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
    sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
                          ^~
src/elogd.c:4503:4: note: ‘sprintf’ output between 1 and 542 bytes into a destination of size 256
    sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/elogd.c: In function ‘el_retrieve_attachment.part.30’:
src/elogd.c:4764:26: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
    sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
                          ^~
src/elogd.c:4764:4: note: ‘sprintf’ output between 1 and 542 bytes into a destination of size 256
    sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/elogd.c: In function ‘el_submit.constprop’:
src/elogd.c:4894:29: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
       sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
                             ^~
src/elogd.c:4894:7: note: ‘sprintf’ output between 1 and 542 bytes into a destination of size 256
       sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/elogd.c: In function ‘el_submit’:
src/elogd.c:4894:29: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
       sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
                             ^~
src/elogd.c:4894:7: note: ‘sprintf’ output between 1 and 542 bytes into a destination of size 256
       sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/elogd.c: In function ‘el_retrieve.constprop’:
src/elogd.c:4503:26: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
    sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
                          ^~
src/elogd.c:4503:4: note: ‘sprintf’ output between 1 and 542 bytes into a destination of size 256
    sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/elogd.c: In function ‘el_retrieve.constprop’:
src/elogd.c:4503:26: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
    sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
                          ^~
src/elogd.c:4503:4: note: ‘sprintf’ output between 1 and 542 bytes into a destination of size 256
    sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/elogd.c: In function ‘el_retrieve.constprop’:
src/elogd.c:4503:26: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
    sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
                          ^~
src/elogd.c:4503:4: note: ‘sprintf’ output between 1 and 542 bytes into a destination of size 256
    sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/elogd.c: In function ‘show_download_page’:
src/elogd.c:14775:32: warning: ‘%s’ directive writing up to 255 bytes into a region of size between 1 and 256 [-Wformat-overflow=]
          sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
                                ^~
src/elogd.c:14775:10: note: ‘sprintf’ output between 1 and 542 bytes into a destination of size 256
          sprintf(file_name, "%s%s%s", lbs->data_dir, lbs->el_index[index].subdir, lbs->el_index[index].file_name);
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/elogd.c: In function ‘search_last_reply’:
.
.
.

Anyone aware of a cure?

  68840   Wed Sep 12 11:10:18 2018 Reply Stefan Rittstefan.ritt@psi.chBug reportLinux3.1.3Re: Compile issues on Fedora withe current elog source

This warning is triggered by the use of the sprintf() funciton, which can write beyond the boundary of the destination string. I replaced it by snprintf(), which should make the compiler happy. Code is committed. Unfortuantely I have no FC27 here, so if there is still some waring with the current code, please post the full warning list here.

Stefan

ELOG V3.1.5-2eba886