Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 720 of 796  Not logged in ELOG logo
New entries since:Thu Jan 1 01:00:00 1970
ID Date Icondown Author Author Email Category OS ELOG Version Subject
  68893   Wed Feb 20 22:24:05 2019 Idea Alan Grantagrant@winnipeg.caRequestWindows3.1.2New feature request for Options list

Is it possible to include an option in the next release to have the Options list reference a text file of attributes rather than explicity listing the attributes in the Config file directly?

This would make it much easier to maintain a particular list that is referenced in several log books.

  68971   Tue May 14 09:40:58 2019 Idea Xuan Wuwux@ihep.ac.cnCommentLinux3.1.3add a little function--go to the specified page number

Hi all,

I added an input widget for pagination. I'd like to share it here, maybe someone needs. If there are many pages,  specifying the page number will be useful. 

The picture and patch code are in the attachment

Regards,

Xuan

Attachment 1: pagination.png
pagination.png
Attachment 2: goto.patch
--- elogd.c.org	2019-05-14 10:12:01.891558950 +0800
+++ elogd.c	2019-05-14 10:44:38.165898395 +0800
@@ -19407,6 +19407,26 @@ void show_page_navigation(LOGBOOK * lbs,
       rsprintf("<a href=\"%s\">%s</a>\n", ref, loc("All"));
    }
 
+   sprintf(ref, "");
+   build_ref(ref, sizeof(ref), "", "", "", "");
+
+   rsprintf("<input id=\"setPage\" title=\"Goto\" type=number size=\"6\" onChange=\'getPage(\"%d\");\'>", num_pages);
+   rsprintf("<script language=\"JavaScript\" type=\"text/javascript\">\n");
+   rsprintf("<!--\n");
+   rsprintf("function getPage(max)\n");
+   rsprintf("  {\n");
+   rsprintf("   var value = document.getElementById('setPage').value;\n");
+   rsprintf("   value = parseInt(value);\n");
+   rsprintf("   if(value > max)\n");
+   rsprintf("      value = max;\n");
+   rsprintf("   if(value < 1)\n");
+   rsprintf("      value = 1;\n");
+   rsprintf("   var url = 'page' + value + \"%s\";\n", ref);
+   rsprintf("   window.location.href = url;\n");
+   rsprintf("  }\n");
+   rsprintf("//-->\n");
+   rsprintf("</script>\n");
+
    rsprintf("</span></td></tr>\n");
 }
 
  69044   Wed Oct 16 13:20:31 2019 Idea Xuan Wuwux@ihep.ac.cnBug reportLinux3.1.3Re: elog hanged when uploading photo failed

Hi all,

I've found a bug in elog. It's all right that uploading an image which file name with special characters. I think it must have something to do with the code like"url_encode(file_enc, sizeof(file_enc));  /* for file names with special characters like "+" */". If I clicked the "Make small/Make larger/Original size/Rotate left/Rotate right" button, the elog server will hang. How it can be fixed? The attached image shows the debug info.

Xuan

Stefan Ritt wrote:

The problem is you have some weird characters in your file name R2BLM15 ? ? ? ? ? .PNG which confuses the interpreter. There should not be any special character or blanks in attached images.

Stefan

Xuan Wu wrote:

Hi all,

  We came across a problem recently when clicking "Upload" button, then elog hanged and never being accessed. I have checked the elog logs and find that it seems that elog didn't get the path of the picture for some reason. So is it a bug or our operation isn't correct?

 

 

Attachment 1: error.png
error.png
  69057   Sat Nov 9 22:44:23 2019 Idea paveltemp213@gorodok.netRequestAll3.1.4Subdirectories in logbooks

Hello, Is there any way to organize logbooks in some kind of tree with sublogbooks or just have a subdirectories in a logbook directory on the filesystem (treat it as a sublogbook if its name is different from 4 digits of year and pin above all the entries in a list) to structure entires a bit?

 

  69060   Mon Nov 18 16:58:21 2019 Idea Roger Kaltroger.kalt@psi.chInfoLinux3.1.4Example scripts how to migrate or combine logbooks

Attached the shell scripts using awk and sed how I have migrated two separated logbooks into one single and how I re-adjusted certain attributes.

Attachment 1: run_modif.sh
#!/bin/bash
# KR84, 28.10.2019

# the input files are the exported XML files from ELOG -> Finden


# search in XML for sring between <DATE> and </DATE>
# and replace with: <DATE> and </DATE><When> and </When>
echo "converting export_rf.xml ..."
cat ./export_rf.xml | 
    sed 's/<Personnel\(.*\)Personnel>/<Author\1Author>/g' |
    sed 's/<DATE\(.*\)DATE>/<DATE\1DATE>\n\t\t<When\1When>/g'   |
    sed 's/<Subject>\(.*\)<\/Subject>/<Title>\1<\/Title><Entry_Type><\/Entry_Type>/g' |
    sed '/<Machine>SwissFEL<\/Machine>/ {N;N; s/<Machine>SwissFEL<\/Machine>.*<Domain>OBLA<\/Domain>.*<Section>TRFCB/<Machine>OBLA<\/Machine>\n\t\t<Domain>All<\/Domain>\n\t\t<Section>TRFCB/g}'  |
    sed 's/<When>Mon, /<When>/g'                          |
    sed 's/<When>Tue, /<When>/g'                          |
    sed 's/<When>Wed, /<When>/g'                          |
    sed 's/<When>Thu, /<When>/g'                          |
    sed 's/<When>Fri, /<When>/g'                          |
    sed 's/<When>Sat, /<When>/g'                          |
    sed 's/<When>Sun, /<When>/g'                          |
    sed '/<When>.*<\/When>/{s/ Jan 20/.01./g}'                    |
    sed '/<When>.*<\/When>/{s/ Feb 20/.02./g}'                    |
    sed '/<When>.*<\/When>/{s/ Mar 20/.03./g}'                    |
    sed '/<When>.*<\/When>/{s/ Apr 20/.04./g}'                    |
    sed '/<When>.*<\/When>/{s/ May 20/.05./g}'                    |
    sed '/<When>.*<\/When>/{s/ Jun 20/.06./g}'                    |
    sed '/<When>.*<\/When>/{s/ Jul 20/.07./g}'                    |
    sed '/<When>.*<\/When>/{s/ Aug 20/.08./g}'                    |
    sed '/<When>.*<\/When>/{s/ Sep 20/.09./g}'                    |
    sed '/<When>.*<\/When>/{s/ Oct 20/.10./g}'                    |
    sed '/<When>.*<\/When>/{s/ Nov 20/.11./g}'                    |
    sed '/<When>.*<\/When>/{s/ Dec 20/.12./g}'                    |
    sed 's/ +0100<\/When>/<\/When>/g'                                     |
    sed 's/ +0200<\/When>/<\/When>/g'                                     > export_rf_modified.xml



#    sed 's/ Jan 20/.01./g'                              |
#    sed 's/ Feb 20/.02./g'                              |
#    sed 's/ Mar 20/.03./g'                              |
#    sed 's/ Apr 20/.04./g'                              |
#    sed 's/ May 20/.05./g'                              |
#    sed 's/ Jun 20/.06./g'                              |
#    sed 's/ Jul 20/.07./g'                              |
#    sed 's/ Aug 20/.08./g'                              |
#    sed 's/ Sep 20/.09./g'                              |
#    sed 's/ Oct 20/.10./g'                              |
#    sed 's/ Nov 20/.11./g'                              |
#    sed 's/ Dec 20/.12./g'                              |




# search in XML and add offset to all IDs because they shall not overlap when merged.
echo "converting export_llrf.xml ..."
cat ./export_llrf.xml           | sed 's/<Subject>\(.*\)<\/Subject>/<Entry_Type><\/Entry_Type>\n\t\t<Status><\/Status>\n\t\t<Title>\1<\/Title>\n\t\t<Inv_ID><\/Inv_ID>/g' > export_llrf_modified1.xml
cat ./export_llrf_modified1.xml | awk -F'\t\t<MID>|</MID>||' '{ if ($2!="") {print "\t\t<MID>"$2+2016"</MID>"} else { print $1} }' > export_llrf_modified2.xml
cat ./export_llrf_modified2.xml | awk -F'\t\t<REPLY_TO>|</REPLY_TO>||' '{ if ($2!="") {print "\t\t<REPLY_TO>"$2+2016"</REPLY_TO>"} else { print $1} }' > export_llrf_modified3.xml
cat ./export_llrf_modified3.xml | awk -F'\t\t<IN_REPLY_TO>|</IN_REPLY_TO>||' '{ if ($2!="") {print "\t\t<IN_REPLY_TO>"$2+2016"</IN_REPLY_TO>"} else { print $1} }' > export_llrf_modified.xml

rm -rf ./export_llrf_modified1.xml ./export_llrf_modified2.xml ./export_llrf_modified3.xml 

cat ./export_llrf_modified.xml | 
    sed '/<Machine>SwissFEL<\/Machine>/ {N;N; s/<Machine>SwissFEL<\/Machine>.*<Domain>Test Systems<\/Domain>.*<Section>TRFCB/<Machine>OBLA<\/Machine>\n\t\t<Domain>All<\/Domain>\n\t\t<Section>TRFCB/g}'  |
    sed 's/<When>Mon /<When>/g'                           |
    sed 's/<When>Tue /<When>/g'                           |
    sed 's/<When>Wed /<When>/g'                           |
    sed 's/<When>Thu /<When>/g'                           |
    sed 's/<When>Fri /<When>/g'                           |
    sed 's/<When>Sat /<When>/g'                           |
    sed 's/<When>Sun /<When>/g'                           |
    sed 's/-Jan-/.01./g'                              |
    sed 's/-Feb-/.02./g'                              |
    sed 's/-Mar-/.03./g'                              |
    sed 's/-Apr-/.04./g'                              |
    sed 's/-May-/.05./g'                              |
    sed 's/-Jun-/.06./g'                              |
    sed 's/-Jul-/.07./g'                              |
    sed 's/-Aug-/.08./g'                              |
    sed 's/-Sep-/.09./g'                              |
    sed 's/-Oct-/.10./g'                              |
    sed 's/-Nov-/.11./g'                              |
    sed 's/-Dec-/.12./g'                              |
    sed 's/ +0100<\/When>//g'                                     |
    sed 's/ +0200<\/When>//g'                                     |
    sed 's/<\/When>/:00<\/When>/g'                      |
    sed 's/<When>-:00<\/When>/<When><\/When>/g'                    > export_llrf_modified_datetime.xml

echo "export_llrf_modified_datetime.xml need manual edit for empty <When></When>"
Attachment 2: generate_import_llrf_fwd.sh
#!/bin/bash
# KR84, 28.10.2019

# generate emtpy auto-fwd text for LLRF for 3100 entries and offset of 2000
echo "generated import_llrf_fwd.xml"
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > import_llrf_fwd.xml
echo "<ELOG_LIST>" >> import_llrf_fwd.xml

declare -i ID
declare -i IDNEW

for ID in {1..3013}
do
    IDNEW=$ID+2016

    echo -e "\t<ENTRY>" >> import_llrf_fwd.xml
    echo -e "\t\t<MID>${ID}</MID>" >> import_llrf_fwd.xml
    echo -e "\t\t<DATE>Mon, 28 Oct 2019 20:00:00 +0200</DATE>" >> import_llrf_fwd.xml
#    echo -e "\t\t<DATE>28.10.2019 20:00:00</DATE>" >> import_llrf_fwd.xml
    echo -e "\t\t<ATTACHMENT></ATTACHMENT>" >> import_llrf_fwd.xml
    echo -e "\t\t<ENCODING>HTML</ENCODING>" >> import_llrf_fwd.xml
    echo -e "\t\t<When>28.10.2019 20:00:00</When>" >> import_llrf_fwd.xml
#    echo -e "\t\t<When>1572289200</When>" >> import_llrf_fwd.xml
    echo -e "\t\t<Author>Kalt Roger (KR84)</Author>" >> import_llrf_fwd.xml
    echo -e "\t\t<Machine>SwissFEL</Machine>" >> import_llrf_fwd.xml
    echo -e "\t\t<Domain></Domain>" >> import_llrf_fwd.xml
    echo -e "\t\t<Section></Section>" >> import_llrf_fwd.xml
    echo -e "\t\t<System></System>" >> import_llrf_fwd.xml
    echo -e "\t\t<Subsystem></Subsystem>" >> import_llrf_fwd.xml
    echo -e "\t\t<Subject>Automatic forward</Subject>" >> import_llrf_fwd.xml
    echo -e "\t\t<TEXT>&lt;meta http-equiv=&quot;refresh&quot; content=&quot;0; URL=&apos;https://elog-gfa.psi.ch/SwissFEL+RF/${IDNEW}&apos;&quot; /&gt;</TEXT>" >> import_llrf_fwd.xml
    echo -e "\t</ENTRY>" >> import_llrf_fwd.xml
done

echo "</ELOG_LIST>" >> import_llrf_fwd.xml

  69114   Wed Feb 12 13:19:31 2020 Idea Stefan Rittstefan.ritt@psi.chInfoAll3.1.4ELOG Null Pointer Dereference Denial-of-Service Vulnerability

An ELOG vulnerability has been reported, thanks to Asif Akbar of Trend Micro Security Researchworking with Trend Micro's Zero Day Initiative:

https://www.zerodayinitiative.com/advisories/ZDI-20-252/

The issue has been fixed in the current release 3.1.4-033e292 and in the RPM http://elog.psi.ch/elog/download/RPMS/elog-latest.x86_64.rpm

Best,
Stefan

 

  69127   Sun Mar 29 13:30:09 2020 Idea Sunilkumarsunilanaveri@gmail.comQuestionWindows3.14How to add bulk client list at once

Please let me know how to add Button for adding client next to Client Mnemonics.

 

I need to add bulk client lists in the Elog page there are 1000+ clients  .

I need to select client from the drop down list if its not there i need to add them using Add Client Button 

Please let me know the steps.

 

 

Attachment 1: Screenshot_3.jpg
Screenshot_3.jpg
  69198   Mon Aug 10 07:56:43 2020 Idea HyonSan Seohyon.san.seo@cern.chBug reportLinux3.1.4SSL connection drop with large content

Dear all,

 

I had some difficulty to upload large files (>20MB) with SSL connection. I think it is also related to https://elog.psi.ch/elogs/Forum/68636

During debuging, I found that, when uploading large files, ssl connection is dropped since 'SSL_read' function returns -1.

But it doesn't alway mean broken connection. It may be "SSL_ERROR_WANT_READ".

I changed the "server_loop" function in the source code to "continue" when it is SSL_ERROR_WANT_READ. And it fixed the problem.

Here is my code.


## elogd.c "server_loop" function L30031

                        if (FD_ISSET(_sock, &readfds)) {
#ifdef HAVE_SSL
                          if (_ssl_flag){
                            i = SSL_read(_ssl_con, net_buffer + len, net_buffer_size - len);
                            if(i<=0){
                              int ssl_error=SSL_get_error(_ssl_con,i);    ## check ssl error code
                              if(ssl_error==SSL_ERROR_WANT_READ||ssl_error==SSL_ERROR_WANT_WRITE) continue;    ## if ssl wants more, continue
                            }
                          }
                          else
#endif
                            i = recv(_sock, net_buffer + len, net_buffer_size - len, 0);
 


 

I am ignorant about networking. Some experts on ssl connection would know a better way to deal with this problem.

 

Best,

HyonSan Seo

 

ELOG V3.1.5-2eba886