Revert all except warning fixes

master
Alexey Khromov 7 months ago
parent 39dd885dd0
commit bcf0d456ee

@ -20,8 +20,6 @@
#include "nodelist.h"
#include "session.h"
char ** sessenv;
/* PID of our child process (if use fork) */
pid_t child_pid = 0;
@ -256,10 +254,6 @@ int main(int argc, char *argv[], char *envp[])
int ch = 0;
opts.runmode = MODE_UNDEFINED;
int i = 0;
int argsz = 0;
memset(&opts, '\0', sizeof(s_bforce_opts));
// parsing
@ -467,21 +461,6 @@ int main(int argc, char *argv[], char *envp[])
//snprintf(runmode_str, 20, "Run mode: %d", opts.runmode);
//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 )
{
case MODE_DAEMON:
@ -509,14 +488,6 @@ default:
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_opts(&opts);

@ -14,8 +14,6 @@
#include "includes.h"
#include "confread.h"
#include "logger.h"
#include <unistd.h>
#include <stdio.h>
struct {
char *name;
@ -28,8 +26,6 @@ struct {
{ NULL, 0 }
};
extern char **environ;
int exec_file_exist(const char *command)
{
const char *p;
@ -77,18 +73,9 @@ int exec_options_parse(char *str)
void exec_options_init(s_exec_options *eopt)
{
int i = 0;
memset(eopt, '\0', sizeof(s_exec_options));
eopt->umask = EXEC_DEFAULT_UMASK;
eopt->envp[0] = NULL;
while(sessenv[i]) {
log("EXEC: Added ENV variable: %s\n", sessenv[i]);
eopt->envp[i] = xmalloc(strlen(sessenv[i]) + 2);
sprintf(eopt->envp[i], sessenv[i++]);
eopt->envp[i] = NULL;
}
}
void exec_options_deinit(s_exec_options *eopt)

@ -175,9 +175,6 @@ typedef struct {
#define MODE_ANSWER (5)
#define MODE_DAEMON (6)
/* Environment for use with external tools as default */
extern char ** sessenv;
/*
* Global variables

Loading…
Cancel
Save