[boinc] 08/09: Merge branch 'master' of git+ssh://git.debian.org/git/pkg-boinc/boinc

Steffen Möller moeller at alioth.debian.org
Tue Nov 5 09:31:25 UTC 2013


This is an automated email from the git hooks/post-receive script.

moeller pushed a commit to branch master
in repository boinc.

commit c87fd92a1d2c0f919ce8b5002849d8d969438575
Merge: 1f9e5e1 40b1c85
Author: Steffen Moeller <steffen_moeller at gmx.de>
Date:   Tue Nov 5 10:11:32 2013 +0100

    Merge branch 'master' of git+ssh://git.debian.org/git/pkg-boinc/boinc
    
    Conflicts:
    	debian/fetch_example_applications.sh

 Makefile.incl                           |   13 +++---
 api/boinc_api.cpp                       |   22 +++++----
 api/graphics2_util.cpp                  |    4 +-
 apps/Makefile.am                        |    6 +--
 client/Makefile.am                      |    2 +-
 client/app.cpp                          |   12 ++---
 client/app.h                            |   13 +++---
 client/check_security.cpp               |   10 ++--
 client/client_state.cpp                 |    2 +-
 client/cs_files.cpp                     |    4 +-
 client/cs_platforms.cpp                 |   13 +++++-
 client/file_names.cpp                   |   12 ++---
 client/rrsim_test.cpp                   |    9 +++-
 client/sandbox.cpp                      |    2 +-
 client/scheduler_op.cpp                 |    2 +-
 clientgui/DlgAdvPreferences.cpp         |    2 +-
 clientgui/MainDocument.cpp              |   18 +++++---
 clientgui/Makefile.am                   |   11 +++--
 clientgui/sg_ProjectPanel.cpp           |   18 ++++----
 configure.ac                            |   30 ++++++++----
 db/Makefile.am                          |    3 +-
 debian/boinc-app-examples.README.Debian |   15 ++----
 debian/boinc-app-examples.dirs          |    2 +-
 debian/boinc-app-examples.install       |   20 ++++----
 debian/boinc-server-maker.install       |    1 +
 debian/fetch_example_applications.sh    |    8 ++--
 debian/rules                            |    2 +-
 generate_svn_version.sh                 |    4 +-
 html/Makefile.am                        |    2 +-
 html/languages/translations/de.po       |   17 +++----
 html/languages/translations/ru.po       |    1 +
 lib/Makefile.am                         |    6 +--
 lib/coproc.cpp                          |    4 +-
 lib/crypt.cpp                           |    1 +
 lib/crypt_prog.cpp                      |   10 ++++
 lib/diagnostics.cpp                     |    2 +-
 lib/filesys.cpp                         |   77 ++++++++++++++++---------------
 lib/filesys.h                           |   48 +++++++++----------
 lib/mfile.cpp                           |   15 +++---
 lib/mfile.h                             |   12 ++---
 lib/network.cpp                         |    6 +--
 lib/parse_test.cpp                      |    1 +
 lib/procinfo_win.cpp                    |    3 ++
 lib/shmem.cpp                           |    5 +-
 lib/unix_util.cpp                       |    6 +++
 locale/Makefile.am                      |    2 +-
 py/boinc_path_config.py.in              |    2 +-
 samples/wrapper/Makefile                |    2 +-
 samples/wrapper/build_android.sh        |    2 +-
 sched/Makefile.am                       |   13 +++---
 sched/feeder.cpp                        |    1 +
 sched/file_upload_handler.cpp           |    6 +--
 sched/get_file.cpp                      |    1 +
 sched/make_work.cpp                     |    1 +
 sched/sample_work_generator.cpp         |    1 +
 sched/sched_assign.cpp                  |    1 +
 sched/sched_driver.cpp                  |    8 ++--
 sched/sched_shmem.cpp                   |    1 +
 sched/sched_timezone.cpp                |    1 +
 sched/transitioner.cpp                  |    2 +-
 sched/wu_check.cpp                      |    1 +
 stripchart/stripchart                   |    4 +-
 stripchart/stripchart.cgi               |    4 +-
 stripchart/stripchart.cnf               |   10 ++--
 tools/Makefile.am                       |    9 ++--
 tools/create_work.cpp                   |    1 +
 tools/db_query                          |    2 +-
 tools/dir_hier_path.cpp                 |    2 +-
 tools/make_project                      |    2 +
 tools/update_versions                   |    2 +-
 tools/watch_tcp                         |    2 +-
 vda/Makefile.am                         |    2 +-
 zip/unzip/ttyio.c                       |    1 +
 73 files changed, 327 insertions(+), 235 deletions(-)

diff --cc Makefile.incl
index 45b3749,45b3749..1cd9c24
--- a/Makefile.incl
+++ b/Makefile.incl
@@@ -38,22 -38,22 +38,22 @@@ AM_LDFLAGS 
  # dependencies to make sure libs gets compiled before
  # programs linking to them:
  
--LIBSCHED = $(top_builddir)/sched/libsched.la
++LIBSCHED = -lsched
  $(LIBSCHED):
  	cd $(top_builddir)/sched; ${MAKE} libsched.la
--LIBSCHED_FCGI = $(top_builddir)/sched/libsched_fcgi.la
++LIBSCHED_FCGI = -lsched_fcgi
  $(LIBSCHED_FCGI):
  	cd $(top_builddir)/sched; ${MAKE} libsched_fcgi.la
--LIBBOINC = $(top_builddir)/lib/libboinc.la
++LIBBOINC = -lboinc
  $(LIBBOINC):
  	cd $(top_builddir)/lib; ${MAKE} libboinc.la
--LIBBOINC_CRYPT = $(top_builddir)/lib/libboinc_crypt.la
++LIBBOINC_CRYPT = -lboinc_crypt
  $(LIBBOINC_CRYPT):
  	cd $(top_builddir)/lib; ${MAKE} libboinc.la
--LIBBOINC_FCGI = $(top_builddir)/lib/libboinc_fcgi.la
++LIBBOINC_FCGI = -lboinc_fcgi
  $(LIBBOINC_FCGI):
  	cd $(top_builddir)/lib; ${MAKE} libboinc_fcgi.la
--LIBAPI = $(top_builddir)/api/libboinc_api.la
++LIBAPI = -lboinc_api
  $(LIBAPI):
  	cd $(top_builddir)/api; ${MAKE} libboinc_api.la
  
@@@ -61,3 -61,3 +61,4 @@@ SERVERLIBS = $(LIBSCHED) $(LIBBOINC_CRY
  SERVERLIBS_FCGI = $(LIBSCHED_FCGI) $(LIBBOINC_CRYPT) $(LIBBOINC_FCGI) -lfcgi $(MYSQL_LIBS) $(PTHREAD_LIBS) $(RSA_LIBS) $(SSL_LIBS)
  APPLIBS = $(LIBAPI) $(LIBBOINC)
  
++.PHONY: $(LIBBOINC) $(LIBBOINC_CRYPT) $(LIBBOINC_FCGI) $(LIBAPI) $(LIBSCHED) $(LIBSCHED_FCGI)
diff --cc api/boinc_api.cpp
index 74baed7,74baed7..ebc4491
--- a/api/boinc_api.cpp
+++ b/api/boinc_api.cpp
@@@ -356,7 -356,7 +356,7 @@@ static bool update_app_progress(double 
  
      if (standalone) return true;
  
--    sprintf(msg_buf,
++    snprintf(msg_buf,sizeof(msg_buf),
          "<current_cpu_time>%e</current_cpu_time>\n"
          "<checkpoint_cpu_time>%e</checkpoint_cpu_time>\n",
          cpu_t, cp_cpu_t
@@@ -629,6 -629,6 +629,10 @@@ int boinc_init_options_general(BOINC_OP
  }
  
  int boinc_get_status(BOINC_STATUS *s) {
++    if (!s) {
++        fprintf(stderr,"E: boinc_get_status(NULL)\n");
++	return 1;
++    }
      s->no_heartbeat = boinc_status.no_heartbeat;
      s->suspended = boinc_status.suspended;
      s->quit_request = boinc_status.quit_request;
@@@ -804,7 -804,7 +808,7 @@@ static void exit_from_timer_thread(int 
  int boinc_parse_init_data_file() {
      FILE* f;
      int retval;
--    char buf[256];
++    char buf[2560];
  
      if (aid.project_preferences) {
          free(aid.project_preferences);
@@@ -854,15 -854,15 +858,15 @@@ int boinc_report_app_status_aux
      );
      if (other_pid) {
          sprintf(buf, "<other_pid>%d</other_pid>\n", other_pid);
--        strcat(msg_buf, buf);
++        strlcat(msg_buf, buf, sizeof(msg_buf));
      }
      if (_bytes_sent) {
          sprintf(buf, "<bytes_sent>%f</bytes_sent>\n", _bytes_sent);
--        strcat(msg_buf, buf);
++        strlcat(msg_buf, buf, sizeof(msg_buf));
      }
      if (_bytes_received) {
          sprintf(buf, "<bytes_received>%f</bytes_received>\n", _bytes_received);
--        strcat(msg_buf, buf);
++        strlcat(msg_buf, buf, sizeof(msg_buf));
      }
      if (app_client_shm->shm->app_status.send_msg(msg_buf)) {
          return 0;
@@@ -957,7 -957,7 +961,7 @@@ int resume_activities() 
  }
  
  static void handle_upload_file_status() {
--    char path[MAXPATHLEN], buf[256], log_name[256], *p, log_buf[256];
++    char path[MAXPATHLEN], buf[MAXPATHLEN], log_name[MAXPATHLEN], *p, log_buf[256];
      std::string filename;
      int status;
  
@@@ -1170,7 -1170,7 +1174,7 @@@ static void timer_handler() 
      // send graphics-related messages
      //
      if (send_web_graphics_url && !app_client_shm->shm->graphics_reply.has_msg()) {
--        sprintf(buf,
++        snprintf(buf, sizeof(buf),
              "<web_graphics_url>%s</web_graphics_url>",
              web_graphics_url
          );
@@@ -1178,7 -1178,7 +1182,7 @@@
          send_web_graphics_url = false;
      }
      if (send_remote_desktop_addr && !app_client_shm->shm->graphics_reply.has_msg()) {
--        sprintf(buf,
++        snprintf(buf, sizeof(buf),
              "<remote_desktop_addr>%s</remote_desktop_addr>",
              remote_desktop_addr
          );
@@@ -1410,7 -1410,7 +1414,7 @@@ int boinc_receive_trickle_down(char* bu
          DirScanner dirscan(path);
          while (dirscan.scan(filename)) {
              if (strstr(filename.c_str(), "trickle_down")) {
--                strncpy(buf, filename.c_str(), len);
++                strlcpy(buf, filename.c_str(), len);
                  return true;
              }
          }
diff --cc api/graphics2_util.cpp
index 36fb3bf,36fb3bf..f76112f
--- a/api/graphics2_util.cpp
+++ b/api/graphics2_util.cpp
@@@ -37,7 -37,7 +37,7 @@@
  static key_t get_shmem_name(const char* prog_name) {
      char cwd[MAXPATHLEN], path[MAXPATHLEN];
      boinc_getcwd(cwd);
--    sprintf(path, "%s/init_data.xml", cwd);
++    snprintf(path, sizeof(path), "%s/init_data.xml", cwd);
      return ftok(path, 2);
  }
  #else
@@@ -47,7 -47,7 +47,7 @@@ static void get_shmem_name(const char* 
      APP_INIT_DATA aid;
      int retval = boinc_get_init_data(aid);
      if (retval) aid.slot = 0;
--    sprintf(shmem_name, "boinc_%s_%d", prog_name, aid.slot);
++    snprintf(shmem_name, MAXPATHLEN, "boinc_%s_%d", prog_name, aid.slot);
  }
  #endif
  
diff --cc apps/Makefile.am
index 7f3b1fe,7f3b1fe..89a61de
--- a/apps/Makefile.am
+++ b/apps/Makefile.am
@@@ -8,15 -8,15 +8,15 @@@ example_PROGRAMS = upper_case concat 1s
  
  upper_case_SOURCES = upper_case.cpp
  upper_case_CXXFLAGS = $(PTHREAD_CFLAGS)
--upper_case_LDFLAGS = -static-libtool-libs $(PTHREAD_CFLAGS)
++upper_case_LDFLAGS = -static-libtool-libs $(PTHREAD_CFLAGS) -L../api/.libs -L../lib/.libs
  upper_case_LDADD = $(APPLIBS)
  
  concat_SOURCES = concat.cpp
  concat_CXXFLAGS = $(PTHREAD_CFLAGS)
--concat_LDFLAGS = -static-libtool-libs $(PTHREAD_CFLAGS)
++concat_LDFLAGS = -static-libtool-libs $(PTHREAD_CFLAGS) -L../api/.libs -L../lib/.libs
  concat_LDADD = $(APPLIBS)
  
  1sec_SOURCES = 1sec.cpp
  1sec_CXXFLAGS = $(PTHREAD_CFLAGS)
--1sec_LDFLAGS = -static-libtool-libs $(PTHREAD_CFLAGS)
++1sec_LDFLAGS = -static-libtool-libs $(PTHREAD_CFLAGS) -L../api/.libs -L../lib/.libs
  1sec_LDADD = $(APPLIBS)
diff --cc client/Makefile.am
index 59d1ff0,59d1ff0..f58007a
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@@ -91,7 -91,7 +91,7 @@@ boinc_client_LDFLAGS = $(AM_LDFLAGS) $(
  if OS_DARWIN
  boinc_client_LDFLAGS += -Wl,-flat_namespace,-undefined,dynamic_lookup
  endif
--boinc_client_LDADD = $(LIBBOINC) $(LIBBOINC_CRYPT) $(BOINC_EXTRA_LIBS) $(PTHREAD_LIBS)
++boinc_client_LDADD = -L../lib/.libs $(LIBBOINC) $(LIBBOINC_CRYPT) $(BOINC_EXTRA_LIBS) $(PTHREAD_LIBS)
  
  boinc_clientdir = $(bindir)
  
diff --cc client/app.cpp
index dfeeaab,dfeeaab..29a3ba1
--- a/client/app.cpp
+++ b/client/app.cpp
@@@ -423,8 -423,8 +423,8 @@@ int ACTIVE_TASK::move_trickle_file() 
      char new_path[MAXPATHLEN], old_path[MAXPATHLEN];
      int retval;
  
--    sprintf(old_path, "%s/trickle_up.xml", slot_dir);
--    sprintf(new_path,
++    snprintf(old_path, sizeof(old_path), "%s/trickle_up.xml", slot_dir);
++    snprintf(new_path, sizeof(new_path),
          "%s/trickle_up_%s_%d.xml",
          result->project->project_dir(), result->name, (int)time(0)
      );
@@@ -459,7 -459,7 +459,7 @@@ int ACTIVE_TASK::current_disk_usage(dou
      return 0;
  }
  
--bool ACTIVE_TASK_SET::is_slot_in_use(int slot) {
++bool ACTIVE_TASK_SET::is_slot_in_use(const int slot) const {
      unsigned int i;
      for (i=0; i<active_tasks.size(); i++) {
          if (active_tasks[i]->slot == slot) {
@@@ -469,7 -469,7 +469,7 @@@
      return false;
  }
  
--bool ACTIVE_TASK_SET::is_slot_dir_in_use(char* dir) {
++bool ACTIVE_TASK_SET::is_slot_dir_in_use(const char* const dir) const {
      char path[MAXPATHLEN];
      unsigned int i;
      for (i=0; i<active_tasks.size(); i++) {
@@@ -510,7 -510,7 +510,7 @@@ void ACTIVE_TASK::get_free_slot(RESULT
  #endif
  }
  
--bool ACTIVE_TASK_SET::slot_taken(int slot) {
++bool ACTIVE_TASK_SET::slot_taken(const int slot) const {
      unsigned int i;
      for (i=0; i<active_tasks.size(); i++) {
          if (active_tasks[i]->slot == slot) return true;
@@@ -622,7 -622,7 +622,7 @@@ int ACTIVE_TASK::write_gui(MIOFILE& fou
  #endif
  
  int ACTIVE_TASK::parse(XML_PARSER& xp) {
--    char result_name[256], project_master_url[256];
++    char result_name[MAXPATHLEN], project_master_url[MAXPATHLEN];
      int n, dummy;
      unsigned int i;
      PROJECT* project=0;
diff --cc client/app.h
index be46abd,be46abd..dd45876
--- a/client/app.h
+++ b/client/app.h
@@@ -48,6 -48,6 +48,7 @@@ struct ASYNC_COPY
  typedef int PROCESS_ID;
  
  #define MAX_STDERR_LEN  65536
++#define SLOT_DIR_LEN MAXPATHLEN
      // The stderr output of an application is truncated to this length
      // before sending to server,
      // to protect against apps that write unbounded amounts.
@@@ -112,7 -112,7 +113,7 @@@ struct ACTIVE_TASK 
      double bytes_sent;
          // reported by the app if it does network I/O
      double bytes_received;
--    char slot_dir[256];
++    char slot_dir[SLOT_DIR_LEN];
          // directory where process runs (relative)
      char slot_path[MAXPATHLEN];
          // same, absolute
@@@ -153,8 -153,8 +154,8 @@@
          // but not descendants of the main process
          // (e.g. VMs created by vboxwrapper)
          // These are communicated via the app_status message channel
--    char web_graphics_url[256];
--    char remote_desktop_addr[256];
++    char web_graphics_url[MAXPATHLEN];
++    char remote_desktop_addr[MAXPATHLEN];
      ASYNC_COPY* async_copy;
      double finish_file_time;
          // time when we saw finish file in slot dir.
@@@ -290,8 -290,8 +291,8 @@@ public
      bool check_app_exited();
      bool check_rsc_limits_exceeded();
      bool check_quit_timeout_exceeded();
--    bool is_slot_in_use(int);
--    bool is_slot_dir_in_use(char*);
++    bool is_slot_in_use(const int) const;
++    bool is_slot_dir_in_use(const char* const) const;
      void send_heartbeats();
      void send_trickle_downs();
      void report_overdue();
@@@ -300,7 -300,7 +301,7 @@@
      bool want_network();    // does any task want network?
      void network_available();   // notify tasks that network is available
      void free_mem();
--    bool slot_taken(int);
++    bool slot_taken(const int) const;
      void get_memory_usage();
  
      void process_control_poll();
diff --cc client/check_security.cpp
index d567983,d567983..4c1a3d1
--- a/client/check_security.cpp
+++ b/client/check_security.cpp
@@@ -40,9 -40,9 +40,9 @@@ bool IsUserInGroupBM()
  #endif
  
  static int CheckNestedDirectories(
--    char * basepath, int depth, 
++    const char * const basepath, int depth,
      int use_sandbox, int isManager, 
--    char * path_to_error,
++    const char * const path_to_error,
      int len
  );
  
@@@ -505,9 -505,9 +505,9 @@@ saverName[2] = "Progress Thru Processor
  
  
  static int CheckNestedDirectories(
--    char * basepath, int depth,
++    const char * const basepath, int depth,
      int use_sandbox, int isManager, 
--    char * path_to_error, int len
++    const char * const path_to_error, int len
  ) {
      int             isDirectory;
      char            full_path[MAXPATHLEN];
@@@ -517,6 -517,6 +517,7 @@@
      dirent          *dp;
      static int      errShown = 0;
  
++    errno=0;
      dirp = opendir(basepath);
      if (dirp == NULL) {
          // Ideally, all project-created subdirectories under project or slot 
@@@ -526,6 -526,6 +527,7 @@@
          // the subdirectory to check them.
          strlcpy(full_path, basepath, sizeof(full_path));
          if ((depth > 1) && (errno == EACCES)) {
++            fprintf(stderr,"Could not open directory %s in client/check_security.cpp: CheckNestedDirectories: %s\n",full_path,strerror(errno));
              return 0;
          } else {
              retval = -1200;
diff --cc client/client_state.cpp
index f320b1e,f320b1e..ec11632
--- a/client/client_state.cpp
+++ b/client/client_state.cpp
@@@ -463,7 -463,7 +463,7 @@@ int CLIENT_STATE::init() 
  
      // inform the user if there's a newer version of client
      //
--    newer_version_startup_check();
++//    newer_version_startup_check();
  
      // parse account files again,
      // now that we know the host's venue on each project
diff --cc client/cs_files.cpp
index dcd7aa7,dcd7aa7..1f75b98
--- a/client/cs_files.cpp
+++ b/client/cs_files.cpp
@@@ -177,7 -177,7 +177,9 @@@ int FILE_INFO::verify_file
      //
      if (download_gzipped && !boinc_file_exists(pathname)) {
          char gzpath[MAXPATHLEN];
--        sprintf(gzpath, "%s.gz", pathname);
++        snprintf(gzpath, sizeof(gzpath), "%s.gz", pathname);
++       //FIXME: a distinction is missing for the case that the .gz suffix goes beyond the MAXPATHLEN and is hence not found because
++       //       one should then not reperform the download as intended below
          if (boinc_file_exists(gzpath) ) {
              if (allow_async && nbytes > ASYNC_FILE_THRESHOLD) {
                  ASYNC_VERIFY* avp = new ASYNC_VERIFY;
diff --cc client/cs_platforms.cpp
index fd1545d,fd1545d..53a759a
--- a/client/cs_platforms.cpp
+++ b/client/cs_platforms.cpp
@@@ -45,6 -45,6 +45,7 @@@ LPFN_ISWOW64PROCESS fnIsWow64Process
  #include <sys/sysctl.h>
  #endif
  
++#include <cerrno>
  #include "error_numbers.h"
  #include "filesys.h"
  #include "str_util.h"
@@@ -178,9 -178,9 +179,17 @@@ void CLIENT_STATE::detect_platforms() 
                  int i;
                  for (i=0; i < nlibdirs; i++) {
                      struct dirent *entry;
++                    errno=0;
                      DIR *a = opendir(libdir[i]);
--                    // if dir doesn't exist, do the next one
--                    if (a == 0) continue;
++                    if (a == 0) {
++                      if (ENOENT==errno) {
++                          // if dir doesn't exist, do to the next one
++                       }
++                      else {
++                         fprintf(stderr,"Unexpected problem with directory '%s': %s\n",libdir[i],strerror(errno));
++                      }
++                      continue;
++                   }
                      // dir exists. read each entry until you find a 32bit lib
                      while ((support32 == 0) && ((entry=readdir(a)) != 0)) {
                          strlcpy(cmdline, file[eno], 256);
diff --cc client/file_names.cpp
index 37deafd,37deafd..615fd0e
--- a/client/file_names.cpp
+++ b/client/file_names.cpp
@@@ -69,7 -69,7 +69,7 @@@ int make_soft_link(PROJECT* project, ch
  //
  void get_pathname(FILE_INFO* fip, char* path, int len) {
      PROJECT* p = fip->project;
--    char buf[MAXPATHLEN];
++    char buf[std::max(len,MAXPATHLEN)];
  
      // for testing purposes, it's handy to allow a FILE_INFO without
      // an associated PROJECT.
@@@ -91,28 -91,28 +91,28 @@@
  }
  
  void get_sched_request_filename(PROJECT& project, char* buf, int len) {
--    char url[1024];
++    char url[std::max(len,MAXPATHLEN)];
  
      escape_project_url(project.master_url, url);
      snprintf(buf, len, "%s%s.xml", SCHED_OP_REQUEST_BASE, url);
  }
  
  void get_sched_reply_filename(PROJECT& project, char* buf, int len) {
--    char url[1024];
++    char url[std::max(len,MAXPATHLEN)];
  
      escape_project_url(project.master_url, url);
      snprintf(buf, len, "%s%s.xml", SCHED_OP_REPLY_BASE, url);
  }
  
  void get_master_filename(PROJECT& project, char* buf, int len) {
--    char url[1024];
++    char url[std::max(len,MAXPATHLEN)];
  
      escape_project_url(project.master_url, url);
      snprintf(buf, len, "%s%s.xml", MASTER_BASE, url);
  }
  
  void job_log_filename(PROJECT& project, char* buf, int len) {
--    char url[1024];
++    char url[std::max(len,MAXPATHLEN)];
  
      escape_project_url(project.master_url, url);
      snprintf(buf, len, "%s%s.txt", JOB_LOG_BASE, url);
@@@ -220,7 -220,7 +220,7 @@@ int make_slot_dir(int slot) 
  // delete unused stuff in the slots/ directory
  //
  void delete_old_slot_dirs() {
--    char filename[1024], path[MAXPATHLEN];
++    char filename[MAXPATHLEN], path[MAXPATHLEN];
      DIRREF dirp;
      int retval;
  
diff --cc client/rrsim_test.cpp
index f2f07d6,f2f07d6..bc0d58d
--- a/client/rrsim_test.cpp
+++ b/client/rrsim_test.cpp
@@@ -184,7 -184,7 +184,6 @@@ bool CLIENT_STATE::rr_simulation() 
      vector<RESULT*> active;
      unsigned int i;
      double x;
--    vector<RESULT*>::iterator it;
      bool rval = false;
  
      if (log_flags.rr_simulation) {
@@@ -287,7 -287,7 +286,9 @@@
          int last_active_size = active.size();
          int last_proj_active_size = pbest->active.size();
  
--        // remove *rpbest from active set,
++        {
++        vector<RESULT*>::iterator it;
++	// remove *rpbest from active set,
          // and adjust CPU time left for other results
          //
          it = active.begin();
@@@ -301,7 -301,7 +302,10 @@@
                  it++;
              }
          }
++	}
  
++	{
++        vector<RESULT*>::iterator it;
          // remove *rpbest from its project's active set
          //
          it = pbest->active.begin();
@@@ -313,6 -313,6 +317,7 @@@
                  it++;
              }
          }
++	}
  
          // If project has more results, add one to active set.
          //
diff --cc client/sandbox.cpp
index ff6ff93,ff6ff93..c854f4e
--- a/client/sandbox.cpp
+++ b/client/sandbox.cpp
@@@ -207,7 -207,7 +207,7 @@@ int client_clean_out_dir(const char* di
          strcpy(filename, "");
          retval = dir_scan(filename, dirp, sizeof(filename));
          if (retval) break;
--        sprintf(path, "%s/%s", dirpath,  filename);
++        snprintf(path, sizeof(path), "%s/%s", dirpath,  filename);
          if (is_dir(path)) {
              retval = client_clean_out_dir(path, NULL);
              if (retval) final_retval = retval;
diff --cc client/scheduler_op.cpp
index c319b6d,c319b6d..b2b7784
--- a/client/scheduler_op.cpp
+++ b/client/scheduler_op.cpp
@@@ -129,7 -129,7 +129,7 @@@ int SCHEDULER_OP::init_op_project(PROJE
          // and project list
          //
          if (!config.no_info_fetch) {
--            gstate.new_version_check();
++//            gstate.new_version_check();
              gstate.all_projects_list_check();
          }
      }
diff --cc clientgui/DlgAdvPreferences.cpp
index 020084f,020084f..0c5d47a
--- a/clientgui/DlgAdvPreferences.cpp
+++ b/clientgui/DlgAdvPreferences.cpp
@@@ -822,7 -822,7 +822,7 @@@ void CDlgAdvPreferences::OnAddExclusive
  #endif
              wxString directory = picker.GetDirectory();
              wxFileName fn(directory, appNames[i]);
--            if (!fn.IsOk() || !fn.IsFileExecutable()) {
++            if (!fn.IsOk() /*|| !fn.IsFileExecutable()*/) {
                  errmsg.Printf(_("'%s' is not an executable application."), appNames[i].c_str());
                  wxGetApp().SafeMessageBox(errmsg, _("Add Exclusive App"),
                      wxOK | wxICON_EXCLAMATION, this
diff --cc clientgui/MainDocument.cpp
index b51c1c5,b51c1c5..cc41adc
--- a/clientgui/MainDocument.cpp
+++ b/clientgui/MainDocument.cpp
@@@ -1643,7 -1643,7 +1643,6 @@@ void CMainDocument::KillGraphicsApp(HAN
  }
  #else
  void CMainDocument::KillGraphicsApp(int pid) {
--    char* argv[6];
      char currentDir[1024];
      char thePIDbuf[20];
      int id, iRetVal;
@@@ -1651,12 -1651,12 +1650,13 @@@
  
      if (g_use_sandbox) {
          snprintf(thePIDbuf, sizeof(thePIDbuf), "%d", pid);
--        argv[0] = "switcher";
--        argv[1] = "/bin/kill";
--        argv[2] =  "kill";
--        argv[3] = "-KILL";
--        argv[4] = thePIDbuf;
--        argv[5] = 0;
++        char* const argv[6] = {
++           strdup("switcher"),
++	    strdup("/bin/kill"),
++	    strdup("kill"),
++	    strdup("-KILL"),
++	    thePIDbuf,0
++        };
      
          iRetVal = run_program(
              getcwd(currentDir, sizeof(currentDir)),
@@@ -1666,6 -1666,6 +1666,10 @@@
              0,
              id
          );
++	free(argv[0]);
++	free(argv[1]);
++	free(argv[2]);
++	free(argv[3]);
      } else {
          kill_program(pid);
      }
diff --cc clientgui/Makefile.am
index f85177a,f85177a..cb72379
--- a/clientgui/Makefile.am
+++ b/clientgui/Makefile.am
@@@ -3,6 -3,6 +3,7 @@@
  
  include $(top_srcdir)/Makefile.incl
  
++AM_LDFLAGS +=  -L../lib/.libs
  if ENABLE_CLIENT_RELEASE
    AM_LDFLAGS += -static-libtool-libs
  ## for an entirely statically linked library, you may want to try
@@@ -117,9 -117,9 +118,13 @@@ EXTRA_DIST = *.h 
      ../lib/error_numbers.h \
      locale $(mac_headers)
  
--boincmgr_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) $(SQLITE3_CPPFLAGS) $(LIBNOTIFY_CFLAGS) $(CLIENTGUIFLAGS) `pkg-config --cflags gtk+-2.0`
--boincmgr_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS) $(SQLITE3_CPPFLAGS) $(LIBNOTIFY_CFLAGS) $(CLIENTGUIFLAGS) `pkg-config --cflags gtk+-2.0`
--boincmgr_LDFLAGS = $(LIBBOINC) $(SQLITE3_LIBS) $(LIBNOTIFY_LIBS) $(CLIENTGUILIBS) $(BOINC_EXTRA_LIBS) $(CLIENTLIBS) `pkg-config --libs gtk+-2.0` -lnotify
++#boincmgr_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) $(SQLITE3_CPPFLAGS) $(LIBNOTIFY_CFLAGS) $(CLIENTGUIFLAGS) `pkg-config --cflags gtk+-2.0`
++boincmgr_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) $(SQLITE3_CPPFLAGS) $(LIBNOTIFY_CFLAGS) $(CLIENTGUIFLAGS) $(GTK_CLFAGS)
++#boincmgr_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS) $(SQLITE3_CPPFLAGS) $(LIBNOTIFY_CFLAGS) $(CLIENTGUIFLAGS) `pkg-config --cflags gtk+-2.0`
++boincmgr_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS) $(SQLITE3_CPPFLAGS) $(LIBNOTIFY_CFLAGS) $(CLIENTGUIFLAGS) $(GTK_CFLAGS)
++#boincmgr_LDFLAGS = $(LIBBOINC) $(SQLITE3_LIBS) $(LIBNOTIFY_LIBS) $(CLIENTGUILIBS) $(BOINC_EXTRA_LIBS) $(CLIENTLIBS) `pkg-config --libs gtk+-2.0` -lnotify
++boincmgr_LDADD = $(LIBBOINC) $(SQLITE3_LIBS) $(LIBNOTIFY_LIBS) $(CLIENTGUILIBS) $(BOINC_EXTRA_LIBS) $(CLIENTLIBS) $(GTK_LIBS)
++
  
  win_config.h: $(top_srcdir)/config.h
  	grep '#define.*BOINC.*VERSION' $^ > $@
diff --cc clientgui/sg_ProjectPanel.cpp
index 80e45e5,80e45e5..45203d4
--- a/clientgui/sg_ProjectPanel.cpp
+++ b/clientgui/sg_ProjectPanel.cpp
@@@ -414,8 -414,8 +414,7 @@@ void CSimpleProjectPanel::UpdateProject
      CMainDocument* pDoc = wxGetApp().GetDocument();
      ProjectSelectionData* selData;
      PROJECT* project;
--    char* ctrl_url;
--    int i, j, oldProjectSelection, newProjectSelection;
++    int oldProjectSelection, newProjectSelection;
  
      if ( pDoc->IsConnected() ) {
          int projCnt = pDoc->GetSimpleProjectCount();
@@@ -423,10 -423,10 +422,11 @@@
          oldProjectSelection = m_ProjectSelectionCtrl->GetSelection();
          
          // If a new project has been added, figure out which one
--        for(i=0; i<projCnt; i++) {
++        for(int i=0; i<projCnt; i++) {
++            char* ctrl_url;
              project = pDoc->state.projects[i];
              bool found = false;
--            for(j=0; j<ctrlCount; j++) {
++            for(int j=0; j<ctrlCount; j++) {
                  ctrl_url = ((ProjectSelectionData*)m_ProjectSelectionCtrl->GetClientData(j))->project_url;
                  if (!strcmp(project->master_url, ctrl_url)) {
                      found = true;
@@@ -438,7 -438,7 +438,7 @@@
              if ( !found ) {
                  wxString projname(project->project_name.c_str(), wxConvUTF8);
  #if SORTPROJECTLIST
--                int alphaOrder;
++                int alphaOrder,j;
                  for(j = 0; j < ctrlCount; ++j) {
                      alphaOrder = (m_ProjectSelectionCtrl->GetString(j)).CmpNoCase(projname);
                      if (alphaOrder > 0) {
@@@ -470,8 -470,8 +470,8 @@@
          if ( projCnt < ctrlCount ) {
              project = NULL;
              // Check items in descending order so deletion won't change indexes of items yet to be checked
--            for(j=ctrlCount-1; j>=0; --j) {
--                ctrl_url = ((ProjectSelectionData*)m_ProjectSelectionCtrl->GetClientData(j))->project_url;
++            for(int j=ctrlCount-1; j>=0; --j) {
++                char* ctrl_url = ((ProjectSelectionData*)m_ProjectSelectionCtrl->GetClientData(j))->project_url;
                  project = pDoc->state.lookup_project(ctrl_url);
                  if ( project == NULL ) {
                      selData = (ProjectSelectionData*)m_ProjectSelectionCtrl->GetClientData(j);
@@@ -499,9 -499,9 +499,9 @@@
      
          // Check to see if we need to reload the project icon
          ctrlCount = m_ProjectSelectionCtrl->GetCount();
--        for(j=0; j<ctrlCount; j++) {
++        for(int j=0; j<ctrlCount; j++) {
              selData = (ProjectSelectionData*)m_ProjectSelectionCtrl->GetClientData(j);
--            ctrl_url = selData->project_url;
++            char* ctrl_url = selData->project_url;
              project = pDoc->state.lookup_project(ctrl_url);
              if ( project->project_files_downloaded_time > selData->project_files_downloaded_time ) {
                  wxBitmap* projectBM = GetProjectSpecificBitmap(ctrl_url);
diff --cc configure.ac
index cb5631f,cb5631f..3b4f815
--- a/configure.ac
+++ b/configure.ac
@@@ -16,7 -16,7 +16,7 @@@ AC_CANONICAL_TARGE
  dnl generate .tar.gz, .tar.bz2, .zip
  dnl AM_INIT_AUTOMAKE(dist-bzip2 dist-zip)
  AM_INIT_AUTOMAKE(dist-zip)
--m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
++#m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  
  AC_CONFIG_SRCDIR(lib/shmem.cpp)
  
@@@ -289,6 -289,6 +289,20 @@@ AC_SUBST([BOINC_MINOR_VERSION]
  
  AC_SUBST([TOP_BUILD_DIR], [`pwd`])
  
++dnl We can't just export the value of ${bindir} etc. since it may reference
++dnl ${prefix}, so we must resolve those references first
++test "x$prefix" = xNONE && prefix=$ac_default_prefix
++test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
++m4_foreach([dir], [libexecdir], [
++    x="$dir"
++    eval y="$x"
++    while test "x$x" != "x$y"; do
++        x="$y"
++        eval y="$x"
++    done
++    AC_SUBST([CONFIG_]m4_translit(dir, [a-z], [A-Z]), ["$x"])
++])
++
  ## commented this out to turn all maintainer-mode features ON by default,
  ## such as automatic reconfiguring on changes in Makefile.am's and configure.ac
  ## AM_MAINTAINER_MODE
@@@ -743,14 -743,14 +757,12 @@@ f
  
  dnl ---------- libNotify --------------------------------------------------
  if test "${enable_manager}" = yes ; then
--  pkg_config_args=libnotify
--  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
--
--  LIBNOTIFY_CFLAGS=`$PKG_CONFIG libnotify --cflags`
--  LIBNOTIFY_LIBS=`$PKG_CONFIG libnotify --libs`
++  PKG_CHECK_MODULES(LIBNOTIFY, [libnotify >= 0.7.0])
++fi
  
--  AC_SUBST(LIBNOTIFY_CFLAGS)
--  AC_SUBST(LIBNOTIFY_LIBS)
++dnl ---------- GTK2 -------------------------------------------------------
++if test "${enable_manager}" = yes ; then
++  PKG_CHECK_MODULES(GTK, [gtk+-2.0])
  fi
  
  dnl ---------- Sqlite3 ----------------------------------------------------
@@@ -901,7 -901,7 +913,7 @@@ AC_ARG_ENABLE(wx-debug
     ],
    [enable_wx_debug="no"])
  
--CLIENTGUILIBS="${WX_LIBS} ${SQLITE3_LIBS} ${GTK_LIBS}"
++CLIENTGUILIBS="${WX_LIBS} ${SQLITE3_LIBS}"
  
  if test "${enable_client_release}" = "yes" ; then
     if test "x${WX_LIBS_STATIC}" = "x" ; then
diff --cc db/Makefile.am
index 3548944,3548944..1475b52
--- a/db/Makefile.am
+++ b/db/Makefile.am
@@@ -10,4 -10,4 +10,5 @@@ endi
  
  ## other stuff to go into the distribution
  extradir = $(prefix)/share/boinc-server-maker/db
--dist_extra_DATA = constraints.sql schema.sql init_db
++dist_extra_DATA = constraints.sql schema.sql
++dist_extra_SCRIPTS = init_db
diff --cc debian/fetch_example_applications.sh
index cbb8053,5adf808..2e884b0
--- a/debian/fetch_example_applications.sh
+++ b/debian/fetch_example_applications.sh
@@@ -93,22 -74,12 +93,24 @@@ key="$projectroot/keys/code_sign_privat
  
  shortver=$(echo $version|cut -d . -f-2)
  
 -appsdir="apps"
 +if [ -z "$appsdir" ]; then
 +	if [ -d "$projectroot/apps" ]; then
 +		echo "W: 'appsdir' not specified, chose '\$projectroot/apps'."
 +		appsdir="$projectroot/apps"
 +	else
 +		echo "W: 'appsdir' not specified, and no apps directory in \$projectroot, decided for 'apps'.".
 +		appsdir="apps"
 +	fi
 +fi
+ downloaddir="collection"
+ appsdirdownload="/usr/lib/boinc-server-maker/apps" # used as relative path below
  
 -if [ -d "$appsdir"]; then
 -	echo "Directory '$appsdir' is already existing. Please clean this up first."
 +if [ -z "$downloaddir" ]; then
 +	downloaddir="collection"
 +fi
 +
 +if [ -d "$appsdir" ]; then
 +	echo "E: Directory '$appsdir' is already existing. Please clean this up first."
  	exit
  fi
  
diff --cc debian/rules
index 1c3a5d9,a7c2269..d565189
--- a/debian/rules
+++ b/debian/rules
@@@ -132,10 -132,6 +132,10 @@@ ifneq (,$(findstring clang,$(DEB_BUILD_
    export CXX=clang
  endif
  
- ifeq(,$(DEB_OPT_FLAGS))
++ifeq (,$(DEB_OPT_FLAGS))
 +   DEB_OPT_FLAGS = -O3 -funroll-loops -fforce-addr -ffast-math
 +endif
 +
  CFLAGS += $(DEB_OPT_FLAGS)
  CXXFLAGS += $(DEB_OPT_FLAGS)
  
diff --cc generate_svn_version.sh
index 8f8de4c,8f8de4c..a111d8f
--- a/generate_svn_version.sh
+++ b/generate_svn_version.sh
@@@ -7,7 -7,7 +7,9 @@@ echo "#ifndef SVN_VERSION_H" > $TMPFIL
  echo "#define SVN_VERSION_H" >> $TMPFILE
  echo "" >> $TMPFILE
  
--if [ -d .git/svn ]; then
++if [ -d "debian" ]; then
++    CMD=""
++elif [ -d .git/svn ]; then
      CMD="git svn info"
  elif [ -d .git ]; then
      GIT_LOG=`git log -n1 --pretty="format:%H"`
diff --cc html/Makefile.am
index 9862d8d,9862d8d..f376dc1
--- a/html/Makefile.am
+++ b/html/Makefile.am
@@@ -1,4 -1,4 +1,4 @@@
  htmldir=$(DESTDIR)/$(prefix)/share/boinc-server-maker/html
  install-data-local:
  	mkdir -p $(htmldir)
--	cp -r inc languages ops user $(htmldir)
++	cp -r bt drupal inc languages ops project.sample queue user $(htmldir)
diff --cc html/languages/translations/de.po
index accd4e1,accd4e1..813cbc0
--- a/html/languages/translations/de.po
+++ b/html/languages/translations/de.po
@@@ -1066,8 -1066,8 +1066,8 @@@ msgstr "
  
  #: ../inc/prefs.inc:157
  #, php-format
--msgid "% of the processors"
--msgstr "% von den Prozessoren"
++msgid "%% of the processors"
++msgstr "%% von den Prozessoren"
  
  #: ../inc/prefs.inc:161
  msgid "Use at most %1 Can be used to reduce CPU heat %2"
@@@ -1075,8 -1075,8 +1075,8 @@@ msgstr "Nutze höchstens %1Kann benutz
  
  #: ../inc/prefs.inc:166
  #, php-format
--msgid "% of CPU time"
--msgstr "% der Prozessorzeit"
++msgid "%% of CPU time"
++msgstr "%% der Prozessorzeit"
  
  #: ../inc/prefs.inc:174 ../inc/prefs.inc:188
  msgid "Disk: use at most"
@@@ -1095,8 -1095,8 +1095,8 @@@ msgstr "
  #: ../inc/prefs.inc:190 ../inc/prefs.inc:200 ../inc/prefs.inc:205
  #: ../inc/prefs.inc:210
  #, php-format
--msgid "% of total"
--msgstr "% von Gesamt"
++msgid "%% of total"
++msgstr "%% von Gesamt"
  
  #: ../inc/prefs.inc:193
  msgid "Tasks checkpoint to disk at most every"
@@@ -5279,9 -5279,9 +5279,10 @@@ msgid "
  "our message boards are moderated.\n"
  "Message board postings are subject to the following posting rules:\n"
  msgstr ""
++"\n"
  "Um eine angenehme Diskussion und den bestmöglichen Informationsfluss zu "
--"gewährleisten wird dieses Forum moderiert. Forenbeiträge müssen den "
--"folgenden Regeln entsprechen:"
++"gewährleisten, wird dieses Forum moderiert. Forenbeiträge müssen den "
++"folgenden Regeln entsprechen:\n"
  
  #: ../user/moderation.php:30
  msgid ""
diff --cc html/languages/translations/ru.po
index 1573af5,1573af5..f631b67
--- a/html/languages/translations/ru.po
+++ b/html/languages/translations/ru.po
@@@ -386,6 -386,6 +386,7 @@@ msgstr "
  "<li> Не должно быть оскорбительных комментариев, затрагивающих расу, "
  "религию,\n"
  " национальность, пол, класс или сексуальность.\n"
++"        "
  
  #: ../inc/forum.inc:734
  msgid "Rules:"
diff --cc lib/Makefile.am
index 45c3279,45c3279..e981605
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@@ -150,13 -150,13 +150,13 @@@ lib_LTLIBRARIES = libboinc.la libboinc_
  libboinc_la_SOURCES = $(generic_sources) $(mac_sources)
  libboinc_la_CFLAGS = $(AM_CFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
  libboinc_la_CXXFLAGS = $(AM_CXXFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
--libboinc_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -static -version-number $(LIBBOINC_VERSION)
++libboinc_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
  libboinc_la_LIBADD =
  
  libboinc_crypt_la_SOURCES = crypt.cpp
  libboinc_crypt_la_CFLAGS = $(AM_CFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS) $(SSL_CFLAGS)
  libboinc_crypt_la_CXXFLAGS = $(AM_CXXFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS) $(SSL_CXXFLAGS)
--libboinc_crypt_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -static -version-number $(LIBBOINC_VERSION)
++libboinc_crypt_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION) $(SSL_LIBS)
  libboinc_crypt_la_LIBADD =
  
  
@@@ -225,7 -225,7 +225,7 @@@ msg_test_CXXFLAGS = $(PTHREAD_CFLAGS
  msg_test_LDADD = $(LIBBOINC)
  crypt_prog_SOURCES = crypt_prog.cpp 
  crypt_prog_CXXFLAGS = $(PTHREAD_CFLAGS)
--crypt_prog_LDADD = $(LIBBOINC_CRYPT_STATIC) $(LIBBOINC) $(SSL_LIBS) 
++crypt_prog_LDADD = $(LIBBOINC_CRYPT_STATIC) -L../lib/.libs $(LIBBOINC) $(SSL_LIBS)
  parse_test_SOURCES = parse_test.cpp 
  parse_test_CXXFLAGS = $(PTHREAD_CFLAGS)
  parse_test_LDADD = $(LIBBOINC)
diff --cc lib/coproc.cpp
index 4301d10,4301d10..264e983
--- a/lib/coproc.cpp
+++ b/lib/coproc.cpp
@@@ -355,7 -355,7 +355,7 @@@ void COPROC_NVIDIA::clear() 
      cuda_version = 0;
      display_driver_version = 0;
      strcpy(prop.name, "");
--    prop.totalGlobalMem = 0;
++    prop.totalGlobalMem = 0.0;
      prop.sharedMemPerBlock = 0;
      prop.regsPerBlock = 0;
      prop.warpSize = 0;
@@@ -385,7 -385,7 +385,7 @@@ int COPROC_NVIDIA::parse(XML_PARSER& xp
      while (!xp.get_tag()) {
          if (xp.match_tag("/coproc_cuda")) {
              if (!peak_flops) {
--				set_peak_flops();
++                set_peak_flops();
              }
              if (!available_ram) {
                  available_ram = prop.totalGlobalMem;
diff --cc lib/crypt.cpp
index d1a0e1b,d1a0e1b..763dc87
--- a/lib/crypt.cpp
+++ b/lib/crypt.cpp
@@@ -342,6 -342,6 +342,7 @@@ int check_file_signature
      char clear_buf[MD5_LEN];
      int n, retval;
      DATA_BLOCK clear_signature;
++    clear_buf[0]=0;
  
      n = (int)strlen(md5_buf);
      clear_signature.data = (unsigned char*)clear_buf;
diff --cc lib/crypt_prog.cpp
index 3d45361,3d45361..d581724
--- a/lib/crypt_prog.cpp
+++ b/lib/crypt_prog.cpp
@@@ -152,6 -152,6 +152,8 @@@ int main(int argc, char** argv) 
          if (!fpub) die("fopen");
          print_key_hex(fpriv, (KEY*)&private_key, sizeof(private_key));
          print_key_hex(fpub, (KEY*)&public_key, sizeof(public_key));
++	fclose(fpriv);
++	fclose(fpub);
  
      } else if (!strcmp(argv[1], "-sign")) {
          if (argc < 4) {
@@@ -166,6 -166,6 +168,7 @@@
          signature.len = 256;
          retval = sign_file(argv[2], private_key, signature);
          print_hex_data(stdout, signature);
++	fclose(fpriv);
      } else if (!strcmp(argv[1], "-sign_string")) {
          if (argc < 4) {
              usage();
@@@ -177,6 -177,6 +180,7 @@@
          if (retval) die("scan_key_hex\n");
          generate_signature(argv[2], cbuf, private_key);
          puts(cbuf);
++	fclose(fpriv);
      } else if (!strcmp(argv[1], "-verify")) {
          if (argc < 5) {
              usage();
@@@ -190,6 -190,6 +194,8 @@@
          signature.data = signature_buf;
          signature.len = 256;
          retval = scan_hex_data(f, signature);
++	fclose(f);
++	fclose(fpub);
          if (retval) die("scan_hex_data");
  
          char md5_buf[64];
@@@ -219,6 -219,6 +225,8 @@@
          if (!fpub) die("fopen");
          retval = scan_key_hex(fpub, (KEY*)&public_key, sizeof(public_key));
          if (retval) die("read_public_key");
++	fclose(fpriv);
++	fclose(fpub);
          strcpy((char*)buf2, "encryption test successful");
          in.data = buf2;
          in.len = strlen((char*)in.data);
@@@ -236,6 -236,6 +244,7 @@@
          signature.data = signature_buf;
          signature.len = 256;
          retval = scan_hex_data(f, signature);
++	fclose(f);
          if (retval) die("cannot scan_hex_data");
          certpath = check_validity(argv[4], argv[2], signature.data, argv[5]);
          if (certpath == NULL) {
@@@ -391,6 -391,6 +400,7 @@@
                      die("fopen");
                  }
                  print_key_hex(fpub, (KEY*)&public_key, sizeof(public_key));
++		fclose(fpub);
              }
          }
      } else {
diff --cc lib/diagnostics.cpp
index d22ab30,d22ab30..bd70468
--- a/lib/diagnostics.cpp
+++ b/lib/diagnostics.cpp
@@@ -306,7 -306,7 +306,7 @@@ int diagnostics_init
  
      // Store various pieces of inforation for future use.
      if (flags & BOINC_DIAG_BOINCAPPLICATION) {
--        char    buf[256];
++        char    buf[MAXPATHLEN];
          char    proxy_address[256];
          int     proxy_port;
          MIOFILE mf;
diff --cc lib/filesys.cpp
index c387495,c387495..6191397
--- a/lib/filesys.cpp
+++ b/lib/filesys.cpp
@@@ -86,7 -86,7 +86,7 @@@ char boinc_failed_file[MAXPATHLEN]
  
  // routines for enumerating the entries in a directory
  
--int is_file(const char* path) {
++int is_file(const char* const path) {
      struct stat sbuf;
  #ifdef _WIN32
      int retval = stat(path, &sbuf);
@@@ -96,7 -96,7 +96,7 @@@
      return (!retval && (((sbuf.st_mode) & S_IFMT) == S_IFREG));
  }
  
--int is_dir(const char* path) {
++int is_dir(const char* const path) {
      struct stat sbuf;
  #ifdef _WIN32
      int retval = stat(path, &sbuf);
@@@ -108,19 -108,19 +108,19 @@@
  
  #ifndef _WIN32
  
--int is_file_follow_symlinks(const char* path) {
++int is_file_follow_symlinks(const char* const path) {
      struct stat sbuf;
      int retval = stat(path, &sbuf);
      return (!retval && (((sbuf.st_mode) & S_IFMT) == S_IFREG));
  }
  
--int is_dir_follow_symlinks(const char* path) {
++int is_dir_follow_symlinks(const char* const path) {
      struct stat sbuf;
      int retval = stat(path, &sbuf);
      return (!retval && (((sbuf.st_mode) & S_IFMT) == S_IFDIR));
  }
  
--int is_symlink(const char* path) {
++int is_symlink(const char* const path) {
      struct stat sbuf;
      int retval = lstat(path, &sbuf);
      return (!retval && S_ISLNK(sbuf.st_mode));
@@@ -129,7 -129,7 +129,7 @@@
  
  // Open a directory
  //
--DIRREF dir_open(const char* p) {
++DIRREF dir_open(const char* const p) {
      DIRREF dirp;
  #ifdef _WIN32
      if (!is_dir(p)) return NULL;
@@@ -144,7 -144,7 +144,12 @@@
      dirp->handle = INVALID_HANDLE_VALUE;
  #else
      dirp = opendir(p);
--    if (!dirp) return NULL;
++    if (!dirp) {
++        char b[MAXPATHLEN+1];
++	boinc_getcwd(b);
++        fprintf(stderr,"dir_open: Could not open directory '%s' from '%s'.\n",p,b);
++        return NULL;
++    }
  #endif
      return dirp;
  }
@@@ -212,7 -212,7 +217,7 @@@ void dir_close(DIRREF dirp) 
  #endif
  }
  
--bool is_dir_empty(const char *p) {
++bool is_dir_empty(const char* const p) {
      char file[MAXPATHLEN];
  
      DIRREF dir = dir_open(p);
@@@ -292,7 -292,7 +297,7 @@@ DirScanner::~DirScanner() 
  #endif
  }
  
--static int boinc_delete_file_aux(const char* path) {
++static int boinc_delete_file_aux(const char* const path) {
  #ifdef _WIN32
      if (!DeleteFileA(path)) {
          return ERR_UNLINK;
@@@ -306,7 -306,7 +311,7 @@@
  
  // Delete the file located at path
  //
--int boinc_delete_file(const char* path) {
++int boinc_delete_file(const char* const path) {
      int retval = 0;
  
      if (!boinc_file_exists(path)) {
@@@ -330,7 -330,7 +335,7 @@@
  
  // get file size
  //
--int file_size(const char* path, double& size) {
++int file_size(const char* const path, double& size) {
      int retval;
  
  #if defined(_WIN32) && !defined(__CYGWIN32__) && !defined(__MINGW32__)
@@@ -345,7 -345,7 +350,7 @@@
      return 0;
  }
  
--int boinc_truncate(const char* path, double size) {
++int boinc_truncate(const char* const path, double size) {
      int retval;
  #if defined(_WIN32) && !defined(__CYGWIN32__)
      // the usual Windows nightmare.
@@@ -366,7 -366,7 +371,7 @@@
  
  // remove everything from specified directory
  //
--int clean_out_dir(const char* dirpath) {
++int clean_out_dir(const char* const dirpath) {
      char filename[MAXPATHLEN], path[MAXPATHLEN];
      int retval;
      DIRREF dirp;
@@@ -394,7 -394,7 +399,7 @@@
  // Win: use special version because stat() is slow, can be avoided
  // Unix: follow symbolic links
  //
--int dir_size(const char* dirpath, double& size, bool recurse) {
++int dir_size(const char* const dirpath, double& size, bool recurse) {
  #ifdef WIN32
      char path2[_MAX_PATH];
      sprintf(path2, "%s/*", dirpath);
@@@ -430,7 -430,7 +435,7 @@@
      while (1) {
          retval = dir_scan(filename, dirp, sizeof(filename));
          if (retval) break;
--        sprintf(subdir, "%s/%s", dirpath, filename);
++        snprintf(subdir, sizeof(subdir), "%s/%s", dirpath, filename);
  
          if (is_dir(subdir)) {
              if (recurse) {
@@@ -449,7 -449,7 +454,7 @@@
      return 0;
  }
  
--FILE* boinc_fopen(const char* path, const char* mode) {
++FILE* boinc_fopen(const char* const path, const char* mode) {
      // if opening for read, and file isn't there,
      // leave now (avoid 5-second delay!!)
      //
@@@ -500,7 -500,7 +505,7 @@@
  }
  
  
--int boinc_file_exists(const char* path) {
++int boinc_file_exists(const char* const path) {
      struct stat buf;
      if (stat(path, &buf)) {
          return false;     // stat() returns zero on success
@@@ -510,7 -510,7 +515,7 @@@
  
  // same, but doesn't traverse symlinks
  //
--int boinc_file_or_symlink_exists(const char* path) {
++int boinc_file_or_symlink_exists(const char* const path) {
      struct stat buf;
  #ifdef _WIN32
      if (stat(path, &buf)) {
@@@ -524,7 -524,7 +529,7 @@@
  
  // returns zero on success, nonzero if didn't touch file
  //
--int boinc_touch_file(const char *path) {
++int boinc_touch_file(const char* const path) {
  
      if (boinc_file_exists(path)) {
          return 0;
@@@ -548,8 -548,8 +553,8 @@@ int boinc_copy(const char* orig, const 
      }
      return 0;
  #elif defined(__EMX__)
--    char cmd[2*MAXPATHLEN];
--    sprintf(cmd, "copy \"%s\" \"%s\"", orig, newf);
++    char cmd[2*MAXPATHLEN+5];
++    snprintf(cmd, sizeof(cmd), "copy \"%s\" \"%s\"", orig, newf);
      return system(cmd);
  #else
      // POSIX requires that shells run from an application will use the 
@@@ -582,14 -582,14 +587,14 @@@
      fclose(src);
      fclose(dst);
      // Copy file's ownership, permissions to the extent we are allowed
--    lstat(orig, &sbuf);             // Get source file's info
--    chown(newf, sbuf.st_uid, sbuf.st_gid);
--    chmod(newf, sbuf.st_mode);
++    if (lstat(orig, &sbuf)) retval=ERR_FWRITE;             // Get source file's info
++    if (chown(newf, sbuf.st_uid, sbuf.st_gid)) retval=ERR_FWRITE;
++    if (chmod(newf, sbuf.st_mode)) retval=ERR_FWRITE;
      return retval;
  #endif
  }
  
--static int boinc_rename_aux(const char* old, const char* newf) {
++static int boinc_rename_aux(const char* const old, const char* const newf) {
  #ifdef _WIN32
      if (MoveFileExA(old, newf, MOVEFILE_REPLACE_EXISTING|MOVEFILE_WRITE_THROUGH)) return 0;
      return GetLastError();
@@@ -599,7 -599,7 +604,7 @@@
      //
      int retval = rename(old, newf);
      if (retval) {
--        char buf[MAXPATHLEN+MAXPATHLEN];
++        char buf[MAXPATHLEN+MAXPATHLEN+1+7];
          sprintf(buf, "mv \"%s\" \"%s\"", old, newf);
          retval = system(buf);
      }
@@@ -608,7 -608,7 +613,7 @@@
  #endif
  }
  
--int boinc_rename(const char* old, const char* newf) {
++int boinc_rename(const char* const old, const char* const newf) {
      int retval=0;
  
      retval = boinc_rename_aux(old, newf);
@@@ -625,7 -625,7 +630,7 @@@
  
  // make a dir that's owner and group RWX
  //
--int boinc_mkdir(const char* path) {
++int boinc_mkdir(const char* const path) {
      if (is_dir(path)) return 0;
  #ifdef _WIN32
      if (!CreateDirectoryA(path, NULL)) {
@@@ -640,7 -640,7 +645,7 @@@
      return 0;
  }
  
--int boinc_rmdir(const char* name) {
++int boinc_rmdir(const char* const name) {
  #ifdef _WIN32
      if (!RemoveDirectoryA(name)) {
          return ERR_RMDIR;
@@@ -653,7 -653,7 +658,7 @@@
  }
  
  #ifndef _WIN32
--int boinc_chown(const char* path, gid_t gid) {
++int boinc_chown(const char* const path, gid_t gid) {
      if (gid) {
          if (chown(path, (uid_t)-1, gid)) {
              return ERR_CHOWN;
@@@ -666,7 -666,7 +671,7 @@@
  // if "filepath" is of the form a/b/c,
  // create directories dirpath/a, dirpath/a/b etc.
  //
--int boinc_make_dirs(const char* dirpath, const char* filepath) {
++int boinc_make_dirs(const char* const dirpath, const char* const filepath) {
      char buf[MAXPATHLEN], oldpath[MAXPATHLEN], newpath[MAXPATHLEN];
      int retval;
      char *p, *q;
@@@ -680,7 -680,7 +685,7 @@@
          p = strchr(q, '/');
          if (!p) break;
          *p = 0;
--        sprintf(newpath, "%s/%s", oldpath, q);
++        snprintf(newpath, sizeof(newpath), "%s/%s", oldpath, q);
          retval = boinc_mkdir(newpath);
          if (retval) return retval;
          safe_strcpy(oldpath, newpath);
@@@ -745,7 -745,7 +750,7 @@@ int FILE_LOCK::unlock(const char* filen
      return 0;
  }
  
--void boinc_getcwd(char* path) {
++void boinc_getcwd(char* const path) {
  #ifdef _WIN32
      getcwd(path, MAXPATHLEN);
  #else
@@@ -757,7 -757,7 +762,7 @@@
  #endif
  }
  
--void relative_to_absolute(const char* relname, char* path) {
++void relative_to_absolute(const char* const relname, char* const path) {
      boinc_getcwd(path);
      if (strlen(relname)) {
          strcat(path, "/");
@@@ -766,7 -766,7 +771,7 @@@
  }
  
  #if defined(_WIN32) && !(defined(WXDEBUG) || defined(WXNDEBUG))
--int boinc_allocate_file(const char* path, double size) {
++int boinc_allocate_file(const char* const path, double size) {
      int retval = 0;
      HANDLE h = CreateFile(
          path,
@@@ -828,7 -828,7 +833,7 @@@ int get_filesystem_info(double &total_s
          total_space = (double)dwTotalClusters * dwSectPerClust * dwBytesPerSect;
      }
  #else
--int get_filesystem_info(double &total_space, double &free_space, char* path) {
++int get_filesystem_info(double &total_space, double &free_space, const char* const path) {
  #ifdef STATFS
      struct STATFS fs_info;
  
diff --cc lib/filesys.h
index 9cf7adf,9cf7adf..21f01e6
--- a/lib/filesys.h
+++ b/lib/filesys.h
@@@ -43,30 -43,30 +43,30 @@@
  #ifdef __cplusplus
  extern "C" {
  #endif
--  extern int boinc_delete_file(const char*);
--  extern int boinc_touch_file(const char *path);
--  extern FILE* boinc_fopen(const char* path, const char* mode);
++  extern int boinc_delete_file(const char* const);
++  extern int boinc_touch_file(const char* const path);
++  extern FILE* boinc_fopen(const char* const path, const char* mode);
    extern int boinc_copy(const char* orig, const char* newf);
--  extern int boinc_rename(const char* old, const char* newf);
--  extern int boinc_mkdir(const char*);
++  extern int boinc_rename(const char* const old, const char* const newf);
++  extern int boinc_mkdir(const char* const);
  #ifdef _WIN32
--  extern int boinc_allocate_file(const char*, double size);
++  extern int boinc_allocate_file(const char* const, double size);
  #else
--  extern int boinc_chown(const char*, gid_t);
++  extern int boinc_chown(const char* const, const gid_t);
  #endif
--  extern int boinc_rmdir(const char*);
--  extern void boinc_getcwd(char*);
--  extern void relative_to_absolute(const char* relname, char* path);
--  extern int boinc_make_dirs(const char*, const char*);
++  extern int boinc_rmdir(const char* const);
++  extern void boinc_getcwd(/* not const*/ char* const);
++  extern void relative_to_absolute(const char* const relname, /* not const*/ char* const path);
++  extern int boinc_make_dirs(const char* const, const char* const);
    extern char boinc_failed_file[MAXPATHLEN];
--  extern int is_file(const char* path);
--  extern int is_dir(const char* path);
--  extern int is_file_follow_symlinks(const char* path);
--  extern int is_dir_follow_symlinks(const char* path);
--  extern int is_symlink(const char* path);
--  extern int boinc_truncate(const char*, double);
--  extern int boinc_file_exists(const char* path);
--  extern int boinc_file_or_symlink_exists(const char* path);
++  extern int is_file(const char* const path);
++  extern int is_dir(const char* const path);
++  extern int is_file_follow_symlinks(const char* const path);
++  extern int is_dir_follow_symlinks(const char* const path);
++  extern int is_symlink(const char* const path);
++  extern int boinc_truncate(const char* const, double);
++  extern int boinc_file_exists(const char* const path);
++  extern int boinc_file_or_symlink_exists(const char* const path);
  
  #ifdef __cplusplus
  }
@@@ -75,10 -75,10 +75,10 @@@
  /* C++ specific prototypes/defines follow here */
  #ifdef __cplusplus
  
--extern int file_size(const char*, double&);
--extern int clean_out_dir(const char*);
--extern int dir_size(const char* dirpath, double&, bool recurse=true);
--extern int get_filesystem_info(double& total, double& free, char* path=const_cast<char *>("."));
++extern int file_size(const char* const, double&);
++extern int clean_out_dir(const char* const);
++extern int dir_size(const char* const dirpath, double&, bool recurse=true);
++extern int get_filesystem_info(double& total, double& free, const char* const path=const_cast<char *>("."));
  
  // TODO TODO TODO
  // remove this code - the DirScanner class does the same thing.
@@@ -100,7 -100,7 +100,7 @@@ extern int dir_scan(char*, DIRREF, int)
  extern int dir_scan(std::string&, DIRREF);
  extern void dir_close(DIRREF);
  
--extern bool is_dir_empty(const char*);
++extern bool is_dir_empty(const char* const);
  
  class DirScanner {
  #if defined(_WIN32) && !defined(__CYGWIN32__)
diff --cc lib/mfile.cpp
index 7e12e41,7e12e41..47b813c
--- a/lib/mfile.cpp
+++ b/lib/mfile.cpp
@@@ -38,13 -38,13 +38,14 @@@
  MFILE::MFILE() {
      buf = (char*)malloc(64*1024);
      len = 0;
++    f = NULL;
  }
  
  MFILE::~MFILE() {
--    if (buf) free(buf);
++    close();
  }
  
--int MFILE::open(const char* path, const char* mode) {
++int MFILE::open(const char* const path, const char* const mode) {
      f = boinc_fopen(path, mode);
      if (!f) return ERR_FOPEN;
      if (!buf) buf = (char*)malloc(64*1024);
@@@ -67,7 -67,7 +68,7 @@@ static inline char* realloc_aux(char* p
  
  #define BUFSIZE 100000
  
--int MFILE::vprintf(const char* format, va_list ap) {
++int MFILE::vprintf(const char* const format, va_list ap) {
      char buf2[BUFSIZE];
      int n, k;
  
@@@ -93,7 -93,7 +94,7 @@@
      return k;
  }
  
--int MFILE::printf(const char* format, ...) {
++int MFILE::printf(const char* const format, ...) {
      int n;
      va_list ap;
  
@@@ -103,7 -103,7 +104,7 @@@
      return n;
  }
  
--size_t MFILE::write(const void *ptr, size_t size, size_t nitems) {
++size_t MFILE::write(const void *ptr, const size_t size, const size_t nitems) {
      buf = (char *)realloc_aux( buf, len+(size*nitems)+1 );
      if (!buf) {
          fprintf(stderr,
@@@ -118,7 -118,7 +119,7 @@@
      return nitems;
  }
  
--int MFILE::_putchar(char c) {
++int MFILE::_putchar(const char c) {
      buf = (char*)realloc_aux(buf, len+1+1);
      if (!buf) {
          fprintf(stderr,
@@@ -132,7 -132,7 +133,7 @@@
      return c;
  }
  
--int MFILE::puts(const char* p) {
++int MFILE::puts(const char* const p) {
      int n = (int)strlen(p);
      buf = (char*)realloc_aux(buf, len+n+1);
      if (!buf) {
diff --cc lib/mfile.h
index 39e68a6,39e68a6..e41beb4
--- a/lib/mfile.h
+++ b/lib/mfile.h
@@@ -37,12 -37,12 +37,12 @@@ class MFILE 
  public:
      MFILE();
      ~MFILE();
--    int open(const char* path, const char* mode);
--    int _putchar(char);
--    int puts(const char*);
--    int vprintf(const char* format, va_list);
--    int printf(const char* format, ...);
--    size_t write(const void *, size_t size, size_t nitems);
++    int open(const char* const path, const char* const mode);
++    int _putchar(const char);
++    int puts(const char* const s);
++    int vprintf(const char* const format, va_list);
++    int printf(const char* const format, ...);
++    size_t write(const void *, const size_t size, const size_t nitems);
      int close();
      int flush();
      long tell() const;
diff --cc lib/network.cpp
index 0b7965a,0b7965a..a2c7fde
--- a/lib/network.cpp
+++ b/lib/network.cpp
@@@ -71,7 -71,7 +71,7 @@@ const char* socket_error_str() 
      case WSAENOTSOCK:
          return "not a socket";
      }
--    sprintf(buf, "error %d", e);
++    snprintf(buf, sizeof(buf), "error %d", e);
      return buf;
  #else
      switch (h_errno) {
@@@ -85,11 -85,11 +85,11 @@@
          return "host not found or server failure";
  #ifdef NETDB_INTERNAL
      case NETDB_INTERNAL:
--        sprintf(buf,"network internal error %d",errno);
++        snprintf(buf, sizeof(buf), "network internal error %d",errno);
          return buf;
  #endif
      }
--    sprintf(buf, "error %d", h_errno);
++    snprintf(buf, sizeof(buf), "error %d", h_errno);
      return buf;
  #endif
  }
diff --cc lib/parse_test.cpp
index e388e1f,e388e1f..f88873e
--- a/lib/parse_test.cpp
+++ b/lib/parse_test.cpp
@@@ -57,6 -57,6 +57,7 @@@ int main() 
          exit(1);
      }
      parse(f);
++    fclose(f);
  }
  
  /* try it with something like:
diff --cc lib/procinfo_win.cpp
index 8ab2299,8ab2299..0e51334
--- a/lib/procinfo_win.cpp
+++ b/lib/procinfo_win.cpp
@@@ -25,6 -25,6 +25,9 @@@ static int get_process_information(PVOI
      tNTQSI   pNTQSI = (tNTQSI)GetProcAddress(hNTDllLib, "NtQuerySystemInformation");
      ULONG    cbBuffer = 0;
  
++    if (!ppBuffer) return ERR_NULL;
++    if (!pcbBuffer) return ERR_NULL;
++
      while (1) {
          // Store the buffer size since it appears that somebody is monkeying around
          //   with the return values on some systems.
diff --cc lib/shmem.cpp
index b04ab11,b04ab11..fd3bf36
--- a/lib/shmem.cpp
+++ b/lib/shmem.cpp
@@@ -337,7 -337,7 +337,10 @@@ int create_shmem_mmap(const char *path
          // area to all zeros because they write beyond the old EOF. 
          // See the lseek man page for details.
          lseek(fd, size-1, SEEK_SET);
--        write(fd, "\0", 1);
++        if (1 != write(fd, "\0", 1)) {
++	    close(fd);
++	    return ERR_SHMGET;
++	}
      }
  
      *pp = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_FILE | MAP_SHARED, fd, 0);
diff --cc lib/unix_util.cpp
index 8c628c9,8c628c9..88465d9
--- a/lib/unix_util.cpp
+++ b/lib/unix_util.cpp
@@@ -61,7 -61,7 +61,13 @@@ int setenv(const char *name, const cha
              }
              if (i!=envstrings.end()) {
                  // we allocated this string.  Reallocate it.
++		char *b=buf;
                  buf=(char *)realloc(buf,strlen(name)+strlen(value)+2);
++		if (!buf) {
++		    free(b);
++		    errno=ENOMEM;
++		    return -1;
++		}
                  *i=buf;
              } else {
                  // someone else allocated the string.  Allocate new memory.
diff --cc locale/Makefile.am
index a8850cf,a8850cf..0affdb2
--- a/locale/Makefile.am
+++ b/locale/Makefile.am
@@@ -21,7 -21,7 +21,7 @@@ locale_dirs = 
  	gl \
  	hr \
  	hu \
--	it \
++	it_IT \
  	ja \
  	ko \
  	lt \
diff --cc py/boinc_path_config.py.in
index fc5fa96,fc5fa96..5127367
--- a/py/boinc_path_config.py.in
+++ b/py/boinc_path_config.py.in
@@@ -8,5 -8,5 +8,5 @@@
  
  import sys, os
  
--TOP_BUILD_DIR = "@TOP_BUILD_DIR@"
++TOP_BUILD_DIR = "/usr/share/boinc-server-maker"
  sys.path.insert(0, os.path.join(TOP_BUILD_DIR, 'py'))
diff --cc samples/wrapper/Makefile
index bccc0f7,bccc0f7..f10b8a0
--- a/samples/wrapper/Makefile
+++ b/samples/wrapper/Makefile
@@@ -37,4 -37,4 +37,4 @@@ REGEXP_OBJS = 
  	regexp_report.o
  
  wrapper: wrapper.o libstdc++.a $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_api.a $(REGEXP_OBJS)
--	g++ $(CXXFLAGS) $(CPPFLAGS) -o wrapper wrapper.o $(REGEXP_OBJS) libstdc++.a -pthread -lboinc_api -lboinc -lboinc_zip
++	g++ $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o wrapper wrapper.o $(REGEXP_OBJS) libstdc++.a -pthread -lboinc_api -lboinc -lboinc_zip $(LDFLAGS)
diff --cc samples/wrapper/build_android.sh
index e0e11eb,e0e11eb..941d3bc
--- a/samples/wrapper/build_android.sh
+++ b/samples/wrapper/build_android.sh
@@@ -1,4 -1,4 +1,4 @@@
--#/bin/sh
++#!/bin/sh
  #script to compile Wrapper for Android
  
  export ANDROIDTC="$HOME/android-tc"
diff --cc sched/Makefile.am
index 30bb9be,30bb9be..4eabec0
--- a/sched/Makefile.am
+++ b/sched/Makefile.am
@@@ -4,7 -4,7 +4,7 @@@
  include $(top_srcdir)/Makefile.incl
  
  AM_CPPFLAGS += $(MYSQL_CFLAGS) $(PTHREAD_CFLAGS)
--AM_LDFLAGS += -static
++AM_LDFLAGS += -static -L../lib/.libs/
  
  if ENABLE_LIBRARIES
  
@@@ -116,7 -116,7 +116,7 @@@ schedshare_PROGRAMS = 
      sample_trivial_validator \
      sample_work_generator \
      single_job_assimilator \
--	size_regulator \
++    size_regulator \
      transitioner \
      trickle_credit \
      trickle_echo \
@@@ -129,11 -129,11 +129,10 @@@ schedcgi_PROGRAMS= 
  schedshare_DATA = \
      db_dump_spec.xml \
      assimilator.py \
--    pymw_assimilator.py \
--    transitioner_catchup.php
++    pymw_assimilator.py
  
  # scripts that 'make install' should put in bindir
--schedshare_SCRIPTS = start stop status
++schedshare_SCRIPTS = start stop status transitioner_catchup.php
  
  noinst_HEADERS = \
      assimilate_handler.h \
@@@ -257,7 -257,7 +256,7 @@@ update_stats_SOURCES = update_stats.cp
  update_stats_LDADD = $(SERVERLIBS)
  
  file_upload_handler_SOURCES = file_upload_handler.cpp
--file_upload_handler_LDADD = $(SERVERLIBS)
++file_upload_handler_LDADD = $(SERVERLIBS) -lboinc
  
  make_work_SOURCES = make_work.cpp
  make_work_LDADD = $(SERVERLIBS)
@@@ -299,7 -299,7 +298,7 @@@ fcgi_file_upload_handler_SOURCES = 
      sched_config.cpp \
      sched_msgs.cpp 
  fcgi_file_upload_handler_CPPFLAGS = -D_USING_FCGI_ $(AM_CPPFLAGS)
--fcgi_file_upload_handler_LDADD = $(SERVERLIBS_FCGI)
++fcgi_file_upload_handler_LDADD = $(SERVERLIBS_FCGI) -lboinc
  
  endif
  # end of "if ENABLE_FCGI"
diff --cc sched/feeder.cpp
index 0b79774,0b79774..19f56a1
--- a/sched/feeder.cpp
+++ b/sched/feeder.cpp
@@@ -115,6 -115,6 +115,7 @@@ using std::vector
  #include "util.h"
  #include "str_util.h"
  #include "svn_version.h"
++#include "filesys.h"
  
  #include "credit.h"
  #include "sched_config.h"
diff --cc sched/file_upload_handler.cpp
index 3d42d38,3d42d38..2a7a42e
--- a/sched/file_upload_handler.cpp
+++ b/sched/file_upload_handler.cpp
@@@ -138,13 -138,13 +138,13 @@@ int copy_socket_to_file(FILE* in, char
      bytes_left = nbytes - offset;
  
      while (bytes_left > 0) {
--        int n, m, to_write;
++        int m;
  
          m = bytes_left<(double)BLOCK_SIZE ? (int)bytes_left : BLOCK_SIZE;
  
          // try to get m bytes from socket (n>=0 is number actually returned)
          //
--        n = fread(buf, 1, m, in);
++        size_t n = fread(buf, 1, m, in);
  
          // delay opening the file until we've done the first socket read
          // to avoid filesystem lockups (WCG, possible paranoia)
@@@ -210,7 -210,7 +210,7 @@@
  
          // try to write n bytes to file
          //
--        to_write=n;
++        size_t to_write=n;
          while (to_write > 0) {
              ssize_t ret = write(fd, buf+n-to_write, to_write);
              if (ret < 0) {
diff --cc sched/get_file.cpp
index e84f44b,e84f44b..e4abc6f
--- a/sched/get_file.cpp
+++ b/sched/get_file.cpp
@@@ -38,6 -38,6 +38,7 @@@
  
  #include "backend_lib.h"
  #include "str_replace.h"
++#include "filesys.h"
  
  #include "sched_config.h"
  #include "sched_util.h"
diff --cc sched/make_work.cpp
index b8d84c3,b8d84c3..02b9d62
--- a/sched/make_work.cpp
+++ b/sched/make_work.cpp
@@@ -52,6 -52,6 +52,7 @@@ using std::string
  #include "str_replace.h"
  #include "str_util.h"
  #include "svn_version.h"
++#include "filesys.h"
  
  #define LOCKFILE            "make_work.out"
  #define PIDFILE             "make_work.pid"
diff --cc sched/sample_work_generator.cpp
index ea36225,ea36225..1f5a7b7
--- a/sched/sample_work_generator.cpp
+++ b/sched/sample_work_generator.cpp
@@@ -47,6 -47,6 +47,7 @@@
  #include "str_replace.h"
  #include "util.h"
  #include "svn_version.h"
++#include "filesys.h"
  
  #include "sched_config.h"
  #include "sched_util.h"
diff --cc sched/sched_assign.cpp
index 1b1f907,1b1f907..1933e0c
--- a/sched/sched_assign.cpp
+++ b/sched/sched_assign.cpp
@@@ -33,6 -33,6 +33,7 @@@
  #include "crypt.h"
  #include "backend_lib.h"
  #include "error_numbers.h"
++#include "filesys.h"
  
  #include "sched_main.h"
  #include "sched_msgs.h"
diff --cc sched/sched_driver.cpp
index e999a01,e999a01..072161c
--- a/sched/sched_driver.cpp
+++ b/sched/sched_driver.cpp
@@@ -53,9 -53,9 +53,9 @@@
  using std::vector;
  
  struct HOST_DESC{
--    char os_name[256];
--    char p_vendor[256];
--    char p_model[256];
++    char os_name[512];
++    char p_vendor[512];
++    char p_model[512];
  };
  
  vector<HOST_DESC> host_descs;
@@@ -63,7 -63,7 +63,7 @@@ double min_time = 1
  double max_time = 1;
  
  void read_hosts() {
--    char buf[256], buf2[256];
++    char buf[1024], buf2[1024];
      host_descs.clear();
      FILE* f = fopen("host_descs.txt", "r");
      if (!f) {
diff --cc sched/sched_shmem.cpp
index caeb5f7,caeb5f7..e83e1bf
--- a/sched/sched_shmem.cpp
+++ b/sched/sched_shmem.cpp
@@@ -40,6 -40,6 +40,7 @@@ using std::vector
  #include "sched_msgs.h"
  #include "sched_types.h"
  #include "sched_util.h"
++#include "filesys.h"
  
  #include "sched_shmem.h"
  
diff --cc sched/sched_timezone.cpp
index b2c843e,b2c843e..2bf2edf
--- a/sched/sched_timezone.cpp
+++ b/sched/sched_timezone.cpp
@@@ -28,6 -28,6 +28,7 @@@
  
  #include "sched_types.h"
  #include "sched_msgs.h"
++#include "filesys.h"
  #include "sched_config.h"
  
  #ifdef _USING_FCGI_
diff --cc sched/transitioner.cpp
index ca875b5,ca875b5..e9162c8
--- a/sched/transitioner.cpp
+++ b/sched/transitioner.cpp
@@@ -44,7 -44,7 +44,7 @@@
  #include "error_numbers.h"
  #include "str_util.h"
  #include "svn_version.h"
--
++#include "filesys.h"
  #include "sched_config.h"
  #include "credit.h"
  #include "sched_util.h"
diff --cc sched/wu_check.cpp
index 7de20fe,7de20fe..63f7455
--- a/sched/wu_check.cpp
+++ b/sched/wu_check.cpp
@@@ -35,6 -35,6 +35,7 @@@
  #include "error_numbers.h"
  #include "parse.h"
  #include "util.h"
++#include "filesys.h"
  
  #include "sched_config.h"
  #include "sched_util.h"
diff --cc stripchart/stripchart
index db4b6b7,db4b6b7..71e2fcb
--- a/stripchart/stripchart
+++ b/stripchart/stripchart
@@@ -1,4 -1,4 +1,4 @@@
--#!/usr/bin/env perl
++#!/usr/bin/perl
  
  # The contents of this file are subject to the Mozilla Public License
  # Version 1.0 (the "License"); you may not use this file except in
@@@ -47,7 -47,7 +47,7 @@@ $|++
  ################
  
  # Where is the .cnf file?
--$cnfpath = "./stripchart.cnf";
++$cnfpath = "/etc/stripchart.cnf";
  
  # Read it in:
  open (CNFFILE,$cnfpath) or die "cannot open configuration file: $cnfpath\nmake sure this variable is set properly";
diff --cc stripchart/stripchart.cgi
index 26fa9fb,26fa9fb..0ac8a9f
--- a/stripchart/stripchart.cgi
+++ b/stripchart/stripchart.cgi
@@@ -1,4 -1,4 +1,4 @@@
--#! /usr/bin/env perl
++#!/usr/bin/perl
  
  # The contents of this file are subject to the Mozilla Public License
  # Version 1.0 (the "License"); you may not use this file except in
@@@ -44,7 -44,7 +44,7 @@@ use File::Basename
  ################
   
  # Where is the .cnf file? 
--$cnfpath = "./stripchart.cnf";
++$cnfpath = "/etc/stripchart.cnf";
  
  # Read it in: 
  open (CNFFILE,$cnfpath) or die "cannot open configuration file: $cnfpath\nmake sure this variable is set properly"; 
diff --cc stripchart/stripchart.cnf
index 834ee28,834ee28..1d616ec
--- a/stripchart/stripchart.cnf
+++ b/stripchart/stripchart.cnf
@@@ -4,7 -4,7 +4,7 @@@ use Time::Local
  $majorversion = 2; $minorversion = 1;
  
  # Directory where gnuplot is
--$gnuplot = "/usr/local/bin"
++$gnuplot = "/usr/bin"
   
  # Temporary files
  $suffix = rand(10000);
@@@ -38,7 -38,7 +38,7 @@@ $daysecs = 86400
  $tzdiff = timegm($sec,$min,$hour,$mday,$mon,$year) - timelocal($sec,$min,$hour,$mday,$mon,$year);
  
  # Where is the stripchart executable located?
--$stripchartexe = "./stripchart"
++$stripchartexe = "/usr/lib/cgi-bin/stripchart"
   
  # What is the default number of stripcharts?
  $defaultnumcharts = 1;
@@@ -48,11 -48,11 +48,11 @@@ $defaultflags = "-s"
  
  # Where is the list of datafiles for stripchart.cgi?
  # Note: there is a sample copy in the samples directory: 
--$datafilelist = "datafiles";
++$datafilelist = "/usr/share/stripchart/datafiles";
   
--# Where is the list of user-definied cgi queries?
++# Where is the list of user-defined cgi queries?
  # Note: this file gets created by the cgi - must put it somewhere that the cgi user can write to 
--$queryfilelist = "querylist";
++$queryfilelist = "/tmp/querylist";
  
  # What time is it right now?
  $rightnow = time;
diff --cc tools/Makefile.am
index 47bf81d,47bf81d..0abffa3
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@@ -31,11 -31,11 +31,14 @@@ dist_tools_SCRIPTS = 
      manage_privileges \
      run_in_ops \
      stage_file \
--    watch_tcp \
--    project.xml
++    watch_tcp
++
++dist_tools_DATA = \
++    project.xml \
++    gui_urls.xml
  
  AM_CXXFLAGS += $(MYSQL_CFLAGS)
--AM_LDFLAGS += -static
++AM_LDFLAGS += -static -L../sched -L../lib/.libs
  
  cancel_jobs_SOURCES = cancel_jobs.cpp
  cancel_jobs_LDADD = $(SERVERLIBS)
diff --cc tools/create_work.cpp
index 4e27bdf,4e27bdf..e545f61
--- a/tools/create_work.cpp
+++ b/tools/create_work.cpp
@@@ -37,6 -37,6 +37,7 @@@
  #include "sched_config.h"
  #include "str_replace.h"
  #include "util.h"
++#include "filesys.h"
  
  void usage() {
      fprintf(stderr,
diff --cc tools/db_query
index 4852cfa,4852cfa..02aaf54
--- a/tools/db_query
+++ b/tools/db_query
@@@ -1,4 -1,4 +1,4 @@@
--#! /bin/tcsh
++#!/usr/bin/tcsh
  
  set CIVDATE = `date "+%Y:%m:%d:%H:%M"`
  set UNIXDATE = `perl -e 'print time()'`
diff --cc tools/dir_hier_path.cpp
index 30d4d30,30d4d30..fa07c6f
--- a/tools/dir_hier_path.cpp
+++ b/tools/dir_hier_path.cpp
@@@ -29,7 -29,7 +29,7 @@@
  #include "sched_config.h"
  #include "sched_util.h"
  #include "str_util.h"
--
++#include "filesys.h"
  
  const char *usage = 
  "\nUsage: dir_hier_path <filename>\n"
diff --cc tools/make_project
index 99449ed,99449ed..45617bf
--- a/tools/make_project
+++ b/tools/make_project
@@@ -321,6 -321,6 +321,7 @@@ print >>open(httpd_conf_template_filena
      <Directory "%(proot)s/html">
          Options Indexes FollowSymlinks MultiViews
          AllowOverride AuthConfig
++	Require all granted
          Order allow,deny
          Allow from all
      </Directory>
@@@ -328,6 -328,6 +329,7 @@@
      <Directory "%(proot)s/cgi-bin">
          Options ExecCGI
          AllowOverride AuthConfig
++	Require all granted
          Order allow,deny
          Allow from all
      </Directory>
diff --cc tools/update_versions
index 86a89c8,86a89c8..984d671
--- a/tools/update_versions
+++ b/tools/update_versions
@@@ -1,4 -1,4 +1,4 @@@
--#! /usr/bin/env php
++#!/usr/bin/php
  
  <?php
  // This file is part of BOINC.
diff --cc tools/watch_tcp
index 3f4eede,3f4eede..5686014
--- a/tools/watch_tcp
+++ b/tools/watch_tcp
@@@ -1,4 -1,4 +1,4 @@@
--#! /bin/csh 
++#!/usr/bin/tcsh
  # 
  # by jeffc 
  # 
diff --cc vda/Makefile.am
index eccbbfe,eccbbfe..68912cc
--- a/vda/Makefile.am
+++ b/vda/Makefile.am
@@@ -4,7 -4,7 +4,7 @@@ vdadir=$(prefix)/lib/boinc-server-maker
  vda_PROGRAMS = vda vdad ssim
  
  AM_CXXFLAGS += $(MYSQL_CFLAGS)
--AM_LDFLAGS += -static
++AM_LDFLAGS += -static -L../lib/.libs -L../sched
  
  vda_SOURCES = vda.cpp vda_lib.cpp vda_lib2.cpp vda_policy.cpp stats.cpp
  vda_LDADD = $(SERVERLIBS)
diff --cc zip/unzip/ttyio.c
index a1a13b1,a1a13b1..4aeb329
--- a/zip/unzip/ttyio.c
+++ b/zip/unzip/ttyio.c
@@@ -54,6 -54,6 +54,7 @@@
  #  define HAVE_TERMIOS_H
  #endif
  
++#include <unistd.h>	/* defines _POSIX_VERSION */
  #ifdef _POSIX_VERSION
  #  ifndef USE_POSIX_TERMIOS
  #    define USE_POSIX_TERMIOS  /* use POSIX style termio (termios) */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-boinc/boinc.git



More information about the pkg-boinc-commits mailing list