Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 735 of 796  Not logged in ELOG logo
ID Date Icon Author Author Email Category OS ELOG Version Subjectup
  925   Tue Feb 8 17:40:54 2005 Idea Emiliano GabrielliAlberT@SuperAlberT.itBug fixAll2.5.6 cvs[patch]: fixed wrong extention check
current version uses strstr() to check if the file has the expected ascii
text extension ... this is buggy becouse this way a file named
".txt_hidden_file" or "foo.config.dat" are both seen as .txt files.

the following patch fixes the problem, plz apply to cvs:



#######################################################################
--- elogd_orig.c        2005-02-03 16:46:10.000000000 +0100
+++ elogd_extchk_fix.c  2005-02-08 17:32:21.000000000 +0100
@@ -1160,6 +1160,28 @@

 #define my_toupper(_c)    ( ((_c)>='a' && (_c)<='z') ? ((_c)-'a'+'A') : (_c) )

+static BOOL chkext(const char *str, const char *ext)
+{
+   int extl, strl;
+   char c1, c2;
+
+   if (ext == NULL || str == NULL)
+      return FALSE;
+
+   extl = strlen(ext);
+   strl = strlen(str);
+   if (extl >= strl)
+      return FALSE;
+   str = str+strl-extl;
+   while (*str) {
+      c1 = *str++;
+      c2 = *ext++;
+      if (my_toupper(c1) != my_toupper(c2))
+         return FALSE;
+   }
+   return TRUE;
+}
+
 BOOL strieq(const char *str1, const char *str2)
 {
    char c1, c2;
@@ -1168,6 +1190,8 @@
       return TRUE;
    if (str1 == NULL || str2 == NULL)
       return FALSE;
+   if (strlen(str1)!=strlen(str2))
+      return FALSE;

    while (*str1) {
       c1 = *str1++;
@@ -13698,8 +13722,8 @@
                       ("<tr><td colspan=%d class=\"attachment\">%s %d: <a
href=\"%s\">%s</a>\n",
                        colspan, loc("Attachment"), index + 1, ref,
attachment[index] + 14);

-                  if ((strstr(str, ".TXT") || strstr(str, ".ASC") ||
strstr(str, ".CFG")
-                       || strstr(str, ".CONF")
+                  if ((chkext(str, ".TXT") || chkext(str, ".ASC") ||
chkext(str, ".CFG")
+                       || chkext(str, ".CONF")
                        || strchr(str, '.') == NULL) && show_attachments) {
                      /* display attachment */
                      rsprintf("</td></tr><tr><td colspan=%d
class=\"messagelist\"><pre>", colspan);
@@ -14779,7 +14803,7 @@
    regex_t re_buf[MAX_N_ATTR + 1];
    regmatch_t pmatch[10];

-   /* redirect if enpty parameters */
+   /* redirect if empty parameters */
    if (strstr(_cmdline, "=&")) {
       while ((pt1 = strstr(_cmdline, "=&")) != NULL) {
          pt2 = pt1;
#######################################################################
  68625   Thu May 18 16:55:42 2017 Reply Stefano Lacaprarastefano.lacaprara@pd.infn.itQuestionLinux3.1.1[solved] Re: Use X-Forwarded-User as preset in author field
> 
> Sorry, I just double-checked, this userdatabase, I was talking about is the Password-file...
> 
> Please try the following snippet :
> 
> allow password change = 0
> Authentication = Webserver, File
> Preset Author = $short_name <$long_name>
> Locked Attributes = Author
> Password file = PASSWD.file
> 
> Christof

Many thanks, that is what I was looking for.

best,
  Stefano
  1264   Wed Jul 13 15:09:48 2005 Entry Emiliano GabrielliAlberT@SuperAlberT.itBug reportAll [code] should be a sort of <CDATA >
Using the [code] elocode should be intended also to preserve the tagged text from beeing parsed as html or elcode itself ..

this is an example:

Quote:
Note that, for security reasons, you should check the MD5 FINGERPRINT of the SSL certificate issued by the server agaist the following one:

MD5 Fingerprint = 23:A7:AD:33:3C:08:BE:2A:62:6E:85:DF:B8:00:23:40


Thank you
  66   Wed Jul 10 22:19:47 2002 Warning momsheikh25@hotmail.comBug report  a bug and a question
   If you have only one entry in the logbook and have it set up in threaded 
mode like: ?cmd=Search&mode=threaded&reverse=1, when you click on the icon 
of the entry or the number of the entry to see it, it does not allow you 
to.  If there is more than one entry, it works fine.  
   Also I wanted to make a submit page from where you could either go back 
to the logbook which you just entered a message for or type a new entry for 
that logbook.  First of all, is there a way to have only one file called 
submitpage.html in which I can define this for all logbooks or do i need it 
for ever logbook.  And also, is there a way I can even set a link that will 
allow to create a new entry.  I tried: 
    <a href="demo/?cmd=new">Enter</a> another message<p>

but for some reason it does not work.  Is there a way to implement this?

Thanks,
Mo
  69596   Thu Dec 29 20:26:11 2022 Reply Andreykowaraj4stuff@gmail.comBug fixAllELOG V3.1.4-493a hack around

FYI.

Removing "wrap=hard" on the line #11461 in the elogd.cxx file resolves my problem.

 

- rsprintf("<textarea rows=%d cols=%d wrap=hard name=\"Text\">\n", height, width);*/
+ rsprintf("<textarea rows=%d cols=%d name=\"Text\">\n", height, width);

  69597   Fri Dec 30 00:46:03 2022 Reply Konstantin Olchanskiolchansk@triumf.caBug fixAllELOG V3.1.4-493a hack around
- rsprintf(&quot;&lt;textarea rows=%d cols=%d wrap=hard name=\&quot;Text\&quot;&gt;\n&quot;, height, width);
+ rsprintf(&quot;&lt;textarea rows=%d cols=%d name=\&quot;Text\&quot;&gt;\n&quot;, height, width);

my vote is to remove "wrap=hard":

1) I try to read the specs and my head explodes: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
2) textarea should just accept input typed by user, should not try to "neatify" it. if user wants long lines, we should let them.
3) this bug (introduced in recent safari, the best I can tell)

K.O.
  69599   Wed Jan 4 09:33:25 2023 Reply Stefan Rittstefan.ritt@psi.chBug fixAllELOG V3.1.4-493a hack around
> - rsprintf(&quot;&lt;textarea rows=%d cols=%d wrap=hard name=\&quot;Text\&quot;&gt;\n&quot;, height, width);
> + rsprintf(&quot;&lt;textarea rows=%d cols=%d name=\&quot;Text\&quot;&gt;\n&quot;, height, width);
> 
> my vote is to remove "wrap=hard":
> 
> 1) I try to read the specs and my head explodes: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
> 2) textarea should just accept input typed by user, should not try to "neatify" it. if user wants long lines, we should let them.
> 3) this bug (introduced in recent safari, the best I can tell)
> 
> K.O.

I agree with K.O. Does anybody see a problem in removing "wrap=hard"? 

It was there more for historical reasons. In the old days screens were not so wide and wrapping was more of an issue.
People tended to write longer lines and complained that the long lines got reformatted differently for different screen
sizes. So by adding hard CRLF the formatting looked the same on different screens. These days this is not such an issue
any more and I agree with 2) above. If the user wants a long line, the user should get it.

Stefan
  69600   Wed Jan 4 09:39:38 2023 Reply Stefan Rittstefan.ritt@psi.chBug fixAllELOG V3.1.4-493a hack around
Ahh, now I remember. Well, the I put that in like 25 years ago ;-)

Let's assume the user write a very long line and relies on the wrapping of the text box. So the input might look like the 
first attachment. Then the user hits submit and gets just one long line (second attachment) and has to scroll one kilometre
to the right to see the full line. So there is an inconsistency between the entry form and what the user sees after the
submission. Having "wrap=hard" tells the browser to put CRLF where the wrapping in the textarea happens, so the text looks
the same during entry and after submission. If we remove the "wrap=hard", we would be back to the situation below in the two
attachments.

Opinions?

Stefan
Attachment 1: Screenshot_2023-01-04_at_9.38.51_.png
Screenshot_2023-01-04_at_9.38.51_.png
Attachment 2: Screenshot_2023-01-04_at_9.39.09_.png
Screenshot_2023-01-04_at_9.39.09_.png
ELOG V3.1.5-fe60aaf