1997-03-09
1997-03-09 13:36:34 by Henrik Grubbström (Grubba) <grubba@grubba.org>
-
d58987b7e73b9e388fcc855d3e59dd4522731df4
(122 lines)
(+78/-44)
[
Show
| Annotate
]
Branch: devel-1-1-1
Fixed sscanf bug.
Added |void to a couple of functions.
Added some DEBUG-info to the port-opening.
Added some variables for the FTP-protocol.
Added some DEBUG-info to the configuration-enabling.
Rev: server/base_server/roxen.pike:1.31.2.4
1:
- string cvs_version = "$Id: roxen.pike,v 1.31.2.3 1997/03/02 19:11:56 grubba Exp $";
+ string cvs_version = "$Id: roxen.pike,v 1.31.2.4 1997/03/09 13:36:34 grubba Exp $";
#define IN_ROXEN
#include <module.h>
626:
private inline string fix_logging(string s)
{
string pre, post, c;
- sscanf(s, "%*[\t ]", s);
+ sscanf(s, "%*[\t ]%s", s);
s = replace(s, ({"\\t", "\\n", "\\r" }), ({"\t", "\n", "\r" }));
- while(s[0] == ' ') s = s[1..10000];
- while(s[0] == '\t') s = s[1..10000];
+
+ while(s[0] == ' ' || s[0] == '\t') {
+ s = s[1..];
+ }
+
while(sscanf(s, "%s$char(%d)%s", pre, c, post)==3)
s=sprintf("%s%c%s", pre, c, post);
while(sscanf(s, "%s$wchar(%d)%s", pre, c, post)==3)
880:
// to the configuration object. The functions will still be here for
// compatibility for a while, though.
- public string *userinfo(string u, object id)
+ public string *userinfo(string u, void|object id)
{
if(id)
current_configuration = id->conf;
889:
return 0;
}
- public string *userlist(object id)
+ public string *userlist(void|object id)
{
if(id)
current_configuration = id->conf;
898:
return 0;
}
- public string *user_from_uid(int u, object id)
+ public string *user_from_uid(int u, void|object id)
{
if(id)
current_configuration = id->conf;
931:
}
// FIXME
- public varargs string type_from_filename( string file, int to )
+ public varargs array|string type_from_filename( string file, int to )
{
mixed tmp;
string ext=extension(file);
964:
} else {
if(!(tmp=current_configuration->types_fun("default")))
tmp=({ "application/octet-stream", 0 });
+ // FIXME -- tmp above isn't used /grubba
}
return 0;
}
1706: Inside #if defined(MODULE_LEVEL_SECURITY)
map(indices(current_configuration->open_ports), do_dest);
+ foreach(query("Ports"), port ) {
+ #ifdef DEBUG
+ perror("Opening port:%s...\n",
+ map(port, lambda(mixed x){ return(x+""); } )*",");
+ array(mixed) port_error =
+ #endif /* DEBUG */
catch {
- foreach(query("Ports"), port )
- {
+
array tmp;
function rp;
array old = port;
1728: Inside #if defined(MODULE_LEVEL_SECURITY)
err++;
} else
current_configuration->open_ports[o]=old;
- }
+
};
-
+ #ifdef DEBUG
+ if (port_error) {
+ perror("Failed to open port %s at %s\n%s\n", port[0], port[2],
+ master()->describe_backtrace(port_error));
+ }
+ #endif /* DEBUG */
+ }
if(!num && sizeof(query("Ports")))
{
2344:
"FTP Welcome answer; transmitted to new FTP connections if the file "
"<i>/welcome.msg</i> doesn't exist.\n");
+ defvar("named_ftp", 0, "Allow named FTP", TYPE_FLAG,
+ "Allow ftp to normal user-accounts (requires auth-module).\n");
-
+ defvar("shells", "/etc/shells", "Shell database", TYPE_FILE,
+ "File which contains a list of all valid shells.\n"
+ "Usually /etc/shells\n");
+
defvar("_v", CONFIGURATION_FILE_LEVEL, 0, TYPE_INT, 0, 0, 1);
setvars(retrieve("spider#0"));
2369:
array err;
- foreach( modules_to_process, tmp_string )
+ foreach( modules_to_process, tmp_string ) {
+ perror("Enabling module %s\n", tmp_string);
if(err = catch( enable_module( tmp_string ) ))
perror("Failed to enable the module "+tmp_string+". Skipping\n"
#ifdef MODULE_DEBUG
+describe_backtrace(err)+"\n"
#endif
);
-
+ }
return current_configuration;
}
2386:
string config;
enabling_configurations = 1;
+ #define DEBUG
+ #ifdef DEBUG
+ if (mixed err =
+ #endif /* DEBUG */
catch {
configs=list_all_configurations(); // From read_config.pike
configurations = ({});
2395:
enable_configuration(config);
start(0);
}
- };
+ }
+ #ifdef DEBUG
+ ) {
+ perror("Failed to enable configuration:\n%s\n",
+ describe_backtrace(err));
+ }
+ #endif /* DEBUG */
+ ;
enabling_configurations = 0;
}
3388:
}
- string checkfd(object id)
+ string checkfd()
{
// perror(sprintf("%O\n", get_all_active_fd()));