changed: when winix demonizes it creates a three new descriptors (0, 1 and 3)
pointing to /dev/null added: DbBase::AssertValueBin(PGresult * r, int row, int col, std::string & result) it reads binary (bytea) data added: DbTextStream can handle 'bool' types now (is puts 'true' of 'false' to the stream) changed: now passwords can be stored either as plain text, a hash or can be encrypted with RSA currently we have following hashes: md4, md5, sha1, sha224, sha256, sha384, sha512 we are using openssl to manage them (look at config options for more info) changed: winix version to 0.4.7 added: class Run - you can run any program from os and send a buffer to its standard input and read what the program put on its standard output added: class Crypt (in System) - calculating hashes, and crypting/decrypting git-svn-id: svn://ttmath.org/publicrep/winix/trunk@734 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -20,8 +20,9 @@ main.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
main.o: ../core/user.h ../core/ugcontainer.h ../core/lastcontainer.h
|
||||
main.o: ../core/cur.h ../core/session.h ../core/plugindata.h ../core/rebus.h
|
||||
main.o: ../core/mounts.h ../core/mount.h ../core/mountparser.h
|
||||
main.o: ../core/users.h ../core/groups.h ../core/group.h ../core/loadavg.h
|
||||
main.o: ../core/thumb.h ../core/basethread.h ../core/sessionmanager.h
|
||||
main.o: ../core/crypt.h ../core/run.h ../core/users.h ../core/groups.h
|
||||
main.o: ../core/group.h ../core/loadavg.h ../core/thumb.h
|
||||
main.o: ../core/basethread.h ../core/sessionmanager.h
|
||||
main.o: ../core/sessioncontainer.h ../functions/functions.h
|
||||
main.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
||||
main.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
||||
@@ -32,15 +33,14 @@ main.o: ../functions/download.h ../functions/emacs.h ../functions/last.h
|
||||
main.o: ../functions/login.h ../functions/logout.h ../functions/ln.h
|
||||
main.o: ../functions/ls.h ../functions/mkdir.h ../functions/mv.h
|
||||
main.o: ../functions/node.h ../functions/priv.h ../functions/reload.h
|
||||
main.o: ../functions/rm.h ../functions/run.h ../functions/specialdefault.h
|
||||
main.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
||||
main.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
||||
main.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
||||
main.o: ../core/htmlfilter.h ../templates/templates.h
|
||||
main.o: ../templates/patterncacher.h ../templates/ckeditorgetparser.h
|
||||
main.o: ../core/httpsimpleparser.h ../core/log.h ../templates/indexpatterns.h
|
||||
main.o: ../core/sessionmanager.h ../core/compress.h ../core/getparser.h
|
||||
main.o: ../core/httpsimpleparser.h ../core/postparser.h
|
||||
main.o: ../core/cookieparser.h ../core/postmultiparser.h
|
||||
main.o: ../functions/rm.h ../functions/specialdefault.h ../functions/stat.h
|
||||
main.o: ../functions/subject.h ../functions/template.h ../functions/tinymce.h
|
||||
main.o: ../functions/uname.h ../functions/upload.h ../functions/uptime.h
|
||||
main.o: ../functions/who.h ../functions/vim.h ../core/htmlfilter.h
|
||||
main.o: ../templates/templates.h ../templates/patterncacher.h
|
||||
main.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
|
||||
main.o: ../core/log.h ../templates/indexpatterns.h ../core/sessionmanager.h
|
||||
main.o: ../core/compress.h ../core/getparser.h ../core/httpsimpleparser.h
|
||||
main.o: ../core/postparser.h ../core/cookieparser.h ../core/postmultiparser.h
|
||||
main.o: ../core/acceptencodingparser.h ../core/acceptbaseparser.h
|
||||
main.o: ../core/plugin.h ../core/pluginmsg.h
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include <ctime>
|
||||
#include <iostream>
|
||||
#include <sys/param.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "core/log.h"
|
||||
#include "core/app.h"
|
||||
@@ -39,6 +40,37 @@ void print_syntax()
|
||||
|
||||
|
||||
|
||||
void CreateNewDescriptor(int des_dst, int flags)
|
||||
{
|
||||
int descriptor;
|
||||
|
||||
descriptor = open("/dev/null", flags | O_NOCTTY);
|
||||
|
||||
if( descriptor != -1 )
|
||||
{
|
||||
dup2(descriptor, des_dst);
|
||||
|
||||
if( descriptor != des_dst )
|
||||
close(descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CloseDescriptors()
|
||||
{
|
||||
close(0);
|
||||
close(1);
|
||||
close(2);
|
||||
app.stdout_is_closed = true;
|
||||
|
||||
CreateNewDescriptor(0, O_RDONLY);
|
||||
CreateNewDescriptor(1, O_WRONLY);
|
||||
CreateNewDescriptor(2, O_WRONLY);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argv, char ** argc)
|
||||
{
|
||||
@@ -59,16 +91,8 @@ int main(int argv, char ** argc)
|
||||
if( app.stdout_is_closed || app.config.demonize )
|
||||
app.config.log_stdout = false;
|
||||
|
||||
// closing descriptors only at the beginning
|
||||
// !! temporary we do not close standard output for errors
|
||||
// client postgresql uses it for reporting warnings (I don't know why)
|
||||
//close(2);
|
||||
|
||||
if( !app.config.log_stdout )
|
||||
{
|
||||
close(1);
|
||||
app.stdout_is_closed = true;
|
||||
}
|
||||
CloseDescriptors();
|
||||
|
||||
log.Init(app.config.log_level, app.config.log_save_each_line, app.config.log_file,
|
||||
app.config.log_stdout, app.config.log_request);
|
||||
|
Reference in New Issue
Block a user