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 - 2009, 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.1076 2010/12/21 14:52:28 grubba Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.1077 2011/01/20 14:01: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:5714:       backend_thread = this_thread();   #ifdef THREADS    name_thread( backend_thread, "Backend" );   #else    report_debug("\n"    "WARNING: Threads not enabled!\n"    "\n");   #endif /* THREADS */    +  foreach(({ "testca.pem", "demo_certificate.pem" }), string file_name) { +  if (sizeof(roxenloader.package_directories) && +  (lfile_path(file_name) == file_name)) { +  file_name = roxenloader.package_directories[-1] + "/" + file_name; +  report_notice("Generating a new certificate: %O...\n", file_name); +  string cert = Roxen.generate_self_signed_certificate("*"); +  +  // Note: set_u_and_gid() hasn't been called yet, +  // so there's no need for Privs. +  Stdio.File file = Stdio.File(); +  if (!file->open(file_name, "wxc", 0600)) { +  report_error("Couldn't create certificate file %O.\n", file_name); +  } else if (file->write(cert) != sizeof(cert)) { +  rm(cert); +  report_error("Couldn't write certificate file %O.\n", file_name); +  } +  } +  } +     enable_configurations();       string pid_file = Getopt.find_option(argv, "p", "pid-file");    if (pid_file && query("permanent_uid")) rm(pid_file);       set_u_and_gid(); // Running with the right [e]uid:[e]gid from this point on.       create_pid_file(pid_file);       // Done before the modules are dumped.