ID:67204
 
BYOND Version:440
Operating System:Windows Vista Ultimate
Web Browser:Chrome 2.0.172.8
Status: Unverified

Thus far we've been unable to verify or reproduce this bug. Or, it has been observed but it cannot be triggered with a reliable test case. You can help us out by editing your report or adding a comment with more information.
Descriptive Problem Summary:
Using DMCGI, I am entirely unable to login. Using the /CGI Login() proc sends me to the login page correctly once, but after logging in my DMCGI application still decides I'm "guest" and further attempts to reach the login page instantly redirect me back to my own DMCGI page (still as guest). I may be doing something wrong, as DMCGI isn't my primary language, but I think everything's about correct.

Further, in the following code, I initially had it set to automatically send you to the login page if you were "guest" but it had a major flaw---similar to the above where, after the first time, attempts to reach the login page automatically redirect you back, I would get caught in an infinite loop between it sending me to the login page and the login page sending me back as guest.

Numbered Steps to Reproduce Problem:
1. Visit http://fairstrife.com/dmcgi/test.dmb
2. Try to login.
3. You're still guest. Try logging in again. Now you don't even get to the login page.

Code Snippet (if applicable) to Reproduce Problem:
CGI
Topic(href)
var/href_list[] = params2list(href)
if(("q" in href_list) && href_list["q"]=="login")
src.Login("http://fairstrife.com/dmcgi/test.dmb")

if(usr.ckey=="guest")
usr << "You are not logged in ([usr.key]). <a href='?q=login'>Please login</a>."

else
usr << "You are logged in as [usr.key]."


Expected Results: I would like to be able to login with DMCGI.

Actual Results: I am always guest.

Does the problem occur:
Every time? Or how often? Every time.
In other browsers? In other browsers, yes.
This is working for me: http://mheasley.byondhome.com/cgi2.dmb

Your cgi needs write access to $HOME/.byond/cfg/cgicert.db and cgicert.str. Most likely, your web server is running the cgi under a different user from yours, and that user doesn't have permission to create a .byond directory under its home directory.

This thread has more information along with a sample diagnostic program to try. Solutions include creating the required .byond directory with sufficient permissions, or configuring the web server to use suEXEC.
Thanks, after a lot of fiddling trying to get suEXEC set up, as it seems the more ideal solution with the virtual hosts setup, I finally gave in and created a .byond directory in /var/www and played with its permissions. It works now.

It would be nice of course if this could be better documented somewhere, or if it worked easier from a fresh install (I installed BYOND globally as root). I know it's difficult to leverage the fact that users have more options than, say, Apache, or the many ways their system could be configured, but surely there's something that could make this process simpler, eh?
Kuraudo wrote:
Thanks, after a lot of fiddling trying to get suEXEC set up, as it seems the more ideal solution with the virtual hosts setup, I finally gave in and created a .byond directory in /var/www and played with its permissions. It works now.

In order to set suexec up properly, you have to recompile the binary with a few changes. By default, suexec will only run stuff if it's within /var/www or within the user dir (~user -> /home/user/public_html).