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:
@@ -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