// /secure/daemon/master.c // Modifications to allow the SQL daemon to access a socket // Replace "valid_socket" with this code int valid_socket(object ob, string fun, mixed *info) { object *obs; int port; string tmp; int i; if( info && sizeof(info) == 4 ) { ob = info[1]; port = info[3]; if( port == PORT_ADMIN && ob != find_object(ADMIN_D) ) { return 0; } if( port == PORT_RCP && ob != find_object(REMOTE_D) ) { return 0; } } i = sizeof(obs = previous_object(-1)); while(i--) { if( !obs[i] ) continue; if( userp(obs[i]) ) continue; tmp = query_privs(obs[i]); if( file_name(previous_object()) == SQL_D ) continue; if(!tmp && base_name(obs[i]) == SEFUN) tmp = "SECURE"; if( !(tmp) ) return 0; if( !sizeof(explode(tmp, ":") & ({ PRIV_SECURE, PRIV_MUDLIB, PRIV_CMDS, PRIV_GENERAL })) ){ return 0; } } return 1; }