[SCM] BOINC packaging branch, SZTAKI, updated. debian/6.10.17+dfsg-3-291-g2ca3019

Steffen Moeller moeller at debian.org
Sun Jun 12 20:01:14 UTC 2011


The following commit has been merged in the SZTAKI branch:
commit 2ca3019b62c4461df145d0071fc8154a518ff433
Merge: 66af835e490ffe557cecec02fd419cb8cc420936 55484a395a9098cb2859c324c7894631f71b0c28
Author: Steffen Moeller <moeller at debian.org>
Date:   Sun Jun 12 21:59:43 2011 +0200

    Merge branch 'SZTAKI_html_path' into SZTAKI
    
    Also removed the patches from the large diff.gz.

diff --combined SZTAKI_patches_remaining_to_move_into_debian.patch
index 28b7b89,0000000..eab26a8
mode 100644,000000..100644
--- a/SZTAKI_patches_remaining_to_move_into_debian.patch
+++ b/SZTAKI_patches_remaining_to_move_into_debian.patch
@@@ -1,3011 -1,0 +1,1777 @@@
 +--- boinc-server-6.11.0+r18946.orig/Makefile.am
 ++++ boinc-server-6.11.0+r18946/Makefile.am
 +@@ -9,11 +9,11 @@
 + ACLOCAL_AMFLAGS = -I m4
 + 
 + if ENABLE_LIBRARIES
 +-   API_SUBDIRS = api lib
 ++   API_SUBDIRS = lib api
 + endif
 + 
 + if ENABLE_SERVER
 +-   SERVER_SUBDIRS = db test py sched apps tools samples/example_app
 ++   SERVER_SUBDIRS = db test py sched apps tools
 + endif
 + 
 + if ENABLE_CLIENT
 +@@ -37,6 +37,12 @@
 + 	stripchart                                  \
 +     INSTALL										
 + 
 ++nobase_dist_data_DATA =  \
 ++		templates/crontab \
 ++		templates/httpd.conf \
 ++		templates/logrotate.conf \
 ++		templates/readme
 ++
 + if INSTALL_HEADERS
 + pkginclude_HEADERS = \
 +     version.h
 +--- boinc-server-6.11.0+r18946.orig/Makefile.incl
 ++++ boinc-server-6.11.0+r18946/Makefile.incl
 +@@ -6,8 +6,6 @@
 + # ignore any LIBS set by configure
 + LIBS=
 + 
 +-LIBBOINC_VERSION = @LIBBOINC_VERSION@
 +-
 + MYSQL_LIBS = @MYSQL_LIBS@
 + MYSQL_CFLAGS = @MYSQL_CFLAGS@
 + PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 +@@ -56,7 +54,5 @@
 + $(LIBAPI):
 + 	cd $(top_builddir)/api; ${MAKE} libboinc_api.la
 + 
 +-SERVERLIBS = $(LIBSCHED) $(LIBBOINC_CRYPT) $(LIBBOINC) $(MYSQL_LIBS) $(PTHREAD_LIBS) $(RSA_LIBS) $(SSL_LIBS)
 +-SERVERLIBS_FCGI = $(LIBSCHED_FCGI) $(LIBBOINC_CRYPT) $(LIBBOINC_FCGI) -lfcgi $(MYSQL_LIBS) $(PTHREAD_LIBS) $(RSA_LIBS) $(SSL_LIBS)
 + APPLIBS = $(LIBAPI) $(LIBBOINC)
 + 
 +--- boinc-server-6.11.0+r18946.orig/configure.ac
 ++++ boinc-server-6.11.0+r18946/configure.ac
 +@@ -7,8 +7,7 @@
 + 
 + dnl Set the BOINC version here.  You can also use the set-version script.
 + AC_INIT(BOINC, 6.11.0)
 +-LIBBOINC_VERSION=`echo ${PACKAGE_VERSION} | sed 's/\./:/g'`
 +-AC_SUBST([LIBBOINC_VERSION])
 ++AC_CONFIG_MACRO_DIR([m4])
 + 
 + AC_CANONICAL_TARGET
 + 
 +@@ -275,6 +274,20 @@
 + 
 + 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
 +@@ -480,7 +493,6 @@
 + 
 + dnl ---------- decide wether to build the graphical boinc-api libs or not
 + dnl check for X11 
 +-AC_PATH_X
 + AC_PATH_XTRA
 + 
 + dnl check for GL library
 +@@ -858,6 +870,7 @@
 +                  client/scripts/Makefile
 +                  client/scripts/boinc-client
 +                  db/Makefile
 ++		 debian/boinc-server.install
 +                  doc/Makefile
 +                  doc/manpages/Makefile
 +                  lib/Makefile
 +--- boinc-server-6.11.0+r18946.orig/py/Makefile.am
 ++++ boinc-server-6.11.0+r18946/py/Makefile.am
 +@@ -17,7 +17,8 @@
 + 	Boinc/sched_messages.py \
 + 	Boinc/setup_project.py \
 + 	Boinc/tools.py \
 +-	Boinc/util.py
 ++	Boinc/util.py \
 ++	Boinc/Debian.py
 + 
 + $(srcdir)/Boinc/boinc_db.py: $(top_srcdir)/db/boinc_db.h $(top_srcdir)/lib/common_defs.h
 + 	cat $^ | $(top_srcdir)/py/db_def_to_py > $@
 +--- boinc-server-6.11.0+r18946.orig/py/Boinc/tools.py
 ++++ boinc-server-6.11.0+r18946/py/Boinc/tools.py
 +@@ -81,17 +81,8 @@
 +         print 'Signing', executable_path
 +     code_sign_key = os.path.join(config.config.key_dir, 'code_sign_private')
 + 
 +-    # sign_executable could be in bin/ or ../tool/, depending on
 +-    # whether this is a test or an upgrade
 +-
 +-    sign_executable_path = 'bin/sign_executable'
 +-    if not os.path.exists(sign_executable_path):
 +-        sign_executable_path = '../tools/sign_executable'
 +-        if not os.path.exists(sign_executable_path):
 +-            print os.getcwd()
 +-            raise SystemExit("sign_executable not found! did you `make' it?")
 +-    signature_text = os.popen('%s %s %s'%(sign_executable_path,
 +-        executable_path,code_sign_key)).read()
 ++    signature_text = os.popen('sign_executable %s %s' % \
 ++                              (executable_path,code_sign_key)).read()
 +     if not signature_text:
 +         raise SystemExit("Couldn't sign executable %s"%executable_path)
 +     return signature_text
 +--- boinc-server-6.11.0+r18946.orig/py/Boinc/setup_project.py
 ++++ boinc-server-6.11.0+r18946/py/Boinc/setup_project.py
 +@@ -111,6 +111,14 @@
 +         print 'failed to copy ' + src + ' to ' + dest
 +         return
 + 
 ++def install_copy(src, dest, unless_exists = False):
 ++    if unless_exists and os.path.exists(dest):
 ++        return
 ++    try:
 ++        shutil.copy(src, dest)
 ++    except:
 ++        print 'failed to copy ' + src + ' to ' + dest
 ++        return
 + 
 + def install_glob(glob_source, dest, failok=False):
 +     dest = os.path.join(dest, '') # append '/' if necessary
 +@@ -118,6 +126,12 @@
 +         if not os.path.isdir(src):
 +             install(src, dest)
 + 
 ++def install_glob_copy(glob_source, dest, failok=False):
 ++    dest = os.path.join(dest, '') # append '/' if necessary
 ++    for src in glob.glob(glob_source):
 ++        if not os.path.isdir(src):
 ++            install_copy(src, dest)
 ++
 + def macro_substitute(macro, replacement, infile, outfile):
 +     open(outfile, 'w').write(open(infile).read().replace(macro, replacement))
 + def macro_substitute_inplace(macro, replacement, inoutfile):
 +@@ -125,17 +139,6 @@
 +     os.rename(inoutfile, old)
 +     macro_substitute(macro, replacement, old, inoutfile)
 + 
 +-def check_program_exists(prog):
 +-    if not os.path.isfile(prog):
 +-        fatal_error("""
 +-Executable not found: %s
 +-Did you `make' yet?
 +-""" % prog)
 +-def check_core_client_executable():
 +-    check_program_exists(builddir('client', version.CLIENT_BIN_FILENAME))
 +-def check_app_executable(app):
 +-    check_program_exists(builddir('apps', app))
 +-
 + def make_executable(name):
 +     os.chmod(name, 755)
 + def force_symlink(src, dest):
 +@@ -170,15 +173,14 @@
 +def builddir(*dirs):
 +    return apply(os.path.join,(boinc_path_config.TOP_BUILD_DIR,)+dirs)
 + 
 + def run_tool(cmd):
 +-    verbose_shell_call(builddir('tools', cmd))
 ++    verbose_shell_call(cmd)
 + 
 + def _gen_key_p(private_key, public_key):
 +-    shell_call("%s/crypt_prog -genkey 1024 %s %s >/dev/null" % (
 +-        builddir('lib'),
 ++    shell_call("crypt_prog -genkey 1024 %s %s >/dev/null" % (
 +         private_key,
 +         public_key))
 + def _gen_key(key):
 +@@ -252,30 +254,30 @@
 +             pass
 +     map(lambda d: mkdir2(dir(d)),
 +         [   '',
 +-            'cgi-bin',
 +             'bin',
 +-            'py',
 +-            'py/Boinc',
 +             'templates',
 +             'upload',
 +             'download',
 +             'apps',
 ++            'tmp',
 +             'html',
 +             'html/cache',
 +-            'html/inc',
 +             'html/languages',
 +             'html/languages/compiled',
 +-            'html/languages/translations',
 +             'html/languages/project_specific_translations',
 +             'html/ops',
 +             'html/ops/ffmail',
 +             'html/ops/mass_email',
 +             'html/ops/remind_email',
 +-            'html/ops',
 ++            'html/ops/stats',
 +             'html/project',
 +             'html/stats',
 ++            'html/szdg-stat',
 ++            'html/szdg-stat/rrd',
 +             'html/user',
 +             'html/user/img',
 ++            'html/user/stats',
 ++            'html/user/performance',
 +             'html/user_profile',
 +             'html/user_profile/images'
 +         ])
 +@@ -289,9 +291,8 @@
 +     map(lambda d: os.chmod(dir(d), 02770),
 +         [
 +             'upload',
 ++            'tmp',
 +             'html/cache',
 +-            'html/inc',
 +-            'html/languages',
 +             'html/languages/compiled',
 +             'html/user_profile/images'
 +         ])
 +@@ -305,14 +306,15 @@
 + 
 +     create_project_dirs(dest_dir);
 + 
 +-    install_glob(srcdir('html/inc/*.inc'), dir('html/inc/'))
 +-    install_glob(srcdir('html/inc/*.php'), dir('html/inc/'))
 +-    install_glob(srcdir('html/inc/*.dat'), dir('html/inc/'))
 ++    force_symlink(srcdir('html/inc'), dir('html/inc'))
 ++    force_symlink(srcdir('html/languages/translations'), dir('html/languages/translations'))
 ++    force_symlink(libexecdir('cgi-bin'), dir('cgi-bin'))
 ++
 +     install_glob(srcdir('html/ops/*.php'), dir('html/ops/'))
 +     install_glob(srcdir('html/ops/*.inc'), dir('html/ops/'))
 +-    install_glob(srcdir('html/ops/ffmail/sample*'), dir('html/ops/ffmail/'))
 +-    install_glob(srcdir('html/ops/mass_email/sample*'), dir('html/ops/mass_email/'))
 +-    install_glob(srcdir('html/ops/remind_email/sample*'), dir('html/ops/remind_email/'))
 ++    install_glob_copy(srcdir('html/ops/ffmail/sample*'), dir('html/ops/ffmail/'))
 ++    install_glob_copy(srcdir('html/ops/mass_email/sample*'), dir('html/ops/mass_email/'))
 ++    install_glob_copy(srcdir('html/ops/remind_email/sample*'), dir('html/ops/remind_email/'))
 +     install_glob(srcdir('html/user/*.php'), dir('html/user/'))
 +     install_glob(srcdir('html/user/*.inc'), dir('html/user/'))
 +     install_glob(srcdir('html/user/*.css'), dir('html/user/'))
 +@@ -321,56 +323,20 @@
 +     install_glob(srcdir('html/user/*.png'), dir('html/user/img'))
 +     install_glob(srcdir('html/user/*.gif'), dir('html/user/img'))
 +     install_glob(srcdir('html/user/img/*.*'), dir('html/user/img'))
 +-    os.system("rm -f "+dir('html/languages/translations/*'))
 +-    install_glob(srcdir('html/languages/translations/*.po'), dir('html/languages/translations/'))
 + 
 +-    # copy Python stuff
 +-    map(lambda (s): install(srcdir('sched',s), dir('bin',s)),
 +-        [ 'start' ])
 +-    force_symlink(dir('bin', 'start'), dir('bin', 'stop'))
 +-    force_symlink(dir('bin', 'start'), dir('bin', 'status'))
 +-    map(lambda (s): install(srcdir('py/Boinc',s), dir('py/Boinc',s)),
 +-        [ '__init__.py', 'add_util.py', 'boinc_db.py', 'boinc_project_path.py',
 +-          'boincxml.py', 'configxml.py', 'database.py',
 +-          'db_base.py', 'db_mid.py', 'projectxml.py',
 +-          'sched_messages.py', 'tools.py', 'util.py' ])
 +-    print >>open(dir('bin', 'boinc_path_config.py'), 'w'), '''
 +-# Generated by make_project
 +-import sys, os
 +-sys.path.insert(0, os.path.join('%s', 'py'))
 +-''' % dest_dir
 ++    force_symlink(dir('html/user_profile'), dir('html/user/user_profile'))
 ++
 ++    install_glob(srcdir('html/szdg-stat/*.php'), dir('html/szdg-stat'))
 ++    force_symlink(srcdir('html/szdg-stat/include'), dir('html/szdg-stat/include'))
 ++
 ++    # Create empty password file
 ++    open(dir('admin_users.htpasswd'), 'w')
 ++    os.chmod(dir('admin_users.htpasswd'), 0640)
 + 
 +     if web_only:
 +         return
 + 
 +-    # copy backend (C++) programs;
 +-    # rename current web daemons in case they're in use
 +-
 +-    if os.path.isfile(dir('cgi-bin', 'cgi')):
 +-        os.rename(dir('cgi-bin', 'cgi'), dir('cgi-bin', 'cgi.old'))
 +-    if os.path.isfile(dir('cgi-bin', 'file_upload_handler')):
 +-        os.rename(dir('cgi-bin', 'file_upload_handler'), dir('cgi-bin', 'file_upload_handler.old'))
 +-
 +-    map(lambda (s): install(builddir('sched',s), dir('cgi-bin',s)),
 +-        [ 'cgi', 'file_upload_handler'])
 +-    map(lambda (s): install(builddir('sched',s), dir('bin',s)),
 +-        [ 'make_work', 'feeder', 'transitioner',
 +-          'sample_bitwise_validator', 'sample_trivial_validator',
 +-          'file_deleter', 'sample_dummy_assimilator',
 +-          'sample_assimilator', 'sample_work_generator',
 +-          'single_job_assimilator', 
 +-          'assimilator.py', 'pymw_assimilator.py',
 +-          'update_stats', 'db_dump', 'db_purge', 'show_shmem', 'census',
 +-          'delete_file', 'request_file_list', 'get_file', 'send_file' ])
 +-    map(lambda (s): install(srcdir('tools',s), dir('bin',s)),
 +-        [ 'appmgr', 'create_work', 'xadd', 'dbcheck_files_exist', 'run_in_ops',
 +-          'update_versions', 'parse_config', 'grep_logs', 'db_query',
 +-          'watch_tcp', 'sign_executable', 'dir_hier_move',
 +-          'dir_hier_path' ])
 +-    map(lambda (s): install(srcdir('lib',s), dir('bin',s)),
 +-        [ 'crypt_prog' ])
 +-    map(lambda (s): install(srcdir('sched',s), dir('',s)),
 +-        [ 'db_dump_spec.xml' ])
 ++    install_copy(srcdir('db_dump_spec.xml'), dir('db_dump_spec.xml'))
 + 
 + 
 + class Project:
 +@@ -415,6 +381,7 @@
 +         if web_only:
 +             config.no_computing = 1
 + 
 ++        config.httpd_user    = 'www-data'
 +         config.master_url    = master_url or os.path.join(options.html_url , self.short_name , '')
 +         config.download_url  = os.path.join(config.master_url, 'download')
 +         config.cgi_url       = cgi_url or os.path.join(options.cgi_url, self.short_name)
 +@@ -423,7 +390,7 @@
 +         config.upload_dir    = os.path.join(self.project_dir , 'upload')
 +         config.key_dir       = key_dir or os.path.join(self.project_dir , 'keys')
 +         config.app_dir       = os.path.join(self.project_dir, 'apps')
 +-        config.log_dir       = self.project_dir+'log_'+config.host
 ++        config.log_dir       = os.path.join(self.project_dir, 'log_' + config.host)
 +         if production:
 +             config.min_sendwork_interval = 6
 +         self.scheduler_url = os.path.join(config.cgi_url     , 'cgi')
 +@@ -434,21 +401,20 @@
 +     def keydir(self, *dirs):
 +         return apply(os.path.join,(self.config.config.key_dir,)+dirs)
 + 
 +-    def logdir(self):
 +-        return os.path.join(self.project_dir, "log_"+self.config.config.host)
 +-
 +     def create_keys(self):
 +         if not os.path.exists(self.keydir()):
 +-            os.mkdir(self.keydir())
 ++            os.mkdir(self.keydir(), 0750)
 +         _gen_key(self.keydir('upload'))
 +         _gen_key(self.keydir('code_sign'))
 + 
 +     def create_logdir(self):
 +-        os.mkdir(self.logdir())
 +-        os.chmod(self.logdir(), 02770)
 ++        os.mkdir(self.config.config.log_dir)
 ++        os.chmod(self.config.config.log_dir, 02770)
 + 
 +     def query_create_keys(self):
 +-        return query_yesno("Keys don't exist in %s; generate them?"%self.keydir())
 ++        if not options.no_query:
 ++            return query_yesno("Keys don't exist in %s; generate them?"%self.keydir())
 ++        return True
 + 
 +     def keys_exist(self):
 +         keys = ['upload_private', 'upload_public',
 +@@ -457,6 +423,16 @@
 +             if not os.path.exists(self.keydir(key)): return False
 +         return True
 + 
 ++    def install_template(self, src, dst):
 ++        input = open(src, 'r')
 ++        output = open(dst, 'w')
 ++        subst = {}
 ++        subst['project_dir'] = self.project_dir
 ++        subst['short_name'] = self.short_name
 ++        for key in self.config.config.__dict__.keys():
 ++            subst[key] = self.config.config.__dict__[key]
 ++        output.write(input.read() % subst)
 ++
 +     # create new project.  Called only from make_project
 +     def install_project(self, scheduler_file = None):
 +         if os.path.exists(self.dir()):
 +@@ -481,27 +457,26 @@
 +         install_boinc_files(self.dir(), self.web_only)
 + 
 +         # copy sample web files to final names
 +-        install(srcdir('html/user/sample_index.php'),
 ++        install_copy(srcdir('html/user/sample_index.php'),
 +             self.dir('html/user/index.php'))
 +-        install(srcdir('html/project.sample/project.inc'),
 ++        self.install_template(srcdir('html/project.sample/project.inc'),
 +             self.dir('html/project/project.inc'))
 +-        install(srcdir('html/project.sample/project_specific_prefs.inc'),
 ++        install_copy(srcdir('html/project.sample/project_specific_prefs.inc'),
 +             self.dir('html/project/project_specific_prefs.inc'))
 +-        install(srcdir('html/project.sample/project_news.inc'),
 ++        install_copy(srcdir('html/project.sample/project_news.inc'),
 +             self.dir('html/project/project_news.inc'))
 +-        install(srcdir('html/project.sample/cache_parameters.inc'),
 ++        install_copy(srcdir('html/project.sample/cache_parameters.inc'),
 +             self.dir('html/project/cache_parameters.inc'))
 +-        install(srcdir('html/user', 'sample_rss_main.php'),
 ++        install_copy(srcdir('html/user', 'sample_rss_main.php'),
 +             self.dir('html/user/rss_main.php'))
 +-        install(srcdir('html/ops', 'sample_server_status.php'),
 ++        install_copy(srcdir('html/ops', 'sample_server_status.php'),
 +             self.dir('html/user/server_status.php'))
 +-        install(srcdir('tools/project.xml'), self.dir('project.xml'))
 +-        if not self.production:
 +-            install(srcdir('test/uc_result'), self.dir('templates/uc_result'))
 +-            install(srcdir('test/uc_wu_nodelete'), self.dir('templates/uc_wu'))
 ++        install_copy(srcdir('project.xml'), self.dir('project.xml'))
 + 
 +         my_symlink(self.config.config.download_dir, self.dir('html', 'user', 'download'))
 +-        my_symlink('../stats', self.dir('html/user/stats'))
 ++
 ++        self.install_template(srcdir('html/szdg-stat/sample_rrd_config.inc'),
 ++            self.dir('html/szdg-stat/rrd_config.inc'))
 + 
 +         # Copy the sched server in the cgi directory with the cgi names given
 +         # source_dir/html/user/schedulers.txt
 +@@ -521,7 +496,7 @@
 +             f.close()
 +         else:
 +             scheduler_file = 'schedulers.txt'
 +-            f = open(self.dir('html/user', scheduler_file), 'w')
 ++            f = open(self.dir('html/project', scheduler_file), 'w')
 +             print >>f, "<!-- <scheduler>" + self.scheduler_url.strip() + "</scheduler> -->"
 +             print >>f, "<link rel=\"boinc_scheduler\" href=\"" + self.scheduler_url.strip()+ "\">"
 +             f.close()
 +@@ -537,13 +512,9 @@
 + 
 +         self.config.write()
 + 
 +-        # create symbolic links to the CGI and HTML directories
 +-        verbose_echo(1, "Setting up server files: linking cgi programs")
 +-        if options.__dict__.get('cgi_dir'):
 +-            force_symlink(self.dir('cgi-bin'), os.path.join(options.cgi_dir, self.short_name))
 +-        if options.__dict__.get('html_dir'):
 +-            force_symlink(self.dir('html/user'), os.path.join(options.html_dir, self.short_name))
 +-            force_symlink(self.dir('html/ops'), os.path.join(options.html_dir, self.short_name+'_admin'))
 ++        verbose_echo(1, "Creating configuration templates")
 ++        map(lambda d: self.install_template(srcdir('templates/' + d), self.dir(self.short_name + '.' + d)),
 ++            [ 'httpd.conf', 'logrotate.conf', 'crontab', 'readme' ])
 + 
 +     def http_password(self, user, password):
 +         'Adds http password protection to the html/ops directory'
 +@@ -602,20 +573,6 @@
 +     #     self.config_daemons = XXX filter(lambda l: l.find(prog)==-1, self.config_daemons)
 +     #     self.config.write()
 + 
 +-    def start_stripcharts(self):
 +-        map(lambda l: self.copy(os.path.join('stripchart', l), 'cgi-bin/'),
 +-            [ 'stripchart.cgi', 'stripchart', 'stripchart.cnf',
 +-              'looper', 'db_looper', 'datafiles', 'get_load', 'dir_size' ])
 +-        macro_substitute('BOINC_DB_NAME', self.db_name, srcdir('stripchart/samples/db_count'),
 +-                         self.dir('bin/db_count'))
 +-        make_executable(self.dir('bin/db_count'))
 +-
 +-        self._run_sched_prog('looper'    , 'get_load 1'                            , 'get_load')
 +-        self._run_sched_prog('db_looper' , '"result" 1'                            , 'count_results')
 +-        self._run_sched_prog('db_looper' , '"workunit where assimilate_state=2" 1' , 'assimilated_wus')
 +-        self._run_sched_prog('looper'    , '"dir_size ../download" 1'              , 'download_size')
 +-        self._run_sched_prog('looper'    , '"dir_size ../upload" 1'                , 'upload_size')
 +-
 +     def stop(self):
 +         verbose_echo(1,"Stopping server(s) for project '%s'"%self.short_name)
 +         self._run_sched_prog('start', '-v --disable')
 +--- boinc-server-6.11.0+r18946.orig/doc/manpages/Makefile.am
 ++++ boinc-server-6.11.0+r18946/doc/manpages/Makefile.am
 +@@ -13,7 +13,7 @@
 + endif
 + 
 + if ENABLE_SERVER
 +-  SERVER_MANS = appmgr.8
 ++  SERVER_MANS = appmgr.8 confmgr.8
 + endif
 + 
 + man_MANS = $(CLIENT_MANS) $(CLIENTGUI_MANS) $(SERVER_MANS)
 +--- boinc-server-6.11.0+r18946.orig/lib/Makefile.am
 ++++ boinc-server-6.11.0+r18946/lib/Makefile.am
 +@@ -133,60 +133,26 @@
 + 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) -version-number $(LIBBOINC_VERSION)
 +-libboinc_la_LIBADD = 
 ++libboinc_la_LDFLAGS = -rpath $(libdir) -release $(PACKAGE_VERSION)
 ++libboinc_la_LIBADD = -ldl
 + 
 + libboinc_crypt_la_SOURCES = crypt.cpp
 + libboinc_crypt_la_CFLAGS = $(AM_CFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
 + libboinc_crypt_la_CXXFLAGS = $(AM_CXXFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
 +-libboinc_crypt_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
 +-libboinc_crypt_la_LIBADD = $(LIBCURL)
 +-
 ++libboinc_crypt_la_LDFLAGS = -rpath $(libdir) -release $(PACKAGE_VERSION)
 ++libboinc_crypt_la_LIBADD = libboinc.la $(SSL_LIBS)
 + 
 + if ENABLE_FCGI
 + lib_LTLIBRARIES += libboinc_fcgi.la
 ++
 + libboinc_fcgi_la_SOURCES = $(libfcgi_sources) $(mac_sources)
 + libboinc_fcgi_la_CFLAGS = -D_USING_FCGI_ $(AM_CFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
 + libboinc_fcgi_la_CXXFLAGS = -D_USING_FCGI_ $(AM_CXXFLAGS) $(PICFLAGS) $(PTHREAD_CFLAGS)
 +-libboinc_fcgi_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
 +-libboinc_fcgi_la_LIBADD =
 ++libboinc_fcgi_la_LDFLAGS = -rpath $(libdir) -release $(PACKAGE_VERSION)
 ++libboinc_fcgi_la_LIBADD = -lfcgi -ldl
 + endif 
 + # end of "if ENABLE_FCGI"
 + 
 +-# Some OSs may not prefix libraries with lib. 
 +-# For example OS2
 +-if OS_OS2
 +-LIBBOINC_STATIC=boinc.${LIBEXT}
 +-LIBBOINC_CRYPT_STATIC=boinc_crypt.${LIBEXT}
 +-LIBBOINC_FCGI_STATIC=boinc_fcgi.${LIBEXT}
 +-else
 +-LIBBOINC_STATIC=libboinc.${LIBEXT}
 +-LIBBOINC_CRYPT_STATIC=libboinc_crypt.${LIBEXT}
 +-LIBBOINC_FCGI_STATIC=libboinc_fcgi.${LIBEXT}
 +-endif
 +-
 +-
 +-if BUILD_STATIC_LIBS
 +-all_local = $(LIBBOINC_STATIC) $(LIBBOINC_CRTYPT_STATIC)
 +-if ENABLE_FCGI
 +-all_local += $(LIBBOINC_FCGI_STATIC) 
 +-endif
 +-endif
 +-
 +-all-local: $(all_local)
 +-
 +-$(LIBBOINC_STATIC): libboinc.la
 +-	rm -f $(LIBBOINC_STATIC)
 +-	$(LN) .libs/$(LIBBOINC_STATIC) .
 +-
 +-$(LIBBOINC_CRYPT_STATIC): libboinc_crypt.la
 +-	rm -f $(LIBBOINC_CRYPT_STATIC)
 +-	$(LN) .libs/$(LIBBOINC_CRYPT_STATIC)
 +-
 +-$(LIBBOINC_FCGI_STATIC): libboinc_fcgi.la
 +-	rm -f $(LIBBOINC_FCGI_STATIC)
 +-	$(LN) .libs/$(LIBBOINC_FCGI_STATIC) .
 +-
 + endif 
 + # end of "if ENABLE_LIBRARIES"
 + 
 +@@ -205,5 +171,5 @@
 + msg_test_LDADD = $(LIBBOINC)
 + crypt_prog_SOURCES = crypt_prog.cpp 
 + crypt_prog_CXXFLAGS = $(PTHREAD_CFLAGS)
 +-crypt_prog_LDADD = $(LIBBOINC) $(LIBBOINC_CRYPT_STATIC) $(SSL_LIBS) 
 ++crypt_prog_LDADD = $(LIBBOINC) $(LIBBOINC_CRYPT) $(SSL_LIBS)
 + 
 +--- boinc-server-6.11.0+r18946.orig/lib/crypt_prog.cpp
 ++++ boinc-server-6.11.0+r18946/lib/crypt_prog.cpp
 +@@ -52,6 +52,9 @@
 + #include <openssl/engine.h>
 + #include <openssl/err.h>
 + 
 ++#include <sys/types.h>
 ++#include <sys/stat.h>
 ++
 + #include "crypt.h"
 + #include "md5_file.h"
 + 
 +@@ -60,38 +63,6 @@
 +     exit(2);
 + }
 + 
 +-unsigned int random_int() {
 +-    unsigned int n;
 +-#if defined(_WIN32)
 +-#if defined(__CYGWIN32__)
 +-    HMODULE hLib=LoadLibrary((const char *)"ADVAPI32.DLL");
 +-#else
 +-    HMODULE hLib=LoadLibrary("ADVAPI32.DLL");
 +-#endif
 +-    if (!hLib) {
 +-        die("Can't load ADVAPI32.DLL");
 +-    }
 +-    BOOLEAN (APIENTRY *pfn)(void*, ULONG) =
 +-    (BOOLEAN (APIENTRY *)(void*,ULONG))GetProcAddress(hLib,"SystemFunction036");
 +-    if (pfn) {
 +-        char buff[32];
 +-        ULONG ulCbBuff = sizeof(buff);
 +-        if(pfn(buff,ulCbBuff)) {
 +-            // use buff full of random goop
 +-            memcpy(&n,buff,sizeof(n));
 +-        }
 +-    }
 +-    FreeLibrary(hLib);
 +-#else
 +-    FILE* f = fopen("/dev/random", "r");
 +-    if (!f) {
 +-        die("can't open /dev/random\n");
 +-    }
 +-    fread(&n, sizeof(n), 1, f);
 +-#endif
 +-    return n;
 +-}
 +-
 + int main(int argc, char** argv) {
 +     R_RSA_PUBLIC_KEY public_key;
 +     R_RSA_PRIVATE_KEY private_key;
 +@@ -115,6 +86,11 @@
 +         printf("missing command\n");
 +         exit(1);
 +     }
 ++
 ++    OpenSSL_add_all_algorithms();
 ++    ERR_load_crypto_strings();
 ++    ENGINE_load_builtin_engines();
 ++
 +     if (!strcmp(argv[1], "-genkey")) {
 +         if (argc < 5) {
 +             fprintf(stderr, "missing cmdline args\n");
 +@@ -123,11 +99,14 @@
 +         printf("creating keys in %s and %s\n", argv[3], argv[4]);
 +         n = atoi(argv[2]);
 + 
 +-        srand(random_int());
 +         RSA* rp = RSA_generate_key(n,  65537, 0, 0);
 +         openssl_to_keys(rp, n, private_key, public_key);
 ++        // Make sure the private key is not world readable
 ++        mode_t oldmask = umask(0);
 ++        umask(oldmask | S_IROTH | S_IWOTH);
 +         fpriv = fopen(argv[3], "w");
 +         if (!fpriv) die("fopen");
 ++        umask(oldmask);
 +         fpub = fopen(argv[4], "w");
 +         if (!fpub) die("fopen");
 +         print_key_hex(fpriv, (KEY*)&private_key, sizeof(private_key));
 +@@ -247,9 +226,6 @@
 +             kpriv = true;
 +         else
 +             die("either 'pub' or 'priv' must be defined for -convkey\n");
 +-        OpenSSL_add_all_algorithms();
 +-		ERR_load_crypto_strings(); 
 +-		ENGINE_load_builtin_engines();
 + 		if (bio_err == NULL)
 + 		    bio_err = BIO_new_fp(stdout, BIO_NOCLOSE);
 +         //enc=EVP_get_cipherbyname("des");
 +--- boinc-server-6.11.0+r18946.orig/m4/ax_check_glu.m4
 ++++ boinc-server-6.11.0+r18946/m4/ax_check_glu.m4
 +@@ -19,7 +19,7 @@
 +     else
 +       ax_try_lib="${ax_lib}"
 +     fi
 +-    LIBS="-L${prefix}/lib ${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
 ++    LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
 +     #
 +     # libGLU typically links with libstdc++ on POSIX platforms. However,
 +     # setting the language to C++ means that test program source is named
 +@@ -37,7 +37,7 @@
 + # endif
 + # include <GL/glu.h>]],
 +                      [[gluBeginCurve(0)]])],
 +-    [ax_cv_check_glu_libglu="-L${prefix}/lib ${ax_try_lib}"; break])
 ++    [ax_cv_check_glu_libglu="${ax_try_lib}"; break])
 +     if test X$ax_compiler_ms = Xyes; then
 +       AC_LANG_POP([C])
 +     fi
 +--- boinc-server-6.11.0+r18946.orig/m4/ax_check_glut.m4
 ++++ boinc-server-6.11.0+r18946/m4/ax_check_glut.m4
 +@@ -35,7 +35,7 @@
 +     else
 +       ax_try_lib="${ax_lib}"
 +     fi
 +-    LIBS="-L${prefix}/lib ${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}"
 ++    LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}"
 +     AC_LINK_IFELSE(
 +     [AC_LANG_PROGRAM([[
 + # if HAVE_WINDOWS_H && (defined(_WIN32) || defined(CYGWIN_USE_WIN32))
 +@@ -43,7 +43,7 @@
 + # endif
 + # include <GL/glut.h>]],
 +                      [[glutMainLoop()]])],
 +-    [ax_cv_check_glut_libglut="-L${prefix}/lib ${ax_try_lib}"; break])
 ++    [ax_cv_check_glut_libglut="${ax_try_lib}"; break])
 + 
 +   done
 +   LIBS=${ax_save_LIBS}
 +--- boinc-server-6.11.0+r18946.orig/m4/ax_check_gl.m4
 ++++ boinc-server-6.11.0+r18946/m4/ax_check_gl.m4
 +@@ -26,21 +26,8 @@
 + 
 +   AX_LANG_COMPILER_MS
 +   if test X$ax_compiler_ms = Xno; then
 +-    GL_CFLAGS="${PTHREAD_CFLAGS}"
 +-    GL_LIBS="${PTHREAD_LIBS} -lm"
 +-  fi
 +-
 +-  #
 +-  # Use x_includes and x_libraries if they have been set (presumably by
 +-  # AC_PATH_X).
 +-  #
 +-  if test "X$no_x" != "Xyes"; then
 +-    if test -n "$x_includes"; then
 +-      GL_CFLAGS="-I${x_includes} -I${prefix}/include ${GL_CFLAGS}"
 +-    fi
 +-    if test -n "$x_libraries"; then
 +-      GL_LIBS="-L${x_libraries} -L${prefix}/lib -lX11 ${GL_LIBS}"
 +-    fi
 ++    GL_CFLAGS="${X_CFLAGS} ${PTHREAD_CFLAGS}"
 ++    GL_LIBS="${X_LIBS} ${PTHREAD_LIBS} -lm"
 +   fi
 + 
 +   AC_CHECK_HEADERS([windows.h])
 +@@ -58,7 +45,7 @@
 +     else
 +       ax_try_lib="${ax_lib}"
 +     fi
 +-    LIBS="-L${prefix}/lib ${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
 ++    LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
 +     AC_LINK_IFELSE(
 +     [AC_LANG_PROGRAM([[
 + # if HAVE_WINDOWS_H && defined(_WIN32)
 +@@ -66,7 +53,7 @@
 + # endif
 + # include <GL/gl.h>]],
 +                      [[glBegin(0)]])],
 +-    [ax_cv_check_gl_libgl="-L${prefix}/lib ${ax_try_lib}"; break])
 ++    [ax_cv_check_gl_libgl="${ax_try_lib}"; break])
 +   done
 +   LIBS=${ax_save_LIBS}
 +   CPPFLAGS=${ax_save_CPPFLAGS}])
 +--- boinc-server-6.11.0+r18946.orig/tools/Makefile.am
 ++++ boinc-server-6.11.0+r18946/tools/Makefile.am
 +@@ -6,11 +6,17 @@
 + bin_PROGRAMS = create_work sign_executable dir_hier_path dir_hier_move
 + 
 + dist_bin_SCRIPTS = \
 ++		appmgr \
 + 		calculate_credit_multiplier \
 ++		confmgr \
 + 		dbcheck_files_exist \
 + 		grep_logs \
 + 		make_project \
 + 		parse_config \
 ++		update_rrd_data \
 ++		update_rrd_graph \
 ++		update_szdg_performance \
 ++		update_szdg_stats \
 + 		update_versions \
 + 		upgrade \
 + 		vote_monitor \
 +@@ -21,17 +27,16 @@
 + 		makelog.sh \
 + 		run_in_ops
 + 
 ++dist_data_DATA = project.xml
 ++
 + AM_CXXFLAGS += $(MYSQL_CFLAGS)
 +-AM_LDFLAGS += -static
 ++
 ++LDADD = ../sched/libsched.la
 + 
 + create_work_SOURCES = create_work.cpp
 +-create_work_LDADD = $(SERVERLIBS)
 + 
 + sign_executable_SOURCES = sign_executable.cpp
 +-sign_executable_LDADD = $(SERVERLIBS)
 + 
 + dir_hier_path_SOURCES = dir_hier_path.cpp
 +-dir_hier_path_LDADD = $(SERVERLIBS)
 + 
 + dir_hier_move_SOURCES = dir_hier_move.cpp
 +-dir_hier_move_LDADD = $(SERVERLIBS)
 +--- boinc-server-6.11.0+r18946.orig/tools/update_szdg_stats
 ++++ boinc-server-6.11.0+r18946/tools/update_szdg_stats
 +@@ -0,0 +1,16 @@
 ++#!/bin/sh
 ++
 ++cd $HOME/project/html/szdg-stat
 ++
 ++./stat_hosts.php
 ++./chart_hosts.php
 ++
 ++./stat_users.php
 ++./chart_users.php
 ++
 ++./stat_wu_inprogress.php
 ++./chart_wu_inprogress.php
 ++./stat_wu_unsent.php
 ++./chart_wu_unsent.php
 ++./stat_wu_total.php
 ++./chart_wu_total.php
 +--- boinc-server-6.11.0+r18946.orig/tools/vote_monitor
 ++++ boinc-server-6.11.0+r18946/tools/vote_monitor
 +@@ -1,7 +1,16 @@
 + #! /bin/sh 
 +-cd `dirname $0`
 + 
 +-MOD_EMAIL_ADDRESS=`grep POST_REPORT_EMAILS ../html/project/project.inc  | awk -F\" '{print $(NF-1);}'`
 ++CONFIG_XML=
 ++for dir in "$BOINC_PROJECT_DIR" "." ".." "../.."; do
 ++	test -e "$dir/config.xml" && CONFIG_XML="$dir/config.xml"
 ++done
 ++if [ -z "$CONFIG_XML" ]; then
 ++	echo "Could not find config.xml" 1>&2
 ++	exit 1
 ++fi
 ++BOINC_PROJECT_DIR=${BOINC_PROJECT_DIR:-$(dirname "$CONFIG_XML")}
 ++
 ++MOD_EMAIL_ADDRESS=`grep POST_REPORT_EMAILS "$BOINC_PROJECT_DIR"/html/project/project.inc  | awk -F\" '{print $(NF-1);}'`
 + 
 + 
 + while true ; do 
 +@@ -10,10 +19,11 @@
 + msgfile=`mktemp -p /tmp setimods.XXXXXX` || exit 1
 + sec_from_hour=`expr $now % 3600`
 + 
 +-dbhost=`grep db_host ../config.xml | tr '[\<\>]' '[  ]' | head -1 | awk '{print $2}'`
 +-dbuser=`grep db_user ../config.xml | tr '[\<\>]' '[  ]' | head -1 | awk '{print $2}'`
 +-dbname=`grep db_name ../config.xml | tr '[\<\>]' '[  ]' | head -1 | awk '{print $2}'`
 +-MYSQL="mysql -D $dbname -h $dbhost -u $dbuser -N -B"
 ++dbhost=`parse_config db_host`
 ++dbuser=`parse_config db_user`
 ++dbname=`parse_config db_name`
 ++dbpass=`parse_config db_passwd`
 ++MYSQL="mysql -D $dbname -h $dbhost -u $dbuser --password='$dbpass' -N -B"
 + 
 + nmods=`$MYSQL --execute="select count(userid) from forum_preferences where special_user like '1%'"`
 + major=`expr $nmods / 2`
 +--- boinc-server-6.11.0+r18946.orig/tools/upgrade
 ++++ boinc-server-6.11.0+r18946/tools/upgrade
 +@@ -6,7 +6,7 @@
 + Usage: upgrade [options] project_name
 + Options:
 +   --project_root    default: HOME/projects/
 +-  --srcdir          default: current directory
 ++  --srcdir          default: /usr/share/boinc-server
 + 
 + Copy source/build files to a project tree,
 + overwriting what's already there.
 +@@ -35,7 +35,7 @@
 + 
 + options.project_root = os.path.join(home, 'projects')
 + options.web_only = False
 +-options.srcdir = None
 ++options.srcdir = '/usr/share/boinc-server'
 + 
 + for o,a in opts:
 +     if o == '--help':   usage()
 +@@ -74,12 +74,6 @@
 + 
 + print "Upgrading files... done"
 + 
 +-svn_version_file = INSTALL_DIR+'/local.revision'
 +-try:
 +-    os.system('/bin/sh -c /usr/bin/svnversion > '+svn_version_file)
 +-except:
 +-    print '''Couldn't find svnversion'''
 +-
 + try:
 +     os.system('cd '+INSTALL_DIR+'/html/ops; ./update_translations.php -d 1')
 + except:
 +--- boinc-server-6.11.0+r18946.orig/tools/calculate_credit_multiplier
 ++++ boinc-server-6.11.0+r18946/tools/calculate_credit_multiplier
 +@@ -7,21 +7,22 @@
 + FILE_DELETE_DONE=2
 + FILE_DELETE_ERROR=3
 + 
 +-dbhost=`grep db_host ../config.xml | tr '[\<\>]' '[  ]' | head -1 | awk '{print $2}'`
 +-replica_dbhost=`grep replica_db_host ../config.xml | tr '[\<\>]' '[  ]' | head -1 | awk '{print $2}'`
 +-dbuser=`grep db_user ../config.xml | tr '[\<\>]' '[  ]' | head -1 | awk '{print $2}'`
 +-dbname=`grep db_name ../config.xml | tr '[\<\>]' '[  ]' | head -1 | awk '{print $2}'`
 ++dbhost=`parse_config db_host`
 ++replica_dbhost=`parse_config replica_db_host`
 ++dbuser=`parse_config db_user`
 ++dbname=`parse_config db_name`
 ++dbpass=`parse_config db_passwd`
 + 
 + if test ! -z "${replica_dbhost}" ; then
 +-  slave_gap=`mysql -E -h ${replica_dbhost} --execute="show slave status" | grep Seconds_Behind_Master | awk '{print $2}'`
 ++  slave_gap=`mysql -E -h ${replica_dbhost} --password="$dbpass" --execute="show slave status" | grep Seconds_Behind_Master | awk '{print $2}'`
 + fi
 + 
 + if test -z "${replica_dbhost}" || test "$slave_gap" = "NULL" || test $slave_gap -gt $RUN_INCREMENT ; then
 +   replica_dbhost=${dbhost}
 + fi
 + 
 +-MYSQL="mysql -D $dbname -h $dbhost -u $dbuser -N -B"
 +-MYSQL_R="mysql -D $dbname -h $replica_dbhost -u $dbuser -N -B"
 ++MYSQL="mysql -D $dbname -h $dbhost -u $dbuser --password='$dbpass' -N -B"
 ++MYSQL_R="mysql -D $dbname -h $replica_dbhost -u $dbuser --password='$dbpass' -N -B"
 + 
 + function median_host_query() {
 +   $MYSQL --execute="
 +--- boinc-server-6.11.0+r18946.orig/tools/update_rrd_data
 ++++ boinc-server-6.11.0+r18946/tools/update_rrd_data
 +@@ -0,0 +1,6 @@
 ++#!/bin/sh
 ++
 ++cd $HOME/project/html/szdg-stat
 ++
 ++./rrd_result.php
 ++./rrd_host.php
 +--- boinc-server-6.11.0+r18946.orig/tools/backend_lib.cpp
 ++++ boinc-server-6.11.0+r18946/tools/backend_lib.cpp
 +@@ -187,9 +187,9 @@
 + ) {
 +     char* p;
 +     char buf[BLOB_SIZE], md5[33], path[256], url[256], top_download_path[256];
 +-    string out, cmdline;
 ++    string out, cmdline, md5str, urlstr;
 +     int retval, file_number;
 +-    double nbytes;
 ++    double nbytes, nbytesdef;
 +     char open_name[256];
 +     bool found=false;
 +     int nfiles_parsed = 0;
 +@@ -198,7 +198,8 @@
 +     for (p=strtok(tmplate, "\n"); p; p=strtok(0, "\n")) {
 +         if (match_tag(p, "<file_info>")) {
 +             bool generated_locally = false;
 +-            file_number = -1;
 ++            file_number = nbytesdef = -1;
 ++            md5str = urlstr = "";
 +             out += "<file_info>\n";
 +             while (1) {
 +                 p = strtok(0, "\n");
 +@@ -207,7 +208,20 @@
 +                     continue;
 +                 } else if (parse_bool(p, "generated_locally", generated_locally)) {
 +                     continue;
 ++                } else if (parse_str(p, "<url>", urlstr)) {
 ++                    continue;
 ++                } else if (parse_str(p, "<md5_cksum>", md5str)) {
 ++                    continue;
 ++                } else if (parse_double(p, "<nbytes>", nbytesdef)) {
 ++                    continue;
 +                 } else if (match_tag(p, "</file_info>")) {
 ++                   if (nbytesdef != -1 || md5str != "" || urlstr != "") {
 ++                        if (nbytesdef == -1 || md5str == "" || urlstr == "") {
 ++                            fprintf(stderr, "All file properties must be defined "
 ++                                "if at least one defined (url, md5_cksum, nbytes)!\n");
 ++                            return ERR_XML_PARSE;
 ++                        }
 ++                    }
 +                     if (file_number < 0) {
 +                         fprintf(stderr, "No file number found\n");
 +                         return ERR_XML_PARSE;
 +@@ -227,7 +241,7 @@
 +                             "</file_info>\n",
 +                             infiles[file_number]
 +                         );
 +-                    } else {
 ++                    } else if (nbytesdef == -1) {
 +                         dir_hier_path(
 +                             infiles[file_number], config_loc.download_dir,
 +                             config_loc.uldl_dir_fanout, path, true
 +@@ -270,6 +284,18 @@
 +                             md5,
 +                             nbytes
 +                         );
 ++                    } else {
 ++                        sprintf(buf,
 ++                            "    <name>%s</name>\n"
 ++                            "    <url>%s</url>\n"
 ++                            "    <md5_cksum>%s</md5_cksum>\n"
 ++                            "    <nbytes>%.0f</nbytes>\n"
 ++                            "</file_info>\n",
 ++                            infiles[file_number],
 ++                            urlstr.c_str(),
 ++                            md5str.c_str(),
 ++                            nbytesdef
 ++                        );
 +                     }
 +                     out += buf;
 +                     break;
 +--- boinc-server-6.11.0+r18946.orig/tools/make_project
 ++++ boinc-server-6.11.0+r18946/tools/make_project
 +@@ -35,7 +35,7 @@
 +    --drop_db_first      drop database first (from prev installation)
 +    --test_app           install test application
 +    --web_only           install web files, no executables (for Bossa, Bolt)
 +-   --srcdir             where to find the source files (default: current directory)
 ++   --srcdir             where to find the source files (default: /usr/share/boinc-server)
 + 
 + Dir-options:
 +    --project_root       default: HOME/projects/PROJECT
 +@@ -43,7 +43,6 @@
 +    --url_base           default: http://$NODENAME/ (http://%(NODENAME)s/)
 + 
 +    --html_user_url      default: URL_BASE/PROJECT/
 +-   --html_ops_url       default: URL_BASE/PROJECT_ops/
 +    --cgi_url            default: URL_BASE/PROJECT_cgi/
 + 
 + Other:
 +@@ -86,7 +85,6 @@
 +             'project_root=',
 +             'url_base=',
 +             'html_user_url=',
 +-            'html_ops_url=',
 +             'cgi_url=',
 +             'db_name=',
 +             'db_user=',
 +@@ -102,7 +100,7 @@
 + options.test_app = False
 + options.web_only = False
 + options.delete_prev_inst = False
 +-options.srcdir = None
 ++options.srcdir = '/usr/share/boinc-server'
 + 
 + for o,a in opts:
 +     if o == '-h' or o == '--help':        usage()
 +@@ -119,7 +117,6 @@
 +     elif o == '--project_root':  options.project_root   = a
 +     elif o == '--url_base':      options.url_base       = a
 +     elif o == '--html_user_url': options.html_user_url  = a
 +-    elif o == '--html_ops_url':  options.html_ops_url   = a
 +     elif o == '--cgi_url':       options.cgi_url        = a
 +     elif o == '--db_name':       options.db_name        = a
 +     elif o == '--db_user':       options.db_user        = a
 +@@ -166,7 +163,6 @@
 +     syntax_error('url_base needs to be an URL')
 + 
 + defopt('html_user_url' , 'URL_BASE/PROJECT')
 +-defopt('html_ops_url'  , 'URL_BASE/PROJECT_ops')
 + defopt('cgi_url'       , 'URL_BASE/PROJECT_cgi')
 + 
 + defopt('user_name'     , USER, isdir=False)
 +@@ -183,7 +179,6 @@
 +     'project_root',
 +     'url_base',
 +     'html_user_url',
 +-    'html_ops_url',
 +     'cgi_url',
 +     'key_dir',
 +     'db_name',
 +@@ -209,12 +204,12 @@
 +     if not query_yesno("Continue?"):
 +         raise SystemExit('Aborted')
 + 
 +-options.install_method = 'copy'
 ++options.install_method = 'symlink'
 + init()
 + project = Project(
 +     project_shortname,
 +     project_longname,
 +-    project_dir = options.project_root,
 ++    project_dir = delete_slash(options.project_root),
 +     master_url = options.html_user_url,
 +     cgi_url = options.cgi_url,
 +     key_dir = options.key_dir,
 +@@ -279,21 +274,33 @@
 + t.cmd = 'run_in_ops ./notify.php'
 + t.disabled = 1
 + 
 +-project.config.write()
 ++t = project.config.tasks.make_node_and_append("task")
 ++t.period = '1 hour'
 ++t.output = 'update_szdg_performance.out'
 ++t.cmd = 'update_szdg_performance'
 ++t.disabled = 1
 + 
 ++t = project.config.tasks.make_node_and_append("task")
 ++t.period = '12 hours'
 ++t.output = 'update_szdg_stats.out'
 ++t.cmd = 'update_szdg_stats'
 ++t.disabled = 1
 + 
 +-svn_version_file = proot+'/local.revision'
 +-try:
 +-    cmd = '/bin/sh -c \'/usr/bin/svnversion ' + options.srcdir + '\' > '+svn_version_file
 +-    os.system(cmd)
 +-except:
 +-    print '''Couldn't find svnversion'''
 ++t = project.config.tasks.make_node_and_append("task")
 ++t.period = '30 minutes'
 ++t.output = 'update_rrd_data.out'
 ++t.cmd = 'update_rrd_data'
 ++t.disabled = 1
 + 
 +-try:
 +-    cmd = '/bin/sh -c \'/usr/bin/svnversion ' + options.srcdir + '\' > '+proot+'/db_revision'
 +-    os.system(cmd)
 +-except:
 +-    print '''Couldn't find svnversion'''
 ++t = project.config.tasks.make_node_and_append("task")
 ++t.period = '30 minutes'
 ++t.output = 'update_rrd_graph.out'
 ++t.cmd = 'update_rrd_graph'
 ++t.disabled = 1
 ++
 ++project.config.write()
 ++
 ++shutil.copy('/usr/share/boinc-server/db_revision', proot + '/db_revision')
 + 
 + try:
 +     os.system('cd '+proot+'/html/ops; ./update_translations.php -d 1')
 +@@ -316,106 +323,4 @@
 +     shutil.copy('uc_wu', proot+'/templates/')
 +     shutil.copy('../tools/create_work_example', proot+'/bin/')
 + 
 +-httpd_conf_template_filename = os.path.join(
 +-    options.project_root,
 +-    project_shortname+'.httpd.conf'
 +-    )
 +-
 +-html_user_url = options.html_user_url
 +-html_ops_url = options.html_ops_url
 +-
 +-print >>open(httpd_conf_template_filename,'w'), '''
 +-
 +-    ## Settings for BOINC project %(project_longname)s
 +-
 +-    Alias /%(project_shortname)s %(proot)s/html/user
 +-    Alias /%(project_shortname)s_ops %(proot)s/html/ops
 +-    ScriptAlias /%(project_shortname)s_cgi %(proot)s/cgi-bin
 +-
 +-    # Note: projects/*/keys/ should NOT be readable!
 +-
 +-    <Directory "%(proot)s/html">
 +-        Options Indexes FollowSymlinks MultiViews
 +-        AllowOverride AuthConfig
 +-        Order allow,deny
 +-        Allow from all
 +-    </Directory>
 +-
 +-    <Directory "%(proot)s/cgi-bin">
 +-        Options ExecCGI
 +-        AllowOverride AuthConfig
 +-        Order allow,deny
 +-        Allow from all
 +-    </Directory>
 +-''' %locals()
 +-
 +-cronjob_filename = os.path.join(
 +-    options.project_root,
 +-    project_shortname+'.cronjob'
 +-    )
 +-print >>open(cronjob_filename,'w'), '''
 +-0,5,10,15,20,25,30,35,40,45,50,55 * * * * %(proot)s/bin/start --cron
 +-'''%locals()
 +-
 +-readme_filename = os.path.join(
 +-    options.project_root,
 +-    project_shortname+'.readme'
 +-    )
 +-
 +-test_app_msg = ''
 +-if options.test_app:
 +-    test_app_msg = '''
 +--  The project is configured with a test application.
 +-   To install this application (recommended) run:
 +-        cd %(proot)s
 +-        bin/xadd
 +-        bin/update_versions
 +-'''%locals()
 +-    
 +-print >>open(readme_filename,'w'), '''
 +-Steps to complete installation:
 +-
 +--  Change Apache configuration (as root):
 +-
 +-   cat %(httpd_conf_template_filename)s >> /etc/apache/httpd.conf
 +-
 +-   (path to httpd.conf varies; try /etc/httpd/)
 +-   Then restart the web server:
 +-
 +-   /usr/sbin/apache2ctl restart
 +-   (or /usr/sbin/apachectl restart)
 +-
 +--  Add to crontab (as %(USER)s)
 +-
 +-    0,5,10,15,20,25,30,35,40,45,50,55 * * * * %(proot)s/bin/start --cron
 +-
 +-   (If cron cannot run "start", try using a helper script to set PATH and
 +-   PYTHONPATH)
 +-%(test_app_msg)s
 +-
 +--  In the project home directory (%(proot)s) run
 +-    bin/xadd
 +-
 +-To start, show status, and stop the project, run:
 +-    bin/start
 +-    bin/status
 +-    bin/stop
 +-
 +-The project's URLs are:
 +-Home page (and master URL): %(html_user_url)s
 +-Administrative page:        %(html_ops_url)s
 +-
 +-----------------------------
 +-
 +-To use this project for your own computations, you'll need to
 +-- Port your application(s) and add them
 +-- Develop programs to submit and handle jobs
 +-See the online documentation at http://boinc.berkeley.edu/
 +-
 +-'''%locals()
 +-
 +-print '''
 +-Done creating project.  Please view
 +-%(readme_filename)s
 +-for important additional instructions.
 +-'''%locals()
 ++print "Done creating project."
 +--- boinc-server-6.11.0+r18946.orig/tools/update_szdg_performance
 ++++ boinc-server-6.11.0+r18946/tools/update_szdg_performance
 +@@ -0,0 +1,6 @@
 ++#!/bin/sh
 ++
 ++cd $HOME/project/html/szdg-stat
 ++
 ++./stat_performance.php
 ++./chart_performance.php
 +--- boinc-server-6.11.0+r18946.orig/tools/update_rrd_graph
 ++++ boinc-server-6.11.0+r18946/tools/update_rrd_graph
 +@@ -0,0 +1,6 @@
 ++#!/bin/sh
 ++
 ++cd $HOME/project/html/szdg-stat
 ++
 ++./rrd_result.php graph
 ++./rrd_host.php graph
 +--- boinc-server-6.11.0+r18946.orig/api/Makefile.am
 ++++ boinc-server-6.11.0+r18946/api/Makefile.am
 +@@ -35,12 +35,14 @@
 + 
 + lib_LTLIBRARIES = libboinc_api.la
 + libboinc_api_la_SOURCES = $(api_files)
 +-libboinc_api_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
 ++libboinc_api_la_LDFLAGS = -rpath $(libdir) -release $(PACKAGE_VERSION)
 ++libboinc_api_la_LIBADD = ../lib/libboinc.la $(PTHREAD_LIBS)
 + if BUILD_GRAPHICS_API
 + lib_LTLIBRARIES += libboinc_graphics2.la
 + libboinc_graphics2_la_SOURCES = $(graphics2_files)
 + libboinc_graphics2_la_CPPFLAGS = -I$(top_srcdir)/lib 
 +-libboinc_graphics2_la_LDFLAGS = -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
 ++libboinc_graphics2_la_LDFLAGS = -rpath $(libdir) -release $(PACKAGE_VERSION)
 ++libboinc_graphics2_la_LIBADD = libboinc_api.la ../lib/libboinc.la $(GLUT_LIBS) -ljpeg $(PTHREAD_LIBS)
 + endif #BUILD_GRAPHICS_API
 + 
 + if INSTALL_HEADERS
 +@@ -51,35 +53,6 @@
 + 	gutil.h
 + endif ## INSTALL_HEADERS
 + 
 +-# Some OSs may not prefix libraries with lib. 
 +-# For example OS2
 +-if OS_OS2
 +-LIBBOINC_API_STATIC=boinc_api.${LIBEXT}
 +-LIBBOINC_GRAPHICS2_STATIC=boinc_graphics2.${LIBEXT}
 +-else
 +-LIBBOINC_API_STATIC=libboinc_api.${LIBEXT}
 +-LIBBOINC_GRAPHICS2_STATIC=libboinc_graphics2.${LIBEXT}
 +-endif
 +-
 +-
 +-if BUILD_STATIC_LIBS
 +-all_local = $(LIBBOINC_API_STATIC)
 +-if BUILD_GRAPHICS_API
 +-all_local += $(LIBBOINC_GRAPHICS2_STATIC)
 +-endif
 +-endif
 +-
 +-all-local: $(all_local)
 +-
 +-$(LIBBOINC_API_STATIC): libboinc_api.la
 +-	rm -f $(LIBBOINC_API_STATIC)
 +-	$(LN) .libs/$(LIBBOINC_API_STATIC) .
 +-
 +-$(LIBBOINC_GRAPHICS2_STATIC): libboinc_graphics2.la
 +-	rm -f $(LIBBOINC_GRAPHICS2_STATIC)
 +-	$(LN) .libs/$(LIBBOINC_GRAPHICS2_STATIC) .
 +-
 +-
 + endif ## ENABLE_LIBRARIES
 + 
 + .PHONY:
 +--- boinc-server-6.11.0+r18946.orig/db/Makefile.am
 ++++ boinc-server-6.11.0+r18946/db/Makefile.am
 +@@ -8,5 +8,16 @@
 + pkginclude_HEADERS =  boinc_db.h db_base.h
 + endif
 + 
 ++if ENABLE_SERVER
 ++dbdir = $(datadir)/db
 ++dist_db_DATA = \
 ++	bolt_constraints.sql \
 ++	bolt_schema.sql \
 ++	bossa_constraints.sql \
 ++	bossa_schema.sql \
 ++	constraints.sql \
 ++	schema.sql
 ++endif
 ++
 + ## other stuff to go into the distribution
 +-EXTRA_DIST = constraints.sql schema.sql init_db
 ++EXTRA_DIST = init_db
 +--- boinc-server-6.11.0+r18946.orig/db/constraints.sql
 ++++ boinc-server-6.11.0+r18946/db/constraints.sql
 +@@ -66,9 +66,15 @@
 +     add index res_hostid_id (hostid, id desc),
 +         -- html_user/results.php
 + 
 +-    add index res_wu_user (workunitid, userid);
 ++    add index res_wu_user (workunitid, userid),
 +         -- scheduler (avoid sending mult results of same WU to one user)
 + 
 ++    add index ind_received_time (received_time),
 ++        -- for statistics: performance
 ++
 ++    add index ind_hostid (hostid);
 ++        -- for statistics: performance
 ++
 + alter table msg_from_host
 +     add index message_handled (handled);
 +         -- for message handler
- --- boinc-server-6.11.0+r18946.orig/html/ops/profile_screen_form.php
- +++ boinc-server-6.11.0+r18946/html/ops/profile_screen_form.php
- @@ -20,7 +20,7 @@
-  require_once("../inc/text_transform.inc");
-  require_once("../inc/profile.inc");
-  require_once("../inc/util_ops.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  db_init();
-  
- --- boinc-server-6.11.0+r18946.orig/html/ops/remind.php
- +++ boinc-server-6.11.0+r18946/html/ops/remind.php
- @@ -99,9 +99,10 @@
-      }
-  }
-  
- -require_once('../project/project.inc');
-  require_once("../inc/db.inc");
-  require_once("../inc/email.inc");
- +require_once("../inc/util_ops.inc");
- +require_once(html_path('project/project.inc'));
-  
-  db_init();
-  set_time_limit(0);
- --- boinc-server-6.11.0+r18946.orig/html/ops/notify.php
- +++ boinc-server-6.11.0+r18946/html/ops/notify.php
- @@ -28,8 +28,8 @@
-  //
-  
-  require_once("../inc/boinc_db.inc");
- -require_once("../inc/util.inc");
- -require_once("../project/project.inc");
- +require_once("../inc/util_ops.inc");
- +require_once(html_path("project/project.inc"));
-  
-  // delete notifications older than 90 days
-  //
- @@ -62,6 +62,8 @@
-      $query = "select notify.* from DBNAME.notify, DBNAME.forum_preferences where forum_preferences.pm_notification=2 and notify.userid = forum_preferences.userid and notify.create_time > $t";
-  
-      $notifies = BoincNotify::enum_general($query);
- +    if (!isset($notifies))
- +        return;
-      $userid = 0;
-      $message = "";
-      $i = 1;
- --- boinc-server-6.11.0+r18946.orig/html/ops/team_import.php
- +++ boinc-server-6.11.0+r18946/html/ops/team_import.php
- @@ -24,7 +24,7 @@
-  require_once("../inc/user.inc");
-  require_once("../inc/team.inc");
-  require_once("../inc/email.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  if (defined('INVITE_CODES')) {
-      echo "Account creation is protected by invitation codes, so not importing teams";
- --- boinc-server-6.11.0+r18946.orig/html/ops/show_hosts.php
- +++ boinc-server-6.11.0+r18946/html/ops/show_hosts.php
- @@ -0,0 +1,39 @@
- +<?php
- +$sImageDir = "stats/";
- +$htInterval = $_GET['i'];
- +switch ($htInterval) {
- + case '31days':
- +    $sInterval = '31days';
- +    $sTitle = "Host activity for the last 31 days";
- +    break;
- + case '1hour':
- +    $sInterval = '1hour';
- +    $sTitle = "Host activity for the last hour";
- +    break;
- + case '1week':
- + default:
- +    $sInterval = '1week';
- +    $sTitle = "Host activity during the last 1 week";
- +}
- +?>
- +<html>
- +     <head>
- +          <meta http-equiv="refresh" content="180">
- +          <title><?=$sTitle?></title>
- +          <link rel="stylesheet" type="text/css" href="../szdg-stat.css" />
- +     </head>
- +<body>
- +     <div class="menu">
- +           <a href="hostinfo.php">Back</a>
- +     </div>
- +<?
- +$sFilename = $sImageDir. "show_hosts_". $sInterval. ".html";
- +if (is_dir($sImageDir) && is_file($sFilename) ) {
- +  include $sFilename;
- +} else {
- +  echo "No diagrams yet.";
- +}
- +?>
- +
- +      </body>
- +</html>
- --- boinc-server-6.11.0+r18946.orig/html/ops/sample_server_status.php
- +++ boinc-server-6.11.0+r18946/html/ops/sample_server_status.php
- @@ -85,7 +85,7 @@
-  //
-  function daemon_status($host, $pidname, $progname, $disabled) {
-      global $ssh_exe, $ps_exe, $project_host;
- -    $path = "../../pid_$host/$pidname.pid";
- +    $path = project_path("pid_$host/$pidname.pid");
-      $running = 0;
-      if (is_file($path)) {
-          $pid = file_get_contents($path);
- @@ -171,7 +171,7 @@
-  }
-  $uldl_pid = parse_element($config_vars,"<uldl_pid>");
-  if ($uldl_pid == "") {
- -    $uldl_pid = "/etc/httpd/run/httpd.pid";
- +    $uldl_pid = "/var/run/apache2.pid";
-  }
-  $uldl_host = parse_element($config_vars,"<uldl_host>");
-  if ($uldl_host == "") {
- @@ -186,18 +186,11 @@
-      $ps_exe = "/bin/ps";
-  }
-  
- -$version = null;
- -if (file_exists("../../local.revision")) {
- -    $version = trim(file_get_contents("../../local.revision"));
- -}
-  $now = time();
-  
-  $xmlstring = "<server_status>
-    <update_time>$now</update_time>
-  ";
- -if ($version) {
- -    $xmlstring .= "<software_version>$version</software_version>\n";
- -}
-  $xmlstring .= "  <daemon_status>\n";
-  if ($xml) {
-      xml_header();
- @@ -207,9 +200,6 @@
-          fwrite($xmloutfile,$xmlstring);
-      }
-      page_head("Server status page");
- -    if ($version) {
- -        echo "Server software version: $version<p>\n";
- -    }
-      echo time_str(time()), "
-          <table width=100%>
-          <tr>
- @@ -225,9 +215,7 @@
-  // otherwise it will be already set to 1 for "enabled."
-  // Set $www_host to the name of server hosting WWW site.
-  //
- -$web_running = !file_exists("../../stop_web");
- -if ($web_running == 0) $web_running = -1;
- -show_status($www_host, "data-driven web pages", $web_running);
- +show_status($www_host, "data-driven web pages", !web_stopped());
-  
-  // Check for httpd.pid file of upload/download server.
-  //
- @@ -235,8 +223,7 @@
-  if ($uldl_running == 0) $uldl_running = -1;
-  show_status($uldl_host, "upload/download server", $uldl_running);
-  
- -$sched_running = !file_exists("../../stop_sched");
- -show_status($sched_host, "scheduler", $sched_running);
- +show_status($sched_host, "scheduler", !sched_stopped());
-  
-  // parse through config.xml to get all daemons running
-  //
- --- boinc-server-6.11.0+r18946.orig/html/ops/manage_user.php
- +++ boinc-server-6.11.0+r18946/html/ops/manage_user.php
- @@ -33,7 +33,7 @@
-  require_once("../inc/forum.inc");
-  require_once("../inc/util_ops.inc");
-  require_once("../inc/profile.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  db_init();
-  
- --- boinc-server-6.11.0+r18946.orig/html/ops/repair_profile_pictures.php
- +++ boinc-server-6.11.0+r18946/html/ops/repair_profile_pictures.php
- @@ -10,8 +10,8 @@
-  
-  foreach ($profiles as $p) {
-      $id = $p->userid;
- -    $path = "../user_profile/images/$id.jpg";
- -    $smpath = "../user_profile/images/".$id."_sm.jpg";
- +    $path = html_path("user_profile/images/$id.jpg");
- +    $smpath = html_path("user_profile/images/".$id."_sm.jpg");
-      $has_pic = file_exists($path);
-      $has_pic_sm = file_exists($smpath);
-      if ($p->has_picture) {
- --- boinc-server-6.11.0+r18946.orig/html/ops/index.php
- +++ boinc-server-6.11.0+r18946/html/ops/index.php
- @@ -19,11 +19,10 @@
-  require_once("../inc/db_ops.inc");
-  require_once("../inc/util_ops.inc");
-  require_once("../inc/uotd.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  $config = get_config();
-  $cgi_url = parse_config($config, "<cgi_url>");
- -$stripchart_cgi_url = parse_config($config, "<stripchart_cgi_url>");
-  
-  db_init();
-  
- @@ -33,56 +32,6 @@
-  // Notification area
-  echo "<ul>\n";
-  
- -echo "<li>";
- -if (file_exists("../../local.revision")) {
- -    $local_rev = file_get_contents("../../local.revision");
- -}
- -if ($local_rev) {
- -    echo "Currently used SVN revision: ".$local_rev."; ";
- -}
- -
- -if (file_exists("../cache/remote.revision")
- -    && (time() < filemtime("../cache/remote.revision")+(24*60*60))
- -) {
- -    $remote_rev = file_get_contents("../cache/remote.revision");
- -} else {
- -    // Get latest revision
- -    if (isset($project_http_proxy)) {
- -        $context = stream_context_create(
- -            array(
- -                'http' => array(
- -                    'request_fulluri' => true,
- -                    'proxy' => $project_http_proxy
- -                )
- -            )
- -        );
- -        $handle = fopen("http://boinc.berkeley.edu/svn/", "r", false, $context);
- -    } else {
- -        $handle = fopen("http://boinc.berkeley.edu/svn/", "r");
- -    }
- -    if ($handle) {
- -        $remote = fread($handle, 255);
- -        fclose($handle);
- -        preg_match("/Revision (\d+)/", $remote, $remote_rev);
- -        $remote_rev = $remote_rev[1];
- -
- -        $handle = fopen("../cache/remote.revision", "w");
- -        fwrite($handle, $remote_rev);
- -        fclose($handle);
- -    } else {
- -        echo "Can't get latest SVN revision";
- -    }
- -}
- -
- -if ($remote_rev) {
- -    echo "Latest SVN revision: ".$remote_rev."</li>\n";
- -}
- -
- -if (!file_exists(".htaccess")) {
- -    echo "<li><span style=\"color: #ff0000\">The Project Management directory is not
- -        protected from public access by a .htaccess file.</span></li>\n";
- -}
- -
-  if (!defined("SYS_ADMIN_EMAIL")) {
-      echo "<li><span style=\"color: #ff0000\">The defined constant SYS_ADMIN_EMAIL
-          has not been set. Please edit <tt>project/project.inc</tt> and set this
- @@ -218,9 +167,9 @@
-  // Stripcharts, logs, etc
-  
-  echo "<div>
- -    <a href=\"$stripchart_cgi_url/stripchart.cgi\">Stripcharts</a>
- -    | <a href=\"show_log.php\">Show/Grep all logs</a>
- +    <a href=\"show_log.php\">Show/Grep all logs</a>
-      | <a href=\"show_log.php?f=mysql*.log&l=-20\">Tail MySQL logs</a>
- +    | <a href=\"hostinfo.php\">Per-host statistics</a>
-      </div>
-  ";
-  
- --- boinc-server-6.11.0+r18946.orig/html/ops/mass_email_script.php
- +++ boinc-server-6.11.0+r18946/html/ops/mass_email_script.php
- @@ -38,9 +38,10 @@
-  //
-  // see http://boinc.berkeley.edu/mass_email.php for info
-  
- -require_once('../project/project.inc');
-  require_once('../inc/email.inc');
-  require_once('../inc/db.inc');
- +require_once('../inc/util_ops.inc');
- +require_once(html_path('project/project.inc'));
-  
-  db_init();
-  set_time_limit(0);
- --- boinc-server-6.11.0+r18946.orig/html/ops/update_profile_pages.php
- +++ boinc-server-6.11.0+r18946/html/ops/update_profile_pages.php
- @@ -17,11 +17,11 @@
-  // You should have received a copy of the GNU Lesser General Public License
-  // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
-  
- -require_once("../project/project.inc");
-  require_once("../inc/util.inc");
-  require_once("../inc/uotd.inc");
-  require_once("../inc/db.inc");
-  require_once("../inc/profile.inc");
- +require_once(html_path("project/project.inc"));
-  
-  // this causes "cannot modify header" errors
-  //echo date(DATE_RFC822), ": Starting\n";
- @@ -232,6 +232,7 @@
-      // of the userids who belong to those countries.
-      // Format: array[country][index] = userid.
-  
- +    $countryMembers = array();
-      while ($profile = mysql_fetch_object($result)) {
-          $user = lookup_user_id($profile->userid);
-          if (!$user) continue;
- @@ -259,7 +260,7 @@
-          build_profile_pages(
-              $countryMembers[$country],
-              "User Profiles from $country", $country, 5, 2,
- -            $filePath, $baseFileName, "../html/"
- +            $filePath, $baseFileName, html_path("")
-          );
-      }
-  
- @@ -281,6 +282,7 @@
-      $result = mysql_query($query);
-      $numIds = 0;
-  
- +    $members = array();
-      while ($profile = mysql_fetch_object($result)) {
-          $user = lookup_user_id($profile->userid);
-          if (!$user) continue;
- --- boinc-server-6.11.0+r18946.orig/html/ops/show_log.php
- +++ boinc-server-6.11.0+r18946/html/ops/show_log.php
- @@ -58,13 +58,13 @@
-  echo 'Hint: Example greps: "RESULT#106876", "26fe99aa_25636_00119.wu_1", "WU#8152", "too many errors", "2003-07-17", "CRITICAL" <br>';
-  
-  if (strlen($f)) {
- -	$f = "../log*/". $f;
- +	$f = project_path("log*/". $f);
-  } else {
- -    $f = "../log*/*.log";
- +    $f = project_path("log*/*.log");
-  }
-  
-  if ($s) {
- -    passthru("cd $log_dir && ../bin/grep_logs -html -l $l '$s' $f 2>&1");
- +    passthru("cd $log_dir && " . project_path("bin/grep_logs") . " -html -l $l '$s' $f 2>&1");
-  }
-  
-  admin_page_tail();
- --- boinc-server-6.11.0+r18946.orig/html/ops/hostinfo.php
- +++ boinc-server-6.11.0+r18946/html/ops/hostinfo.php
- @@ -0,0 +1,44 @@
- +<?
- +require_once("../inc/util.inc");
- +include_once(html_path("project/project.inc"));
- +?>
- +<html>
- +	<head>
- +		    <meta http-equiv="refresh" content="900">
- +                    <link rel="stylesheet" type="text/css" href="szdg-stat.css" />
- +                    <title>Project utilization information for <?=PROJECT?></title>
- +	</head>
- +	<body>
- +                <div class="menu">
- +		    Detailed host activity for the last <a href="show_hosts.php?i=1week">1 week</a> |
- +		    <a href="show_hosts.php?i=31days">31 days</a>
- +		</div>
- +		<div class="main">
- +
- +		    <h1>Welcome to the monitoring site of the <i><?=PROJECT?></i> project</h1>
- +
- +		    This site provides information about the performance (work unit processing) of the project and about the activities of the attached clients:
- +		    <ul>
- +		    <li> This page gives summarized information about the work done by clients (see below).
- +		    <li> You can access the detailed (individual for each connected host) statistics by using the links on the top the page. There only those hosts are displayed that were active during the last 14 days, inactive hosts are filtered out.
- +		    </ul>
- +
- +
- +		    <?
- +		    if (is_file("stats/credit_stats.html")) {
- +		      include 'stats/credit_stats.html';
- +		    }?>
- +		</div>
- +                    <?
- +		    $aFiles = array("stats/1week_results.png", "stats/31days_results.png");
- +
- +		    foreach ($aFiles as $sFile) {
- +			if (is_file($sFile)) {
- +				echo "<img class=\"maincharts\" src=\"". $sFile. "\"/>";
- +			} else {
- +				echo "No diagram yet. <br/><br/>";
- +			}
- +		    }
- +		    ?>
- +	</body>
- +</html>
- --- boinc-server-6.11.0+r18946.orig/html/ops/clean_cache.php
- +++ boinc-server-6.11.0+r18946/html/ops/clean_cache.php
- @@ -24,13 +24,13 @@
-  function cache_check_diskspace2(){
-     $too_old = 86400;
-     while (1) {
- -       $f = disk_free_space("../cache");
- -       $u = disk_usage("../cache");
- +       $f = disk_free_space(html_path("cache"));
- +       $u = disk_usage(html_path("cache"));
-         echo "free: $f used: $u\n";
-         if ($f > MIN_FREE_SPACE && $u < MAX_CACHE_USAGE) {
-             break;
-         }
- -       clean_cache($too_old, "../cache");
- +       clean_cache($too_old, html_path("cache"));
-         $too_old/=2;
-     }
-  }
- --- boinc-server-6.11.0+r18946.orig/html/ops/bossa_example_make_files.php
- +++ boinc-server-6.11.0+r18946/html/ops/bossa_example_make_files.php
- @@ -92,7 +92,7 @@
-  
-  if (!$nfiles || !$dir) usage();
-  
- -$dir = "../user/$dir";
- +$dir = html_path("user/$dir");
-  if (!is_dir($dir)) {
-      exit("$dir is not a directory\n");
-  }
- --- boinc-server-6.11.0+r18946.orig/html/ops/bossa_example_make_jobs.php
- +++ boinc-server-6.11.0+r18946/html/ops/bossa_example_make_jobs.php
- @@ -32,7 +32,7 @@
-      // if it's a calibration job, get the answer and store in job record
-      //
-      if ($calibration) {
- -        $path2 = str_replace(".png", ".ans", "../user/$path");
- +        $path2 = str_replace(".png", ".ans", html_path("user/$path"));
-          $info->answer = unserialize(file_get_contents($path2));
-      }
-  
- @@ -48,7 +48,7 @@
-          exit("bossa_create_batch() failed\n");
-      }
-  
- -    $d = opendir("../user/$dir");
- +    $d = opendir(html_path("user/$dir"));
-      while ($file = readdir($d)) {
-          if (!strstr($file, ".png")) continue;
-          make_job("$dir/$file", $batchid, $appid, $calibration);
- @@ -74,8 +74,8 @@
-      exit("Application '$app_name' not found\n");
-  }
-  
- -if (!is_dir("../user/$dir")) {
- -    exit("../user/$dir is not a directory\n");
- +if (!is_dir(html_path("user/$dir"))) {
- +    exit(html_path("user/$dir") . " is not a directory\n");
-  }
-  
-  make_jobs($dir, $appid, $calibration);
- --- boinc-server-6.11.0+r18946.orig/html/ops/job_times.php
- +++ boinc-server-6.11.0+r18946/html/ops/job_times.php
- @@ -204,7 +204,7 @@
-      show_apps();
-  }
-  
- -if ($_GET['submit']=='OK') {
- +if (array_key_exists($_GET['submit']) && $_GET['submit']=='OK') {
-      set_time_limit(0);
-      $appid = $_GET['appid'];
-      if (!$appid) {
- --- boinc-server-6.11.0+r18946.orig/html/ops/upgrade_db.php
- +++ boinc-server-6.11.0+r18946/html/ops/upgrade_db.php
- @@ -22,9 +22,11 @@
-  
-  echo "Checking for DB updates...\n";
-  
- +require_once("../inc/util.inc");
- +
-  $db_revision = 0;
- -if (file_exists("../../db_revision")) {
- -    $db_revision = (int) file_get_contents("../../db_revision");
- +if (file_exists(project_path("db_revision"))) {
- +    $db_revision = (int) file_get_contents(project_path("db_revision"));
-  }
-  require_once("db_update.php");
-  
- @@ -55,7 +57,7 @@
-      list($rev, $func) = $update;
-      echo "performing update $func\n";
-      call_user_func($func);
- -    file_put_contents("../../db_revision", $rev);
- +    file_put_contents(project_path("db_revision"), $rev);
-  }
-  echo "All done.\n";
-  
- --- boinc-server-6.11.0+r18946.orig/html/ops/bossa_example4_make_jobs.php
- +++ boinc-server-6.11.0+r18946/html/ops/bossa_example4_make_jobs.php
- @@ -39,7 +39,7 @@
-          exit("bossa_create_batch() failed\n");
-      }
-  
- -    $d = opendir("../user/$dir");
- +    $d = opendir(html_path("user/$dir"));
-      while ($file = readdir($d)) {
-          if (!strstr($file, ".png") && !strstr($file, ".jpg")) continue;
-          make_job("$dir/$file", $batchid, $appid);
- @@ -58,8 +58,8 @@
-  
-  if (!$dir) usage();
-  
- -if (!is_dir("../user/$dir")) {
- -    exit("../user/$dir is not a directory\n");
- +if (!is_dir(html_path("user/$dir"))) {
- +    exit(html_path("user/$dir") . " is not a directory\n");
-  }
-  
-  $appid = bossa_app_lookup("bossa_example4");
- --- boinc-server-6.11.0+r18946.orig/html/ops/manage_app_versions.php
- +++ boinc-server-6.11.0+r18946/html/ops/manage_app_versions.php
- @@ -117,7 +117,7 @@
-          }
-      }
-      mysql_free_result($result);
- -    touch("../../reread_db");
- +    touch(project_path("reread_db"));
-  }
-  
-  
- --- boinc-server-6.11.0+r18946.orig/html/ops/eah_server_status.php
- +++ boinc-server-6.11.0+r18946/html/ops/eah_server_status.php
- @@ -19,7 +19,7 @@
-  require_once("../inc/cache.inc");
-  require_once("../inc/util.inc");
-  require_once("../inc/db.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  ################################################
-  # local functions
- @@ -47,7 +47,7 @@
-  }
-  
-  function daemon_status($host, $pidname) {
- -    $path = "../../pid_$host/$pidname.pid";
- +    $path = project_path("/pid_$host/$pidname.pid");
-      $running = false;
-      if (is_file($path)) {
-          $pid = file_get_contents($path);
- @@ -120,8 +120,7 @@
-  
-  
-  
- -$web_running = !file_exists("../../stop_web");
- -show_status("einstein", "Web server", $web_running);
- +show_status("einstein", "Web server", !web_stopped());
-  
-  
-  
- @@ -130,8 +129,7 @@
-  show_daemon_status("einstein", "Pulsar work generator (LLO)", "make_pulsar_WU_daemon_l");
-  show_daemon_status("einstein", "BOINC database feeder", "feeder");
-  show_daemon_status("einstein", "BOINC transitioner", "transitioner");
- -$sched_running = !file_exists("../../stop_sched");
- -show_status("einstein", "BOINC scheduler", $sched_running);
- +show_status("einstein", "BOINC scheduler", !sched_stopped());
-  show_daemon_status("einstein", "Einstein validator", "einstein_validator"); 
-  show_daemon_status("einstein", "Einstein assimilator", "einstein_assimilator");
-  show_daemon_status("einstein", "BOINC file deleter", "file_deleter");
- @@ -297,16 +295,6 @@
-  
-  // Display cgi-bin restriction status
-  
- -if (  file_exists("../../cgi-bin/.htaccess") ) {
- -    echo "<P><font color=RED>
- -        <b>The ".PROJECT." scheduler is currently restricted 
- -	  to uwm.edu and a few other domains.
- -
- -	</b></font><P>
- -     ";
- -} 
- -
- -
-  echo "</TD></TR>
-  	</TABLE>
-      ";  
- --- boinc-server-6.11.0+r18946.orig/html/inc/notify.inc
- +++ boinc-server-6.11.0+r18946/html/inc/notify.inc
- @@ -16,7 +16,8 @@
-  // You should have received a copy of the GNU Lesser General Public License
-  // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
-  
- -require_once("../project/project.inc");
- +require_once("../inc/util.inc");
- +require_once(html_path("project/project.inc"));
-  
-  function notify_rss_auth($user) {
-      return md5($user->authenticator.$user->passwd_hash."notify_rss");
- --- boinc-server-6.11.0+r18946.orig/html/inc/forum_email.inc
- +++ boinc-server-6.11.0+r18946/html/inc/forum_email.inc
- @@ -18,7 +18,7 @@
-  
-  require_once("../inc/util.inc");
-  require_once("../inc/email.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  define('MASTER_URL', $master_url);
-  
- --- boinc-server-6.11.0+r18946.orig/html/inc/db_conn.inc
- +++ boinc-server-6.11.0+r18946/html/inc/db_conn.inc
- @@ -32,6 +32,7 @@
-          if (!$this->db_conn) {
-              return false;
-          }
- +        mysql_set_charset('utf8', $this->db_conn);
-          $this->db_name = $name;
-          return true;
-      }
- --- boinc-server-6.11.0+r18946.orig/html/inc/cache.inc
- +++ boinc-server-6.11.0+r18946/html/inc/cache.inc
- @@ -16,7 +16,8 @@
-  // You should have received a copy of the GNU Lesser General Public License
-  // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
-  
- -require_once("../project/cache_parameters.inc");
- +require_once("../inc/util.inc");
- +require_once(html_path("project/cache_parameters.inc"));
-  
-  // If we can't see request headers, don't do caching
-  //
- @@ -28,27 +29,27 @@
-  // mechanism for caching commonly-accessed pages
-  
-  function make_cache_dirs() {
- -    if (!@filemtime("../cache")) {
- -        mkdir("../cache", 0770);
- -        chmod("../cache", 0770);
- +    if (!@filemtime(html_path("cache"))) {
- +        mkdir(html_path("cache", 0770));
- +        chmod(html_path("cache", 0770));
-      }
-      for ($i=0;$i<256;$i++) {
-          $j=sprintf("%02x",$i);
- -        if (!@filemtime("../cache/$j")) {
- -            mkdir("../cache/$j", 0770);
- -            chmod("../cache/$j", 0770);
- +        if (!@filemtime(html_path("cache/$j"))) {
- +            mkdir(html_path("cache/$j"), 0770);
- +            chmod(html_path("cache/$j"), 0770);
-          } 
-      }
-  }
-  
-  function get_path($params) {
- -    if (!@filemtime("../cache/00")) make_cache_dirs();
- +    if (!@filemtime(html_path("cache/00"))) make_cache_dirs();
-      $y = pathinfo($_SERVER["PHP_SELF"]);
-      $z = $y["basename"];
-  
-      // add a layer of subdirectories for reducing file lookup time
-      $sz = substr(md5($z."_".urlencode($params)),1,2);
- -    $path = "../cache/".$sz."/".$z;
- +    $path = html_path("cache/".$sz."/".$z);
-      if ($params) {
-          $path = $path."_".urlencode($params);
-      }
- @@ -106,10 +107,10 @@
-      if (!(rand() % CACHE_SIZE_CHECK_FREQ)) {
-          set_time_limit(0);  // this may take a while
-          $max_age = 86400;
- -        while ((disk_free_space("../cache") < MIN_FREE_SPACE) ||
- -            (disk_usage("../cache") > MAX_CACHE_USAGE)
- +        while ((disk_free_space(html_path("cache")) < MIN_FREE_SPACE) ||
- +            (disk_usage(html_path("cache")) > MAX_CACHE_USAGE)
-          ) {
- -            clean_cache($max_age, "../cache");
- +            clean_cache($max_age, html_path("cache"));
-              $max_age/=2;
-          }
-      }
- --- boinc-server-6.11.0+r18946.orig/html/inc/util.inc
- +++ boinc-server-6.11.0+r18946/html/inc/util.inc
- @@ -17,7 +17,7 @@
-  // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
-  
-  require_once("../inc/util_basic.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  require_once("../inc/countries.inc");
-  require_once("../inc/db.inc");
-  require_once("../inc/boinc_db.inc");
- @@ -484,7 +484,7 @@
-      }
-      $x .= " <a href=\"".URL_BASE."show_user.php?userid=".$user->id."\">".$user->name."</a>";
-      if ($user->donated == 1) { 
- -        require_once("../project/donations.inc");
- +        require_once(html_path("project/donations.inc"));
-          $x .= DONATION_LINK;
-      }
-      $x .= "</td></tr></table>\n";
- @@ -503,7 +503,7 @@
-      }
-      $x .= " <a href=\"".URL_BASE."show_user.php?userid=".$user->id."\">".$user->name."</a>";
-      if ($user->donated == 1) { 
- -        require_once("../project/donations.inc");
- +        require_once(html_path("project/donations.inc"));
-          $x .= DONATION_LINK;
-      }
-      if (function_exists("project_user_links")){
- --- boinc-server-6.11.0+r18946.orig/html/inc/db.inc
- +++ boinc-server-6.11.0+r18946/html/inc/db.inc
- @@ -40,6 +40,7 @@
-      if (!$link) {
-          return 1;
-      }
- +    mysql_set_charset('utf8', $link);
-      $db_name = parse_config($config, "<db_name>");
-      if (!mysql_select_db($db_name, $link)) {
-          echo "selecting $db_name\n";
- --- boinc-server-6.11.0+r18946.orig/html/inc/user.inc
- +++ boinc-server-6.11.0+r18946/html/inc/user.inc
- @@ -321,8 +321,8 @@
-          }
-      }
-      if ($user->donated == 1) { 
- -        if (file_exists("../project/donations.inc")) {
- -            require_once("../project/donations.inc");
- +        if (file_exists(html_path("project/donations.inc"))) {
- +            require_once(html_path("project/donations.inc"));
-              $x .= DONATION_LINK;
-              row2(tra("Donor"), $x);
-          }
- --- boinc-server-6.11.0+r18946.orig/html/inc/util_basic.inc
- +++ boinc-server-6.11.0+r18946/html/inc/util_basic.inc
- @@ -19,12 +19,36 @@
-  // minimal set of util functions;
-  // doesn't pull in translation.inc etc.
-  
- +$g_project_path = null;
- +function project_path($file) {
- +    global $g_project_path;
- +
- +    if ($g_project_path)
- +	return $g_project_path . "/" . $file;
- +    if (function_exists('apache_getenv') && apache_getenv("BOINC_PROJECT_DIR"))
- +	$g_project_path = apache_getenv("BOINC_PROJECT_DIR");
- +    else if (isset($_ENV["BOINC_PROJECT_DIR"]))
- +	$g_project_path = $_ENV["BOINC_PROJECT_DIR"];
- +    else if (file_exists("config.xml"))
- +	$g_project_path = ".";
- +    else if (file_exists("../config.xml"))
- +	$g_project_path = "..";
- +    else
- +	$g_project_path = "../..";
- +
- +    return $g_project_path . "/" . $file;
- +}
- +
- +function html_path($file) {
- +    return project_path("html/" . $file);
- +}
- +
-  function web_stopped() {
- -    return file_exists("../../stop_web");
- +    return file_exists(project_path("stop_web"));
-  }
-  
-  function sched_stopped() {
- -    return file_exists("../../stop_sched");
- +    return file_exists(project_path("stop_sched"));
-  }
-  
-  function show_page($x, $y) {
- @@ -64,7 +88,7 @@
-  function get_config() {
-      global $g_config;
-      if ($g_config == null) {
- -       $g_config = file_get_contents("../../config.xml");
- +       $g_config = file_get_contents(project_path("config.xml"));
-      }
-      return $g_config;
-  }
- @@ -115,7 +139,7 @@
-      return false;
-  }
-  
- -// look for a particular element in the ../../config.xml file
- +// look for a particular element in the config.xml file
-  //
-  function parse_config($config, $tag) {
-      $element = parse_element($config, $tag);
- --- boinc-server-6.11.0+r18946.orig/html/inc/translation.inc
- +++ boinc-server-6.11.0+r18946/html/inc/translation.inc
- @@ -16,7 +16,9 @@
-  // You should have received a copy of the GNU Lesser General Public License
-  // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
-  
- -$lang_language_dir = "../languages/";
- +require_once '../inc/util_basic.inc';
- +
- +$lang_language_dir = html_path("languages/");
-  $lang_translations_dir = "translations/";
-  $lang_prj_translations_dir = "project_specific_translations/";
-  $lang_compiled_dir = "compiled/";
- --- boinc-server-6.11.0+r18946.orig/html/inc/prefs.inc
- +++ boinc-server-6.11.0+r18946/html/inc/prefs.inc
- @@ -56,7 +56,8 @@
-  // Various functions are defined below for converting between these forms,
-  // and also to/from HTML form elements
-  
- -include_once("../project/project_specific_prefs.inc");
- +require_once("../inc/util.inc");
- +include_once(html_path("project/project_specific_prefs.inc"));
-  
-  // strings describing various preference fields
-  //
- --- boinc-server-6.11.0+r18946.orig/html/inc/email.inc
- +++ boinc-server-6.11.0+r18946/html/inc/email.inc
- @@ -20,7 +20,7 @@
-  // Don't put specific message text here.
-  
-  require_once("../inc/util.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  $config = get_config();
-  $master_url = parse_config($config, "<master_url>");
- --- boinc-server-6.11.0+r18946.orig/html/inc/util_ops.inc
- +++ boinc-server-6.11.0+r18946/html/inc/util_ops.inc
- @@ -18,7 +18,7 @@
-  
-  require_once("../inc/db_ops.inc");
-  require_once("../inc/util.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  // TODO: get rid of the following.  use style sheets
-  define("TD", "<td bgcolor=\"#708090\">");
- --- boinc-server-6.11.0+r18946.orig/html/inc/bolt_snap.inc
- +++ boinc-server-6.11.0+r18946/html/inc/bolt_snap.inc
- @@ -40,9 +40,9 @@
-  
-  
-  function compare_snapshot_filename($course_id, $select_name, $xset_name) {
- -    @mkdir("../bolt_snap");
- +    @mkdir(html_path("bolt_snap"));
-      $x = urlencode($course_id."_".$select_name."_".$xset_name);
- -    return "../bolt_snap/compare_snapshot_$x";
- +    return html_path("bolt_snap/compare_snapshot_$x");
-  }
-  
-  function write_compare_snapshot($course_id, $select_name, $xset_name, $dur) {
- @@ -124,7 +124,7 @@
-  
-  
-  function map_snapshot_filename($course_id) {
- -    return "../bolt_snap/map_snapshot_".$course_id;
- +    return html_path("bolt_snap/map_snapshot_".$course_id);
-  }
-  
-  function write_map_snapshot($course_id, $dur) {
- --- boinc-server-6.11.0+r18946.orig/html/inc/countries.inc
- +++ boinc-server-6.11.0+r18946/html/inc/countries.inc
- @@ -478,7 +478,7 @@
-      require_once("../inc/geoip.inc"); 
-  
-      //See if we can find the user's country and select it as default:
- -    $gi = geoip_open("../inc/GeoIP.dat",GEOIP_STANDARD);
- +    $gi = geoip_open("/usr/share/GeoIP/GeoIP.dat",GEOIP_STANDARD);
-      $geoip_country = geoip_country_name_by_addr($gi,$_SERVER["REMOTE_ADDR"]);
-      geoip_close($gi);
-  
- --- boinc-server-6.11.0+r18946.orig/html/project.sample/project.inc
- +++ boinc-server-6.11.0+r18946/html/project.sample/project.inc
- @@ -7,11 +7,11 @@
-  require_once("../inc/util.inc");
-  
-  $master_url = parse_config(get_config(), "<master_url>");
- -define("PROJECT", "REPLACE WITH PROJECT NAME");
- +define("PROJECT", "%(long_name)s");
-  define("URL_BASE", $master_url);
- -define("IMAGE_PATH", "../user_profile/images/");
- +define("IMAGE_PATH", html_path("user_profile/images/"));
-  define("IMAGE_URL", "user_profile/images/");
- -define("PROFILE_PATH", "../user_profile/");
- +define("PROFILE_PATH", html_path("user_profile/"));
-  define("PROFILE_URL", "user_profile/");
-  define("LANGUAGE_FILE", "languages.txt");
-  define("STYLESHEET", "white.css");
- --- boinc-server-6.11.0+r18946.orig/html/user/sample_moderation.php
- +++ boinc-server-6.11.0+r18946/html/user/sample_moderation.php
- @@ -19,7 +19,7 @@
-  
-  
-  require_once("../inc/util.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  page_head("Moderation");
-  echo "
- --- boinc-server-6.11.0+r18946.orig/html/user/ffmail_action.php
- +++ boinc-server-6.11.0+r18946/html/user/ffmail_action.php
- @@ -16,8 +16,8 @@
-  // You should have received a copy of the GNU Lesser General Public License
-  // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
-  
- -require_once("../project/project.inc");
-  require_once("../inc/email.inc");
- +require_once(html_path("project/project.inc"));
-  
-  function replace($toname, $comment, $fromname, $template) {
-      $pat = array(
- @@ -33,9 +33,9 @@
-      return preg_replace($pat, $rep, $template);
-  }
-  
- -$html = file_get_contents('../ops/ffmail/html');
- -$text = file_get_contents('../ops/ffmail/text');
- -$subject = file_get_contents('../ops/ffmail/subject');
- +$html = file_get_contents(html_path('ops/ffmail/html'));
- +$text = file_get_contents(html_path('ops/ffmail/text'));
- +$subject = file_get_contents(html_path('ops/ffmail/subject'));
-  
-  $preview = get_str('preview', true);
-  $uname = get_str('uname');
- --- boinc-server-6.11.0+r18946.orig/html/user/stats.php
- +++ boinc-server-6.11.0+r18946/html/user/stats.php
- @@ -29,6 +29,7 @@
-  <li><a href=\"top_users.php\">" . tra("Top participants")."</a>
-  <li><a href=\"top_hosts.php\">" . tra("Top computers")."</a>
-  <li><a href=\"top_teams.php\">" . tra("Top teams"). "</a>
- +<li><a href=\"performance.php\">" . tra("Project performance"). "</a>
-  </ul>
-  
-  <p>".
- --- boinc-server-6.11.0+r18946.orig/html/user/uotd_gadget.php
- +++ boinc-server-6.11.0+r18946/html/user/uotd_gadget.php
- @@ -19,7 +19,7 @@
-  
-  
-  require_once("../inc/xml.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  xml_header();
-  
- --- boinc-server-6.11.0+r18946.orig/html/user/notify_rss.php
- +++ boinc-server-6.11.0+r18946/html/user/notify_rss.php
- @@ -23,7 +23,7 @@
-  require_once("../inc/pm.inc");
-  require_once("../inc/friend.inc");
-  require_once("../inc/notify.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  $userid = get_int('userid');
-  $auth = get_str('auth');
- --- boinc-server-6.11.0+r18946.orig/html/user/moderation.php
- +++ boinc-server-6.11.0+r18946/html/user/moderation.php
- @@ -20,7 +20,7 @@
-  
-  require_once("../inc/util.inc");
-  require_once("../inc/forum.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  page_head("Moderation");
-  echo "
- --- boinc-server-6.11.0+r18946.orig/html/user/home.php
- +++ boinc-server-6.11.0+r18946/html/user/home.php
- @@ -57,8 +57,8 @@
-      show_user_stats_private($user);
-  }
-  
- -if (file_exists("../project/donations.inc")) {
- -    require_once("../project/donations.inc");
- +if (file_exists(html_path("project/donations.inc"))) {
- +    require_once(html_path("project/donations.inc"));
-      if (function_exists('show_user_donations_private')) {
-          show_user_donations_private($user);
-      }
- --- boinc-server-6.11.0+r18946.orig/html/user/sample_index.php
- +++ boinc-server-6.11.0+r18946/html/user/sample_index.php
- @@ -24,8 +24,8 @@
-  require_once("../inc/sanitize_html.inc");
-  require_once("../inc/translation.inc");
-  require_once("../inc/text_transform.inc");
- -require_once("../project/project.inc");
- -require_once("../project/project_news.inc");
- +require_once(html_path("project/project.inc"));
- +require_once(html_path("project/project_news.inc"));
-  
-  
-  function show_nav() {
- @@ -103,7 +103,7 @@
-      <link rel=\"stylesheet\" type=\"text/css\" href=\"".STYLESHEET."\">
-      <link rel=\"alternate\" type=\"application/rss+xml\" title=\"".$rssname."\" href=\"".$rsslink."\">
-  ";
- -include 'schedulers.txt';
- +include html_path('project/schedulers.txt');
-  echo "
-      </head><body>
-      <span class=page_title>".PROJECT."</span>
- --- boinc-server-6.11.0+r18946.orig/html/user/get_project_config.php
- +++ boinc-server-6.11.0+r18946/html/user/get_project_config.php
- @@ -26,7 +26,7 @@
-  // and update it every hour if possible.
-  //
-  function show_platforms() {
- -    $path = "../cache/platform_list.xml";
- +    $path = html_path("cache/platform_list.xml");
-      $mtime = @filemtime($path);
-      if ($mtime && (time() - $mtime) < 3600) {
-          @readfile($path);
- @@ -71,11 +71,6 @@
-      <master_url>$master_url</master_url>
-  ";
-  
- -$local_revision = trim(file_get_contents("../../local.revision"));
- -if ($local_revision) {
- -    echo "<local_revision>$local_revision</local_revision>\n";
- -}
- -
-  if (web_stopped()) {
-      echo "
-          <error_num>-183</error_num>
- @@ -105,7 +100,7 @@
-  
-  show_platforms();
-  
- -$tou_file = "../../terms_of_use.txt";
- +$tou_file = project_path("terms_of_use.txt");
-  if (file_exists($tou_file)) {
-      $terms_of_use = trim(file_get_contents($tou_file));
-      if ($terms_of_use) {
- --- boinc-server-6.11.0+r18946.orig/html/user/sample_moderator_instructions.php
- +++ boinc-server-6.11.0+r18946/html/user/sample_moderator_instructions.php
- @@ -19,7 +19,7 @@
-  
-  
-  require_once("../inc/util.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  page_head("Moderator instructions");
-  echo "
- --- boinc-server-6.11.0+r18946.orig/html/user/show_coproc.php
- +++ boinc-server-6.11.0+r18946/html/user/show_coproc.php
- @@ -92,7 +92,7 @@
-      exit;
-  }
-  
- -$fname = "../ops/".filename($mode);
- +$fname = html_path("ops/".filename($mode));
-  $data = file_get_contents($fname);
-  $array = unserialize($data);
-  
- --- boinc-server-6.11.0+r18946.orig/html/user/mail_passwd.php
- +++ boinc-server-6.11.0+r18946/html/user/mail_passwd.php
- @@ -19,7 +19,7 @@
-  require_once("../inc/boinc_db.inc");
-  require_once("../inc/util.inc");
-  require_once("../inc/email.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  function email_sent_message($email_addr) {
-      if (defined('EMAIL_FROM')) {
- --- boinc-server-6.11.0+r18946.orig/html/user/all_news.php
- +++ boinc-server-6.11.0+r18946/html/user/all_news.php
- @@ -18,7 +18,7 @@
-  
-  require_once("../inc/util.inc");
-  require_once("../inc/news.inc");
- -require_once("../project/project_news.inc");
- +require_once(html_path("project/project_news.inc"));
-  
-  page_head("News archive");
-  
- --- boinc-server-6.11.0+r18946.orig/html/user/show_user.php
- +++ boinc-server-6.11.0+r18946/html/user/show_user.php
- @@ -31,7 +31,7 @@
-  require_once("../inc/boinc_db.inc");
-  require_once("../inc/user.inc");
-  require_once("../inc/forum.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  $auth = get_str("auth", true);
-  if (!$auth) {
- --- boinc-server-6.11.0+r18946.orig/html/user/performance.php
- +++ boinc-server-6.11.0+r18946/html/user/performance.php
- @@ -0,0 +1,51 @@
- +<?php
- +    session_start();
- +    require_once("../inc/db.inc");
- +    require_once("../inc/util.inc");
- +    require_once(html_path("project/project.inc"));
- +
- +    page_head(PROJECT . " Diagrams");
- +?>
- +
- +<table width="100%">
- +    <tr><td align="center">
- +	<div class="image">
- +	    <img src="performance/wu_total14day.jpg">
- +	    <div>Total number of workunits for the last 14 days</div>
- +	</div>
- +    </td></tr>
- +    <tr><td align="center">
- +	<div class="image">
- +	    <img src="performance/wu_unsent14day.jpg">
- +	    <div>Number of unsent workunits for the last 14 days</div>
- +	</div>
- +    </td></tr>
- +    <tr><td align="center">
- +	<div class="image">
- +	    <img src="performance/wu_inprogress14day.jpg">
- +	    <div>Number of in-progress workunits for the last 14 days</div>
- +	</div>
- +    </td></tr>
- +    <tr><td align="center">
- +	<div class="image">
- +	    <img src="performance/performance48.jpg">
- +	    <div>Last 48 hours performance</div>
- +	</div>
- +    </td></tr>
- +    <tr><td align="center">
- +	<div class="image">
- +	    <img src="performance/performance168.jpg">
- +	    <div>Last 168 hours performance</div>
- +	</div>
- +    </td></tr>
- +    <tr><td align="center">
- +	<div class="image">
- +	    <img src="performance/performance28day.jpg">
- +	    <div>Last 4 weeks performance</div>
- +	</div>
- +    </td></tr>
- +</table>
- +
- +<?php
- +    page_tail();
- +?>
- --- boinc-server-6.11.0+r18946.orig/html/user/project.inc.sample
- +++ boinc-server-6.11.0+r18946/html/user/project.inc.sample
- @@ -9,8 +9,8 @@
-  define("PROJECT", "Test Project");
-  define("MASTER_URL", "http://boinc.berkeley.edu/");
-  define("URL_BASE", "");
- -define('IMAGE_PATH', '../user_profile/images/');
- -define('PROFILE_PATH', '../user_profile/');
- +define('IMAGE_PATH', html_path('user_profile/images/'));
- +define('PROFILE_PATH', html_path('user_profile/'));
-  define('PROFILE_URL', 'user_profile/');
-  define('LANGUAGE_FILE', 'languages.txt');
-  define('STYLESHEET', 'white.css');
- --- boinc-server-6.11.0+r18946.orig/html/user/old_news.php
- +++ boinc-server-6.11.0+r18946/html/user/old_news.php
- @@ -18,7 +18,7 @@
-  
-  require_once("../inc/util.inc");
-  require_once("../inc/news.inc");
- -require_once("../project/project_news.inc");
- +require_once(html_path("project/project_news.inc"));
-  
-  page_head("News archive");
-  
- --- boinc-server-6.11.0+r18946.orig/html/user/ffmail_form.php
- +++ boinc-server-6.11.0+r18946/html/user/ffmail_form.php
- @@ -21,7 +21,7 @@
-  db_init();
-  $user = get_logged_in_user();
-  
- -if (!@file_get_contents('../ops/ffmail/subject')) {
- +if (!@file_get_contents(html_path('ops/ffmail/subject'))) {
-      error_page(
-          'This project hasn\'t created an email message -
-          please notify its administrators'
- --- boinc-server-6.11.0+r18946.orig/html/user/forum_rss.php
- +++ boinc-server-6.11.0+r18946/html/user/forum_rss.php
- @@ -18,8 +18,8 @@
-  
-  // get a forum (possibly filtered by user) as RSS feed
-  
- -require_once("../project/project.inc");
-  require_once("../inc/db.inc");
- +require_once(html_path("project/project.inc"));
-  
-  $forumid = get_int('forumid');
-  $forum = BoincForum::lookup_id($forumid);
- --- boinc-server-6.11.0+r18946.orig/html/user/sample_rss_main.php
- +++ boinc-server-6.11.0+r18946/html/user/sample_rss_main.php
- @@ -17,6 +17,9 @@
-  // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
-  
-  
- +require_once("../inc/util.inc");
- +
- +
-  // rss_main.php:
-  // RSS 2.0 feed for BOINC default server installation.
-  // Channel Main show the current news on project mainpage 
- @@ -27,7 +30,7 @@
-  
-  // Get unix time that last modification was made to the news source
-  //
- -$last_mod_time=filemtime("../project/project_news.inc");
- +$last_mod_time=filemtime(html_path("project/project_news.inc"));
-  $create_date  = gmdate('D, d M Y H:i:s', $last_mod_time) . ' GMT'; 
-  
-  // Now construct header
- @@ -49,8 +52,8 @@
-  // include project constants and news file
-  //
-  require_once("../inc/text_transform.inc");
- -require_once("../project/project.inc");
- -require_once("../project/project_news.inc");
- +require_once(html_path("project/project.inc"));
- +require_once(html_path("project/project_news.inc"));
-  
-  // Create channel header and open XML content
-  //
- --- boinc-server-6.11.0+r18946.orig/html/user/moderator_instructions.php
- +++ boinc-server-6.11.0+r18946/html/user/moderator_instructions.php
- @@ -20,7 +20,7 @@
-  
-  require_once("../inc/util.inc");
-  require_once("../inc/forum.inc");
- -require_once("../project/project.inc");
- +require_once(html_path("project/project.inc"));
-  
-  page_head("Moderator instructions");
-  echo "
 +--- boinc-server-6.11.0+r18946.orig/sched/Makefile.am
 ++++ boinc-server-6.11.0+r18946/sched/Makefile.am
 +@@ -4,7 +4,8 @@
 + include $(top_srcdir)/Makefile.incl
 + 
 + AM_CPPFLAGS += $(MYSQL_CFLAGS) $(PTHREAD_CFLAGS)
 +-AM_LDFLAGS += -static
 ++
 ++LDADD = libsched.la
 + 
 + if ENABLE_LIBRARIES
 + 
 +@@ -23,8 +24,8 @@
 + libsched_la_SOURCES = $(libsched_sources)
 + libsched_la_CFLAGS = $(AM_CPPFLAGS)
 + libsched_la_CXXFLAGS = $(AM_CPPFLAGS)
 +-libsched_la_LDFLAGS= -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
 +-libsched_la_LIBADD= $(SSL_LIBS)
 ++libsched_la_LDFLAGS = -rpath $(libdir) -release $(PACKAGE_VERSION)
 ++libsched_la_LIBADD = ../lib/libboinc_crypt.la ../lib/libboinc.la $(MYSQL_LIBS)
 + 
 + ## install only headers that are meant for exporting the API !!
 + if INSTALL_HEADERS
 +@@ -43,41 +44,12 @@
 + libsched_fcgi_la_SOURCES = $(libsched_sources)
 + libsched_fcgi_la_CFLAGS = -D_USING_FCGI_ $(AM_CPPFLAGS)
 + libsched_fcgi_la_CXXFLAGS = -D_USING_FCGI_ $(AM_CPPFLAGS)
 +-libsched_fcgi_la_LDFLAGS= -L$(libdir) -rpath $(libdir) -version-number $(LIBBOINC_VERSION)
 +-libsched_fcgi_la_LIBADD=
 ++libsched_fcgi_la_LDFLAGS= -rpath $(libdir) -release $(PACKAGE_VERSION)
 ++libsched_fcgi_la_LIBADD = ../lib/libboinc_crypt.la ../lib/libboinc_fcgi.la $(MYSQL_LIBS) -lfcgi
 + 
 + endif
 + # end of "if ENABLE_FCGI"
 + 
 +-# Some OSs may not prefix libraries with lib. 
 +-# For example OS2
 +-if OS_OS2
 +-LIBSCHED_STATIC=sched.${LIBEXT}
 +-LIBSCHED_FCGI_STATIC=sched_fcgi.${LIBEXT}
 +-else
 +-LIBSCHED_STATIC=libsched.${LIBEXT}
 +-LIBSCHED_FCGI_STATIC=libsched_fcgi.${LIBEXT}
 +-endif
 +-
 +-
 +-if BUILD_STATIC_LIBS
 +-all_local = $(LIBSCHED_STATIC)
 +-if ENABLE_FCGI
 +-all_local += $(LIBSCHED_FCGI_STATIC)
 +-endif
 +-endif
 +-
 +-all-local: $(all_local)
 +-
 +-$(LIBSCHED_STATIC): libsched.la
 +-	rm -f $(LIBSCHED_STATIC)
 +-	$(LN) .libs/$(LIBSCHED_STATIC)
 +-
 +-$(LIBSCHED_FCGI_STATIC): libsched_fcgi.la
 +-	rm -f $(LIBSCHED_FCGI_STATIC)
 +-	$(LN) .libs/$(LIBSCHED_FCGI_STATIC)
 +-
 +-
 + endif
 + # end of "if ENABLE_LIBRARIES
 + 
 +@@ -120,6 +92,8 @@
 + # scripts that 'make install' should put in bindir
 + bin_SCRIPTS = start stop status
 + 
 ++dist_data_DATA = db_dump_spec.xml
 ++
 + noinst_HEADERS = \
 +     assimilate_handler.h \
 +     handle_request.h \
 +@@ -155,29 +129,23 @@
 +     time_stats_log.cpp
 + 
 + cgi_SOURCES = $(cgi_sources)
 +-cgi_LDADD = $(SERVERLIBS)
 + 
 + census_SOURCES = \
 +     census.cpp \
 +     hr.cpp \
 +     hr_info.cpp
 +-census_LDADD = $(SERVERLIBS)
 + 
 + feeder_SOURCES = \
 +     feeder.cpp \
 +     hr.cpp \
 +     hr_info.cpp \
 +     ../lib/synch.cpp
 +-feeder_LDADD = $(SERVERLIBS)
 + 
 + wu_check_SOURCES = wu_check.cpp
 +-wu_check_LDADD = $(SERVERLIBS)
 + 
 + show_shmem_SOURCES = show_shmem.cpp
 +-show_shmem_LDADD = $(SERVERLIBS)
 + 
 + file_deleter_SOURCES = file_deleter.cpp
 +-file_deleter_LDADD = $(SERVERLIBS)
 + 
 + VALIDATOR_SOURCES = \
 + 	credit.cpp \
 +@@ -187,11 +155,9 @@
 + 
 + sample_bitwise_validator_SOURCES = $(VALIDATOR_SOURCES) \
 + 	sample_bitwise_validator.cpp 
 +-sample_bitwise_validator_LDADD = $(SERVERLIBS)
 + 
 + sample_trivial_validator_SOURCES = $(VALIDATOR_SOURCES) \
 + 	sample_trivial_validator.cpp
 +-sample_trivial_validator_LDADD = $(SERVERLIBS)
 + 
 + ASSIMILATOR_SOURCES = \
 + 	assimilator.cpp \
 +@@ -199,57 +165,40 @@
 + 
 + sample_dummy_assimilator_SOURCES = $(ASSIMILATOR_SOURCES) \
 + 	sample_dummy_assimilator.cpp
 +-sample_dummy_assimilator_LDADD = $(SERVERLIBS)
 + 
 + sample_assimilator_SOURCES = $(ASSIMILATOR_SOURCES) \
 + 	sample_assimilator.cpp
 +-sample_assimilator_LDADD = $(SERVERLIBS)
 + 
 + single_job_assimilator_SOURCES = $(ASSIMILATOR_SOURCES) \
 + 	single_job_assimilator.cpp
 +-single_job_assimilator_LDADD = $(SERVERLIBS)
 + 
 + sample_work_generator_SOURCES = sample_work_generator.cpp
 +-sample_work_generator_LDADD = $(SERVERLIBS)
 + 
 + db_dump_SOURCES = db_dump.cpp
 +-db_dump_LDADD = $(SERVERLIBS)
 + 
 + db_purge_SOURCES = db_purge.cpp
 +-db_purge_LDADD = $(SERVERLIBS)
 + 
 + trickle_handler_SOURCES = trickle_handler.cpp
 +-trickle_handler_LDADD = $(SERVERLIBS)
 + 
 + update_stats_SOURCES = update_stats.cpp
 +-update_stats_LDADD = $(SERVERLIBS)
 + 
 + file_upload_handler_SOURCES = file_upload_handler.cpp
 +-file_upload_handler_LDADD = $(SERVERLIBS)
 + 
 + make_work_SOURCES = make_work.cpp
 +-make_work_LDADD = $(SERVERLIBS)
 + 
 + transitioner_SOURCES = transitioner.cpp
 +-transitioner_LDADD = $(SERVERLIBS)
 + 
 + message_handler_SOURCES = message_handler.cpp
 +-message_handler_LDADD = $(SERVERLIBS)
 + 
 + request_file_list_SOURCES = request_file_list.cpp
 +-request_file_list_LDADD = $(SERVERLIBS)
 + 
 + get_file_SOURCES = get_file.cpp
 +-get_file_LDADD = $(SERVERLIBS)
 + 
 + send_file_SOURCES = send_file.cpp
 +-send_file_LDADD = $(SERVERLIBS)
 + 
 + delete_file_SOURCES = delete_file.cpp
 +-delete_file_LDADD = $(SERVERLIBS)
 + 
 + sched_driver_SOURCES = sched_driver.cpp
 +-sched_driver_LDADD = $(SERVERLIBS)
 + 
 + if ENABLE_FCGI
 + 
 +@@ -258,7 +207,7 @@
 + 
 + fcgi_SOURCES = $(cgi_sources)
 + fcgi_CPPFLAGS = -D_USING_FCGI_ $(AM_CPPFLAGS)
 +-fcgi_LDADD = $(SERVERLIBS_FCGI)
 ++fcgi_LDADD = libsched_fcgi.la
 + 
 + 
 + fcgi_file_upload_handler_SOURCES = \
 +@@ -266,7 +215,7 @@
 +     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 = libsched_fcgi.la
 + 
 + endif
 + # end of "if ENABLE_FCGI"
 +--- boinc-server-6.11.0+r18946.orig/sched/file_deleter.cpp
 ++++ boinc-server-6.11.0+r18946/sched/file_deleter.cpp
 +@@ -133,7 +133,7 @@
 + int get_file_path(
 +     const char *filename, char* upload_dir, int fanout, char* path
 + ) {
 +-    dir_hier_path(filename, upload_dir, fanout, path);
 ++    dir_hier_path(filename, upload_dir, fanout, path, true);
 +     if (boinc_file_exists(path)) {
 +         return 0;
 +     }
 +@@ -281,7 +281,7 @@
 + static bool preserve_wu_files=false;
 + static bool preserve_result_files=false;
 + 
 +-// return nonzero if did anything
 ++// return true if we changed the file_delete_state of a WU or a result
 + //
 + bool do_pass(bool retry_error) {
 +     DB_WORKUNIT wu;
 +@@ -289,7 +289,7 @@
 +     bool did_something = false;
 +     char buf[256];
 +     char clause[256];
 +-    int retval;
 ++    int retval, new_state;
 + 
 +     check_stop_daemons();
 + 
 +@@ -319,30 +319,33 @@
 +             }
 +             break;
 +         }
 +-        did_something = true;
 + 
 +-        retval = 0;
 +-        if (!preserve_wu_files) {
 ++        if (preserve_wu_files) {
 ++            retval = 0;
 ++        } else {
 +             retval = wu_delete_files(wu);
 +         }
 +         if (retval) {
 +-            wu.file_delete_state = FILE_DELETE_ERROR;
 ++            new_state = FILE_DELETE_ERROR;
 +             log_messages.printf(MSG_CRITICAL,
 +                 "[WU#%d] file deletion failed: %d\n", wu.id, retval
 +             );
 +         } else {
 +-            wu.file_delete_state = FILE_DELETE_DONE;
 ++            new_state = FILE_DELETE_DONE;
 +         }
 +-        sprintf(buf, "file_delete_state=%d", wu.file_delete_state);
 +-        retval = wu.update_field(buf);
 +-        if (retval) {
 +-            log_messages.printf(MSG_CRITICAL,
 +-                "[WU#%d] update failed: %d\n", wu.id, retval
 +-            );
 +-        } else {
 +-            log_messages.printf(MSG_DEBUG,
 +-                "[WU#%d] file_delete_state updated\n", wu.id
 +-            );
 ++        if (new_state != wu.file_delete_state) {
 ++            sprintf(buf, "file_delete_state=%d", new_state);
 ++            retval = wu.update_field(buf);
 ++            if (retval) {
 ++                log_messages.printf(MSG_CRITICAL,
 ++                    "[WU#%d] update failed: %d\n", wu.id, retval
 ++                );
 ++            } else {
 ++                log_messages.printf(MSG_DEBUG,
 ++                    "[WU#%d] file_delete_state updated\n", wu.id
 ++                );
 ++                did_something = true;
 ++            }
 +         } 
 +     }
 + 
 +@@ -362,30 +365,32 @@
 +             break;
 +         }
 + 
 +-        did_something = true;
 +-        retval = 0;
 +-        if (!preserve_result_files) {
 ++        if (preserve_result_files) {
 ++            retval = 0;
 ++        } else {
 +             retval = result_delete_files(result);
 +         }
 +         if (retval) {
 +-            result.file_delete_state = FILE_DELETE_ERROR;
 ++            new_state = FILE_DELETE_ERROR;
 +             log_messages.printf(MSG_CRITICAL,
 +                 "[RESULT#%d] file deletion failed: %d\n", result.id, retval
 +             );
 +         } else {
 +-            result.file_delete_state = FILE_DELETE_DONE;
 ++            new_state = FILE_DELETE_DONE;
 +         }
 +-        sprintf(buf, "file_delete_state=%d", result.file_delete_state); 
 +-        retval = result.update_field(buf);
 +-        retval = result.update_field(buf);
 +-        if (retval) {
 +-            log_messages.printf(MSG_CRITICAL,
 +-                "[RESULT#%d] update failed: %d\n", result.id, retval
 +-            );
 +-        } else {
 +-            log_messages.printf(MSG_DEBUG,
 +-                "[RESULT#%d] file_delete_state updated\n", result.id
 +-            );
 ++        if (new_state != result.file_delete_state) {
 ++            sprintf(buf, "file_delete_state=%d", new_state); 
 ++            retval = result.update_field(buf);
 ++            if (retval) {
 ++                log_messages.printf(MSG_CRITICAL,
 ++                    "[RESULT#%d] update failed: %d\n", result.id, retval
 ++                );
 ++            } else {
 ++                log_messages.printf(MSG_DEBUG,
 ++                    "[RESULT#%d] file_delete_state updated\n", result.id
 ++                );
 ++                did_something = true;
 ++            }
 +         } 
 +     } 
 + 
 +--- boinc-server-6.11.0+r18946.orig/sched/handle_request.cpp
 ++++ boinc-server-6.11.0+r18946/sched/handle_request.cpp
 +@@ -127,7 +127,7 @@
 + 
 +     sprintf(filename, "%s/CGI_%07d", config.sched_lockfile_dir, g_reply->host.id);
 + 
 +-    fd = open(filename, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
 ++    fd = open(filename, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH);
 +     if (fd < 0) return -1;
 + 
 +     // if we can't get an advisory write lock on the file,
 +@@ -591,7 +591,10 @@
 +         orp.reason = ABORT_REASON_NOT_FOUND;
 +         if (i > 0) result_names.append(", ");
 +         result_names.append("'");
 +-        result_names.append(orp.name);
 ++        char buf[1024];
 ++        strcpy(buf, orp.name);
 ++        escape_string(buf, 1024);
 ++        result_names.append(buf);
 +         result_names.append("'");
 +     }
 + 
 +--- boinc-server-6.11.0+r18946.orig/sched/transitioner.cpp
 ++++ boinc-server-6.11.0+r18946/sched/transitioner.cpp
 +@@ -301,7 +301,28 @@
 +         );
 +         wu_item.error_mask |= WU_ERROR_TOO_MANY_ERROR_RESULTS;
 +     }
 +-    if ((int)items.size() > wu_item.max_total_results) {
 ++
 ++    // see how many new results we need to make
 ++    //
 ++    int n_new_results_needed = wu_item.target_nresults - nunsent - ninprogress - nsuccess;
 ++    if (n_new_results_needed < 0) n_new_results_needed = 0;
 ++    int n_new_results_allowed = wu_item.max_total_results - (int)items.size();
 ++
 ++    // if we're already at the limit and need more, error out the WU
 ++    //
 ++    bool too_many = false;
 ++    if (n_new_results_allowed < 0) {
 ++        too_many = true;
 ++    } else if (n_new_results_allowed == 0) {
 ++        if (n_new_results_needed > 0) {
 ++            too_many = true;
 ++        }
 ++    } else {
 ++        if (n_new_results_needed > n_new_results_allowed) {
 ++            n_new_results_needed = n_new_results_allowed;
 ++        }
 ++    }
 ++    if (too_many) {
 +         log_messages.printf(MSG_NORMAL,
 +             "[WU#%d %s] WU has too many total results (%d)\n",
 +             wu_item.id, wu_item.name, (int)items.size()
 +@@ -360,18 +381,17 @@
 +     } else if (wu_item.canonical_resultid == 0) {
 +         // Here if no WU-level error.
 +         // Generate new results if needed.
 +-        // NOTE: n must be signed
 +         //
 +-        int n = wu_item.target_nresults - nunsent - ninprogress - nsuccess;
 +         std::string values;
 +         char value_buf[MAX_QUERY_LEN];
 +-        if (n > 0) {
 ++        if (n_new_results_needed > 0) {
 +             log_messages.printf(
 +                 MSG_NORMAL,
 +                 "[WU#%d %s] Generating %d more results (%d target - %d unsent - %d in progress - %d success)\n",
 +-                wu_item.id, wu_item.name, n, wu_item.target_nresults, nunsent, ninprogress, nsuccess
 ++                wu_item.id, wu_item.name, n_new_results_needed,
 ++                wu_item.target_nresults, nunsent, ninprogress, nsuccess
 +             );
 +-            for (j=0; j<n; j++) {
 ++            for (j=0; j<n_new_results_needed; j++) {
 +                 sprintf(suffix, "%d", max_result_suffix+j+1);
 +                 const char *rtfpath = config.project_path("%s", wu_item.result_template_file);
 +                 int priority_increase = 0;
 +--- boinc-server-6.11.0+r18946.orig/sched/start
 ++++ boinc-server-6.11.0+r18946/sched/start
 +@@ -226,10 +226,19 @@
 +     si = open(stdin, 'r')
 +     if not stderr: stderr = stdout
 +     se = open(stderr, 'a+', 0)
 ++    try:
 ++        # fchmod would be better, but that requires Python 2.6
 ++        os.chmod(stderr, 0640)
 ++    except OSError, e:
 ++        pass
 +     if stdout == stderr:
 +         so = se
 +     else:
 +         so = open(stdout, 'a+')
 ++        try:
 ++            os.chmod(stdout, 0640)
 ++        except OSError, e:
 ++            pass
 + 
 +     # Redirect standard file descriptors.
 +     os.dup2(si.fileno(), sys.stdin.fileno())
 +@@ -328,12 +337,18 @@
 + def lookup_task_run_state(task):
 +     for run_state_task in run_state.tasks:
 +         if run_state_task.cmd == task.cmd:
 +-            run_state_task.prunable = False
 ++            if task.disabled:
 ++                run_state_task.prunable = True
 ++            else:
 ++                run_state_task.prunable = False
 +             return run_state_task
 +     run_state_task = run_state.tasks.make_node_and_append('task')
 +     run_state_task.cmd = task.cmd
 +     run_state_task.last_run = 0
 +-    run_state_task.prunable = False
 ++    if task.disabled:
 ++        run_state_task.prunable = True
 ++    else:
 ++        run_state_task.prunable = False
 +     return run_state_task
 + 
 + def interpret_period(str):
 +@@ -450,7 +465,8 @@
 +         return
 +     for run_state_task in run_state.tasks:
 +         if run_state_task.prunable:
 +-            print 'Deleting obsolete run_state task', run_state_task.cmd, '(last run %s)' %timestamp(float(run_state_task.last_run))
 ++            if verbose:
 ++                print 'Deleting obsolete run_state task', run_state_task.cmd, '(last run %s)' %timestamp(float(run_state_task.last_run))
 +             run_state.tasks.remove_node(run_state_task)
 + 
 + def stop_daemon(pid):
diff --combined debian/patches/series
index 28bacbe,9eb95b1..0e90dca
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,8 -1,3 +1,8 @@@
 +upstream_sztaki_Help_Function_Declaration_with_void.patch
 +local_sztaki_NoWriteFcgiWithHostinfo.patch
 +local_sztaki_m4_libcurl_update.patch
 +upstream_sztaki_LIBEXEC_DIR.patch
 +local_sztaki_allow_world_read_and_execute_directory.patch
  AvoidingBlanksInMakefiles.patch
  pythonPath.patch
  calculate_credit_multiplier.patch
@@@ -15,5 -10,4 +15,6 @@@ csh2tcsh.patc
  file_upload_handler_permission.patch
  upstream_sztaki_usingTempfileInUpdateVersions.patch
  upstream_sztaki_reduce_accessibility_of_php_inc_file.patch
 +upstream_sztaki_moreVoidArgumentsMadeExplicit_Boinc_API.patch
 +upstream_sztaki_NewSQLindices.patch
+ upstream_sztaki_html_path.patch

-- 
BOINC packaging



More information about the pkg-boinc-commits mailing list