r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!Cheyenne] Discussions about the Cheyenne Web Server

onetom
7-May-2011
[10342]
im running with -w 1. is it debug mode too?
Dockimbel
7-May-2011
[10343x4]
No.
I can't get the error here using -w 1, only using -w 0.
Can you show me the content of %obj.r from : do %../lib/obj.r?
New Cheyenne revision: 138


FIX: RSP code binding issue with nested DO calls (thanks to Tamas 
Herman for
reporting it).


Please pay attention that this fix is really deep in RSP engine, 
I have tested it with all my RSP apps, but regressions are not excluded. 
Be sure to report me any odd changes in your app behaviour after 
upgrading to r138.
GrahamC
7-May-2011
[10347]
Dunno if this is relevant .. but I tend to use 'do* instead of 'do
Dockimbel
7-May-2011
[10348]
do* == do/global == native 'do

There are cases where you want to bind your code to global context, 
so you will use 'do/global. For all other cases, you should just 
use 'do (especially now that nested 'do should to be fixed).
GrahamC
7-May-2011
[10349x3]
my meaning being that 'do did not work as I expected ...
I should go back and see if this new build fixes the issues I've 
had
OTOH, if it's working .. don't touch it!
onetom
7-May-2011
[10352x2]
just for the sake of test, it would be valuable if u could try your 
'do* code using 'do
since we dont have automated tests for this - i guess - at least 
lets do some manual tests
GrahamC
7-May-2011
[10354]
Anyway, thanks for examining this .. I just avoided the issue!
onetom
7-May-2011
[10355]
i was going around it too, by putting my DOs into on-app-start, but 
hey, for rapid development, such basics should work too
GrahamC
7-May-2011
[10356x3]
I was putting my stuff into app-init.r as well but found it did not 
work
So, I was defining my odbc sources there but they were being overwritten
So, now I load the db from a disk file each time ...
onetom
7-May-2011
[10359x2]
:) im loading my db from files too...
on each request actually
GrahamC
7-May-2011
[10361x2]
I have mutiple users using a web app on different ports.  Each has 
their own vhost, and their own pages but to keep things simple, each 
web app is the same.  I include a config file each time a rsp page 
is loaded with the db definition instead of in the app-init.r where 
it did not work
When I included the definitions in the app-init, users would access 
other users' db!
Kaj
7-May-2011
[10363x4]
Data wants to be free
Switching away from root is impossible when the RSP module is disabled:
7-May-2011/20:07:17+2:00 : make object! [
    code: 311
    type: 'script
    id: 'invalid-path
    arg1: 'mod-rsp
    arg2: none
    arg3: none

    near: [if exists? file: service/mod-list/mod-rsp/sessions/ctx-file 
    [try-chown file uid gid]]
    where: 'set-process-to
]
from crash.log
Dockimbel
8-May-2011
[10367x2]
Kaj: pushed a fix for that in r139.
When I included the definitions in the app-init, users would access 
other users' db!
 

Have you used session variables to store user-specific data? Everything 
else is unsafe.
Kaj
8-May-2011
[10369x5]
Thanks, nice turnaround :-)
Next problem when trying to switch away from root:
8-May-2011/17:30:23+2:00 : make object! [
    code: 303
    type: 'script
    id: 'expect-arg
    arg1: 'zero?
    arg2: 'number
    arg3: [number! pair! char! money! time! tuple!]

    near: [if any [zero? gid not zero? set-gid gid] [log/error ["setgid 
    '" group " failed!"]] 
        if
    ]
    where: 'set-process-to
]
I've checked that I'm doing everything right according to the latest 
Cheyenne conventions. I have a fairly standard httpd.cfg with this:
globals [
	user  "www"
	group "www"
Dockimbel
8-May-2011
[10374x5]
Odd, maybe a regression in the latest revisions...I will test that 
on my local linux box in a few minutes.
Kaj: can you try with user "www" only?
(without the 'group line)
Also, could you run Cheyenne in verbose mode (-vvvv) and check the 
boot logs for any error message?
The only cause of the error you've reported above, is that something 
unexpected happened when trying to access and parse %/etc/passwd 
and %/etc/group. Anything special with these files on your system 
(compared to e.g., Ubuntu)?
Kaj
8-May-2011
[10379x4]
Without group the error is still exactly the same
This is a custom Linux, so no comparison to Ubuntu :-)
One difference is that the root user and group are called "system", 
but I didn't find a problem with that in my Cheyenne patch a year 
ago
It works if I only use group, although it's hard to check that the 
group has actually changed
Dockimbel
8-May-2011
[10383x4]
Could you extract the mod-userdir/get-id function and try to run 
it from a REBOL console using:

    col: #":"
    get-id "www"
Hmm, wait, I think the problem is related to the 'set-gid function.
Are you using the Pro or Command binary? (I guess it is the r139 
one)
I have found a bug with the 'chown function.
Kaj
8-May-2011
[10387]
Pro 135
Dockimbel
8-May-2011
[10388]
Did you see any error in Cheyenne log file (chey-pid-*.log or crash.log)?
Kaj
8-May-2011
[10389x2]
Wait, I have r137 now
The errors I quoted are from crash.log. I'll do the -vvvv thing, 
but have to do it later tonight
Dockimbel
8-May-2011
[10391]
Ok, I think it is not needed anymore. It seems that the set-gid call 
is failing on your system for group "www". Set-gid returns a logic! 
or none! value if running on a 2.7.8 kernel and an integer! for previous 
kernels (due to different mappings), that is what's causing the error.