Roxen.git/server/base_server/roxenloader.pike:83:
string pw_name(int uid)
{
#if !constant(getpwuid)
return "uid #"+uid;
#else
if(pwn[uid]) return pwn[uid];
return pwn[uid]=([array(string)]getpwuid(uid)||((""+uid)/":"))[0];
#endif
}
+ #if !constant(utf8_string)
+ protected typedef __attribute__("utf8", string(8bit)) utf8_string;
+ #endif
+
#if !constant(getppid)
int getppid() { return -1; }
#endif
#if constant(syslog)
#define LOG_CONS (1<<0)
#define LOG_NDELAY (1<<1)
#define LOG_PERROR (1<<2)
#define LOG_PID (1<<3)
Roxen.git/server/base_server/roxenloader.pike:1832:
{
string ver = r_read_bytes(combine_path(package_dir, "VERSION"));
if (ver && (ver != "")) {
report_debug("Adding package %s (Version %s).\n",
roxen_path (package_dir), ver - "\n");
} else {
report_debug("Adding package %s.\n",
roxen_path (package_dir));
}
package_directories += ({ package_dir });
-
+
string real_pkg_dir = roxen_path (package_dir);
string sub_dir = combine_path(real_pkg_dir, "pike-modules");
if (Stdio.is_dir(sub_dir)) {
master()->add_module_path(sub_dir);
}
if (Stdio.is_dir(sub_dir = combine_path(real_pkg_dir, "include/"))) {
master()->add_include_path(sub_dir);
}
-
+ #ifdef RUN_SELF_TEST
+ sub_dir = combine_path(real_pkg_dir, "test/pike-modules");
+ if (Stdio.is_dir(sub_dir)) {
+ master()->add_module_path(sub_dir);
+ }
+ if (Stdio.is_dir(sub_dir = combine_path(real_pkg_dir, "test/include/"))) {
+ master()->add_include_path(sub_dir);
+ }
+ #endif
package_module_path += ({ combine_path(package_dir, "modules/") });
if (r_is_dir(sub_dir = combine_path(package_dir, "roxen-modules/"))) {
package_module_path += ({ sub_dir });
}
if (r_is_dir(sub_dir = combine_path(package_dir, "fonts/"))) {
default_roxen_font_path += ({ sub_dir });
}
-
+ #ifdef RUN_SELF_TEST
+ if (r_is_dir(sub_dir = combine_path(package_dir, "test/modules/"))) {
+ package_module_path += ({ sub_dir });
}
-
+ #endif
+ }
//! @appears lopen
object|void lopen(string filename, string mode, int|void perm)
{
if( filename[0] != '/' ) {
foreach(package_directories, string dir) {
Stdio.File o;
if (o = open(combine_path(roxen_path(dir), filename), mode, perm))
return o;
Roxen.git/server/base_server/roxenloader.pike:1959: Inside #if __VERSION__ < 8.0
#if __VERSION__ < 8.0
report_debug(
#"
------- FATAL -------------------------------------------------
Roxen 6.0 should be run with Pike 8.0 or newer.
---------------------------------------------------------------
");
exit(1);
#endif
+ #if !constant(utf8_string)
+ // Not present in Pike 8.0 and earlier.
+ add_constant("utf8_string", utf8_string);
+ #endif
+
// Check if IPv6 support is available.
if (mixed err = catch {
// Note: Attempt to open a port on the IPv6 loopback (::1)
// rather than on IPv6 any (::), to make sure some
// IPv6 support is actually configured. This is needed
// since eg Solaris happily opens ports on :: even
// if no IPv6 interfaces are configured.
// Try IPv6 any (::) too for paranoia reasons.
string interface;
Stdio.Port p = Stdio.Port();
Roxen.git/server/base_server/roxenloader.pike:2070:
if( my_mysql_path != defpath )
{
werror(
" : ----------------------------------------------------------\n"
"Notice: Not using the built-in MySQL\n"
"MySQL path is "+my_mysql_path+"\n"
);
mysql_path_is_remote = 1;
}
+ #if constant(MIME.set_boundary_prefix)
+ // Set MIME message boundary prefix.
+ string boundary_prefix = Standards.UUID.make_version4()->str();
+ boundary_prefix = (boundary_prefix / "-") * "";
+ MIME.set_boundary_prefix(boundary_prefix);
+ #endif
+
nwrite = lambda(mixed ... ){};
call_out( do_main_wrapper, 0, argc, argv );
// Get rid of the _main and main() backtrace elements..
return -1;
}
// Wrapper to make sure we die if loading fails.
void do_main_wrapper(int argc, array(string) argv)
{
mixed err = catch {
Roxen.git/server/base_server/roxenloader.pike:3242:
"default-storage-engine = MYISAM" + a[1];
cfg_file = a * "[mysqld]";
force = 1;
} else {
report_warning("Mysql configuration file %s/my.cfg lacks\n"
"storage engine entry, and automatic repairer failed.\n",
datadir);
}
}
+ if ((normalized_mysql_version > "010.002.003") &&
+ !has_value(normalized_cfg_file, "sql_mode")) {
+ // Since MariaDB 10.2.4, SQL_MODE is by default set to NO_AUTO_CREATE_USER,
+ // NO_ENGINE_SUBSTITUTION, STRICT_TRANS_TABLES, ERROR_FOR_DIVISION_BY_ZERO.
+ // In earlier versions of MariaDB 10.2, and since MariaDB 10.1.7, SQL_MODE
+ // is by default set to NO_ENGINE_SUBSTITUTION, NO_AUTO_CREATE_USER.
+ // For earlier versions of MariaDB 10.1, and MariaDB 10.0 and before, no
+ // default is set.
+ //
+ // This change in 10.2 can cause queries to fail, complaining about
+ // no default values:
+ //
+ // big_query(): Query failed (Field 'x' doesn't have a default value)
+ //
+ // cf:
+ // https://www.slickdev.com/2017/09/05/mariadb-10-2-field-xxxxxxx-doesnt-default-value-error/
+ array a = cfg_file/"[mysqld]";
+ if (sizeof(a) > 1) {
+ report_debug("Adding sql_mode entry to %s/my.cfg.\n", datadir);
+ a[1] = "\n"
+ "sql_mode = NO_ENGINE_SUBSTITUTION" + a[1];
+ cfg_file = a * "[mysqld]";
+ force = 1;
+ } else {
+ report_warning("Mysql configuration file %s/my.cfg lacks\n"
+ "sql_mode entry, and automatic repairer failed.\n",
+ datadir);
+ }
+ }
+
#ifdef __NT__
cfg_file = replace(cfg_file, ({ "\r\n", "\n" }), ({ "\r\n", "\r\n" }));
#endif /* __NT__ */
if(force)
catch(Stdio.write_file(datadir+"/my.cfg", cfg_file));
// Keep mysql's logging to stdout and stderr when running in --once
// mode, to get it more synchronous.
Stdio.File errlog = !once_mode && Stdio.File( err_log, "wct" );