Hei,
After some pause, I rejoined the list to ask this question. Nice to meet you again. I have trouble using OS_process. I moved the module to LassoModules, restarted Lasso Service, created a user in the OS Process Users group. Now I get the browser authentication prompt every time I try to run the page. THe prompt says Enter the name and password for "Lasso Security" at www.mydomain.com (where mydomain is my domain). The code I use is like this: inline: -username = 'myUser', -password = 'myPass'; Var: 'myProcess' = (OS_Process: '/root/scripts/myscript.sh'); Encode_HTML: $myProcess->Read; $myProcess->Close; 'The script has been run!'; /inline; If I replace this code with a trivial Lasso code (like date;) the page runs without problem. So the problem must be connected with the OS_process tag. What to do? - Jussi -- Jussi Hirvi * Green Spot Topeliuksenkatu 15 C * 00250 Helsinki * Finland Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms) [hidden email] * http://www.greenspot.fi -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
Have you checked the security on os_process users? I would start
there. Make sure your user is in that group. On 27-Feb-09, at 4:34 AM, Jussi Hirvi wrote: > If I replace this code with a trivial Lasso code (like date;) the > page runs > without problem. So the problem must be connected with the > OS_process tag. > > What to do? Rich in Toronto ...now go get on your bike -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
In reply to this post by Jussi Hirvi
When you get the authentication prompt, enter the u/p that you have in your inline. Do you authenticate?
If no, then the u/p is either incorrect or the u is not a member of a group that can use the os_process tag. In the context of Lasso Security, os_process is very similar to the file_ tags. So you can use my file perms guide, as well as the Language Guide, for further information. http://www.stevepiercy.com/lasso_stuff/file_perms.lasso --steve On Friday, February 27, 2009, [hidden email] (Jussi Hirvi) pronounced: >Hei, > >After some pause, I rejoined the list to ask this question. Nice to meet you >again. > >I have trouble using OS_process. I moved the module to LassoModules, >restarted Lasso Service, created a user in the OS Process Users group. > >Now I get the browser authentication prompt every time I try to run the >page. THe prompt says > > Enter the name and password for "Lasso Security" at www.mydomain.com > >(where mydomain is my domain). > >The code I use is like this: > >inline: -username = 'myUser', -password = 'myPass'; > Var: 'myProcess' = (OS_Process: '/root/scripts/myscript.sh'); > Encode_HTML: $myProcess->Read; > $myProcess->Close; > 'The script has been run!'; >/inline; > >If I replace this code with a trivial Lasso code (like date;) the page runs >without problem. So the problem must be connected with the OS_process tag. > >What to do? > >- Jussi > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Web Site Builder Soquel, CA <[hidden email]> <http://www.StevePiercy.com/> -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
Ok, I solved some issues. The main issue was that the domain I was working
with was assigned to a different Lasso Site than I thought. :-) Now the page runs ok, but the script seems to do nothing, when run with a browser (though it works fine when run from the shell). 27.2.2009 11:44 Steve Piercy - Web Site Builder ([hidden email]) kirjoitteli: > In the context of Lasso Security, os_process is very similar to the file_ > tags. So you can use my file perms guide, as well as the Language Guide, for > further information. > http://www.stevepiercy.com/lasso_stuff/file_perms.lasso Do I have to manually enable the needed file paths for the group "OS Process Users"? - Jussi -- Jussi Hirvi * Green Spot Topeliuksenkatu 15 C * 00250 Helsinki * Finland Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms) [hidden email] * http://www.greenspot.fi -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
I am not sure about the command to run that script.
From page 530: Var: 'os' = (OS_Process: 'cmd', (Array: '/C batch.bat'); You have to specify what method to use, then the parameters. In this case, the latter would point to that shell script, but I am not sure what you have to call to run the script. On 27-Feb-09, at 6:24 AM, Jussi Hirvi wrote: > Do I have to manually enable the needed file paths for the group "OS > Process > Users"? Rich in Toronto ...now go get on your bike -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
My command has no parameters - it is like this:
Var: 'myProcess' = (OS_Process: '../myscript.sh'); So no worries about parameters. - Jussi 27.2.2009 13:29 Viaduct Productions ([hidden email]) kirjoitteli: > I am not sure about the command to run that script. > > From page 530: > Var: 'os' = (OS_Process: 'cmd', (Array: '/C batch.bat'); > > You have to specify what method to use, then the parameters. In this > case, the latter would point to that shell script, but I am not sure > what you have to call to run the script. -- Jussi Hirvi * Green Spot Topeliuksenkatu 15 C * 00250 Helsinki * Finland Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms) [hidden email] * http://www.greenspot.fi -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
In reply to this post by Jussi Hirvi
Let's see your tag and its parameters.
Otherwise just follow the example syntax in the Language Guide. --steve On Friday, February 27, 2009, [hidden email] (Jussi Hirvi) pronounced: >Ok, I solved some issues. The main issue was that the domain I was working >with was assigned to a different Lasso Site than I thought. :-) > >Now the page runs ok, but the script seems to do nothing, when run with a >browser (though it works fine when run from the shell). > >27.2.2009 11:44 Steve Piercy - Web Site Builder ([hidden email]) >kirjoitteli: >> In the context of Lasso Security, os_process is very similar to the file_ >> tags. So you can use my file perms guide, as well as the Language Guide, for >> further information. >> http://www.stevepiercy.com/lasso_stuff/file_perms.lasso > >Do I have to manually enable the needed file paths for the group "OS Process >Users"? > >- Jussi > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Web Site Builder Soquel, CA <[hidden email]> <http://www.StevePiercy.com/> -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
In reply to this post by Jussi Hirvi
Yes I know. That might be the problem though. It's like saying
"Computer: /users/jussi/files/porkloin.txt'". There's no indication what you want to do, and you are assuming you want to open the file. Your script file might need to be a parameter to run using a unix app. On 27-Feb-09, at 6:32 AM, Jussi Hirvi wrote: > My command has no parameters - it is like this: > Var: 'myProcess' = (OS_Process: '../myscript.sh'); > So no worries about parameters. Rich in Toronto ...now go get on your bike -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
In reply to this post by stevepiercy
I didn't see any direct script called in the LG.
On 27-Feb-09, at 6:34 AM, Steve Piercy - Web Site Builder wrote: > Let's see your tag and its parameters. > > Otherwise just follow the example syntax in the Language Guide. Rich in Toronto ...now go get on your bike -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
Ok, I think the script has to be in the PATH - so far I tried the /root
directory, and the web directory. var: 'myProcess' = (OS_Process: '/bin/ls'); works for me, and shows the output in the browser window. - Jussi 27.2.2009 13:35 Viaduct Productions ([hidden email]) kirjoitteli: > I didn't see any direct script called in the LG. > > > On 27-Feb-09, at 6:34 AM, Steve Piercy - Web Site Builder wrote: > >> Let's see your tag and its parameters. >> >> Otherwise just follow the example syntax in the Language Guide. -- Jussi Hirvi * Green Spot Topeliuksenkatu 15 C * 00250 Helsinki * Finland Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms) [hidden email] * http://www.greenspot.fi -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
OK, but that isn't a script you are calling. LS is an application.
It's a function. I am just thinking that you have to do the same, point to an application of some sort, and then use your script as a file. I could be wrong, but that's what I'm thinking at the moment. I've used os_process for various things, and she's a tricky one, but I've never called a script. On 27-Feb-09, at 6:39 AM, Jussi Hirvi wrote: > Ok, I think the script has to be in the PATH - so far I tried the / > root > directory, and the web directory. > > var: 'myProcess' = (OS_Process: '/bin/ls'); > > works for me, and shows the output in the browser window. Rich in Toronto ...now go get on your bike -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
In reply to this post by Jussi Hirvi
I think I'm back to square one: how to trigger my own shell script with
browser? Do I have to compile it to make it work?? I've never done that before. - Jussi 27.2.2009 13:39 Jussi Hirvi ([hidden email]) kirjoitteli: > Ok, I think the script has to be in the PATH - so far I tried the /root > directory, and the web directory. > > var: 'myProcess' = (OS_Process: '/bin/ls'); > > works for me, and shows the output in the browser window. -- Jussi Hirvi * Green Spot Topeliuksenkatu 15 C * 00250 Helsinki * Finland Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms) [hidden email] * http://www.greenspot.fi -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
No it's not about compilation. It's about finding the right
os_process way of launching it, as opposed to just calling it. I'm sure someone will poke in here. Try /bin/bash. On 27-Feb-09, at 6:47 AM, Jussi Hirvi wrote: > I think I'm back to square one: how to trigger my own shell script > with > browser? Do I have to compile it to make it work?? I've never done > that > before. Rich in Toronto ...now go get on your bike -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
Ok, I got forward with this. I first tested with
Var: 'myProcess' = (OS_Process: '/bin/pwd'); (pwd shows the current directory) ..and from the output I found out that the "current" dir is the Lasso Site, inside the Lasso\ Professional\ ... etc. etc. folder (why on earth such long names??). Then I made a new subfolder in there, called JussiScripts, and put my new script in there. I can now trigger it like this: Var: 'myProcess' = (OS_Process: './JussiScripts/MyScript.sh'); The problem is only that I cannot accomplish what I want - to correct (chmod) the privileges in the www root directory of this www site. If I try that, the www page (supposed to launch the script) hangs. Apparently the Lasso user does not have enough privileges for chmod. - Jussi 27.2.2009 13:56 Viaduct Productions ([hidden email]) kirjoitteli: > No it's not about compilation. It's about finding the right > os_process way of launching it, as opposed to just calling it. I'm > sure someone will poke in here. > > Try /bin/bash. > > > On 27-Feb-09, at 6:47 AM, Jussi Hirvi wrote: >> I think I'm back to square one: how to trigger my own shell script >> with >> browser? Do I have to compile it to make it work?? I've never done >> that >> before. -- Jussi Hirvi * Green Spot Topeliuksenkatu 15 C * 00250 Helsinki * Finland Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms) [hidden email] * http://www.greenspot.fi -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
In reply to this post by Jussi Hirvi
Here is an example.
ls.lasso -------- <code> [ inline( -username='os_process_user', -password='os_process_pass', -nothing ); // use the filesystem-relative path to the command var('myprocess2') = os_process('/Library/WebServer/Documents/site/lsal.sh'); encode_break($myprocess2->read); $myprocess2->isopen; $myprocess2->close; /inline; ] </code> lsal.sh -------- #!/bin/bash # all shell scripts must begin with the above line in order to invoke your shell and user profile # also shell scripts might have problems with the BOM of UTF-8 files, so try saving it without a BOM. #print the current directory pwd # list all items in the current directory in long format ls -al . ------- Make lsal.sh executable by changing its system file perms to whatever works (start with 555, then make it more secure). ==> /Applications/Lasso Professional 8/LassoSites/default-1 total 1240 drwxrwxr-x 13 lasso admin 442 Feb 23 07:22 . drwxrwxr-x 5 lasso admin 170 Oct 30 19:16 .. -rw-rw-r--@ 1 stevepiercy admin 6148 Feb 23 07:28 .DS_Store drwxrwxr-x 2 lasso admin 68 Jul 16 2005 JDBCDrivers drwxrwxr-x 2 lasso admin 68 Jul 16 2005 JavaLibraries drwxrwxr-x 2 lasso admin 68 Jul 16 2005 LassoAdmin drwxrwxr-x 2 lasso admin 68 Aug 10 2005 LassoApps -rw-rw-r-- 1 lasso admin 625243 Feb 27 04:16 LassoErrors.txt drwxrwxr-x 3 lasso admin 102 Nov 5 03:46 LassoLibraries drwxrwxr-x 2 lasso admin 68 Jul 16 2005 LassoModules drwxrwxr-x 8 lasso admin 272 Feb 23 07:24 LassoStartup drwxrwxr-x 12 lasso admin 408 Feb 27 04:31 SQLiteDBs Note that the output of the current directory is relative to the current Lasso Site. This actually makes me curious to try the montage command again. I mean, if you write a shell script that does what you want, just fire off an os_process to the shell script, and you're golden. That of course means learning how to do basic shell scripting, but it would work. --steve On Friday, February 27, 2009, [hidden email] (Jussi Hirvi) pronounced: >I think I'm back to square one: how to trigger my own shell script with >browser? Do I have to compile it to make it work?? I've never done that >before. > >- Jussi > >27.2.2009 13:39 Jussi Hirvi ([hidden email]) kirjoitteli: >> Ok, I think the script has to be in the PATH - so far I tried the /root >> directory, and the web directory. >> >> var: 'myProcess' = (OS_Process: '/bin/ls'); >> >> works for me, and shows the output in the browser window. > -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Steve Piercy Web Site Builder Soquel, CA <[hidden email]> <http://www.StevePiercy.com/> -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
In reply to this post by Jussi Hirvi
OK then, it has to do with where os_process has its point of view.
When I call third party apps, I have to consider that as well. Good to know you can launch a bash shell directly as well. On 27-Feb-09, at 7:37 AM, Jussi Hirvi wrote: > Then I made a new subfolder in there, called JussiScripts, and put > my new > script in there. I can now trigger it like this: > > Var: 'myProcess' = (OS_Process: './JussiScripts/MyScript.sh'); Rich in Toronto ...now go get on your bike -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
I always found it a little confusing that [os_process] had the Lasso
application folder as it's pwd instead of the web root from which it's called (since that's most often where you want to manipulate something). That's why I change it automatically right off the bat in the [shell] wrapper tag. I also find it a lot easier to just spawn a terminal than to interact directly with whatever process I'm using, so that I can directly transfer whatever works on the command line to the tag. http://tagswap.net/shell/ - jason On Fri, Feb 27, 2009 at 7:41 AM, Viaduct Productions <[hidden email]> wrote: > OK then, it has to do with where os_process has its point of view. When I > call third party apps, I have to consider that as well. Good to know you > can launch a bash shell directly as well. > > On 27-Feb-09, at 7:37 AM, Jussi Hirvi wrote: > >> Then I made a new subfolder in there, called JussiScripts, and put my new >> script in there. I can now trigger it like this: >> >> Var: 'myProcess' = (OS_Process: './JussiScripts/MyScript.sh'); > > > > Rich in Toronto > ...now go get on your bike > > > > -- > This list is a free service of LassoSoft: http://www.LassoSoft.com/ > Search the list archives: http://www.ListSearch.com/Lasso/Browse/ > Manage your subscription: http://www.ListSearch.com/Lasso/ > > > -- tagSwap.net :: Open Source Lasso Code <http://tagSwap.net/> -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
I originally thought os_process was about terminal control, as opposed
to the whole library of potential uses. When I first saw your tag, I thought the cd command was to give it a fixed scope, and that the os_process had no current viewpoint. Oh I am so looking forward to 9. "9 is the new 5!" On 27-Feb-09, at 7:48 AM, Jason Huck wrote: > I also find it a lot easier to just spawn a > terminal than to interact directly with whatever process I'm using, so > that I can directly transfer whatever works on the command line to the > tag. Rich in Toronto ...now go get on your bike -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
In reply to this post by stevepiercy
27.2.2009 14:39 Steve Piercy - Web Site Builder ([hidden email])
kirjoitteli: > Here is an example. Ok, but it seems that ls is easy to trigger. I cannot trigger the chmod command at all. ls is not so much fun yet. :-) - Jussi -- Jussi Hirvi * Green Spot Topeliuksenkatu 15 C * 00250 Helsinki * Finland Tel. & fax +358 9 493 981 * Mobile +358 40 771 2098 (only sms) [hidden email] * http://www.greenspot.fi -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
os_process can have multiple commands, so you can interact with a
multi-command session. It's tricky, and I had to test it through and through to make sure things were going on properly. Perhaps you can get into su and try it that way. I don't know, just speculating. On 27-Feb-09, at 8:13 AM, Jussi Hirvi wrote: > Ok, but it seems that ls is easy to trigger. I cannot trigger the > chmod > command at all. ls is not so much fun yet. :-) Rich in Toronto ...now go get on your bike -- This list is a free service of LassoSoft: http://www.LassoSoft.com/ Search the list archives: http://www.ListSearch.com/Lasso/Browse/ Manage your subscription: http://www.ListSearch.com/Lasso/ |
Free forum by Nabble | Edit this page |