Compare commits
No commits in common. "27b4c624b3c95f1930a0562722f70cc938d0e3f5" and "0b2630f62460fe6ad227071eb34fdb466d0c0890" have entirely different histories.
27b4c624b3
...
0b2630f624
23
README.md
23
README.md
@ -25,18 +25,13 @@ New Versions
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
https://prj.zxalexis.ru/gitea/zx/bforce
|
https://prj.zxalexis.ru/gitea/zx/bforce
|
||||||
|
|
||||||
|
|
||||||
##Older Sources
|
Copyright (c) 1998-2000 Alexander Belkin, Moscow, Russia.
|
||||||
-------------
|
(c) 2004-2007 Evgeniy Kozhuhovskiy 2:450/256, 2:450/267
|
||||||
https://github.com/zotrix/binkleyforce/
|
(c) 2005 Andrey Slusar
|
||||||
https://sourceforge.net/projects/binkforce/
|
(c) 2006-2016 Max N. Boyarov
|
||||||
|
(c) 2007-2008 Sergey Babitch
|
||||||
Copyright <br>
|
(c) 2011-2014 Sergey Dorofeev
|
||||||
> (c) 1998-2000 Alexander Belkin, Moscow, Russia.<br>
|
(c) 2014 Alexander Skovpen
|
||||||
> (c) 2004-2007 Evgeniy Kozhuhovskiy 2:450/256, 2:450/267<br>
|
(c) 2024 Alexey Khromov
|
||||||
> (c) 2005 Andrey Slusar<br>
|
|
||||||
> (c) 2006-2016 Max N. Boyarov<br>
|
|
||||||
> (c) 2007-2008 Sergey Babitch<br>
|
|
||||||
> (c) 2011-2014 Sergey Dorofeev<br>
|
|
||||||
> (c) 2014 Alexander Skovpen<br>
|
|
||||||
> (c) 2024 Alexey Khromov<br>
|
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#include "nodelist.h"
|
#include "nodelist.h"
|
||||||
#include "session.h"
|
#include "session.h"
|
||||||
|
|
||||||
char ** sessenv;
|
|
||||||
|
|
||||||
/* PID of our child process (if use fork) */
|
/* PID of our child process (if use fork) */
|
||||||
pid_t child_pid = 0;
|
pid_t child_pid = 0;
|
||||||
|
|
||||||
@ -256,10 +254,6 @@ int main(int argc, char *argv[], char *envp[])
|
|||||||
int ch = 0;
|
int ch = 0;
|
||||||
opts.runmode = MODE_UNDEFINED;
|
opts.runmode = MODE_UNDEFINED;
|
||||||
|
|
||||||
int i = 0;
|
|
||||||
int argsz = 0;
|
|
||||||
|
|
||||||
|
|
||||||
memset(&opts, '\0', sizeof(s_bforce_opts));
|
memset(&opts, '\0', sizeof(s_bforce_opts));
|
||||||
|
|
||||||
// parsing
|
// parsing
|
||||||
@ -459,7 +453,7 @@ int main(int argc, char *argv[], char *envp[])
|
|||||||
/* Reopen log file if it was defined in config */
|
/* Reopen log file if it was defined in config */
|
||||||
if( log_reopen(log_getfilename(LOG_FILE_SESSION), NULL, NULL) )
|
if( log_reopen(log_getfilename(LOG_FILE_SESSION), NULL, NULL) )
|
||||||
{
|
{
|
||||||
DEB((D_CONFIG, "can't continue without logging"));
|
log("can't continue without logging");
|
||||||
gotoexit(BFERR_FATALERROR);
|
gotoexit(BFERR_FATALERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -467,21 +461,6 @@ int main(int argc, char *argv[], char *envp[])
|
|||||||
//snprintf(runmode_str, 20, "Run mode: %d", opts.runmode);
|
//snprintf(runmode_str, 20, "Run mode: %d", opts.runmode);
|
||||||
//log(runmode_str);
|
//log(runmode_str);
|
||||||
|
|
||||||
/* Init environment table for childs */
|
|
||||||
argsz = 4096;
|
|
||||||
//argsz = sysconf(_SC_ARG_MAX);
|
|
||||||
DEB((D_CONFIG, "Limits: %d\n",argsz));
|
|
||||||
sessenv = malloc(sizeof(sessenv)*argsz);
|
|
||||||
sessenv[0] = NULL;
|
|
||||||
i=0;
|
|
||||||
while (envp[i]) {
|
|
||||||
sessenv[i] = malloc(strlen(envp[i])+2);
|
|
||||||
strcpy(sessenv[i], envp[i]);
|
|
||||||
sessenv[i++] = NULL;
|
|
||||||
DEB((D_FREE, "session ENV: %s\n", sessenv[(i-1)]));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
switch( opts.runmode )
|
switch( opts.runmode )
|
||||||
{
|
{
|
||||||
case MODE_DAEMON:
|
case MODE_DAEMON:
|
||||||
@ -509,14 +488,6 @@ default:
|
|||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
|
||||||
/* de-init sessenv */
|
|
||||||
i=0;
|
|
||||||
while(sessenv[i]) {
|
|
||||||
DEB((D_FREE, "De-init session ENV: %s\n", sessenv[(i)]));
|
|
||||||
free(sessenv[i]);
|
|
||||||
}
|
|
||||||
free(sessenv);
|
|
||||||
|
|
||||||
deinit_conf();
|
deinit_conf();
|
||||||
deinit_opts(&opts);
|
deinit_opts(&opts);
|
||||||
|
|
||||||
|
@ -82,10 +82,10 @@ void exec_options_init(s_exec_options *eopt)
|
|||||||
eopt->umask = EXEC_DEFAULT_UMASK;
|
eopt->umask = EXEC_DEFAULT_UMASK;
|
||||||
eopt->envp[0] = NULL;
|
eopt->envp[0] = NULL;
|
||||||
|
|
||||||
while(sessenv[i]) {
|
while(environ[i]) {
|
||||||
log("EXEC: Added ENV variable: %s\n", sessenv[i]);
|
log("EXEC: Added ENV variable: %s\n", environ[i]);
|
||||||
eopt->envp[i] = xmalloc(strlen(sessenv[i]) + 2);
|
eopt->envp[i] = xmalloc(strlen(environ[i]) + 2);
|
||||||
sprintf(eopt->envp[i], sessenv[i++]);
|
sprintf(eopt->envp[i], environ[i++]);
|
||||||
eopt->envp[i] = NULL;
|
eopt->envp[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,9 +175,6 @@ typedef struct {
|
|||||||
#define MODE_ANSWER (5)
|
#define MODE_ANSWER (5)
|
||||||
#define MODE_DAEMON (6)
|
#define MODE_DAEMON (6)
|
||||||
|
|
||||||
/* Environment for use with external tools as default */
|
|
||||||
extern char ** sessenv;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global variables
|
* Global variables
|
||||||
|
Loading…
x
Reference in New Issue
Block a user