Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG, Page 156 of 806  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
  1694   Tue Feb 14 22:31:08 2006 Reply Steve Jonessteve.jones@freescale.comBug reportOther2.6.1Re: CONCERN: Cross-platform compiling at risk

Steve Jones wrote:

Stefan Ritt wrote:

Steve Jones wrote:
Stefan, I am concerned that there are becoming too many Linux dependencies in terms of required libraries and header files. Although we have a replacement for the
forkpty()
routine, I am running into many other dependencies, the latest of which is pty.h. Aren't there guidelines in GCC that point out what is available cross-platform and what is not? For example, any SVR# (System Five, Release XX) based Unix will not include the forkpty() function, but BSD derivatives will.

Currently we are stuck at eLog 2.5.9 because of this issue.


The whole issue with the forkpty() came from the request of the shell subsitution. I managed to compile this under Linux and under Windows, so I was under the impression that this is not too specific (although I had to use completely different approaches for Linux and Windows). Now if you tell me that this is not true, we have basically two options:

1) Make the shell substitution an option. On systems which don't have a forkpty(), don't compile it in. I guess not many people need the shell substitution. Thos people who need it have to stick to certain Unix flavours.

2) Find equivalents of forkpty() on all systems. The problem with that is that I have to rely on others like you to supply me some code for other systems and test it.

Please let me know what option you prefer. Also other users are asked for their opinion.



Best regards,

Stefan


Stefan et al.

I think it would be preferrable if we could find a routine that performed the same function but that was available under Windows/Linux/Unix. Question: Is the functionality really just to issue an arbitrary command-string to a "shell" and have the result stuffed back into an eLog variable? I'm not an expert but it would seem that such a feature would be universally available or could be used to construct a suitable routine.

If possible, could one use the
int system(const char *s);
function in conjunction with a filei/o function as the means for getting the results of a system call back into a var. Perhaps
char *tmpnam(char *s);
, running a command via
int system(const char *s);
, then opening that file for a read would accomplish what is being desired?
  1695   Wed Feb 15 18:13:25 2006 Reply Stefan Rittstefan.ritt@psi.chQuestionLinux2.6.1Re: Accessing elog through two apache servers...
Thanks for the patch, I committed it to Subversion Revision #1657.
  1696   Wed Feb 15 18:25:15 2006 Reply Stefan Rittstefan.ritt@psi.chBug reportOther2.6.1Re: CONCERN: Cross-platform compiling at risk

Steve Jones wrote:
Question: Is the functionality really just to issue an arbitrary command-string to a "shell" and have the result stuffed back into an eLog variable? I'm not an expert but it would seem that such a feature would be universally available or could be used to construct a suitable routine.

If possible, could one use the
int system(const char *s);
function in conjunction with a filei/o function as the means for getting the results of a system call back into a var. Perhaps
char *tmpnam(char *s);
, running a command via
int system(const char *s);
, then opening that file for a read would accomplish what is being desired?


Indeed the results from the "shell" need to be stuffed back into an elog attribute, that's why you cannot use the system() function directly. The idea with the tmpnam() could however be a clever workaround. I have to see if this works under Windows. If so, it would be a much more portable alternative to forkpty().
  1697   Wed Feb 15 19:02:32 2006 Reply Steve Jonessteve.jones@freescale.comBug reportOther2.6.1Re: CONCERN: Cross-platform compiling at risk

Steve Jones wrote:

Stefan Ritt wrote:

Steve Jones wrote:
Question: Is the functionality really just to issue an arbitrary command-string to a "shell" and have the result stuffed back into an eLog variable? I'm not an expert but it would seem that such a feature would be universally available or could be used to construct a suitable routine.

If possible, could one use the
int system(const char *s);
function in conjunction with a filei/o function as the means for getting the results of a system call back into a var. Perhaps
char *tmpnam(char *s);
, running a command via
int system(const char *s);
, then opening that file for a read would accomplish what is being desired?


Indeed the results from the "shell" need to be stuffed back into an elog attribute, that's why you cannot use the system() function directly. The idea with the tmpnam() could however be a clever workaround. I have to see if this works under Windows. If so, it would be a much more portable alternative to forkpty().



Yes, these routines are from the standard C libraries. tmpname() returns a pointer to a filename guaranteed to be unique, then you can create that file. tmpfile() actually creates a temporary file and returns a pointer to the filestream, and auto cleans up upon stream termination. system() passes the command string to the shell/commandproc if available. You could wrap these into a single callable function that is called 'shell()' and accomplish your first gola plus achieve cross-platformness again ;->

My 2 cents - hope that is enough!
  1698   Fri Feb 17 13:31:00 2006 Reply Stefan Rittstefan.ritt@psi.chBug reportOther2.6.1Re: CONCERN: Cross-platform compiling at risk

Steve Jones wrote:
If possible, could one use the
int system(const char *s);
function in conjunction with a filei/o function as the means for getting the results of a system call back into a var. Perhaps
char *tmpnam(char *s);
, running a command via
int system(const char *s);
, then opening that file for a read would accomplish what is being desired?


I implemented exprimentally such a code. Instead of tmpnam() (which the compiler claims to be obsolete), I use a hard-wired file name /tmp/elog-shell for that purpose. I put it under /tmp so that the "elog" user (under which elog should normally run) is able to write to. Can you please check if that works fine now under Solaris?
  1702   Tue Feb 21 20:24:18 2006 Reply Stefan Rittstefan.ritt@psi.chQuestionAll2.6.1Re: svn revision number in the source

Steve Jones wrote:
There is a variable $Id$ in source that looks like it is supposed to reflect the svn revision number of the compiled code. How is this supposed to be set, manually just before compiling?


It gets set automatically on every commit to the Subversion repository.
  1703   Tue Feb 21 21:01:22 2006 Reply Steve Jonessteve.jones@freescale.comQuestionAll2.6.1Re: svn revision number in the source

Stefan Ritt wrote:

Steve Jones wrote:
There is a variable $Id$ in source that looks like it is supposed to reflect the svn revision number of the compiled code. How is this supposed to be set, manually just before compiling?


It gets set automatically on every commit to the Subversion repository.


So, when we go to the download section and download directly from there, that is not "committed" source? I ask because the revision id there is not set to anything that I can see.
  1704   Tue Feb 21 21:17:13 2006 Reply Stefan Rittstefan.ritt@psi.chQuestionAll2.6.1Re: svn revision number in the source

Steve Jones wrote:
So, when we go to the download section and download directly from there, that is not "committed" source? I ask because the revision id there is not set to anything that I can see.


Can you be a bit more specific? What do you download? The Windows binaries, the Linux RPM? Or from the Subversion repository? The current version in the repository, which you can download here, contains in the file elogd.c following line 8:
   $Id: elogd.c 1660 2006-02-17 19:48:12Z ritt $

This tells you that this is revision 1660, committed on Feb. 17 by myself. So what is the problem?
ELOG V3.1.5-3fb85fa6