ID |
Date |
Icon |
Author |
Author Email |
Category |
OS |
ELOG Version |
Subject |
68267
|
Fri Feb 26 08:47:22 2016 |
| Nigel Warr | warr@ikp.uni-koeln.de | Bug report | Linux | 3.1.1-1 | Possible bug in elogd execute_shell |
I was just playing around with gcc6's new feature for warning about misleading indentation (which can often hide real bugs) and I think it found one in elog-3.1.1-1 at src/elogd.c:22538. Here there is an if statement, which looks as though it should be inside a loop, but it isn't. The code is:
for (i = 0; i < MAX_ATTACHMENTS; i++)
generate_subdir_name(att_file[i], subdir, sizeof(subdir));
if (att_file[i][0] && strlen(shell_cmd) + strlen(lbs->data_dir) + strl$
< sizeof(shell_cmd) + 1) {
strcpy(p, "\"");
strcat(p, lbs->data_dir);
strlcat(str, subdir, sizeof(str));
strlcpy(str, att_file[i], sizeof(str));
str_escape(str, sizeof(str));
strcat(p, str);
strcat(p, "\" ");
p += strlen(p);
}
and the if statment is accessing the loop variable i but it is actually outside the loop. Presumably, there should be some more curly brackets here. gcc6 gave the warning:
src/elogd.c: In function ‘execute_shell’:
src/elogd.c:22538:10: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
if (att_file[i][0] && strlen(shell_cmd) + strlen(lbs->data_dir) + strlen(subdir) + strlen(att_file[i])
^~
src/elogd.c:22536:7: note: ...this ‘for’ clause, but it is not
for (i = 0; i < MAX_ATTACHMENTS; i++)
^~~
|
Draft
|
Fri Feb 26 08:38:06 2016 |
| Nigel Warr | warr@ikp.uni-koeln.de | Bug report | Linux | | Possible bug in elogd execute_shell |
I was just playing around with gcc6's new feature for warning about misleading indentation (which can often hide real bugs) and I think it found one in elog-3.1.1-1 at src/elogd.c:22538. Here there is an if statement, which looks as though it should be inside a loop, but it isn't. The code is:
for (i = 0; i < MAX_ATTACHMENTS; i++)
generate_subdir_name(att_file[i], subdir, sizeof(subdir));
if (att_file[i][0] && strlen(shell_cmd) + strlen(lbs->data_dir) + strl$
< sizeof(shell_cmd) + 1) {
strcpy(p, "\"");
strcat(p, lbs->data_dir);
strlcat(str, subdir, sizeof(str));
strlcpy(str, att_file[i], sizeof(str));
str_escape(str, sizeof(str));
strcat(p, str);
strcat(p, "\" ");
p += strlen(p);
}
and the if statment is accessing the loop variable i but it is actually outside the loop. Presumably, there should be some more curly brackets here. gcc6 gave the warning:
src/elogd.c: In function ‘execute_shell’:
src/elogd.c:22538:10: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation]
if (att_file[i][0] && strlen(shell_cmd) + strlen(lbs->data_dir) + strlen(subdir) + strlen(att_file[i])
^~
src/elogd.c:22536:7: note: ...this ‘for’ clause, but it is not
for (i = 0; i < MAX_ATTACHMENTS; i++)
^~~
|
68265
|
Wed Feb 24 09:48:09 2016 |
| Stefan Ritt | stefan.ritt@psi.ch | Question | Linux | 3.0.0 | Re: Kerberos auth not available on 3.0 ? |
Hi Jimmy, no Kerberos is not compiled into the Windows installer. You are the first one asking for that under Windows. All other Kerberos users use Linux so far. You have to compile the Windows version yourelf. This is because there are several versions of Kerberos around and people need differnt libraries. Sorry for that.
/Stefan
Jimmy Bria wrote: |
Hi Stefan - Do you know is Kerberos is available (compiled) on the Windows installer?
-Jimmy
Stefan Ritt wrote: |
Kerberos support is not compiled into the binary RPM. You have to comile from sources to get that. The reason is that there are different Kerberos libraries around, and different people need different ones.
/Stefan
|
|
|
68264
|
Tue Feb 23 22:32:30 2016 |
| Jimmy Bria | jimmy.bria@gmail.com | Question | Linux | 3.0.0 | Re: Kerberos auth not available on 3.0 ? |
Hi Stefan - Do you know is Kerberos is available (compiled) on the Windows installer?
-Jimmy
Stefan Ritt wrote: |
Kerberos support is not compiled into the binary RPM. You have to comile from sources to get that. The reason is that there are different Kerberos libraries around, and different people need different ones.
/Stefan
|
|
68263
|
Wed Feb 17 18:33:18 2016 |
| Stefan Ritt | stefan.ritt@psi.ch | Info | All | ELOG V3.1.1-3f3 | Re: Find empty attributes |
Cool, I didn't know that trick myself, thanks for sharing.
Andreas Luedeke wrote: |
It is possible for normal string attributes: the regular expression pattern "^$" can be used to search for an empty string.
E.g. in this Forum "ELOG Version" is a required attribute, and should never be empty. But if you search for:
you'll find a couple of entries from a time where it apparently wasn't a required attribute.
Cheers
Andreas
Arno Teunisse wrote: |
Want to use the find function from ELOG to search for empty fields ( Attributes that are not defined )
How to do that ?
Could not find it in the Forum.
Greetings Arno Teunisse
|
|
|
68262
|
Wed Feb 17 18:08:53 2016 |
| Andreas Luedeke | andreas.luedeke@psi.ch | Info | All | ELOG V3.1.1-3f3 | Re: Find empty attributes |
It is possible for normal string attributes: the regular expression pattern "^$" can be used to search for an empty string.
E.g. in this Forum "ELOG Version" is a required attribute, and should never be empty. But if you search for:
you'll find a couple of entries from a time where it apparently wasn't a required attribute.
Cheers
Andreas
Arno Teunisse wrote: |
Want to use the find function from ELOG to search for empty fields ( Attributes that are not defined )
How to do that ?
Could not find it in the Forum.
Greetings Arno Teunisse
|
|
68261
|
Wed Feb 17 08:18:05 2016 |
| Stefan Ritt | stefan.ritt@psi.ch | Info | Windows | ELOG V3.1.1-3f3 | Re: Find empty attributes |
Unfortunately not possible.
Stefan
Arno Teunisse wrote: |
Want to use the find function from ELOG to search for empty fields ( Attributes that are not defined )
How to do that ?
Could not find it in the Forum.
Greetings Arno Teunisse
|
|
68260
|
Tue Feb 16 23:19:31 2016 |
| Arno Teunisse | arno.teunisse@simac.com | Info | Windows | ELOG V3.1.1-3f3 | Find empty attributes |
Want to use the find function from ELOG to search for empty fields ( Attributes that are not defined )
How to do that ?
Could not find it in the Forum.
Greetings Arno Teunisse
|