ID |
Date |
Icon |
Author |
Author Email |
Category |
OS |
ELOG Version |
Subject |
67069
|
Fri May 20 22:45:00 2011 |
| John M O'Donnell | odonnell@lanl.gov | Bug fix | Linux | svn 2414 | my_shell (OS_UNIX) uses /tmp/elog_shell - conflict when more than one elogd runs at the same time | all instances of elogd use the same file name in /tmp when calling my_shell. This can cause some inconsistent behavior when two or more copies of elogd are runnnig at the same time. (eg. one might detect ImageMagik is installed, and the other not,)
The propsed solution is to have the parent read from a pipe to the child rather from a file. A patch is attached. |
Attachment 1: elogd.c.patch_shellPipe
|
--- elogd.c.orig 2011-05-20 13:28:48.000000000 -0600
+++ elogd.c 2011-05-20 14:16:12.000000000 -0600
@@ -866,25 +866,27 @@
#ifdef OS_UNIX
pid_t child_pid;
- int fh, status, i;
+ int fd[2], status, i;
char str[256];
+ /* create pipe for parent<->child communication */
+ if (pipe(fd) < 0)
+ return 0;
+
if ((child_pid = fork()) < 0)
return 0;
else if (child_pid > 0) {
- /* parent process waits for child */
- waitpid(child_pid, &status, 0);
+
+ /* parent does not write to child */
+ close(fd[1]);
/* read back result */
memset(result, 0, size);
- fh = open("/tmp/elog-shell", O_RDONLY);
- if (fh > 0) {
- i = read(fh, result, size);
- close(fh);
- }
+ i = read(fd[0], result, size);
+ close(fd[0]);
- /* remove temporary file */
- remove("/tmp/elog-shell");
+ /* parent process waits for child */
+ waitpid(child_pid, &status, 0);
/* strip trailing CR/LF */
while (strlen(result) > 0 && (result[strlen(result) - 1] == '\r' || result[strlen(result) - 1] == '\n'))
@@ -926,8 +928,7 @@
eprintf("Falling back to user \"%s\"\n", str);
}
- /* execute shell with redirection to /tmp/elog-shell */
- sprintf(str, "/bin/sh -c \"%s\" > /tmp/elog-shell 2>&1", cmd);
+ /* execute command with redirection to pipe to parent */
if (is_verbose()) {
efputs("Going to execute: ");
@@ -935,7 +936,17 @@
efputs("\n");
}
- system(str);
+ /* redirect stdout/stderr to pipe for parent to read */
+ close(STDOUT_FILENO); dup2(fd[1], STDOUT_FILENO);
+ close(STDERR_FILENO); dup2(fd[1], STDERR_FILENO);
+ /* child does not read the pipe */
+ close(fd[0]);
+ /* child nolonger uses fd[1] - use stderr or stdout instead */
+ close(fd[1]);
+
+ if (system(cmd) == -1) {
+ fprintf(stderr, "unable to execute command: %s\n", cmd);
+ }
_exit(0);
}
|
67082
|
Wed Jun 15 11:10:01 2011 |
| Andreas Luedeke | andreas.luedeke@psi.ch | Request | All | 2.9.0 | Integrate Latex Formula Editor plugin | There is a nice js plugin to create formulas with a latex editor.
This plugin (Can be found at http://www.codecogs.com/latex/integration/ckeditor/install.php) is for the CK Editor.
Currently the FCK Editor is used, which has been superseded in 2009 by the CK Editor.
It would be nice to change ELOG to use the newer CKEditor, in order to be able to use the formula plugin (and
maybe other plugins as well later). |
67123
|
Tue Sep 13 13:38:19 2011 |
| Andreas Luedeke | andreas.luedeke@psi.ch | Bug fix | Linux | 2.9.0-2414 | Re: Elog crashes with URL find npp=0 | > [...] It appears that npp=0 crashes elogd [...]
Here's a patch: search for "npp" in src/elogd.c and add the following line:
if (n_page<=0) n_page = 20;
Here's the diff output for version 2.9.0-2414
*** 20092,20096 ****
if (isparam("npp"))
n_page = atoi(getparam("npp"));
+ if (n_page<=0) n_page = 20;
if (page_mid) { |
67177
|
Fri Jan 27 14:05:09 2012 |
| Christian Herzog | herzog@phys.ethz.ch | Question | Linux | 2.9.0 | el cheapo LDAP binding | Hi all,
we would like to hook elog to our LDAP server. Instead of writing a full-featured LDAP auth module for elog, I have the following idea: use Apache's LDAP module to require LDAP auth for a single logbook:
<Location /elog/admin>
Use PhysLDAP
Use RequirePhysLDAPGroup isg
RewriteEngine On
RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule . - [E=RU:%1]
RequestHeader add X-Forwarded-User %{RU}e
</Location>
the two Use statements are Apache macros that define our LDAP settings. The last 4 lines are necessary for Apache to pass on the logged in user to the proxied elog (ends up in ENV X-Forwarded-User).
In elogd.c, I added
/* extract REMOTE_USER */
if ((p = strstr(request, "X-Forwarded-User:")) != NULL) {
p += 17;
while (*p && *p == ' ')
p++;
strlcpy(remote_user, p, sizeof(remote_user));
if (strchr(remote_user, '\r'))
*strchr(remote_user, '\r') = 0;
char sid[32];
/* get a new session ID */
sid_new(NULL, remote_user, (char *) inet_ntoa(rem_addr), sid);
/* set SID cookie */
set_sid_cookie(NULL, sid);
// TODO: set lbs!
}
to process_http_request in order to extract the LDAP login. I have managed to populate the author field with remote_user, but what I'd really like is to write a cookie containing this login name so that session handling kicks in. You can see that I attempt to write a cookie, but elogd segfaults at set_sid_cookie() (gdb backtrace:
set_cookie (lbs=0x0, name=0x483b22 "sid", value=0x7ffffffd7590 "4831386B7B333A99", global=0, expiration=0x7ffffffd7300 "")
Would anyone be willing to help me with this? I'm not at all familiar with the program flow in elogd and my C is a bit rusty...
thanks,
-Christian
--
Dr. Christian Herzog <herzog@phys.ethz.ch> support: +41 44 633 26 68
IT Services Group, HPT H 8 voice: +41 44 633 39 50
Department of Physics, ETH Zurich
8093 Zurich, Switzerland http://nic.phys.ethz.ch/
|
67218
|
Thu Mar 29 13:01:17 2012 |
| leen smit | leen.smit@gmail.com | Info | Linux | All | ELOG V2.9. | RSS Feed | Hi All,
Just a quick message in the hope of helping other find an answer to the question: How to reach the RSS Feed???
I spend hours trying to find out what the correct URL is to reach the feed. The documentation on this is non-existent - at least we could't find this anywhere in the docs.
Answer: Just add elog.rdf at the end of the URL of the logbook!!
eg. http://midas.psi.ch/elogs/Forum/elog.rdf
Leen |
67219
|
Thu Mar 29 13:01:26 2012 |
| leen smit | leen.smit@gmail.com | Info | Linux | All | ELOG V2.9. | RSS Feed | Hi All,
Just a quick message in the hope of helping other find an answer to the question: How to reach the RSS Feed???
I spend hours trying to find out what the correct URL is to reach the feed. The documentation on this is non-existent - at least we could't find this anywhere in the docs.
Answer: Just add elog.rdf at the end of the URL of the logbook!!
eg. http://midas.psi.ch/elogs/Forum/elog.rdf
Leen |
67456
|
Mon Feb 25 19:10:07 2013 |
| Francois Cukier | Monsieurdindon@gmail.com | Question | Windows | 2.9.2 | Edit from summary view | Good day,
I was wondering (and I searched for :) ) a way to directly edit an entry while in summary view instead of having to first click on the entry then click on Edit...
I mean, in summary view, every row entry is clickable to access the entry itself (except email witch open email client), so instead to open it, can it be edited directly ?
Is it possible ? |
67457
|
Mon Feb 25 19:12:47 2013 |
| Francois Cukier | Monsieurdindon@gmail.com | Question | Windows | 2.9.2 | Search result background color | Is it possible to change the "yellow" background color when running a search ? (I looked in the css, there is nothing...)
Couldn't find any syntax for elogd.cfg
Thanks for your help :) |
|