Re: [Soaplab-users] shell builtin
Brought to you by:
marsenger
From: Sebastien M. <Seb...@un...> - 2008-04-11 13:04:31
|
> Is there a way to use shell builtin (like type) as executable in > application ? > > > Not a straightforward way. Java does not support it (as far as I know) > so you have to write a wrapper script around your builtin. > > The second option is to use application attribute 'method' in your ACD > file. For example, let's assume that you wish to execute builtin 'let' > (that returns an exit code depending on the evaluation of its parameters): > > appl: HelloWorld [ > ... > executable: "bash" > comment: 'method -c "let ${greeting}"' > ] > > This works fine - try for example the command-lines (and see that the > exit code changes): > > build/run/run-cmdline-client -name classic.helloworld -w -r -protocol > local greeting '1+1' > build/run/run-cmdline-client -name classic.helloworld -w -r -protocol > local greeting '1-1' > > But this might be a security risk - a user can send anything and it is > evaluated by your bash. I recommend to use it with caution and only when > limited access is established. > > Cheers, > Martin I know it is a security issue but it is only for internal use, and only for type shell builtin which is more reactive than unix which command on our file system. It works perfectly ! Thanks -- Sébastien Moretti SIB, Quartier Sorge - Genopode CH-1015 Lausanne, Switzerland Tel.: +41 (21) 692 4056/4221 |