diff --git a/sched/Makefile.in b/sched/Makefile.in index b2a26fbe74..98c069893f 100644 --- a/sched/Makefile.in +++ b/sched/Makefile.in @@ -5,22 +5,15 @@ VPATH = @srcdir@ all: cgi -ifndef BOINC_KEY -BOINC_KEY = 0xdadacafe -endif - CFLAGS = -g -Wall @DEFS@ \ -I@top_srcdir@/db \ -I@top_srcdir@/lib \ -I@top_srcdir@/tools \ -DBOINC_DB_NAME=\"$(BOINC_DB_NAME)\" \ -DBOINC_KEY=$(BOINC_KEY) \ - -DBOINC_PUBLIC_KEY_PATH=\"$(BOINC_PUBLIC_KEY_PATH)\" \ -I/usr/local/mysql/include \ -I@top_srcdir@/RSAEuro/source \ -DBOINC_KEY_DIR=\"$(BOINC_KEY_DIR)\" \ - -DBOINC_KEY=$(BOINC_KEY) \ - -DBOINC_UPLOAD_DIR=\"$(BOINC_UPLOAD_DIR)\" CC = g++ $(CFLAGS) diff --git a/sched/feeder.C b/sched/feeder.C index d3e0de3ab8..58064b0b75 100644 --- a/sched/feeder.C +++ b/sched/feeder.C @@ -172,6 +172,7 @@ int main(int argc, char** argv) { int i, retval; bool asynch = false; void* p; + char* barry; for (i=1; iinit(); - retval = db_open(BOINC_DB_NAME); + retval = db_open(getenv("BOINC_DB_NAME")); if (retval) { fprintf(stderr, "feeder: db_open: %d\n", retval); exit(1); diff --git a/sched/file_upload_handler.C b/sched/file_upload_handler.C index 426c255544..73e5f0057d 100644 --- a/sched/file_upload_handler.C +++ b/sched/file_upload_handler.C @@ -19,15 +19,13 @@ // bad file size #include +#include #include #include #include "parse.h" #include "crypt.h" -/* #define BOINC_UPLOAD_DIR "/home/david/html/upload" */ -/* #define BOINC_PUBLIC_KEY_PATH "/home/david/boinc_keys/upload_public" */ - #define MAX_FILES 32 struct FILE_INFO { @@ -156,7 +154,7 @@ int handle_request(FILE* in, R_RSA_PUBLIC_KEY& key) { return -1; } - sprintf(path, "%s/%s", BOINC_UPLOAD_DIR, file_info.name); + sprintf(path, "%s/%s", getenv("BOINC_UPLOAD_DIR"), file_info.name); retval = copy_socket_to_file(in, path, offset, nbytes); break; } @@ -168,7 +166,7 @@ int get_key(R_RSA_PUBLIC_KEY& key) { FILE* f; int retval; - f = fopen(BOINC_PUBLIC_KEY_PATH, "r"); + f = fopen(strcat(getenv("BOINC_KEY_DIR"), "/upload_public"), "r"); if (!f) return -1; retval = scan_key_hex(f, (KEY*)&key, sizeof(key)); fclose(f);