Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2004, Roxen IS.   //   // The Roxen WebServer main program.   //   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.1002 2008/12/11 15:58:42 jonasw Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.1003 2008/12/11 17:14:02 grubba Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:2498:    return protocols;   }         mapping(string:program/*(Protocol)*/) protocols;      // prot:ip:port ==> Protocol.   mapping(string:mapping(string:mapping(int:Protocol))) open_ports = ([ ]);      // url:"port" ==> Protocol. - mapping(string:mapping(string:mixed)) urls = ([]); + mapping(string:mapping(string:Configuration|Protocol|string)) urls = ([]);   array sorted_urls = ({});      array(string) find_ips_for( string what )   {    if( what == "*" || lower_case(what) == "any" )    return ({ 0,   #if constant(__ROXEN_SUPPORTS_IPV6__)    "::",   #endif /* __ROXEN_SUPPORTS_IPV6__ */    }); // ANY
Roxen.git/server/base_server/roxen.pike:2545:    return 0; // FAIL   }      string normalize_url(string url)   {    if (!sizeof (url - " " - "\t")) return "";       url = lower_case( url );    Standards.URI ui = Standards.URI(url);    ui->fragment = 0; -  if (ui->host == "any" || ui->host == "::") +  if (lower_case(ui->host) == "any" || ui->host == "::")    ui->host = "*";       string host = ui->host;    string protocol = ui->scheme;    if (!host || !sizeof(host) || !protocols[protocol])    return "";    if (!ui->port)    ui->port = protocols[protocol]->default_port;    return (string) ui;   }
Roxen.git/server/base_server/roxen.pike:2619:    }    ui->fragment = 0;       if( (int)opts->nobind )    {    report_warning(    LOC_M(61,"Not binding the port %O, disabled in configuration")+"\n",    (string) ui );    return 0;    } -  if (ui->host == "any" || ui->host == "::") +  if (lower_case(ui->host) == "any" || ui->host == "::")    ui->host = "*";       protocol = ui->scheme;    host = ui->host;    if (!sizeof(host || "") || !protocols[protocol]) {    report_error(LOC_M(19,"Bad URL '%s' for server `%s'")+"\n",    (string) ui, conf->query_name());    }    if (!ui->port)    ui->port = protocols[protocol]->default_port;
Roxen.git/server/base_server/roxen.pike:4644: Inside #if undefined(__NT__)
   // The euid switch in the backend thread worked here too, so    // there's no need to do anything.   #ifdef TEST_EUID_CHANGE    werror ("euid change effective in handler thread.\n");   #endif    return 1;    }       u=query("User");    sscanf(u, "%s:%s", u, g); + #if 0 +  // FIXME: Support caching the uid/gid in the setting +  // in case of lookup failure further below. +  sscanf(u, "%d", uid); +  sscanf(u, "%s(%d)", u, uid); +  if (g) { +  sscanf(g, "%d", gid); +  sscanf(g, "%s(%d)", g, gid); +  } + #endif /* 0 */    if(strlen(u))    {    if(getuid())    {    if (!from_handler_thread)    report_error(LOC_M(24, "It is possible to change uid and gid only "    "if the server is running as root.")+"\n");    } else {   #ifdef TEST_EUID_CHANGE    if (Stdio.write_file ("rootonly",