Sprout from master 2005-08-08 14:17:20 UTC Aleš Křenek <ljocha@ics.muni.cz> 'clean up install: tools to sbin, examples to examples'
Cherrypick from master 2005-10-12 12:20:59 UTC Andrew McNab <andrew.mcnab@manchester.ac.uk> 'Older OpenSSL fix':
org.gridsite.core/CHANGES
org.gridsite.core/INSTALL
org.gridsite.core/README
org.gridsite.core/VERSION
org.gridsite.core/doc/delegation-1.wsdl
org.gridsite.core/doc/findproxyfile.1
org.gridsite.core/doc/gsexec.8
org.gridsite.core/doc/htcp.1
org.gridsite.core/doc/htfind.1
org.gridsite.core/doc/htmv.1
org.gridsite.core/doc/htping.1
org.gridsite.core/doc/httpd-fileserver.conf
org.gridsite.core/doc/httpd-webserver.conf
org.gridsite.core/doc/index.html
org.gridsite.core/doc/mod_gridsite.8
org.gridsite.core/doc/urlencode.1
org.gridsite.core/interface/gridsite.h
org.gridsite.core/project/version.properties
org.gridsite.core/src/Makefile
org.gridsite.core/src/gridsite.spec
org.gridsite.core/src/grst_asn1.c
org.gridsite.core/src/grst_gacl.c
org.gridsite.core/src/grst_htcp.c
org.gridsite.core/src/grst_http.c
org.gridsite.core/src/grst_x509.c
org.gridsite.core/src/gsexec.c
org.gridsite.core/src/htcp
org.gridsite.core/src/htcp.c
org.gridsite.core/src/mod_gridsite.c
org.gridsite.core/src/showx509exts.c
Cherrypick from master 2004-08-17 13:41:21 UTC Elisabetta Ronchieri <elisabetta.ronchieri@cnaf.infn.it> 'Moved out JobIdExceptions.h cjobid.h JobId.h':
org.glite.security.proxyrenewal/project/configure.properties.xml
org.glite.wms-utils.jobid/interface/glite/wmsutils/jobid/JobId.h
Cherrypick from master 2005-02-15 09:29:04 UTC Jiří Škrábal <nykolas@ics.muni.cz> '- files lb_gss.* renamed to glite_gss.*':
org.glite.security.gsoap-plugin/test/test_gss.cpp
Cherrypick from master 2005-08-11 12:04:48 UTC Aleš Křenek <ljocha@ics.muni.cz> 'Tagged dependencies properties file [GLBUILDER]':
org.glite.lb/project/dependencies.properties
Cherrypick from glite-security-proxyrenewal_branch_1_0_0_RC1 2005-08-10 18:42:48 UTC Joni Hahkala <joni.hahkala@cern.ch> 'get the header from teh right place after the removal of the copy':
org.glite.security.proxyrenewal/Makefile
org.glite.security.proxyrenewal/build.xml
org.glite.security.proxyrenewal/config/startup
org.glite.security.proxyrenewal/interface/renewal.h
org.glite.security.proxyrenewal/project/build.number
org.glite.security.proxyrenewal/project/version.properties
org.glite.security.proxyrenewal/src/api.c
org.glite.security.proxyrenewal/src/commands.c
org.glite.security.proxyrenewal/src/common.c
org.glite.security.proxyrenewal/src/renew.c
org.glite.security.proxyrenewal/src/renewal_locl.h
org.glite.security.proxyrenewal/src/renewd.c
org.glite.security.proxyrenewal/src/renewd_locl.h
org.glite.security.proxyrenewal/src/voms.c
Cherrypick from glite-deployment-lb_branch_2_0_0 2005-10-31 11:08:31 UTC Master Builder <glbuilder@cern.ch> 'Incremented build number [GLBUILDER]':
org.glite.deployment.lb/CHANGELOG
org.glite.deployment.lb/config/scripts/glite-lb-config.py
org.glite.deployment.lb/config/templates/glite-lb.cfg.xml
org.glite.deployment.lb/doc/release_notes/release_notes.doc
org.glite.deployment.lb/doc/release_notes/release_notes.html
org.glite.deployment.lb/doc/release_notes/release_notes.pdf
org.glite.deployment.lb/project/build.number
org.glite.deployment.lb/project/glite-lb.sdf.xml.template
org.glite.deployment.lb/project/lxscript-rpm.xsl
org.glite.deployment.lb/project/quattor-template.xsl
org.glite.deployment.lb/project/version.properties
Cherrypick from glite-security-gsoap-plugin_branch_1_1_0 2005-06-02 11:00:51 UTC Jiří Škrábal <nykolas@ics.muni.cz> '- clean connection on unsuccessfull connect':
org.glite.security.gsoap-plugin/Makefile
org.glite.security.gsoap-plugin/build.xml
org.glite.security.gsoap-plugin/project/build.number
org.glite.security.gsoap-plugin/project/configure.properties.xml
org.glite.security.gsoap-plugin/project/version.properties
org.glite.security.gsoap-plugin/src/glite_gsplugin.c
org.glite.security.gsoap-plugin/src/stdsoap2_2.6.2.c
Cherrypick from glite-wms-utils-exception_branch_1_0_0 2005-07-28 13:55:08 UTC Giuseppe Avellino <giuseppe.avellino@datamat.it> 'updating version':
org.glite.wms-utils.exception/build.xml
org.glite.wms-utils.exception/configure.ac
org.glite.wms-utils.exception/interface/glite/wmsutils/exception/Exception.h
org.glite.wms-utils.exception/project/build.number
org.glite.wms-utils.exception/project/version.properties
org.glite.wms-utils.exception/src/Exception.cpp
Cherrypick from glite-lb-server_branch_1_2_4 2005-08-11 12:01:36 UTC Aleš Křenek <ljocha@ics.muni.cz> 'pushed version to reflect internal testing fixes':
org.glite.lb.server/Makefile
org.glite.lb.server/project/configure.properties.xml
org.glite.lb.server/project/version.properties
org.glite.lb.server/src/request.c
Cherrypick from glite-lb-client_branch_2_0_0 2005-08-11 11:58:24 UTC Aleš Křenek <ljocha@ics.muni.cz> 'pushed version to reflect internal testing fixes':
org.glite.lb.client/project/version.properties
org.glite.lb.client/src/prod_proto.c
org.glite.lb.client/src/producer.c
Cherrypick from glite-lb-common_branch_2_0_0 2005-08-11 11:57:43 UTC Aleš Křenek <ljocha@ics.muni.cz> 'pushed version to reflect internal testing fixes':
org.glite.lb.common/project/version.properties
org.glite.lb.common/src/il_msg.c
org.glite.lb.common/test/il_msg_test.cpp
Cherrypick from glite-wms-utils-jobid_branch_1_0_0 2005-04-03 01:12:39 UTC Master Builder <glbuilder@cern.ch> 'Incremented build number [GLBUILDER]':
org.glite.wms-utils.jobid/build.xml
org.glite.wms-utils.jobid/project/build.number
org.glite.wms-utils.jobid/project/version.properties
Cherrypick from glite-lb-logger_branch_1_1_1 2005-08-11 12:00:24 UTC Aleš Křenek <ljocha@ics.muni.cz> 'pushed version to reflect internal testing fixes':
org.glite.lb.logger/project/version.properties
org.glite.lb.logger/src/server_msg.c
Cherrypick from glite-lb_branch_1_1_0_ 2005-08-11 12:03:14 UTC Aleš Křenek <ljocha@ics.muni.cz> 'pushed version to reflect internal testing fixes':
org.glite.lb/project/version.properties
Delete:
org.glite.deployment.lb/config/scripts/remove_all_rpms.sh
org.glite.jp.client/.cvsignore
org.glite.jp.client/Makefile
org.glite.jp.client/build.xml
org.glite.jp.client/project/build.number
org.glite.jp.client/project/build.properties
org.glite.jp.client/project/configure.properties.xml
org.glite.jp.client/project/properties.xml
org.glite.jp.client/project/tar_exclude
org.glite.jp.client/project/version.properties
org.glite.jp.client/src/authz.c
org.glite.jp.client/src/authz.h
org.glite.jp.client/src/backend.h
org.glite.jp.client/src/bones_server.c
org.glite.jp.client/src/builtin_plugins.h
org.glite.jp.client/src/db.h
org.glite.jp.client/src/feed.c
org.glite.jp.client/src/feed.h
org.glite.jp.client/src/file_plugin.c
org.glite.jp.client/src/ftp_backend.c
org.glite.jp.client/src/is_client.c
org.glite.jp.client/src/jpimporter.c
org.glite.jp.client/src/jptype_map.h
org.glite.jp.client/src/mysql.c
org.glite.jp.client/src/new_ftp_backend.c
org.glite.jp.client/src/simple_server.c
org.glite.jp.client/src/soap_ops.c
org.glite.jp.client/src/tags.c
org.glite.jp.client/src/tags.h
org.glite.jp.client/src/tags_plugin.c
org.glite.jp.client/src/typemap.dat
org.glite.jp.common/.cvsignore
org.glite.jp.common/Makefile
org.glite.jp.common/build.xml
org.glite.jp.common/interface/context.h
org.glite.jp.common/interface/strmd5.h
org.glite.jp.common/interface/type_plugin.h
org.glite.jp.common/interface/types.h
org.glite.jp.common/project/build.number
org.glite.jp.common/project/build.properties
org.glite.jp.common/project/configure.properties.xml
org.glite.jp.common/project/properties.xml
org.glite.jp.common/project/tar_exclude
org.glite.jp.common/project/version.properties
org.glite.jp.common/src/attr.c
org.glite.jp.common/src/context.c
org.glite.jp.common/src/stdtypes.c
org.glite.jp.common/src/strmd5.c
org.glite.jp.index/.cvsignore
org.glite.jp.index/Makefile
org.glite.jp.index/build.xml
org.glite.jp.index/project/JobProvenanceIS.wsdl
org.glite.jp.index/project/build.number
org.glite.jp.index/project/build.properties
org.glite.jp.index/project/configure.properties.xml
org.glite.jp.index/project/properties.xml
org.glite.jp.index/project/tar_exclude
org.glite.jp.index/project/version.properties
org.glite.jp.index/src/simple_server.c
org.glite.jp.index/src/soap_ops.c
org.glite.jp.index/src/typemap.dat
org.glite.jp.primary/.cvsignore
org.glite.jp.primary/Makefile
org.glite.jp.primary/build.xml
org.glite.jp.primary/config/glite-jp-primary-dbsetup.sql
org.glite.jp.primary/examples/README.test
org.glite.jp.primary/examples/jpps-test.c
org.glite.jp.primary/interface/file_plugin.h
org.glite.jp.primary/project/build.number
org.glite.jp.primary/project/build.properties
org.glite.jp.primary/project/configure.properties.xml
org.glite.jp.primary/project/properties.xml
org.glite.jp.primary/project/tar_exclude
org.glite.jp.primary/project/version.properties
org.glite.jp.primary/src/authz.c
org.glite.jp.primary/src/authz.h
org.glite.jp.primary/src/backend.h
org.glite.jp.primary/src/bones_server.c
org.glite.jp.primary/src/builtin_plugins.h
org.glite.jp.primary/src/db.h
org.glite.jp.primary/src/feed.c
org.glite.jp.primary/src/feed.h
org.glite.jp.primary/src/file_plugin.c
org.glite.jp.primary/src/ftp_backend.c
org.glite.jp.primary/src/is_client.c
org.glite.jp.primary/src/is_client.h
org.glite.jp.primary/src/jptype_map.h
org.glite.jp.primary/src/mysql.c
org.glite.jp.primary/src/new_ftp_backend.c
org.glite.jp.primary/src/simple_server.c
org.glite.jp.primary/src/soap_ops.c
org.glite.jp.primary/src/tags.c
org.glite.jp.primary/src/tags.h
org.glite.jp.primary/src/tags_plugin.c
org.glite.jp.primary/src/typemap.dat
org.glite.jp.ws-interface/.cvsignore
org.glite.jp.ws-interface/LICENSE
org.glite.jp.ws-interface/Makefile
org.glite.jp.ws-interface/build.xml
org.glite.jp.ws-interface/interface/JobProvenanceIS.wsdl
org.glite.jp.ws-interface/project/build.number
org.glite.jp.ws-interface/project/build.properties
org.glite.jp.ws-interface/project/configure.properties.xml
org.glite.jp.ws-interface/project/glite-jp-ws-interface.spec
org.glite.jp.ws-interface/project/properties.xml
org.glite.jp.ws-interface/project/tar_exclude
org.glite.jp.ws-interface/project/version.properties
org.glite.jp.ws-interface/src/JobProvenancePS.xml
org.glite.jp.ws-interface/src/JobProvenanceTypes.xml
org.glite.jp.ws-interface/src/doc.xml
org.glite.jp.ws-interface/src/puke-ug.xsl
org.glite.jp.ws-interface/src/puke-wsdl.xsl
org.glite.jp/.cvsignore
org.glite.jp/build.xml
org.glite.jp/project/build.number
org.glite.jp/project/build.properties
org.glite.jp/project/dependencies.properties
org.glite.jp/project/glite.jp.csf.xml
org.glite.jp/project/properties.xml
org.glite.jp/project/run-workspace
org.glite.jp/project/taskdefs.xml
org.glite.jp/project/version.properties
org.glite.security.proxyrenewal/src/acstack.h
org.glite.security.proxyrenewal/src/newformat.h
org.glite.wms-utils.exception/test/Makefile.am
org.glite.wms-utils.exception/test/exception_cu_main.cpp
org.glite.wms-utils.exception/test/exception_cu_suite.cpp
org.glite.wms-utils.exception/test/exception_cu_suite.h
org.glite.wms-utils.jobid/test/Makefile.am
org.glite.wms-utils.jobid/test/jobid_cu_main.cpp
org.glite.wms-utils.jobid/test/jobid_cu_suite.cpp
org.glite.wms-utils.jobid/test/jobid_cu_suite.h
org.glite.wms-utils.jobid/test/manipulation_cu_main.cpp
org.glite.wms-utils.jobid/test/manipulation_cu_suite.cpp
org.glite.wms-utils.jobid/test/manipulation_cu_suite.h
org.gridsite.core/doc/admin.html
org.gridsite.core/doc/config.html
org.gridsite.core/doc/gacl.html
org.gridsite.core/doc/install.html
org.gridsite.core/doc/library.html
org.gridsite.core/doc/module.html
org.gridsite.core/doc/user.html
+DATE: 12-10-2005 00:15\r
+[dimeglio] Use checkMySQLConfiguration function to check root password\r
+\r
+DATE: 13-09-2005 23:00\r
+[dimeglio] Use standard mysql module functions to create db\r
+\r
+DATE: 08-07-2005 15:20\r
+[dimeglio] Increased major version because of interface changes in the config scripts\r
+\r
DATE: 08-07-2005 15:20\r
[dimeglio] Merged from branch 1.2.2\r
\r
# For license conditions see the license file or http://eu-egee.org/license.html
#
################################################################################
-# glite-lb-config v. 1.3.0
+# glite-lb-config v. 2.0.4
#
# Post-installation script for configuring the gLite Logging and Bookkeping Server
# Robert Harakaly < robert.harakaly@cern.ch >
# Version info: $Id$
#
# Usage: python glite-lb-config [-c|-v|-h|--help]
-# -c print configuration
-# -v print version
-# -h,--help print usage info
+# -c, --checkconf print configuration
+# -v, --version print version
+# -h,--help print usage info
+# --configure configure the service
+# --start start the service
+# --stop stop the service
+# --status show service status
#
# Return codes: 0 - Ok
# 1 - Configuration failed
def __init__(self):
self.mysql = MySQL.Mysql()
self.verbose = 0
- self.version = "1.3.0"
+ self.version = "2.0.4"
self.name = "glite-lb"
self.friendly_name = "gLite Logging and Bookkeeping"
params['module.version'] = self.version
print ' -c, --checkconf print the service configuration'
print ' -v, --version print the version of the configuration script'
print ' -h, --help print this usage information'
+ print ' --configure configure the service'
print ' --start start the service'
print ' --stop stop the service'
print ' --status check service status'
print 'The LB Server service has been stopped ',
glib.printOkMessage()
+ #-------------------------------------------------------------------
+ # MySQL
+ #-------------------------------------------------------------------
+
self.mysql.stop()
#-------------------------------------------------------------------
#--------------------------------------------------------
if os.system("python %s/glite-security-utils-config.py --subservice" % glib.getScriptPath()):
- print "\nInstalling gLite Security Utilities ",
+ print "\nConfiguring gLite Security Utilities ",
glib.printFailedMessage()
- return 1
-
- print "\nInstalling gLite Security Utilities ",
- glib.printOkMessage()
+ else:
+ print "\nConfiguring gLite Security Utilities ",
+ glib.printOkMessage()
# Create the GLITE_USER if it doesn't exists
print "\nCreating/Verifying the GLITE_USER account %s" % os.environ['GLITE_USER']
os.chmod("%s/hostkey.pem" % lb_cert_path, 0400)
glib.printOkMessage()
- # Create the MySQL database
- print "\nCreate/Verify the %s database" % params['lb.database.name']
+ #--------------------------------------------------------
+ # Configure MySQL
+ #--------------------------------------------------------
+
+ # start MySQL
self.mysql.stop()
time.sleep(5)
- self.mysql.start()
-
+ self.mysql.start()
+
if not os.path.exists('/tmp/mysql.sock'):
os.symlink('/var/lib/mysql/mysql.sock', '/tmp/mysql.sock')
+ # ------------------------------------------------------------
+ # Check password of MySQL
+ # ------------------------------------------------------------
+
+ self.mysql_root_password = params['mysql.root.password']
+ if not params.has_key('set.mysql.root.password'):
+ params['set.mysql.root.password'] = 'false'
+ setempty = params['set.mysql.root.password']
+ if self.mysql.checkMySQLConfiguration(self.mysql_root_password,setempty):
+ return 1
+
+ # Create the MySQL database
+ print "\nCreate/Verify the %s database" % params['lb.database.name']
+
# Check if database exists
- if self.mysql.existsDB(params['lb.database.name']) != 0:
+ if self.mysql.existsDB(params['lb.database.name'],self.mysql_root_password) != 0:
# Create database
print ('\n==> Creating MySQL %s database\n' % params['lb.database.name'])
os.remove('/tmp/mysql_ct')
file = open('/tmp/mysql_ct', 'w')
- text = ['CREATE DATABASE %s;\n' % params['lb.database.name'],
- 'GRANT ALL PRIVILEGES ON %s.* TO %s@localhost IDENTIFIED BY "";\n' \
- % (params['lb.database.name'],params['lb.database.username']),
- 'USE %s;\n' % params['lb.database.name'],
- '\. %s/etc/glite-lb-dbsetup.sql\n' % os.environ['GLITE_LOCATION']]
+
+ self.mysql.add_user(params['lb.database.name'],params['lb.database.username'],"",self.mysql_root_password)
+ text = ['USE %s;\n' % params['lb.database.name'],
+ '\. %s/etc/glite-lb-dbsetup.sql\n' % os.environ['GLITE_LOCATION']]
file.writelines(text)
file.close()
- os.system('/usr/bin/mysql < /tmp/mysql_ct')
+ os.system('/usr/bin/mysql -p%s < /tmp/mysql_ct' % self.mysql_root_password)
os.system('/bin/rm /tmp/mysql_ct')
#Starting and stopping the database before the index creation
# Set all environment variables
#-------------------------------------------------------------------------------
+def loadDefaults(params):
+
+ params['GLITE_LOCATION'] = "/opt/glite"
+ params['mysql.root.password'] = ""
+ params['lb.database.name'] = "lbserver20"
+ params['lb.database.username'] = "lbserver"
+
def set_env():
# gLite
# Load parameters
params = {}
+ loadDefaults(params)
try:
- opts, args = getopt.getopt(sys.argv[1:], '', ['siteconfig='])
+ opts, args = glib.getopt(sys.argv[1:], '', ['siteconfig='])
for o, a in opts:
if o == "--siteconfig":
params['site.config.url'] = a
# Command line opts if any
try:
- opts, args = getopt.getopt(sys.argv[1:], 'chv', ['checkconf', 'help', 'version','stop','start','status','siteconfig='])
+ opts, args = glib.getopt(sys.argv[1:], 'chv', ['checkconf', 'help', 'version','configure','stop','start','status','siteconfig='])
except getopt.GetoptError:
service.usage(msg = "Unknown options(s)")
sys.exit(1)
+ if len(opts) == 0:
+ service.usage()
+ sys.exit(0)
+
# Check cli options
for o, a in opts:
+
if o in ("-h", "--help"):
service.usage()
sys.exit(0)
+
if o in ("-v", "--version"):
service.showVersion()
sys.exit(0)
+
if o in ("-c", "--checkconf"):
service.copyright()
service.showVersion()
glib.print_params(params)
sys.exit(0)
- if o in ("stop", "--stop"):
+
+ if o == "--configure":
+
+ # Check certificates
+ if params.has_key('glite.installer.checkcerts'):
+ if params['glite.installer.checkcerts'] == "true":
+ if glib.check_certs(params) != 0:
+ print "An error occurred while configuring the %s service" \
+ % service.friendly_name
+ sys.exit(1)
+
+ # Print configuration parameters
+ if verbose:
+ glib.print_params(params)
+
+ service.copyright()
+ service.showVersion()
+ service.banner()
+
+ # Stop all services
+ glib.printInfoMessage("\n\nStopping all running LB services...")
service.stop()
- sys.exit(0)
- if o in ("start", "--start"):
- service.start()
- sys.exit(0)
- if o == "--status":
- sys.exit(service.status())
+
+ # Configure the service
+ return_result = service.configure()
+
+ if return_result == 0:
+
+ # Stop all services
+ glib.printInfoMessage("\n\nStopping all running LB services...")
+ service.stop()
+
+ print "\n\nThe %s configuration was successfully completed\n" % service.friendly_name
+ print "You can now start the service using the --start option of this script\n\n"
+ glib.registerService()
+
+ sys.exit(0)
+
+ elif return_result == 2:
+
+ # Stop all services
+ glib.printInfoMessage("\n\nStopping all running LB services...")
+ service.stop()
+ print "\n\nThe %s configuration was completed,\n" % service.friendly_name
+ print "but warnings were issued. Please revise them and re-run the script\n"
+ print "or configure LB manually\n"
+
+ sys.exit(2)
- # Check certificates
- if params.has_key('glite.installer.checkcerts'):
- if params['glite.installer.checkcerts'] == "true":
- if glib.check_certs(params) != 0:
- print "An error occurred while configuring the %s service" \
+ else:
+ print "\n\nAn unrecoverable error occurred while configuring the %s" \
% service.friendly_name
- sys.exit(1)
-
- # Print configuration parameters
- if verbose:
- glib.print_params(params)
- service.copyright()
- service.showVersion()
- service.banner()
-
- # Configure the service
- if service.configure() == 0:
- print "\n%s configuration successfully completed " % service.friendly_name,
- glib.printOkMessage()
- glib.registerService()
- else:
- print "\nAn error occurred while configuring the %s " % service.friendly_name,
- glib.printFailedMessage()
- sys.exit(1)
+ sys.exit(1)
+
+ if o in ("start", "--start"):
+ # Start the service
+ if service.start() == 0:
+ print "\n\nThe %s was successfully started " % service.friendly_name,
+ glib.printOkMessage()
+ sys.exit(0)
+ else:
+ print "\n\nAn error occurred while starting the %s " % service.friendly_name,
+ glib.printFailedMessage()
+ sys.exit(1)
+
+ if o in ("stop", "--stop"):
+ # Stop the service
+ if service.stop() == 0:
+ print "\n\nThe %s was successfully stopped " % service.friendly_name,
+ glib.printOkMessage()
+ sys.exit(0)
+ else:
+ print "\n\nAn unrecoverable error occurred while stopping the %s " % service.friendly_name,
+ glib.printFailedMessage()
+ sys.exit(1)
- # Start the service
- if service.start() == 0:
- print "\nThe %s was successfully started " % service.friendly_name,
- glib.printOkMessage()
- else:
- print "\nAn error occurred while starting the %s " % service.friendly_name,
- glib.printFailedMessage()
- sys.exit(1)
-
+ if o == "--status":
+ sys.exit(service.status())
+
+++ /dev/null
-
-#!/bin/sh
-
-rpm -e edg-fetch-crl-1.0.0-EGEE \
-ca_ArmeSFo-0.23-1 \
-ca_ASGCCA-0.23-1 \
-ca_BEGrid-0.23-1 \
-ca_CERN-0.23-1 \
-ca_CESNET-0.23-1 \
-ca_CNRS-0.23-1 \
-ca_CNRS-DataGrid-0.23-1 \
-ca_CNRS-Projets-0.23-1 \
-ca_CyGrid-0.23-1 \
-ca_DOEGrids-0.23-1 \
-ca_DOESG-Root-0.23-1 \
-ca_ESnet-0.23-1 \
-ca_FNAL-0.23-1 \
-ca_FNAL_KCA-0.23-1 \
-ca_GermanGrid-0.23-1 \
-ca_Grid-Ireland-0.23-1 \
-ca_GridCanada-0.23-1 \
-ca_HellasGrid-0.23-1 \
-ca_INFN-0.23-1 \
-ca_IUCC-0.23-1 \
-ca_LIP-0.23-1 \
-ca_NIKHEF-0.23-1 \
-ca_NorduGrid-0.23-1 \
-ca_PK-Grid-0.23-1 \
-ca_PolishGrid-0.23-1 \
-ca_Russia-0.23-1 \
-ca_SlovakGrid-0.23-1 \
-ca_Spain-0.23-1 \
-ca_UKeScience-0.23-1 \
-glite-wms-utils-exception-0.1.0-0 \
-glite-wms-utils-jobid-0.1.0-0 \
-glite-lb-client-interface-0.2.0-0 \
-glite-lb-server-bones-0.0.0-0 \
-glite-lb-common-0.2.0-0 \
-glite-lb-logger-0.2.0-0 \
-glite-lb-server-0.3.0-0 \
-glite-security-proxyrenewal-0.1.0-1 \
-ares-1.1.1-EGEE \
-gpt-VDT1.2.0rh9-1 \
-vdt_globus_essentials-VDT1.2.0rh9-1 \
-perl-Expect.pm-1.01-9 \
-myproxy-1.14-EGEE \
-MySQL-client-4.0.20-0 \
-MySQL-server-4.0.20-0
-
parameter. Leave it empty of comment it out to use the same as 'glite.user.name'"
value="changeme"/>
+ <mysql.root.password
+ description="The mysql root password"
+ value="changeme"/>
+
<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
<!-- Advanced parameters - Change them if you know what you're doing -->
<!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
description="Enable check of host certificates"
value="true"/>
- <!-- MySQL DB -->
- <lb.database.name
- description="The mySQL database name to create for storing LB data
- In this version it must be set to the given value"
- value="lbserver20"/>
+ <!-- mysql configuration -->
+ <set.mysql.root.password
+ description="If this parameter is true, then the root password of the mysql database
+ is set to the value specified in mysql.root.password if it not yet set. This parameter has
+ no effect if the database root password is already set. It can be used to ease automated
+ installation and configuration of the service, if mysql is not managed in some other way"
+ value="false"/>
+ <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
+ <!-- System parameters - You should leave these alone -->
+ <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
+
<lb.index.list
description="Definitions of indices on all the currently supported indexed system attributes">
</lb.index.list>
- <lb.database.username
- description="The username to be used to access the local mySQL server
- In this version it must be set to the given value"
- value="lbserver"/>
-
- <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
- <!-- System parameters - You should leave these alone -->
- <!-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
-
</parameters>
<!--RGMA service publishing: log server -->
value="true"/>
+ <rgma.servicetool.service_type
+ description="The service type. This should be uniquely defined for each service type.
+ The recommended format is the service namespace in
+ reversed domain name format [Type: 'string']"
+ value="org.glite.lb.lbserver"/>
+
<rgma.servicetool.name
- description="Name of the service. This should be globally unique.
- Example: your.host.name_Logging_Bookkeeping_Server
- [Type: 'String']"
- value="${HOSTNAME}_Logging_Bookkeeping_Server"/>
+ description="Name of the service. This should be globally unique.
+ [Example: 'HOSTANME_LB_LocalLogger'] [Type: 'String']"
+ value="${HOSTNAME}_${rgma.servicetool.service_type}"/>
<rgma.servicetool.url_endpoint
description="URL to contact the service at.
This should be unique for each service. Use example and adapt host.
Example: http://your.host.name/LB/LBServer
[Type: 'string']"
- value="http://${HOSTNAME}/LB/LBServer"/>
-
- <rgma.servicetool.service_type
- description="The service type. This should be uniquely defined for
- each service type. Currently two methods of type naming are recommended:
- (1) The targetNamespace from the WSDL document,
- followed by a space and then the service name.
- (2) A URL owned by the body or individual who defines the service type.
- Example: Logging and Bookkeeping Server
- [Type: 'string']"
- value="Logging and Bookkeeping Server"/>
+ value="not available"/>
<rgma.servicetool.service_version
description="Service version in the form 'major.minor.patch'
<rgma.servicetool.status_interval
description="How often to check and publish service status.
Example: 60 [Type: 'string'] [Unit: 'seconds']"
- value="60"/>
+ value="30"/>
<rgma.servicetool.url_wsdl
description="URL of a WSDL document for the service (leave blank if the
service has no WSDL).
Example: http://example.rl.ac.uk/service?WSDL
[Type: 'string']"
- value="n/a"/>
+ value="not available"/>
<rgma.servicetool.url_semantics
description="URL of a document containing a detailed description of the service
and how it should be used.
Example: http://example.rl.ac.uk/service/semantics.html
[Type: 'string']"
- value="n/a"/>
+ value="not available"/>
</parameters>
</instance>
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
+ {font-family:"MS Mincho";
+ panose-1:2 2 6 9 4 2 5 8 3 4;}
+@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
+ {font-family:"\@MS Mincho";
+ panose-1:2 2 6 9 4 2 5 8 3 4;}
+@font-face
+ {font-family:ZWAdobeF;
+ panose-1:0 0 0 0 0 0 0 0 0 0;}
+@font-face
{font-family:Times;
panose-1:2 2 6 3 5 4 5 2 3 4;}
@font-face
text-align:justify;
font-size:12.0pt;
font-family:"Times New Roman";}
+p.MsoIndex2, li.MsoIndex2, div.MsoIndex2
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:22.0pt;
+ text-align:justify;
+ text-indent:-11.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoIndex3, li.MsoIndex3, div.MsoIndex3
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:33.0pt;
+ text-align:justify;
+ text-indent:-11.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoIndex4, li.MsoIndex4, div.MsoIndex4
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:44.0pt;
+ text-align:justify;
+ text-indent:-11.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoIndex5, li.MsoIndex5, div.MsoIndex5
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:55.0pt;
+ text-align:justify;
+ text-indent:-11.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoIndex6, li.MsoIndex6, div.MsoIndex6
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:66.0pt;
+ text-align:justify;
+ text-indent:-11.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoIndex7, li.MsoIndex7, div.MsoIndex7
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:77.0pt;
+ text-align:justify;
+ text-indent:-11.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoIndex8, li.MsoIndex8, div.MsoIndex8
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:88.0pt;
+ text-align:justify;
+ text-indent:-11.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoIndex9, li.MsoIndex9, div.MsoIndex9
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:99.0pt;
+ text-align:justify;
+ text-indent:-11.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
p.MsoToc1, li.MsoToc1, div.MsoToc1
{margin-top:6.0pt;
margin-right:0mm;
text-align:justify;
font-size:11.0pt;
font-family:"Times New Roman";}
+p.MsoIndexHeading, li.MsoIndexHeading, div.MsoIndexHeading
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:Arial;
+ font-weight:bold;}
p.MsoCaption, li.MsoCaption, div.MsoCaption
{margin-top:6.0pt;
margin-right:0mm;
font-size:11.0pt;
font-family:"Times New Roman";
font-weight:bold;}
-span.MsoFootnoteReference
- {vertical-align:super;}
-p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
- {margin-top:3.0pt;
+p.MsoTof, li.MsoTof, div.MsoTof
+ {margin-top:2.0pt;
margin-right:0mm;
- margin-bottom:3.0pt;
+ margin-bottom:2.0pt;
margin-left:0mm;
text-align:justify;
font-size:11.0pt;
font-family:"Times New Roman";}
-p.MsoBodyText3, li.MsoBodyText3, div.MsoBodyText3
- {margin-top:2.5pt;
+p.MsoEnvelopeAddress, li.MsoEnvelopeAddress, div.MsoEnvelopeAddress
+ {margin-top:2.0pt;
margin-right:0mm;
- margin-bottom:2.5pt;
+ margin-bottom:2.0pt;
+ margin-left:144.0pt;
+ text-align:justify;
+ font-size:12.0pt;
+ font-family:Arial;}
+p.MsoEnvelopeReturn, li.MsoEnvelopeReturn, div.MsoEnvelopeReturn
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
margin-left:0mm;
text-align:justify;
- page-break-after:avoid;
font-size:10.0pt;
font-family:Arial;}
-p.MsoBlockText, li.MsoBlockText, div.MsoBlockText
+span.MsoFootnoteReference
+ {vertical-align:super;}
+p.MsoEndnoteText, li.MsoEndnoteText, div.MsoEndnoteText
{margin-top:2.0pt;
margin-right:0mm;
margin-bottom:2.0pt;
margin-left:0mm;
text-align:justify;
- text-indent:17.0pt;
+ font-size:10.0pt;
+ font-family:"Times New Roman";}
+p.MsoToa, li.MsoToa, div.MsoToa
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:11.0pt;
+ text-align:justify;
+ text-indent:-11.0pt;
font-size:11.0pt;
font-family:"Times New Roman";}
-a:link, span.MsoHyperlink
- {color:blue;
- text-decoration:underline;}
-a:visited, span.MsoHyperlinkFollowed
- {color:purple;
- text-decoration:underline;}
-p.MsoDocumentMap, li.MsoDocumentMap, div.MsoDocumentMap
+p.MsoMacroText, li.MsoMacroText, div.MsoMacroText
{margin-top:2.0pt;
margin-right:0mm;
margin-bottom:2.0pt;
margin-left:0mm;
text-align:justify;
- background:navy;
- font-size:11.0pt;
- font-family:Tahoma;}
-p
- {margin-top:5.0pt;
+ font-size:10.0pt;
+ font-family:"Courier New";}
+p.MsoToaHeading, li.MsoToaHeading, div.MsoToaHeading
+ {margin-top:6.0pt;
margin-right:0mm;
- margin-bottom:5.0pt;
+ margin-bottom:2.0pt;
margin-left:0mm;
text-align:justify;
font-size:12.0pt;
- font-family:"Times New Roman";}
-tt
- {font-family:"Courier New";}
-p.3eretraitnormal, li.3eretraitnormal, div.3eretraitnormal
+ font-family:Arial;
+ font-weight:bold;}
+p.MsoList, li.MsoList, div.MsoList
{margin-top:2.0pt;
margin-right:0mm;
- margin-bottom:3.0pt;
- margin-left:102.9pt;
+ margin-bottom:2.0pt;
+ margin-left:18.0pt;
text-align:justify;
- text-indent:-17.85pt;
- font-size:12.0pt;
+ text-indent:-18.0pt;
+ font-size:11.0pt;
font-family:"Times New Roman";}
-p.2eretraitjustifi, li.2eretraitjustifi, div.2eretraitjustifi
+p.MsoListBullet, li.MsoListBullet, div.MsoListBullet
{margin-top:2.0pt;
margin-right:0mm;
- margin-bottom:3.0pt;
- margin-left:40.0mm;
+ margin-bottom:2.0pt;
+ margin-left:18.0pt;
text-align:justify;
- text-indent:-7.1pt;
- line-height:12.0pt;
+ text-indent:-18.0pt;
font-size:11.0pt;
font-family:"Times New Roman";}
-p.2eretraitnormal, li.2eretraitnormal, div.2eretraitnormal
+p.MsoListNumber, li.MsoListNumber, div.MsoListNumber
{margin-top:2.0pt;
margin-right:0mm;
- margin-bottom:3.0pt;
+ margin-bottom:2.0pt;
margin-left:18.0pt;
text-align:justify;
text-indent:-18.0pt;
- font-size:12.0pt;
+ font-size:11.0pt;
font-family:"Times New Roman";}
-p.1erretraitnormal, li.1erretraitnormal, div.1erretraitnormal
+p.MsoList2, li.MsoList2, div.MsoList2
{margin-top:2.0pt;
margin-right:0mm;
- margin-bottom:12.0pt;
- margin-left:0mm;
+ margin-bottom:2.0pt;
+ margin-left:36.0pt;
text-align:justify;
- font-size:12.0pt;
+ text-indent:-18.0pt;
+ font-size:11.0pt;
font-family:"Times New Roman";}
-p.titrebloc, li.titrebloc, div.titrebloc
+p.MsoList3, li.MsoList3, div.MsoList3
{margin-top:2.0pt;
margin-right:0mm;
margin-bottom:2.0pt;
- margin-left:0mm;
+ margin-left:54.0pt;
text-align:justify;
+ text-indent:-18.0pt;
font-size:11.0pt;
- font-family:Arial;
- font-weight:bold;}
-p.TitreTable, li.TitreTable, div.TitreTable
- {margin-top:6.0pt;
+ font-family:"Times New Roman";}
+p.MsoList4, li.MsoList4, div.MsoList4
+ {margin-top:2.0pt;
margin-right:0mm;
margin-bottom:2.0pt;
- margin-left:0mm;
- text-align:center;
- font-size:12.0pt;
- font-family:Arial;
- font-weight:bold;}
-p.form, li.form, div.form
- {margin-top:6.0pt;
- margin-right:7.05pt;
- margin-bottom:0mm;
- margin-left:0mm;
- margin-bottom:.0001pt;
+ margin-left:72.0pt;
text-align:justify;
- background:black;
- border:none;
- padding:0mm;
- font-size:14.0pt;
- font-family:"Univers \(W1\)";
- color:white;
- text-transform:uppercase;
- font-weight:bold;}
-p.HB, li.HB, div.HB
+ text-indent:-18.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoList5, li.MsoList5, div.MsoList5
{margin-top:2.0pt;
margin-right:0mm;
- margin-bottom:12.0pt;
- margin-left:0mm;
+ margin-bottom:2.0pt;
+ margin-left:90.0pt;
text-align:justify;
- page-break-after:avoid;
- font-size:12.0pt;
- font-family:"Times New Roman";
- color:black;
- font-weight:bold;}
-p.reference, li.reference, div.reference
+ text-indent:-18.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoListBullet2, li.MsoListBullet2, div.MsoListBullet2
{margin-top:2.0pt;
margin-right:0mm;
margin-bottom:2.0pt;
- margin-left:0mm;
+ margin-left:36.0pt;
text-align:justify;
- page-break-after:avoid;
- font-size:9.0pt;
- font-family:Arial;}
-p.1erretraitjustifi, li.1erretraitjustifi, div.1erretraitjustifi
- {margin-top:6.0pt;
+ text-indent:-18.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoListBullet3, li.MsoListBullet3, div.MsoListBullet3
+ {margin-top:2.0pt;
margin-right:0mm;
margin-bottom:2.0pt;
- margin-left:14.2pt;
+ margin-left:54.0pt;
text-align:justify;
- text-indent:-14.2pt;
+ text-indent:-18.0pt;
font-size:11.0pt;
font-family:"Times New Roman";}
-p.ZonetatEnTte, li.ZonetatEnTte, div.ZonetatEnTte
+p.MsoListBullet4, li.MsoListBullet4, div.MsoListBullet4
{margin-top:2.0pt;
- margin-right:2.85pt;
+ margin-right:0mm;
margin-bottom:2.0pt;
- margin-left:2.85pt;
- text-align:center;
- page-break-after:avoid;
- font-size:36.0pt;
- font-family:Arial;
- text-transform:uppercase;
- font-weight:bold;}
-p.DocTitle, li.DocTitle, div.DocTitle
+ margin-left:72.0pt;
+ text-align:justify;
+ text-indent:-18.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoListBullet5, li.MsoListBullet5, div.MsoListBullet5
{margin-top:2.0pt;
margin-right:0mm;
margin-bottom:2.0pt;
- margin-left:0mm;
- text-align:center;
- font-size:22.0pt;
- font-family:Arial;
- font-variant:small-caps;
- color:gray;
- letter-spacing:4.0pt;
- font-weight:bold;}
-p.DocDate, li.DocDate, div.DocDate
- {margin-top:6.0pt;
+ margin-left:90.0pt;
+ text-align:justify;
+ text-indent:-18.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoListNumber2, li.MsoListNumber2, div.MsoListNumber2
+ {margin-top:2.0pt;
margin-right:0mm;
- margin-bottom:6.0pt;
- margin-left:0mm;
+ margin-bottom:2.0pt;
+ margin-left:36.0pt;
text-align:justify;
+ text-indent:-18.0pt;
font-size:11.0pt;
- font-family:Arial;
- layout-grid-mode:line;
- font-weight:bold;}
-p.DocSubTitle, li.DocSubTitle, div.DocSubTitle
+ font-family:"Times New Roman";}
+p.MsoListNumber3, li.MsoListNumber3, div.MsoListNumber3
{margin-top:2.0pt;
margin-right:0mm;
margin-bottom:2.0pt;
- margin-left:0mm;
- text-align:center;
- line-height:12.0pt;
- font-size:12.0pt;
- font-family:Arial;
- font-variant:small-caps;
- color:gray;
- letter-spacing:4.0pt;
- font-weight:bold;}
- /* Page Definitions */
- @page Section1
- {size:595.3pt 841.9pt;
- margin:70.85pt 70.85pt 70.85pt 70.85pt;}
-div.Section1
- {page:Section1;}
- /* List Definitions */
- ol
- {margin-bottom:0mm;}
-ul
- {margin-bottom:0mm;}
--->
-</style>
-
-</head>
-
-<body lang=EN-GB link=blue vlink=purple>
-
-<div class=Section1>
-
-<p class=DocTitle><span lang=FR style='font-variant:normal !important;
-text-transform:uppercase'>gLite Logging & Bookkeeping Server</span></p>
-
-<h1><span lang=FR>1. </span><span lang=FR>Release Description</span></h1>
-
-<p class=MsoNormal>This release contains the gLite Logging & Bookkeeping
-Server module v. 1.2.3. The following sections provide additional information about
-the release content, the module dependencies, the know bugs and issues and a
-list of bugs closed since the previous release. For information about
-installing and using the gLite Logging & Bookkeeping Server, please refer
-to the gLite Installation and User Guides. </p>
-
-<h1><span lang=FR>2. </span><span lang=FR>Changes in this Release</span></h1>
-
-<p class=MsoNormal>This release introduces the following changes:</p>
-
-<p class=MsoNormal> </p>
-
-<ul style='margin-top:0mm' type=disc>
- <li class=MsoNormal style='text-align:left'>All R-GMA service publishing
- instances in the configuration template now have default values</li>
- <li class=MsoNormal>Bug fixes (see below for the complete lists)</li>
-</ul>
-
-<h1>3. Release contents</h1>
-
-<p class=MsoNormal>The gLite Logging & Bookkeeping Server v. 1.2.3 is
-composed of the following gLite components:</p>
-
-<p class=MsoNormal> </p>
-
-<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width=621
- style='width:466.1pt;border-collapse:collapse;border:none'>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>Component name</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border:solid windowtext 1.0pt;
- border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>Version</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border:solid windowtext 1.0pt;
- border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>File</span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>org.glite.deployment.lb</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.2.3</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/installers/glite-lb_installer.sh">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/installers/glite-lb_installer.sh</a>
- </span></p>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/noarch/RPMS/glite-lb-config-1.2.3-1.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/noarch/RPMS/glite-lb-config-1.2.3-1.noarch.rpm</a></span></span></p>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt;color:windowtext;text-decoration:none'>apt-get install
- glite-lb-config</span></span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>org.glite.deployment.config</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.1.1</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/noarch/RPMS/glite-config-1.1.1-3.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/noarch/RPMS/glite-config-1.1.1-3.noarch.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>org.glite.lb.client-interface</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.3</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/glite-lb-client-interface-1.0.3-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/glite-lb-client-interface-1.0.3-1.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.lb.</span><span
- lang=EN-US style='font-size:8.0pt'>common</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.1.4</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-common-1.1.4-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/glite-lb-common-1.1.4-1.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.lb.</span><span
- lang=EN-US style='font-size:8.0pt'>logger</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.1</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=IT style='font-size:
- 8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-logger-1.0.1-1.i386.rpm"><span
- lang=FR>http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/glite-lb-logger-1.0.1-1.i386.rpm</span></a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.lb.server</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>1.0.1</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=FR style='font-size:
- 8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-server-1.0.1-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/glite-lb-server-1.0.1-1.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.lb.</span><span
- lang=EN-US style='font-size:8.0pt'>server-bones</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.0</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-server-bones-1.0.0-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/glite-lb-server-bones-1.0.0-1.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.lb.</span><span
- lang=EN-US style='font-size:8.0pt'>ws-interface</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.1</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-ws-interface-1.0.1-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/glite-lb-ws-interface-1.0.1-1.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>org.glite.security.proxyrenewal</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.13</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/glite-security-proxyrenewal-1.0.13-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/glite-security-proxyrenewal-1.0.13-1.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.wms-utils.exception</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.1</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-wms-utils-exception-1.0.1-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/glite-wms-utils-exception-1.0.1-1.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>org.glite.wms-utils.jobid</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.0</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-wms-utils-jobid-1.0.0-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/glite-wms-utils-jobid-1.0.0-1.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.security.voms</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.2.32</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-security-voms-1.2.32-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/glite-security-voms-1.2.32-1.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>org.gridsite.core</span></p>
- </td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.1.5</span></p>
- </td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/gridsite-1.1.5-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/bin/rhel30/i386/RPMS/gridsite-1.1.5-1.i386.rpm</a></span></span></p>
- </td>
- </tr>
-</table>
-
-<p class=MsoNormal><span lang=EN-US> </span></p>
-
-<h1>4. Dependencies</h1>
-
-<p class=MsoNormal>The gLite Logging & Bookkeeping Server v. 1.2.2 module
-has the following dependencies:</p>
-
-<p class=MsoNormal> </p>
-
-<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width=621
- style='width:466.1pt;border-collapse:collapse;border:none'>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
- 8.0pt'>Component name</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border:solid windowtext 1.0pt;
- border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>Version</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border:solid windowtext 1.0pt;
- border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>RPM file name</span></p>
- </td>
- </tr>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span lang=EN-US
- style='font-size:8.0pt'>gLite Security Utilities</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.1</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/installers/glite-security-utils_installer.sh">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/installers/glite-security-utils_installer.sh</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span lang=EN-US
- style='font-size:8.0pt'>gLite </span><span style='font-size:8.0pt'>R-GMA </span><span
- lang=EN-US style='font-size:8.0pt'>Service Publisher</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>4.2.0</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/installers/glite-rgma-servicetool_installer.sh">http://glite.web.cern.ch/glite/packages/R1.1/R20050430/installers/glite-rgma-servicetool_installer.sh</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
- 8.0pt'>GPT</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>VDT 1.2.2</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/gpt-VDT1.2.2rh9-1.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/gpt-<span
- lang=EN-GB>VDT1.2.2rh9</span>-1.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
- 8.0pt'>VDT Globus Essentials</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>VDT 1.2.2</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/vdt_globus_essentials-VDT1.2.2rh9-1.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/vdt_globus_essentials-<span
- lang=EN-GB>VDT1.2.2rh9</span>-1.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
- 8.0pt'>MySQL-server</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>4.0.20</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/MySQL-server-4.0.20-0.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/MySQL-server-<span
- lang=EN-GB>4.0.20</span>-0.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
- 8.0pt'>MySQL-client</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>4.0.20</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/MySQL-client-4.0.20-0.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/MySQL-client-<span
- lang=EN-GB>4.0.20</span>-0.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
- 8.0pt'>ares</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>1.1.1</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/ares-1.1.1-EGEE.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/ares-<span
- lang=EN-GB>1.1.1</span>-EGEE.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
- 8.0pt'>myproxy</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>1.14</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/myproxy-1.14-EGEE.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/myproxy-<span
- lang=EN-GB>1.14</span>-EGEE.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
- 8.0pt'>perl-Expect.pm</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>1.01</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/per-Expect.pm-1.01-9.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/per-Expect.pm-<span
- lang=EN-GB>1.01</span>-9.i386.rpm</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
- 8.0pt'>Java SDK/JRE</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>1.4.2</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'>http://java.sun.com/j2se/1.4.2/download.html</span></span></p>
- </td>
- </tr>
-</table>
-
-<p class=MsoNormal> </p>
-
-<h1>5. Known bugs and issues</h1>
-
-<p class=MsoNormal align=left style='text-align:left'>This release has the
-following bugs and issues. Bug numbers refer to the gLite Bug Tracking system
-database hosted on the CERN Savannah system at <a
-href="https://savannah.cern.ch/bugs/?group=jra1mdw">https://savannah.cern.ch/bugs/?group=jra1mdw</a>
-.</p>
-
-<p class=MsoNormal align=left style='text-align:left'> </p>
+ margin-left:54.0pt;
+ text-align:justify;
+ text-indent:-18.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoListNumber4, li.MsoListNumber4, div.MsoListNumber4
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:72.0pt;
+ text-align:justify;
+ text-indent:-18.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoListNumber5, li.MsoListNumber5, div.MsoListNumber5
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:90.0pt;
+ text-align:justify;
+ text-indent:-18.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoTitle, li.MsoTitle, div.MsoTitle
+ {margin-top:12.0pt;
+ margin-right:0mm;
+ margin-bottom:3.0pt;
+ margin-left:0mm;
+ text-align:center;
+ font-size:16.0pt;
+ font-family:Arial;
+ font-weight:bold;}
+p.MsoClosing, li.MsoClosing, div.MsoClosing
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:216.0pt;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoSignature, li.MsoSignature, div.MsoSignature
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:216.0pt;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
+ {margin-top:3.0pt;
+ margin-right:0mm;
+ margin-bottom:3.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoBodyTextIndent, li.MsoBodyTextIndent, div.MsoBodyTextIndent
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:6.0pt;
+ margin-left:18.0pt;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoListContinue, li.MsoListContinue, div.MsoListContinue
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:6.0pt;
+ margin-left:18.0pt;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoListContinue2, li.MsoListContinue2, div.MsoListContinue2
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:6.0pt;
+ margin-left:36.0pt;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoListContinue3, li.MsoListContinue3, div.MsoListContinue3
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:6.0pt;
+ margin-left:54.0pt;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoListContinue4, li.MsoListContinue4, div.MsoListContinue4
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:6.0pt;
+ margin-left:72.0pt;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoListContinue5, li.MsoListContinue5, div.MsoListContinue5
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:6.0pt;
+ margin-left:90.0pt;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoMessageHeader, li.MsoMessageHeader, div.MsoMessageHeader
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:54.0pt;
+ text-align:justify;
+ text-indent:-54.0pt;
+ background:#CCCCCC;
+ border:none;
+ padding:0mm;
+ font-size:12.0pt;
+ font-family:Arial;}
+p.MsoSubtitle, li.MsoSubtitle, div.MsoSubtitle
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:3.0pt;
+ margin-left:0mm;
+ text-align:center;
+ font-size:12.0pt;
+ font-family:Arial;}
+p.MsoSalutation, li.MsoSalutation, div.MsoSalutation
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoDate, li.MsoDate, div.MsoDate
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoBodyTextFirstIndent, li.MsoBodyTextFirstIndent, div.MsoBodyTextFirstIndent
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:6.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ text-indent:10.5pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoBodyTextFirstIndent2, li.MsoBodyTextFirstIndent2, div.MsoBodyTextFirstIndent2
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:6.0pt;
+ margin-left:18.0pt;
+ text-align:justify;
+ text-indent:10.5pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoNoteHeading, li.MsoNoteHeading, div.MsoNoteHeading
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoBodyText2, li.MsoBodyText2, div.MsoBodyText2
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:6.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ line-height:200%;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoBodyText3, li.MsoBodyText3, div.MsoBodyText3
+ {margin-top:2.5pt;
+ margin-right:0mm;
+ margin-bottom:2.5pt;
+ margin-left:0mm;
+ text-align:justify;
+ page-break-after:avoid;
+ font-size:10.0pt;
+ font-family:Arial;}
+p.MsoBodyTextIndent2, li.MsoBodyTextIndent2, div.MsoBodyTextIndent2
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:6.0pt;
+ margin-left:18.0pt;
+ text-align:justify;
+ line-height:200%;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.MsoBodyTextIndent3, li.MsoBodyTextIndent3, div.MsoBodyTextIndent3
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:6.0pt;
+ margin-left:18.0pt;
+ text-align:justify;
+ font-size:8.0pt;
+ font-family:"Times New Roman";}
+p.MsoBlockText, li.MsoBlockText, div.MsoBlockText
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ text-indent:17.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+a:link, span.MsoHyperlink
+ {color:blue;
+ text-decoration:underline;}
+a:visited, span.MsoHyperlinkFollowed
+ {color:purple;
+ text-decoration:underline;}
+p.MsoDocumentMap, li.MsoDocumentMap, div.MsoDocumentMap
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ background:navy;
+ font-size:11.0pt;
+ font-family:Tahoma;}
+p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Courier New";}
+p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p
+ {margin-top:5.0pt;
+ margin-right:0mm;
+ margin-bottom:5.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:12.0pt;
+ font-family:"Times New Roman";}
+address
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:"Times New Roman";
+ font-style:italic;}
+pre
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Courier New";}
+tt
+ {font-family:"Courier New";}
+p.MsoCommentSubject, li.MsoCommentSubject, div.MsoCommentSubject
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:10.0pt;
+ font-family:"Times New Roman";
+ font-weight:bold;}
+p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:8.0pt;
+ font-family:Tahoma;}
+p.3eretraitnormal, li.3eretraitnormal, div.3eretraitnormal
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:3.0pt;
+ margin-left:102.9pt;
+ text-align:justify;
+ text-indent:-17.85pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman";}
+p.2eretraitjustifi, li.2eretraitjustifi, div.2eretraitjustifi
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:3.0pt;
+ margin-left:40.0mm;
+ text-align:justify;
+ text-indent:-7.1pt;
+ line-height:12.0pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.2eretraitnormal, li.2eretraitnormal, div.2eretraitnormal
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:3.0pt;
+ margin-left:18.0pt;
+ text-align:justify;
+ text-indent:-18.0pt;
+ font-size:12.0pt;
+ font-family:"Times New Roman";}
+p.1erretraitnormal, li.1erretraitnormal, div.1erretraitnormal
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:12.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:12.0pt;
+ font-family:"Times New Roman";}
+p.titrebloc, li.titrebloc, div.titrebloc
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:Arial;
+ font-weight:bold;}
+p.TitreTable, li.TitreTable, div.TitreTable
+ {margin-top:6.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:center;
+ font-size:12.0pt;
+ font-family:Arial;
+ font-weight:bold;}
+p.form, li.form, div.form
+ {margin-top:6.0pt;
+ margin-right:7.05pt;
+ margin-bottom:0mm;
+ margin-left:0mm;
+ margin-bottom:.0001pt;
+ text-align:justify;
+ background:black;
+ border:none;
+ padding:0mm;
+ font-size:14.0pt;
+ font-family:"Univers \(W1\)";
+ color:white;
+ text-transform:uppercase;
+ font-weight:bold;}
+p.HB, li.HB, div.HB
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:12.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ page-break-after:avoid;
+ font-size:12.0pt;
+ font-family:"Times New Roman";
+ color:black;
+ font-weight:bold;}
+p.reference, li.reference, div.reference
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ page-break-after:avoid;
+ font-size:9.0pt;
+ font-family:Arial;}
+p.1erretraitjustifi, li.1erretraitjustifi, div.1erretraitjustifi
+ {margin-top:6.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:14.2pt;
+ text-align:justify;
+ text-indent:-14.2pt;
+ font-size:11.0pt;
+ font-family:"Times New Roman";}
+p.ZonetatEnTte, li.ZonetatEnTte, div.ZonetatEnTte
+ {margin-top:2.0pt;
+ margin-right:2.85pt;
+ margin-bottom:2.0pt;
+ margin-left:2.85pt;
+ text-align:center;
+ page-break-after:avoid;
+ font-size:36.0pt;
+ font-family:Arial;
+ text-transform:uppercase;
+ font-weight:bold;}
+p.DocTitle, li.DocTitle, div.DocTitle
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:center;
+ font-size:22.0pt;
+ font-family:Arial;
+ font-variant:small-caps;
+ color:gray;
+ letter-spacing:4.0pt;
+ font-weight:bold;}
+p.DocDate, li.DocDate, div.DocDate
+ {margin-top:6.0pt;
+ margin-right:0mm;
+ margin-bottom:6.0pt;
+ margin-left:0mm;
+ text-align:justify;
+ font-size:11.0pt;
+ font-family:Arial;
+ layout-grid-mode:line;
+ font-weight:bold;}
+p.DocSubTitle, li.DocSubTitle, div.DocSubTitle
+ {margin-top:2.0pt;
+ margin-right:0mm;
+ margin-bottom:2.0pt;
+ margin-left:0mm;
+ text-align:center;
+ line-height:12.0pt;
+ font-size:12.0pt;
+ font-family:Arial;
+ font-variant:small-caps;
+ color:gray;
+ letter-spacing:4.0pt;
+ font-weight:bold;}
+ /* Page Definitions */
+ @page Section1
+ {size:595.3pt 841.9pt;
+ margin:70.85pt 70.85pt 70.85pt 70.85pt;}
+div.Section1
+ {page:Section1;}
+ /* List Definitions */
+ ol
+ {margin-bottom:0mm;}
+ul
+ {margin-bottom:0mm;}
+-->
+</style>
-<ul style='margin-top:0mm' type=disc>
- <li class=MsoNormal style='text-align:left'>If the mysql root password is set
- and it is not specified in the mysql.conf file, the configuration script
- fails. This bug will be fixed in the next release</li>
- <li class=MsoNormal style='text-align:left'>No removal procedure is provided
- with this release apart from the removal of the RPMS. Any account, group
- or other resource created during the module configuration must be manually
- cleaned.</li>
-</ul>
+</head>
-<p class=MsoNormal align=left style='text-align:left'> </p>
+<body lang=EN-GB link=blue vlink=purple>
-<p class=MsoNormal align=left style='text-align:left'>Known open bugs:</p>
+<div class=Section1>
-<p class=MsoNormal align=left style='text-align:left'> </p>
+<p class=DocTitle><span lang=FR style='font-variant:normal !important;
+text-transform:uppercase'>gLite Logging & Bookkeeping Server</span></p>
-<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
- style='border-collapse:collapse;border:none'>
- <tr>
- <td width=59 valign=top style='width:44.35pt;border:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'>Bug number</span></p>
- </td>
- <td width=543 valign=top style='width:407.6pt;border:solid windowtext 1.0pt;
- border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'>Description</span></p>
- </td>
- <td width=17 valign=top style='width:12.45pt;border:solid windowtext 1.0pt;
- border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7053"><span
- style='color:windowtext;text-decoration:none'> #7053</span></a></span></p>
- </td>
- <td width=543 valign=top style='width:407.6pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7053"><span
- style='color:windowtext;text-decoration:none'>LB configuration fails if the
- mysql root pwd is set</span></a> </span></p>
- </td>
- <td width=17 valign=top style='width:12.45pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7237"><span
- style='color:windowtext;text-decoration:none'> #7237</span></a></span></p>
- </td>
- <td width=543 valign=top style='width:407.6pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7237"><span
- style='color:windowtext;text-decoration:none'>Intermittent errors with job
- submission</span></a> </span></p>
- </td>
- <td width=17 valign=top style='width:12.45pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7300"><span
- style='color:windowtext;text-decoration:none'> #7300</span></a></span></p>
- </td>
- <td width=543 valign=top style='width:407.6pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7300"><span
- style='color:windowtext;text-decoration:none'>update of the lb instructions
- at the end of the installer script </span></a> </span></p>
- </td>
- <td width=17 valign=top style='width:12.45pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7305"><span
- style='color:windowtext;text-decoration:none'> #7305</span></a></span></p>
- </td>
- <td width=543 valign=top style='width:407.6pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7305"><span
- style='color:windowtext;text-decoration:none'>lb.database.username paramenter
- in config file</span></a> </span></p>
- </td>
- <td width=17 valign=top style='width:12.45pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7307"><span
- style='color:windowtext;text-decoration:none'> #7307</span></a></span></p>
- </td>
- <td width=543 valign=top style='width:407.6pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7307"><span
- style='color:windowtext;text-decoration:none'>lb config script does _not_
- fail if mysql root password is set</span></a> </span></p>
- </td>
- <td width=17 valign=top style='width:12.45pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
+<h1><span lang=FR>1. </span><span lang=FR>Release Description</span></h1>
+
+<p class=MsoNormal>This release contains the gLite Logging & Bookkeeping
+Server module v. 2.0.2. The following sections provide additional information about
+the release content, the module dependencies, the know bugs and issues and a
+list of bugs closed since the previous release. For information about
+installing and using the gLite Logging & Bookkeeping Server, please refer
+to the gLite Installation and User Guides. </p>
+
+<h1 style='margin-left:0mm;text-indent:0mm'><span lang=FR>2. </span><span
+lang=FR>Changes in this release</span></h1>
+
+<h2><span lang=FR>2.1. </span><span lang=FR>Changes in functionality</span></h2>
+
+<p class=MsoNormal><span lang=EN-US>The mysql database can now be protected
+with a root password. The mysql root password can be set in the configuration
+file.</span></p>
+
+<h2>2.2. Changes in Configuration</h2>
+
+<p class=MsoNormal><span lang=EN-US>The following new parameters have been
+added to the glite-security-utils.cfg.xml file:</span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
+ style='border-collapse:collapse;border:none'>
<tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ <td width=185 valign=top style='width:138.8pt;border:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7324"><span
- style='color:windowtext;text-decoration:none'> #7324</span></a></span></p>
+ <p class=MsoNormal><b><span lang=EN-US>Parameter name</span></b></p>
</td>
- <td width=543 valign=top style='width:407.6pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7324"><span
- style='color:windowtext;text-decoration:none'>lb-bkserver is running with no
- pid</span></a> </span></p>
+ <td width=101 valign=top style='width:75.9pt;border:solid windowtext 1.0pt;
+ border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><b><span lang=EN-US>Default value</span></b></p>
</td>
- <td width=17 valign=top style='width:12.45pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <td width=333 valign=top style='width:249.7pt;border:solid windowtext 1.0pt;
+ border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><b><span lang=EN-US>Description</span></b></p>
</td>
</tr>
<tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7389"><span
- style='color:windowtext;text-decoration:none'> #7389</span></a></span></p>
+ <td width=185 valign=top style='width:138.8pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span lang=EN-US>mysql.root.password</span></p>
</td>
- <td width=543 valign=top style='width:407.6pt;border-top:none;border-left:
+ <td width=101 valign=top style='width:75.9pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7389"><span
- style='color:windowtext;text-decoration:none'>LB server and WMS local logger
- related issues</span></a> </span></p>
+ <p class=MsoNormal><span lang=EN-US><changeme></span></p>
</td>
- <td width=17 valign=top style='width:12.45pt;border-top:none;border-left:
+ <td width=333 valign=top style='width:249.7pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal><span lang=EN-US>The mysql root password</span></p>
</td>
</tr>
</table>
-<p class=MsoNormal> </p>
+<p class=MsoNormal><span lang=EN-US> </span></p>
-<p class=MsoNormal>Bugs fixed in this or previous releases, but not yet officially
-tested:</p>
+<p class=MsoNormal><span lang=EN-US>The following parameters have been changed
+in the glite-security-utils.cfg.xml file:</span></p>
-<p class=MsoNormal> </p>
+<p class=MsoNormal><span lang=EN-US> </span></p>
<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
style='border-collapse:collapse;border:none'>
<tr>
- <td width=57 valign=top style='width:43.05pt;border:solid windowtext 1.0pt;
+ <td width=134 valign=top style='width:100.5pt;border:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'>Bug number</span></p>
+ <p class=MsoNormal><b><span lang=EN-US>Parameter name</span></b></p>
</td>
- <td width=536 valign=top style='width:401.8pt;border:solid windowtext 1.0pt;
+ <td width=210 valign=top style='width:157.45pt;border:solid windowtext 1.0pt;
border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'>Description</span></p>
+ <p class=MsoNormal><b><span lang=EN-US>Old value</span></b></p>
</td>
- <td width=26 valign=top style='width:19.55pt;border:solid windowtext 1.0pt;
+ <td width=141 valign=top style='width:105.45pt;border:solid windowtext 1.0pt;
border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6412"><span
- style='color:windowtext;text-decoration:none'> #6412</span></a></span></p>
- </td>
- <td width=536 valign=top style='width:401.8pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6412"><span
- style='color:windowtext;text-decoration:none'>--start and --stop options not
- documented in glite-ce-config.py, glite-lb-config.py</span></a> </span></p>
- </td>
- <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6722"><span
- style='color:windowtext;text-decoration:none'> #6722</span></a></span></p>
- </td>
- <td width=536 valign=top style='width:401.8pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6722"><span
- style='color:windowtext;text-decoration:none'>glite-job-status -all doesn't
- work</span></a> </span></p>
- </td>
- <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7151"><span
- style='color:windowtext;text-decoration:none'> #7151</span></a></span></p>
- </td>
- <td width=536 valign=top style='width:401.8pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7151"><span
- style='color:windowtext;text-decoration:none'>There are conflicts when
- installing WMS and LB on the same node</span></a> </span></p>
- </td>
- <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7180"><span
- style='color:windowtext;text-decoration:none'> #7180</span></a></span></p>
- </td>
- <td width=536 valign=top style='width:401.8pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7180"><span
- style='color:windowtext;text-decoration:none'>Logging & Bookkeping UI </span></a> </span></p>
+ <p class=MsoNormal><b><span lang=EN-US>New value</span></b></p>
</td>
- <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <td width=135 valign=top style='width:101.0pt;border:solid windowtext 1.0pt;
+ border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><b><span lang=EN-US>Description</span></b></p>
</td>
</tr>
+</table>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<p class=MsoNormal><span lang=EN-US>The following new parameters have been
+removed from the glite-security-utils.cfg.xml file:</span></p>
+
+<p class=MsoNormal><span lang=EN-US> </span></p>
+
+<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
+ style='border-collapse:collapse;border:none'>
<tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7321"><span
- style='color:windowtext;text-decoration:none'> #7321</span></a></span></p>
- </td>
- <td width=536 valign=top style='width:401.8pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ <td width=185 valign=top style='width:138.8pt;border:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7321"><span
- style='color:windowtext;text-decoration:none'>creation of indices fails
- randomly</span></a> </span></p>
+ <p class=MsoNormal><b><span lang=EN-US>Parameter name</span></b></p>
</td>
- <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <td width=333 valign=top style='width:249.7pt;border:solid windowtext 1.0pt;
+ border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><b><span lang=EN-US>Comment</span></b></p>
</td>
</tr>
<tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7884"><span
- style='color:windowtext;text-decoration:none'> #7884</span></a></span></p>
- </td>
- <td width=536 valign=top style='width:401.8pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7884"><span
- style='color:windowtext;text-decoration:none'>local header files distributed
- in RPMs. </span></a> </span></p>
+ <td width=185 valign=top style='width:138.8pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span lang=EN-US>lb.database.name</span></p>
</td>
- <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
+ <td width=333 valign=top style='width:249.7pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal><span lang=EN-US>The LB database name cannot be configured
+ internally, therefore this parameter was ignored</span></p>
</td>
</tr>
<tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7910"><span
- style='color:windowtext;text-decoration:none'> #7910</span></a></span></p>
- </td>
- <td width=536 valign=top style='width:401.8pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7910"><span
- style='color:windowtext;text-decoration:none'>Duplicate apostroph in MySQL
- calls</span></a> </span></p>
+ <td width=185 valign=top style='width:138.8pt;border:solid windowtext 1.0pt;
+ border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span lang=EN-US>lb.database.username</span></p>
</td>
- <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
+ <td width=333 valign=top style='width:249.7pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal><span lang=EN-US>The LB database user cannot be configured
+ internally, therefore this parameter was ignored</span></p>
</td>
</tr>
</table>
-<p class=MsoNormal align=left style='margin:0mm;margin-bottom:.0001pt;
-text-align:left;text-autospace:none'><span lang=EN-US style='font-size:10.0pt;
-font-family:"Courier New"'> </span></p>
+<p class=MsoNormal><span lang=EN-US> </span></p>
-<h1>6. Bugs closed since last release</h1>
+<h1>3. Release contents</h1>
-<p class=MsoNormal align=left style='text-align:left'>This release fixes the
-following bugs and issues. Bug numbers refer to the gLite Bug Tracking system
-database hosted on the CERN Savannah system at <a
-href="https://savannah.cern.ch/bugs/?group=jra1mdw">https://savannah.cern.ch/bugs/?group=jra1mdw</a>
- </p>
+<h2><a name="_Ref114562685">3.1. Glite sub-deployment modules</a></h2>
-<p class=MsoNormal align=left style='text-align:left'> </p>
+<p class=MsoNormal>The gLite Logging and Bookkeeping module requires the
+following sub-modules:</p>
-<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
- style='border-collapse:collapse;border:none'>
+<p class=MsoNormal> </p>
+
+<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt'>-<span
+style='font:7.0pt "Times New Roman"'>
+</span>gLite Security Utilities</p>
+
+<p class=MsoNormal style='margin-left:36.0pt;text-indent:-18.0pt'>-<span
+style='font:7.0pt "Times New Roman"'>
+</span>gLite R-GMA Servicetool</p>
+
+<p class=MsoNormal> </p>
+
+<p class=MsoNormal>The sub-modules are automatically installed with the LB
+module. For more information about these sub-modules please refer to the
+specific release notes and installation instructions.</p>
+
+<h2>3.2. Glite RPMS</h2>
+
+<p class=MsoNormal>The gLite Logging & Bookkeeping Server v. 2.0.2 is
+composed of the following gLite components:</p>
+
+<p class=MsoNormal> </p>
+
+<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width="100%"
+ style='width:100.36%;border-collapse:collapse;border:none'>
<tr>
- <td width=87 valign=top style='width:64.95pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'>Bug number</span></p>
+ <p class=MsoNormal align=left style='text-align:left'><b><span
+ style='font-size:8.0pt'>Component name</span></b></p>
</td>
- <td width=533 valign=top style='width:399.45pt;border:solid windowtext 1.0pt;
+ <td width="22%" valign=top style='width:22.8%;border:solid windowtext 1.0pt;
border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'>Description</span></p>
+ <p class=MsoNormal align=left style='text-align:left'><b><span
+ style='font-size:8.0pt'>Description</span></b></p>
</td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5850"><span
- style='color:windowtext;text-decoration:none'> #5850</span></a></span></p>
+ <td width="10%" valign=top style='width:10.66%;border:solid windowtext 1.0pt;
+ border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal align=left style='text-align:left'><b><span
+ style='font-size:8.0pt'>Version</span></b></p>
</td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5850"><span
- style='color:windowtext;text-decoration:none'>glite-lb-config.py has
- glite.location and globus.location not set in params[]</span></a> </span></p>
+ <td width="45%" valign=top style='width:45.6%;border:solid windowtext 1.0pt;
+ border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal align=left style='text-align:left'><b><span
+ style='font-size:8.0pt'>File</span></b></p>
</td>
</tr>
<tr>
- <td width=87 valign=top style='width:64.95pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5901"><span
- style='color:windowtext;text-decoration:none'> #5901</span></a></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-config</span></p>
</td>
- <td width=533 valign=top style='width:399.45pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5901"><span
- style='color:windowtext;text-decoration:none'>mysqlaccess command fails with
- Broken pipe if mysql socket file is in /tmp </span></a> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5908"><span
- style='color:windowtext;text-decoration:none'> #5908</span></a></span></p>
- </td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5908"><span
- style='color:windowtext;text-decoration:none'>Environment variables set via
- the configuration script are not passed to daemon startup scripts</span></a> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6057"><span
- style='color:windowtext;text-decoration:none'> #6057</span></a></span></p>
- </td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6057"><span
- style='color:windowtext;text-decoration:none'>glite-lb configuration scripts
- has missing dependency (CGI.pm)</span></a> </span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>gLite configuration scripts</span></p>
</td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6075"><span
- style='color:windowtext;text-decoration:none'> #6075</span></a></span></p>
- </td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6075"><span
- style='color:windowtext;text-decoration:none'>glite-lb-config.py crashes with
- KeyError: GLITE_CERT_DIR</span></a> </span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>1.4.5</span></p>
</td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6190"><span
- style='color:windowtext;text-decoration:none'> #6190</span></a></span></p>
- </td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6190"><span
- style='color:windowtext;text-decoration:none'>LB local logger doesn't start
- on the CE node</span></a> </span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-config-1.4.2-1.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-config-1.4.2-1.noarch.rpm</a></span></p>
</td>
</tr>
<tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6366"><span
- style='color:windowtext;text-decoration:none'> #6366</span></a></span></p>
- </td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6366"><span
- style='color:windowtext;text-decoration:none'>LB install script:: Fails but
- no error reported</span></a> </span></p>
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
+ border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-lb-client-interface</span></p>
</td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6415"><span
- style='color:windowtext;text-decoration:none'> #6415</span></a></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>L&B client library
+ header files</span></p>
</td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6415"><span
- style='color:windowtext;text-decoration:none'>glite-lb-bkserver does not
- start and blocks execution of glite-lb-config.py</span></a> </span></p>
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>2.0.0</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-lb-client-interface-2.0.0-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-lb-client-interface-2.0.0-1.i386.rpm</a></span></p>
</td>
</tr>
<tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
+ border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-lb-common</span></p>
+ </td>
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7296"><span
- style='color:windowtext;text-decoration:none'> #7296</span></a></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>L&B common subroutines
+ library</span></p>
</td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7296"><span
- style='color:windowtext;text-decoration:none'>glite-lb-config.py crashes with
- a TypeError exception</span></a> </span></p>
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>2.0.1</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-lb-common-2.0.1-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-lb-common-2.0.1-1.i386.rpm</a></span></p>
</td>
</tr>
<tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
+ border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-lb-config</span></p>
+ </td>
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7753"><span
- style='color:windowtext;text-decoration:none'> #7753</span></a></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>gLite Logging and
+ Bookkeeping node configuration files</span></p>
</td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7753"><span
- style='color:windowtext;text-decoration:none'>glite-lb-config.py fails with
- an indentation error</span></a> </span></p>
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>2.0.1</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-lb-config-2.0.1-1.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-lb-config-2.0.1-1.noarch.rpm</a></span></p>
</td>
</tr>
<tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
+ border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-lb-logger</span></p>
+ </td>
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7976"><span
- style='color:windowtext;text-decoration:none'> #7976</span></a></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>L&B local logger</span></p>
</td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7976"><span
- style='color:windowtext;text-decoration:none'>edg-job-status not working with
- voms proxies</span></a> </span></p>
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>1.1.2</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-lb-logger-1.1.2-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-lb-logger-1.1.2-1.i386.rpm</a></span></p>
</td>
</tr>
<tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
+ border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-lb-server</span></p>
+ </td>
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=8094"><span
- style='color:windowtext;text-decoration:none'> #8094</span></a></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>L&B bookkeeping server</span></p>
</td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=8094"><span
- style='color:windowtext;text-decoration:none'>interlogd on the WMS doesn't
- restart</span></a> </span></p>
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>1.2.5</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-lb-server-1.2.5-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-lb-server-1.2.5-1.i386.rpm</a></span></p>
</td>
</tr>
-</table>
-
-<p class=MsoNormal align=left style='text-align:left'> </p>
-
-<b><span style='font-size:12.0pt;font-family:Arial;text-transform:uppercase;
-layout-grid-mode:line'><br clear=all style='page-break-before:always'>
-</span></b>
-
-<h1>7. Previous Releases</h1>
-
-<h2>7.1. Release 1.2.2</h2>
-
-<h3><span lang=FR>7.1.1. </span><span lang=FR>Release Description</span></h3>
-
-<p class=MsoNormal>This release contains the gLite Logging & Bookkeeping
-Server module v. 1.2.2. The following sections provide additional information
-about the release content, the module dependencies, the know bugs and issues
-and a list of bugs closed since the previous release. For information about
-installing and using the gLite Logging & Bookkeeping Server, please refer
-to the gLite Installation and User Guides. </p>
-
-<h3><span lang=FR>7.1.2. </span><span lang=FR>Changes in this Release</span></h3>
-
-<p class=MsoNormal>This release introduces the following changes:</p>
-
-<p class=MsoNormal> </p>
-
-<ul style='margin-top:0mm' type=disc>
- <li class=MsoNormal>Implemented status method</li>
- <li class=MsoNormal>Added definition of PERL5LIB env var</li>
- <li class=MsoNormal>Stopping and starting the database before the index
- creation (just after the database is created and the user granted) to fix
- access denied error</li>
- <li class=MsoNormal>Moved creation of indices inside database creation (if
- database exists indices must not be recreated)</li>
- <li class=MsoNormal>GLITE_USER parameter is not exposed anymore in the
- configuration file; instead the module uses the same user parameters as
- WMS to allow installation on same node</li>
- <li class=MsoNormal>LB admin tools are now installed in sbin, not in bin</li>
- <li class=MsoNormal>Bug fixes (see below for the complete lists)</li>
-</ul>
-
-<h3>7.1.3. Release contents</h3>
-
-<p class=MsoNormal>The gLite Logging & Bookkeeping Server v. 1.2.2 is
-composed of the following gLite components:</p>
-
-<p class=MsoNormal> </p>
-
-<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width=621
- style='width:466.1pt;border-collapse:collapse;border:none'>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
+ border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-lb-server-bones</span></p>
+ </td>
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>Component name</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>L&B server bones</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border:solid windowtext 1.0pt;
- border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>Version</span></p>
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>2.0.0</span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border:solid windowtext 1.0pt;
- border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>File</span></p>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-lb-server-bones-2.0.0-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-lb-server-bones-2.0.0-1.i386.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>org.glite.deployment.lb</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-lb-ws-interface</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.2.2</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'> </span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/installers/glite-lb_installer.sh">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/installers/glite-lb_installer.sh</a>
- </span></p>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/noarch/RPMS/glite-lb-config-1.2.2-1.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/noarch/RPMS/glite-lb-config-1.2.2-1.noarch.rpm</a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>2.0.0</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-lb-ws-interface-2.0.0-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-lb-ws-interface-2.0.0-1.i386.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>org.glite.deployment.config</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-rgma-api-java</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.0</span></p>
+ <p class=MsoNormal><span lang=IT style='font-size:8.0pt'>Java API for R-GMA</span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/noarch/RPMS/glite-config-1.0.0-1.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/noarch/RPMS/glite-config-1.0.0-1.noarch.rpm</a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>4.1.5</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-rgma-api-java-4.1.5-1.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-rgma-api-java-4.1.5-1.noarch.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.lb.client-interface</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-rgma-base</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.2</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>R-GMA basic configuration
+ and documentation</span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-client-interface-1.0.2-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-client-interface-1.0.2-1.i386.rpm</a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>4.1.19</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-rgma-base-4.1.19-1.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-rgma-base-4.1.19-1.noarch.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.lb.</span><span
- lang=EN-US style='font-size:8.0pt'>common</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-rgma-common-config</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.1.4</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>gLite rgma common
+ configuration items installation</span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-common-1.1.4-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-common-1.1.4-1.i386.rpm</a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>5.0.0</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-rgma-common-config-5.0.0-1.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-rgma-common-config-5.0.0-1.noarch.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.lb.</span><span
- lang=EN-US style='font-size:8.0pt'>logger</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-rgma-servicetool</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.1</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>R-GMA service tool</span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=IT style='font-size:
- 8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-logger-1.0.1-1.i386.rpm"><span
- lang=FR>http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-logger-1.0.1-1.i386.rpm</span></a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>4.1.19</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-rgma-servicetool-4.1.19-3.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-rgma-servicetool-4.1.19-3.noarch.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.lb.server</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-rgma-servicetool-config</span></p>
+ </td>
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'>gLite R-GMA servicetool
+ installation</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>1.0.1</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>5.1.0</span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=FR style='font-size:
- 8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-server-1.0.1-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-server-1.0.1-1.i386.rpm</a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-rgma-servicetool-config-5.1.0-1.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-rgma-servicetool-config-5.1.0-1.noarch.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.lb.</span><span
- lang=EN-US style='font-size:8.0pt'>server-bones</span></p>
+ <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>glite-rgma-stubs-servlet-java</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.0</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>Java client implementation
+ stubs for R-GMA</span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-server-bones-1.0.0-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-server-bones-1.0.0-1.i386.rpm</a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>4.1.13</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-rgma-stubs-servlet-java-4.1.13-1.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-rgma-stubs-servlet-java-4.1.13-1.noarch.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.lb.</span><span
- lang=EN-US style='font-size:8.0pt'>ws-interface</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-security-gsoap-plugin</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.1</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>gSOAP plugin and gss
+ libraries</span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-ws-interface-1.0.1-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-lb-ws-interface-1.0.1-1.i386.rpm</a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>1.1.1</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-security-gsoap-plugin-1.1.1-0.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-security-gsoap-plugin-1.1.1-0.i386.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>org.glite.security.proxyrenewal</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-security-trustmanager</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.11</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>The java certificate path
+ checkin for proxy certs in SSL with plugins for tomcat and axis.</span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-security-proxyrenewal-1.0.11-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-security-proxyrenewal-1.0.11-1.i386.rpm</a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>1.7.3</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-security-trustmanager-1.7.3-1.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-security-trustmanager-1.7.3-1.noarch.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.wms-utils.exception</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-security-util-java</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.1</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>The java utilities library
+ for security</span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-wms-utils-exception-1.0.1-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-wms-utils-exception-1.0.1-1.i386.rpm</a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>1.1.2</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-security-util-java-1.1.2-2.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-security-util-java-1.1.2-2.noarch.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>org.glite.wms-utils.jobid</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-security-utils-config</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.0</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>gLite Security Utilities
+ configuration files</span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-wms-utils-jobid-1.0.0-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-wms-utils-jobid-1.0.0-1.i386.rpm</a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>1.0.4</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-security-utils-config-1.0.4-1.noarch.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/noarch/RPMS/glite-security-utils-config-1.0.4-1.noarch.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=FR style='font-size:8.0pt'>org.glite.security.voms</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-security-voms-api-c</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.2.32</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'> </span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-security-voms-1.2.32-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/glite-security-voms-1.2.32-1.i386.rpm</a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>1.6.3</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-security-voms-api-c-1.6.3-0.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-security-voms-api-c-1.6.3-0.i386.rpm</a></span></p>
</td>
</tr>
<tr>
- <td width=153 valign=top style='width:115.0pt;border:solid windowtext 1.0pt;
+ <td width="20%" valign=top style='width:20.94%;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>org.gridsite.core</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>glite-wms-utils-exception</span></p>
</td>
- <td width=54 valign=top style='width:40.15pt;border-top:none;border-left:
+ <td width="22%" valign=top style='width:22.8%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.1.5</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'> </span></p>
</td>
- <td width=415 valign=top style='width:310.95pt;border-top:none;border-left:
+ <td width="10%" valign=top style='width:10.66%;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/gridsite-1.1.5-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/bin/rhel30/i386/RPMS/gridsite-1.1.5-1.i386.rpm</a></span></span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>1.0.2</span></p>
+ </td>
+ <td width="45%" valign=top style='width:45.6%;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:8.0pt'><a
+ href="http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-wms-utils-exception-1.0.2-1.i386.rpm">http://glite.web.cern.ch/glite/packages/R1.4/R20050916/bin/rhel30/i386/RPMS/glite-wms-utils-exception-1.0.2-1.i386.rpm</a></span></p>
</td>
</tr>
</table>
-<p class=MsoNormal><span lang=EN-US> </span></p>
+<p class=MsoNormal> </p>
-<h3>7.1.4. Dependencies</h3>
+<h1>4. Dependencies</h1>
-<p class=MsoNormal>The gLite Logging & Bookkeeping Server v. 1.2.2 module
+<p class=MsoNormal>The gLite Logging & Bookkeeping Server v. 2.0.2 module
has the following dependencies:</p>
<p class=MsoNormal> </p>
<tr>
<td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span lang=EN-US
- style='font-size:8.0pt'>gLite Security Utilities</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>1.0.0</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/installers/glite-security-utils_installer.sh">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/installers/glite-security-utils_installer.sh</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal align=left style='text-align:left'><span lang=EN-US
- style='font-size:8.0pt'>gLite </span><span style='font-size:8.0pt'>R-GMA </span><span
- lang=EN-US style='font-size:8.0pt'>Service Publisher</span></p>
- </td>
- <td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=EN-US style='font-size:8.0pt'>4.1.5</span></p>
- </td>
- <td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
- href="http://glite.web.cern.ch/glite/packages/R1.0/R20050331/installers/glite-rgma-servicetool_installer.sh">http://glite.web.cern.ch/glite/packages/R1.0/R20050331/installers/glite-rgma-servicetool_installer.sh</a></span></span></p>
- </td>
- </tr>
- <tr>
- <td width=158 valign=top style='width:118.6pt;border:solid windowtext 1.0pt;
- border-top:none;padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal align=left style='text-align:left'><span style='font-size:
8.0pt'>GPT</span></p>
</td>
<td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
+ <p class=MsoNormal style='text-autospace:ideograph-numeric'><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:8.0pt'><a
href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/gpt-VDT1.2.2rh9-1.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/gpt-<span
- lang=EN-GB>VDT1.2.2rh9</span>-1.i386.rpm</a></span></span></p>
+ lang=EN-GB>VDT1.2.2rh9</span>-1.i386.rpm</a></span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span></p>
</td>
</tr>
<tr>
<td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
+ <p class=MsoNormal style='text-autospace:ideograph-numeric'><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:8.0pt'><a
href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/vdt_globus_essentials-VDT1.2.2rh9-1.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/vdt_globus_essentials-<span
- lang=EN-GB>VDT1.2.2rh9</span>-1.i386.rpm</a></span></span></p>
+ lang=EN-GB>VDT1.2.2rh9</span>-1.i386.rpm</a></span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span></p>
</td>
</tr>
<tr>
<td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>4.0.20</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>4.1.11</span></p>
</td>
<td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
+ <p class=MsoNormal style='text-autospace:ideograph-numeric'><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:8.0pt'><a
href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/MySQL-server-4.0.20-0.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/MySQL-server-<span
- lang=EN-GB>4.0.20</span>-0.i386.rpm</a></span></span></p>
+ lang=EN-GB>4.0.20</span>-0.i386.rpm</a></span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span></p>
</td>
</tr>
<tr>
<td width=66 valign=top style='width:49.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:8.0pt'>4.0.20</span></p>
+ <p class=MsoNormal><span style='font-size:8.0pt'>4.1.11</span></p>
</td>
<td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
+ <p class=MsoNormal style='text-autospace:ideograph-numeric'><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:8.0pt'><a
href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/MySQL-client-4.0.20-0.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/MySQL-client-<span
- lang=EN-GB>4.0.20</span>-0.i386.rpm</a></span></span></p>
+ lang=EN-GB>4.0.20</span>-0.i386.rpm</a></span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span></p>
</td>
</tr>
<tr>
<td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
+ <p class=MsoNormal style='text-autospace:ideograph-numeric'><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:8.0pt'><a
href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/ares-1.1.1-EGEE.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/ares-<span
- lang=EN-GB>1.1.1</span>-EGEE.i386.rpm</a></span></span></p>
+ lang=EN-GB>1.1.1</span>-EGEE.i386.rpm</a></span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span></p>
</td>
</tr>
<tr>
<td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
+ <p class=MsoNormal style='text-autospace:ideograph-numeric'><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:8.0pt'><a
href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/myproxy-1.14-EGEE.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/myproxy-<span
- lang=EN-GB>1.14</span>-EGEE.i386.rpm</a></span></span></p>
+ lang=EN-GB>1.14</span>-EGEE.i386.rpm</a></span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span></p>
</td>
</tr>
<tr>
<td width=398 valign=top style='width:298.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span class=MsoHyperlink><span lang=EN-US
- style='font-size:8.0pt'><a
+ <p class=MsoNormal style='text-autospace:ideograph-numeric'><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;
+ color:windowtext;text-decoration:none'>H</span></span><span
+ class=MsoHyperlink><span lang=EN-US style='font-size:8.0pt'><a
href="http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/per-Expect.pm-1.01-9.i386.rpm">http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/per-Expect.pm-<span
- lang=EN-GB>1.01</span>-9.i386.rpm</a></span></span></p>
+ lang=EN-GB>1.01</span>-9.i386.rpm</a></span></span><span class=MsoHyperlink><span
+ lang=EN-US style='font-size:1.0pt;font-family:ZWAdobeF;color:windowtext;
+ text-decoration:none'>H</span></span></p>
</td>
</tr>
<tr>
<p class=MsoNormal> </p>
-<h3>7.1.5. Known bugs and issues</h3>
+<h1>5. Known bugs and issues</h1>
-<p class=MsoNormal align=left style='text-align:left'>This release has the
-following bugs and issues. Bug numbers refer to the gLite Bug Tracking system
-database hosted on the CERN Savannah system at <a
-href="https://savannah.cern.ch/bugs/?group=jra1mdw">https://savannah.cern.ch/bugs/?group=jra1mdw</a>
-.</p>
+<p class=MsoNormal align=left style='text-align:left;text-autospace:ideograph-numeric'>This
+release has the following bugs and issues. Bug numbers refer to the gLite Bug
+Tracking system database hosted on the CERN Savannah system at <span
+style='font-size:1.0pt;font-family:ZWAdobeF'>H</span><a
+href="https://savannah.cern.ch/bugs/?group=jra1mdw">https://savannah.cern.ch/bugs/?group=jra1mdw</a><span
+style='font-size:1.0pt;font-family:ZWAdobeF'>H</span> .</p>
<p class=MsoNormal align=left style='text-align:left'> </p>
<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
style='border-collapse:collapse;border:none'>
<tr>
- <td width=59 valign=top style='width:44.05pt;border:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'>Bug number</span></p>
- </td>
- <td width=534 valign=top style='width:400.8pt;border:solid windowtext 1.0pt;
- border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'>Description</span></p>
- </td>
- <td width=26 valign=top style='width:19.55pt;border:solid windowtext 1.0pt;
- border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6412"><span
- style='color:windowtext;text-decoration:none'> #6412</span></a></span></p>
- </td>
- <td width=534 valign=top style='width:400.8pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6412"><span
- style='color:windowtext;text-decoration:none'>--start and --stop options not
- documented in glite-ce-config.py, glite-lb-config.py</span></a> </span></p>
- </td>
- <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7053"><span
- style='color:windowtext;text-decoration:none'> #7053</span></a></span></p>
- </td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7053"><span
- style='color:windowtext;text-decoration:none'>LB configuration fails if the
- mysql root pwd is set</span></a> </span></p>
- </td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7180"><span
- style='color:windowtext;text-decoration:none'> #7180</span></a></span></p>
- </td>
- <td width=534 valign=top style='width:400.8pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7180"><span
- style='color:windowtext;text-decoration:none'>Logging & Bookkeping UI </span></a> </span></p>
- </td>
- <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7237"><span
- style='color:windowtext;text-decoration:none'> #7237</span></a></span></p>
- </td>
- <td width=534 valign=top style='width:400.8pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ <td width=59 valign=top style='width:44.15pt;border:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7237"><span
- style='color:windowtext;text-decoration:none'>Intermittent errors with job
- submission</span></a> </span></p>
+ <p class=MsoNormal><b><span style='font-size:10.0pt'>Bug number</span></b></p>
</td>
- <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <td width=534 valign=top style='width:400.7pt;border:solid windowtext 1.0pt;
+ border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><b><span style='font-size:10.0pt'>Description</span></b></p>
+ </td>
+ <td width=26 valign=top style='width:19.55pt;border:solid windowtext 1.0pt;
+ border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><b><span style='font-size:10.0pt'> </span></b></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7300"><span
- style='color:windowtext;text-decoration:none'> #7300</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7324"><span
+ style='font-size:11.0pt;color:#333333;text-decoration:none'> #7324</span></a></span></p>
</td>
<td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7300"><span
- style='color:windowtext;text-decoration:none'>update of the lb instructions
- at the end of the installer script </span></a> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7324"><span
+ style='font-size:11.0pt;color:#333333;text-decoration:none'>lb-bkserver is
+ running with no pid</span></a> </span></p>
</td>
<td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7305"><span
- style='color:windowtext;text-decoration:none'> #7305</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=9148"><span
+ style='font-size:11.0pt;color:#333333;text-decoration:none'> #9148</span></a></span></p>
</td>
<td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7305"><span
- lang=IT style='color:windowtext;text-decoration:none'>lb.database.username
- paramenter in config file</span></a></span><span lang=IT style='font-size:
- 10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=9148"><span
+ style='font-size:11.0pt;color:#333333;text-decoration:none'>Job stays
+ 'Submitted' forever</span></a> </span></p>
</td>
<td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span lang=IT style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7307"><span
- lang=IT style='color:windowtext;text-decoration:none'> </span><span
- style='color:windowtext;text-decoration:none'>#7307</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=9701"><span
+ style='font-size:11.0pt;color:#333333;text-decoration:none'> #9701</span></a></span></p>
</td>
<td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7307"><span
- style='color:windowtext;text-decoration:none'>lb config script does _not_
- fail if mysql root password is set</span></a> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=9701"><span
+ style='font-size:11.0pt;color:#333333;text-decoration:none'>erroneous rpath
+ in several shared objects</span></a> </span></p>
</td>
<td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7321"><span
- style='color:windowtext;text-decoration:none'> #7321</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=9777"><span
+ style='font-size:11.0pt;color:#333333;text-decoration:none'> #9777</span></a></span></p>
</td>
<td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7321"><span
- style='color:windowtext;text-decoration:none'>creation of indices fails
- randomly</span></a> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=9777"><span
+ style='font-size:11.0pt;color:#333333;text-decoration:none'>unable to get
+ logging-info -2 info for 1000 jobs</span></a> </span></p>
</td>
<td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7324"><span
- style='color:windowtext;text-decoration:none'> #7324</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=10781"><span
+ style='font-size:11.0pt;color:#333333;text-decoration:none'> #10781</span></a></span></p>
</td>
<td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7324"><span
- style='color:windowtext;text-decoration:none'>lb-bkserver is running with no
- pid</span></a> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=10781"><span
+ style='font-size:11.0pt;color:#333333;text-decoration:none'>Missing the
+ timestamps of 'Scheduled' and 'Running' status</span></a> </span></p>
</td>
<td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
- </td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7389"><span
- style='color:windowtext;text-decoration:none'> #7389</span></a></span></p>
- </td>
- <td width=534 valign=top style='width:400.8pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7389"><span
- style='color:windowtext;text-decoration:none'>LB server and WMS local logger
- related issues</span></a> </span></p>
- </td>
- <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
- none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
- padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
</table>
<p class=MsoNormal> </p>
-<p class=MsoNormal>Bugs fixed in this or previous releases, but not yet
-officially tested:</p>
+<p class=MsoNormal>Bugs fixed in this or previous releases, but not yet officially
+tested:</p>
<p class=MsoNormal> </p>
<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
style='border-collapse:collapse;border:none'>
<tr>
- <td width=58 valign=top style='width:43.3pt;border:solid windowtext 1.0pt;
+ <td width=57 valign=top style='width:42.6pt;border:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'>Bug number</span></p>
+ <p class=MsoNormal align=left style='text-align:left'><b><span
+ style='font-size:10.0pt;color:#333333'>Bug number</span></b></p>
</td>
- <td width=535 valign=top style='width:401.55pt;border:solid windowtext 1.0pt;
+ <td width=536 valign=top style='width:402.25pt;border:solid windowtext 1.0pt;
border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'>Description</span></p>
+ <p class=MsoNormal align=left style='text-align:left'><b><span
+ style='font-size:10.0pt;color:#333333'>Description</span></b></p>
</td>
<td width=26 valign=top style='width:19.55pt;border:solid windowtext 1.0pt;
border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><b><span
+ style='font-size:10.0pt;color:#333333'> </span></b></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5850"><span
- style='color:windowtext;text-decoration:none'> #5850</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7053"><span
+ style='color:#333333;text-decoration:none'> #7053</span></a></span></p>
</td>
- <td width=535 valign=top style='width:401.55pt;border-top:none;border-left:
+ <td width=536 valign=top style='width:402.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5850"><span
- style='color:windowtext;text-decoration:none'>glite-lb-config.py has
- glite.location and globus.location not set in params[]</span></a> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7053"><span
+ style='color:#333333;text-decoration:none'>LB configuration fails if the
+ mysql root pwd is set</span></a> </span></p>
</td>
<td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5908"><span
- style='color:windowtext;text-decoration:none'> #5908</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7300"><span
+ style='color:#333333;text-decoration:none'> #7300</span></a></span></p>
</td>
- <td width=535 valign=top style='width:401.55pt;border-top:none;border-left:
+ <td width=536 valign=top style='width:402.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5908"><span
- style='color:windowtext;text-decoration:none'>Environment variables set via
- the configuration script are not passed to daemon startup scripts</span></a> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7300"><span
+ style='color:#333333;text-decoration:none'>update of the lb instructions at
+ the end of the installer script </span></a> </span></p>
</td>
<td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6075"><span
- style='color:windowtext;text-decoration:none'> #6075</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7305"><span
+ style='color:#333333;text-decoration:none'> #7305</span></a></span></p>
</td>
- <td width=535 valign=top style='width:401.55pt;border-top:none;border-left:
+ <td width=536 valign=top style='width:402.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6075"><span
- style='color:windowtext;text-decoration:none'>glite-lb-config.py crashes with
- KeyError: GLITE_CERT_DIR</span></a> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7305"><span
+ style='color:#333333;text-decoration:none'>lb.database.username paramenter in
+ config file</span></a> </span></p>
</td>
<td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6366"><span
- style='color:windowtext;text-decoration:none'> #6366</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7307"><span
+ style='color:#333333;text-decoration:none'> #7307</span></a></span></p>
</td>
- <td width=535 valign=top style='width:401.55pt;border-top:none;border-left:
+ <td width=536 valign=top style='width:402.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6366"><span
- style='color:windowtext;text-decoration:none'>LB install script:: Fails but
- no error reported</span></a> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7307"><span
+ style='color:#333333;text-decoration:none'>lb config script does _not_ fail
+ if mysql root password is set</span></a> </span></p>
</td>
<td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6415"><span
- style='color:windowtext;text-decoration:none'> #6415</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7237"><span
+ style='color:#333333;text-decoration:none'>#7237</span></a></span></p>
</td>
- <td width=535 valign=top style='width:401.55pt;border-top:none;border-left:
+ <td width=536 valign=top style='width:402.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6415"><span
- style='color:windowtext;text-decoration:none'>glite-lb-bkserver does not
- start and blocks execution of glite-lb-config.py</span></a> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7237"><span
+ style='color:#333333;text-decoration:none'>Intermittent errors with job
+ submission</span></a> </span></p>
</td>
<td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6689"><span
- style='color:windowtext;text-decoration:none'> #6689</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7910"><span
+ style='color:#333333;text-decoration:none'> #7910</span></a></span></p>
</td>
- <td width=535 valign=top style='width:401.55pt;border-top:none;border-left:
+ <td width=536 valign=top style='width:402.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6689"><span
- style='color:windowtext;text-decoration:none'>glite-proxy-renewd starts the
- daemon glite-proxy-renewd as GLITE_USER which is glite-lb i.e. wrong</span></a> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7910"><span
+ style='color:#333333;text-decoration:none'>Duplicate apostroph in MySQL calls</span></a> </span></p>
</td>
<td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6722"><span
- style='color:windowtext;text-decoration:none'> #6722</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=8630"><span
+ style='color:#333333;text-decoration:none'> #8630</span></a></span></p>
</td>
- <td width=535 valign=top style='width:401.55pt;border-top:none;border-left:
+ <td width=536 valign=top style='width:402.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6722"><span
- style='color:windowtext;text-decoration:none'>glite-job-status -all doesn't
- work</span></a> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=8630"><span
+ style='color:#333333;text-decoration:none'>EDG_WL_* variables in LB library</span></a> </span></p>
</td>
<td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7296"><span
- style='color:windowtext;text-decoration:none'> #7296</span></a></span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=9135"><span
+ style='color:#333333;text-decoration:none'> #9135</span></a></span></p>
</td>
- <td width=535 valign=top style='width:401.55pt;border-top:none;border-left:
+ <td width=536 valign=top style='width:402.25pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7296"><span
- style='color:windowtext;text-decoration:none'>glite-lb-config.py crashes with
- a TypeError exception</span></a> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=9135"><span
+ style='color:#333333;text-decoration:none'>The interlogd has problem sending
+ event to the LB server</span></a> </span></p>
</td>
<td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
+ </td>
+ </tr>
+ <tr>
+ <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=9183"><span
+ style='color:#333333;text-decoration:none'> #9183</span></a></span></p>
+ </td>
+ <td width=536 valign=top style='width:402.25pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'><a
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=9183"><span
+ style='color:#333333;text-decoration:none'>Broken connections in LB contect
+ connection pool</span></a> </span></p>
+ </td>
+ <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal align=left style='text-align:left'><span style='font-size:
+ 10.0pt;color:#333333'> </span></p>
</td>
</tr>
</table>
text-align:left;text-autospace:none'><span lang=EN-US style='font-size:10.0pt;
font-family:"Courier New"'> </span></p>
-<h3>7.1.6. Bugs closed since last release</h3>
+<h1>6. Bugs closed since last release</h1>
-<p class=MsoNormal align=left style='text-align:left'>This release fixes the
-following bugs and issues. Bug numbers refer to the gLite Bug Tracking system
-database hosted on the CERN Savannah system at <a
-href="https://savannah.cern.ch/bugs/?group=jra1mdw">https://savannah.cern.ch/bugs/?group=jra1mdw</a>
- </p>
+<p class=MsoNormal align=left style='text-align:left;text-autospace:ideograph-numeric'>This
+release fixes the following bugs and issues. Bug numbers refer to the gLite Bug
+Tracking system database hosted on the CERN Savannah system at <span
+style='font-size:1.0pt;font-family:ZWAdobeF'>H</span><a
+href="https://savannah.cern.ch/bugs/?group=jra1mdw">https://savannah.cern.ch/bugs/?group=jra1mdw</a><span
+style='font-size:1.0pt;font-family:ZWAdobeF'>H</span> </p>
<p class=MsoNormal align=left style='text-align:left'> </p>
<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
style='border-collapse:collapse;border:none'>
<tr>
- <td width=103 valign=top style='width:77.45pt;border:solid windowtext 1.0pt;
+ <td width=64 valign=top style='width:47.8pt;border:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'>Bug number</span></p>
+ <p class=MsoNormal><b><span style='font-size:10.0pt'>Bug number</span></b></p>
+ </td>
+ <td width=529 valign=top style='width:397.05pt;border:solid windowtext 1.0pt;
+ border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><b><span style='font-size:10.0pt'>Description</span></b></p>
</td>
- <td width=516 valign=top style='width:386.95pt;border:solid windowtext 1.0pt;
+ <td width=26 valign=top style='width:19.55pt;border:solid windowtext 1.0pt;
border-left:none;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'>Description</span></p>
+ <p class=MsoNormal><b><span style='font-size:10.0pt'> </span></b></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5833"><span
- style='color:windowtext;text-decoration:none'> #5833</span></a></span></p>
- </td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5833"><span
- style='color:windowtext;text-decoration:none'>all jobs in SUBMITTED after a
- job storm</span></a> </span></p>
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6722"><span
+ style='color:windowtext;text-decoration:none'> #6722</span></a></span></p>
</td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ <td width=529 valign=top style='width:397.05pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5897"><span
- style='color:windowtext;text-decoration:none'> #5897</span></a></span></p>
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6722"><span
+ style='color:windowtext;text-decoration:none'>glite-job-status -all doesn't
+ work</span></a> </span></p>
</td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5897"><span
- style='color:windowtext;text-decoration:none'>I20041203 LB installation
- script has a missing dependency </span></a> </span></p>
+ <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5910"><span
- style='color:windowtext;text-decoration:none'> #5910</span></a></span></p>
- </td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5910"><span
- style='color:windowtext;text-decoration:none'>glite-lb configuration scripts
- don't set GLITE_USER environment</span></a> </span></p>
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7151"><span
+ style='color:windowtext;text-decoration:none'> #7151</span></a></span></p>
</td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ <td width=529 valign=top style='width:397.05pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5925"><span
- style='color:windowtext;text-decoration:none'> #5925</span></a></span></p>
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7151"><span
+ style='color:windowtext;text-decoration:none'>There are conflicts when
+ installing WMS and LB on the same node</span></a> </span></p>
</td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=5925"><span
- style='color:windowtext;text-decoration:none'>Running glite-lb script removes
- mysql.sock file </span></a> </span></p>
+ <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6416"><span
- style='color:windowtext;text-decoration:none'> #6416</span></a></span></p>
- </td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=6416"><span
- style='color:windowtext;text-decoration:none'>the BKserver on the LB machine
- needs a symlink and the script doesn't check for it</span></a> </span></p>
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7180"><span
+ style='color:windowtext;text-decoration:none'> #7180</span></a></span></p>
</td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ <td width=529 valign=top style='width:397.05pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7032"><span
- style='color:windowtext;text-decoration:none'> #7032</span></a></span></p>
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7180"><span
+ style='color:windowtext;text-decoration:none'>Logging & Bookkeping UI </span></a> </span></p>
</td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7032"><span
- style='color:windowtext;text-decoration:none'>The LB installer fails with an
- RPM not found message</span></a> </span></p>
+ <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7152"><span
- style='color:windowtext;text-decoration:none'> #7152</span></a></span></p>
- </td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7152"><span
- style='color:windowtext;text-decoration:none'>The LB installer tries to
- install gridsite with a wrong rpm name</span></a> </span></p>
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7389"><span
+ style='color:windowtext;text-decoration:none'> #7389</span></a></span></p>
</td>
- </tr>
- <tr>
- <td valign=top style='border:solid windowtext 1.0pt;border-top:none;
+ <td width=529 valign=top style='width:397.05pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7351"><span
- style='color:windowtext;text-decoration:none'> #7351</span></a></span></p>
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7389"><span
+ style='color:windowtext;text-decoration:none'>LB server and WMS local logger
+ related issues</span></a> </span></p>
</td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
- <p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7351"><span
- style='color:windowtext;text-decoration:none'>Star/restart of LB services </span></a> </span></p>
+ <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7401"><span
- style='color:windowtext;text-decoration:none'> #7401</span></a></span></p>
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7884"><span
+ style='color:windowtext;text-decoration:none'> #7884</span></a></span></p>
</td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
+ <td width=529 valign=top style='width:397.05pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7401"><span
- style='color:windowtext;text-decoration:none'>The first time the LB config
- script is run it fails creating the db indices</span></a> </span></p>
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7884"><span
+ style='color:windowtext;text-decoration:none'>local header files distributed
+ in RPMs. </span></a> </span></p>
+ </td>
+ <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
</td>
</tr>
<tr>
<td valign=top style='border:solid windowtext 1.0pt;border-top:none;
padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7423"><span
- style='color:windowtext;text-decoration:none'> #7423</span></a></span></p>
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=9861"><span
+ style='color:windowtext;text-decoration:none'> #9861</span></a></span></p>
</td>
- <td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;
- border-right:solid windowtext 1.0pt;padding:0mm 5.4pt 0mm 5.4pt'>
+ <td width=529 valign=top style='width:397.05pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
<p class=MsoNormal><span style='font-size:10.0pt'><a
- href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=7423"><span
- style='color:windowtext;text-decoration:none'>'/etc/rc.d/init.d/gLite status'
- not working correctly in LB</span></a> </span></p>
+ href="https://savannah.cern.ch/bugs/?func=detailitem&item_id=9861"><span
+ style='color:windowtext;text-decoration:none'>@ext.gpt.rpm.platform@ strings
+ in glite-lb_installer.sh</span></a> </span></p>
+ </td>
+ <td width=26 valign=top style='width:19.55pt;border-top:none;border-left:
+ none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
+ padding:0mm 5.4pt 0mm 5.4pt'>
+ <p class=MsoNormal><span style='font-size:10.0pt'> </span></p>
</td>
</tr>
</table>
<p class=MsoNormal align=left style='text-align:left'> </p>
-<p class=MsoNormal> </p>
-
</div>
</body>
-#Wed Apr 13 09:36:57 CEST 2005
-module.build=232
+#Mon Oct 31 12:08:27 CET 2005
+module.build=322
age="@org.glite.wms-utils.exception.info.age@"
build="@org.glite.wms-utils.exception.info.build@"
arch="i386"/>
-
- <component name="glite-security-proxyrenewal"
- version="@org.glite.security.proxyrenewal.info.version@"
- age="@org.glite.security.proxyrenewal.info.age@"
- build="@org.glite.security.proxyrenewal.info.build@"
+
+ <component name="glite-security-gsoap-plugin"
+ version="@org.glite.security.gsoap-plugin.info.version@"
+ age="@org.glite.security.gsoap-plugin.info.age@"
+ build="@org.glite.security.gsoap-plugin.info.build@"
arch="i386"/>
- <component name="glite-security-voms"
- version="@org.glite.security.voms.info.version@"
- age="@org.glite.security.voms.info.age@"
- build="@org.glite.security.voms.info.build@"
+
+ <component name="glite-security-voms-api-c"
+ version="@org.glite.security.voms-api-c.info.version@"
+ age="@org.glite.security.voms-api-c.info.age@"
+ build="@org.glite.security.voms-api-c.info.build@"
arch="i386"/>
+
<component name="gridsite"
version="@org.gridsite.core.info.version@"
age="@org.gridsite.core.info.age@"
<external name="@ext.gpt.rpm.name@"
version="@ext.gpt.rpm.version@"
age="@ext.gpt.rpm.age@"
- arch="@ext.gpt.rpm.platform@"/>
+ arch="@ext.gpt.platform@"/>
<external name="@ext.myproxy.rpm.name@"
- version="@ext.myproxy.rpm.version@"
+ version="@ext.myproxy.version@"
age="@ext.myproxy.rpm.age@"
- arch="@ext.myproxy.rpm.platform@"/>
+ arch="@ext.myproxy.platform@"/>
<external name="@ext.perl-expect-pm.rpm.name@"
version="@ext.perl-expect-pm.version@"
age="@ext.perl-expect-pm.rpm.age@"
echo Done!
echo
echo Before using the gLite LB, please create or update the configuration
- echo file /opt/glite/etc/config/glite-lb.cfg.xml
+ echo files /opt/glite/etc/config/glite-lb.cfg.xml
+ echo and /opt/glite/etc/config/glite-global.cfg.xml
echo and run the configuration script
echo /opt/glite/etc/config/scripts/glite-lb-config.py.
echo A template is provided in
echo /opt/glite/etc/config/templates/glite-lb.cfg.xml
+ echo Alternatively site configuration files can be used
else
echo
echo An error occurred while installing the LB RPMS.
echo For more information refer to the gLite Installation and User Guides
echo or to the gLite web site \(http:\/\/www.glite.org\)
echo Please report problems and comments to the gLite Team at
- echo project-eu-egee-glite-bugs@cern.ch
+ echo glite-bugs@cern.ch
cd ..
}
<xsl:variable name="package"><xsl:value-of select="@name"/>_installer.sh</xsl:variable>
<xsl:choose>
<xsl:when test="$install = 'true'">
-wget -N --non-verbose <xsl:value-of select="$installers"/><xsl:value-of select="$package"/>
+wget -N -nv <xsl:value-of select="$installers"/><xsl:value-of select="$package"/>
if [ ! -f "<xsl:value-of select="$package"/>" ]
then
echo
<xsl:variable name="package.name"><xsl:value-of select="@name"/>-<xsl:value-of select="@version"/>-<xsl:value-of select="@age"/></xsl:variable>
<xsl:choose>
<xsl:when test="$install = 'true'">
-wget -N --non-verbose <xsl:value-of select="$ext-repository"/><xsl:value-of select="$package"/>
+wget -N -nv <xsl:value-of select="$ext-repository"/><xsl:value-of select="$package"/>
if [ ! -f "<xsl:value-of select="$package"/>" ]
then
echo
<xsl:variable name="package.name"><xsl:value-of select="@name"/>-<xsl:value-of select="@version"/>-<xsl:value-of select="@age"/></xsl:variable>
<xsl:choose>
<xsl:when test="$install='true'">
-wget -N --non-verbose <xsl:value-of select="$repository"/><xsl:value-of select="@arch"/>/RPMS/<xsl:value-of select="$package"/>
+wget -N -nv <xsl:value-of select="$repository"/><xsl:value-of select="@arch"/>/RPMS/<xsl:value-of select="$package"/>
if [ ! -f "<xsl:value-of select="$package"/>" ]
then
echo
<!-- global processing -->
<xsl:template match="/">
+
template pro_software_glite_lb;
#
# glite-lb Quattor template v. <xsl:value-of select="/node/@version"/>
#
+## CAs
+
+include pro_software_glite_CA;
+
+
+
# Global dependencies
<xsl:for-each select="node/dependencies">
<xsl:apply-templates/>
<xsl:apply-templates/>
</xsl:for-each>
+ <xsl:for-each select="subservice">
+include pro_software_<xsl:value-of select="translate(@name, '-', '_')"/>;
+ </xsl:for-each>
+
+
</xsl:for-each>
</xsl:template>
-module.version = 1.3.0
+module.version = 2.0.5
module.age = 1
\ No newline at end of file
+++ /dev/null
-# defaults
-top_srcdir=.
-builddir=build
-top_builddir=${top_srcdir}/${builddir}
-stagedir=.
-distdir=.
-globalprefix=glite
-jpprefix=jp
-package=glite-jp-client
-version=0.0.0
-PREFIX=/opt/glite
-
-glite_location=/opt/glite
-globus_prefix=/opt/globus
-nothrflavour=gcc32
-thrflavour=gcc32pthr
-expat_prefix=/opt/expat
-ares_prefix=/opt/ares
-gsoap_prefix=/software/gsoap-2.6
-
-CC=gcc
-
--include Makefile.inc
-
-
-VPATH=${top_srcdir}/src:${top_srcdir}/examples:${top_srcdir}/project:${stagedir}/interface
-
-GLOBUS_LIBS:=-L${globus_prefix}/lib \
- -lglobus_common_${nothrflavour} \
- -lglobus_gssapi_gsi_${nothrflavour}
-
-GLOBUS_CFLAGS:=-I${globus_prefix}/include/${nothrflavour}
-
-DEBUG:=-g -O0 -DDEBUG
-
-CFLAGS:=${DEBUG} -I. -I${top_srcdir}/interface -I${top_srcdir}/src -I${gsoap_prefix}/include -I${stagedir}/include ${GLOBUS_CFLAGS}
-LDFLAGS:=-L${stagedir}/lib
-
-LINK:=libtool --mode=link ${CC} ${LDFLAGS}
-LTCOMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
-LINKXX:=libtool --mode=link ${CXX} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-
-daemon:=glite-jp-importer
-
-wsprefix:=jpps_
-
-SRCS:= jpimporter.c \
- ${wsprefix}ClientLib.c ${wsprefix}C.c
-# env_C.c
-
-EXA_SRCS:=
-
-OBJS:=${SRCS:.c=.o}
-EXA_OBJS:=${EXA_SRCS:.c=.o}
-
-COMMONLIB:=-lglite_jp_common
-GSOAPLIB:=-lglite_security_gsoap_plugin_${nothrflavour} -lglite_security_gss_${nothrflavour} \
- -L${gsoap_prefix}/lib -lgsoap${GSOAP_DEBUG} -L${ares_prefix}/lib -lares
-LBMAILDIRLIB:=-lglite_lb_maildir
-
-default all: compile
-
-compile: ${daemon}
-
-${daemon}: ${OBJS}
- ${LINK} -o $@ ${OBJS} ${LBMAILDIRLIB} ${COMMONLIB} ${GSOAPLIB} ${GLOBUS_LIBS}
-
-
-JobProvenancePS.xh: %.xh: %.wsdl JobProvenanceTypes.wsdl typemap.dat
- cp ${stagedir}/interface/JobProvenanceTypes.wsdl .
- ${gsoap_prefix}/bin/wsdl2h -t ${top_srcdir}/src/typemap.dat -c -o $@ $<
- rm -f JobProvenanceTypes.wsdl
-
-${wsprefix}Client.c ${wsprefix}ClientLib.c \
-${wsprefix}C.c ${wsprefix}H.h: JobProvenancePS.xh
- ${gsoap_prefix}/bin/soapcpp2 -n -w -c -p ${wsprefix} JobProvenancePS.xh
-
-env_C.c env_Server.c:
- touch env.xh
- cp ${jpproject}/JobProvenanceTypes.wsdl .
- ${gsoap_prefix}/bin/wsdl2h -t ${top_srcdir}/src/typemap.dat -c -o env.xh JobProvenanceTypes.wsdl
- rm -f JobProvenanceTypes.wsdl
- ${gsoap_prefix}/bin/soapcpp2 -w -c -p env_ env.xh
-
-${OBJS}: ${wsprefix}H.h soap_version.h
-
-soap_version.h:
- ${gsoap_prefix}/bin/soapcpp2 /dev/null
- perl -ne '$$. == 2 && /.*([0-9])\.([0-9])\.([0-9]).*/ && printf "#define GSOAP_VERSION %d%02d%02d\n",$$1,$$2,$$3' soapH.h >$@
- -rm soapC.cpp soapH.h soapStub.h soapClient.cpp soapServer.cpp soapClientLib.cpp soapServerLib.cpp
-
-
-
-
-check:
- -echo nothing yet
-
-doc:
-
-stage: compile
- ${MAKE} PREFIX=${stagedir} DOSTAGE=yes install
-
-dist: distsrc distbin
-
-distsrc:
- mkdir -p ${top_srcdir}/${package}-${version}
- cd ${top_srcdir} && GLOBIGNORE="${package}-${version}" && cp -Rf * ${package}-${version}
- cd ${top_srcdir} && tar -czf ${distdir}/${package}-${version}_src.tar.gz --exclude-from=project/tar_exclude ${package}-${version}
- rm -rf ${top_srcdir}/${package}-${version}
-
-distbin:
- $(MAKE) install PREFIX=`pwd`/tmpbuilddir${stagedir}
- save_dir=`pwd`; cd tmpbuilddir${stagedir} && tar -czf $$save_dir/${top_srcdir}/${distdir}/${package}-${version}_bin.tar.gz *; cd $$save_dir
- rm -rf tmpbuilddir
-
-install:
- -mkdir -p ${PREFIX}/bin ${PREFIX}/etc ${PREFIX}/examples ${PREFIX}/etc/init.d
- ${INSTALL} -m 755 ${daemon} ${PREFIX}/bin
-
-clean:
-
-# we have no real config.h but have to force gSoap not to use
-# linux ftime with broken (aka obsolete) DST information
-stdsoap2.o: ${gsoap_prefix}/devel/stdsoap2.c
- test -f config.h || touch config.h
- @echo 'The following warning "time_t (de)serialization is not MT safe on this platform" is harmless'
- ${CC} -o $@ -c -DWITH_NONAMESPACES -DHAVE_CONFIG_H ${CFLAGS} ${gsoap_prefix}/devel/stdsoap2.c
-
-
-%.lo: %.c
- ${LTCOMPILE} -o $@ -c $<
-
-%.o: %.c
- ${LTCOMPILE} -o $@ -c $<
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Build file for the GLite JP Primary module
--->
-
-<project name="client" default="dist">
-
- <!-- =========================================
- Builds the gLite JP Primary Module
- ========================================= -->
-
- <!-- =========================================
- Import properties (order is important)
- ========================================= -->
-
- <!-- import baseline & user properties -->
- <import file="../org.glite/project/baseline.properties.xml" />
-
- <!-- import component build properties,
- component properties &
- component common properties -->
- <import file="./project/properties.xml"/>
-
- <!-- import subsystem build properties,
- subsystem properties &
- subsystem common properties -->
- <import file="${subsystem.properties.file}"/>
-
- <!-- import global build properties &
- global properties -->
- <import file="${global.properties.file}" />
-
- <!-- =========================================
- Load dependency property files (order is important)
- ========================================= -->
- <property file="${user.dependencies.file}"/>
- <property file="${component.dependencies.file}" />
- <property file="${subsystem.dependencies.file}" />
- <property file="${global.dependencies.file}"/>
-
- <!-- =========================================
- Load configure options (order is important)
- ========================================= -->
- <import file="${global.configure.options.file}"/>
- <import file="${component.configure.options.file}"/>
-
- <!-- =========================================
- Import task definitions (order is important)
- ========================================= -->
- <import file="${subsystem.taskdefs.file}" />
- <import file="${global.taskdefs.file}" />
-
- <!-- =========================================
- Load common targets
- ========================================= -->
- <import file="${global.targets-simple_make.file}" />
-
- <!-- =========================================
- Load version file
- ========================================= -->
- <property file="${module.version.file}"/>
- <property file="${module.build.file}"/>
-
- <!-- ==============================================
- Local private targets
- ============================================== -->
-
- <target name="localinit"
- description="Module specific initialization tasks">
-
- <antcall target="lbmakefiles" />
- </target>
-
- <target name="localcompile"
- description="Module specific compile tasks">
- </target>
-
- <target name="localclean"
- description="Module specific cleaning tasks">
- </target>
-
-</project>
+++ /dev/null
-module.build=0
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Configuration options for the gLite JP client module
--->
-
- <!-- ======================================================
- Define extra properties here ...
- ====================================================== -->
-
- <project name="LB Common configuration options">
- <target name="lbmakefiles">
- <exec executable="ln" failonerror="true">
- <arg line="-fs ${component.dir}/Makefile ${module.build.dir}/Makefile"/>
- </exec>
- <echo file="${module.build.dir}/Makefile.inc">
-top_srcdir=..
-builddir=build
-stagedir=${stage.abs.dir}
-distdir=${dist.dir}
-globalprefix=${global.prefix}
-lbprefix=${subsystem.prefix}
-package=${module.package.name}
-PREFIX=${install.dir}
-version=${module.version}
-glite_location=${with.glite.location}
-globus_prefix=${with.globus.prefix}
-expat_prefix=${with.expat.prefix}
-ares_prefix=${with.ares.prefix}
-gsoap_prefix=${with.gsoap.prefix}
-mysql_prefix=${with.mysql.prefix}
-mysql_version=${ext.mysql.version}
-thrflavour=${with.globus.thr.flavor}
-nothrflavour=${with.globus.nothr.flavor}
-cppunit=${with.cppunit.prefix}
-jpproject=${subsystem.project.dir}
-project=${component.project.dir}
- </echo>
- </target>
- </project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Common build properties file for the gLite JP Client component
--->
-
-<project name="JP Client component common properties">
-
- <!-- Include build properties to allow overwriting
- of properties for subsystem -->
- <property file="project/build.properties" />
-
- <!-- ======================================================
- Define corresponding subsystem properties
- ====================================================== -->
-
- <!-- Subsystem name -->
- <property name="subsystem.name" value="${jp.subsystem.name}"/>
-
- <!-- Subsystem prefix -->
- <property name="subsystem.prefix" value="${jp.subsystem.prefix}"/>
-
- <!-- ======================================================
- Define component properties
- ====================================================== -->
-
- <!-- Component name prefix -->
- <property name="component.prefix" value="client" />
-
- <!-- ======================================================
- Define general component properties
- ====================================================== -->
-
- <import file="${component.general.properties.file}" />
-
- <!-- ======================================================
- Define extra properties here ...
- ====================================================== -->
-
-
-</project>
+++ /dev/null
-tar_exclude
-CVS
-build.xml
-build
-build.properties
-properties.xml
-configure.properties.xml
-.cvsignore
-.project
-.cdtproject
+++ /dev/null
-module.version=1.0.0
-module.age=1
+++ /dev/null
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <assert.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-
-#include "jpps_H.h"
-
-int glite_jpps_authz(glite_jp_context_t ctx,int op,const char *job,const char *owner)
-{
- glite_jp_error_t err;
- char buf[200];
- int i;
-
- memset(&err,0,sizeof err);
- glite_jp_clear_error(ctx);
- err.source = __FUNCTION__;
- err.code = EPERM;
-
- switch (op) {
- case SOAP_TYPE___jpsrv__RegisterJob:
- case SOAP_TYPE___jpsrv__StartUpload:
- case SOAP_TYPE___jpsrv__CommitUpload:
- for (i=0; ctx->trusted_peers && ctx->trusted_peers[i]; i++)
- if (!strcmp(ctx->trusted_peers[i],ctx->peer)) return 0;
- err.desc = "you are not a trusted peer";
- return glite_jp_stack_error(ctx,&err);
-
- case SOAP_TYPE___jpsrv__GetJob:
- assert(owner);
- return strcmp(owner,ctx->peer) ? glite_jp_stack_error(ctx,&err) : 0;
- break;
-
- default:
- snprintf(buf,sizeof buf,"%d: unknown operation",op);
- err.desc = buf;
- err.code = EINVAL;
- return glite_jp_stack_error(ctx,&err);
- }
-}
-
-int glite_jpps_readauth(glite_jp_context_t ctx,const char *file)
-{
- FILE *f = fopen(file,"r");
- glite_jp_error_t err;
- int cnt = 0;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
- if (!f) {
- err.code = errno;
- err.desc = file;
- return glite_jp_stack_error(ctx,&err);
- }
-
- ctx->trusted_peers = NULL;
- while (!feof(f)) {
- char buf[BUFSIZ];
-
- if (fscanf(f,"%[^\n]\n",buf) != 1) {
- err.code = EINVAL;
- err.desc = file;
- fclose(f);
- return glite_jp_stack_error(ctx,&err);
- }
-
- ctx->trusted_peers = realloc(ctx->trusted_peers, (cnt+1) * sizeof *ctx->trusted_peers);
- ctx->trusted_peers[cnt++] = strdup(buf);
- ctx->trusted_peers[cnt] = NULL;
- }
- fclose(f);
- return 0;
-}
+++ /dev/null
-/**
- * Check authorisation of JPPS operation on job.
- *
- * \param[in] ctx JP context including peer name & other credentials (VOMS etc.)
- * \param[in] op operation, one of SOAP_TYPE___jpsrv__*
- * \param[in] job jobid of the job to decide upon
- * \param[in] owner current known owner of the job (may be NULL), shortcut to avoid
- * unnecessary database query.
- *
- * \retval 0 OK, operation permitted
- * \retval EPERM denied
- * \retval other error
- */
-
-int glite_jpps_authz(glite_jp_context_t ctx,int op,const char *job,const char *owner);
-
-int glite_jpps_readauth(glite_jp_context_t ctx,const char *file);
-
+++ /dev/null
-#ifndef __GLITE_JP_BACKEND
-#define __GLITE_JP_BACKEND
-
-#include <sys/types.h>
-#include <unistd.h>
-
-int glite_jppsbe_init(
- glite_jp_context_t ctx,
- int argc,
- char *argv[]
-);
-
-int glite_jppsbe_init_slave(
- glite_jp_context_t ctx
-);
-
-int glite_jppsbe_register_job(
- glite_jp_context_t ctx,
- const char *job,
- const char *owner
-);
-
-int glite_jppsbe_start_upload(
- glite_jp_context_t ctx,
- const char *job,
- const char *class, /* must be filesystem-friendly */
- const char *name, /* optional name within the class */
- const char *content_type,
- char **destination_out,
- time_t *commit_before_inout
-);
-
-int glite_jppsbe_commit_upload(
- glite_jp_context_t ctx,
- const char *destination
-);
-
-int glite_jppsbe_get_names(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- char ***names_out
-);
-
-int glite_jppsbe_destination_info(
- glite_jp_context_t ctx,
- const char *destination,
- char **job_out,
- char **class_out,
- char **name_out
-);
-
-int glite_jppsbe_get_job_url(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name, /* optional within class */
- char **url_out
-);
-
-int glite_jppsbe_open_file(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name, /* optional within class */
- int mode,
- void **handle_out
-);
-
-int glite_jppsbe_close_file(
- glite_jp_context_t ctx,
- void *handle
-);
-
-int glite_jppsbe_pread(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset,
- ssize_t *nbytes_ret
-);
-
-int glite_jppsbe_pwrite(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset
-);
-
-int glite_jppsbe_append(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes
-);
-
-int glite_jppsbe_get_job_metadata(
- glite_jp_context_t ctx,
- const char *job,
- glite_jp_attrval_t attrs_inout[]
-);
-
-int glite_jppsbe_query(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t query[],
- const glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-);
-
-#endif
+++ /dev/null
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-
-#include "glite/lb/srvbones.h"
-#include "glite/security/glite_gss.h"
-
-#include <stdsoap2.h>
-#include "glite/security/glite_gsplugin.h"
-
-#include "backend.h"
-#include "file_plugin.h"
-
-#include "soap_version.h"
-#include "jpps_H.h"
-
-#define CONN_QUEUE 20
-
-extern SOAP_NMAC struct Namespace jpis__namespaces[],jpps__namespaces[];
-
-static int newconn(int,struct timeval *,void *);
-static int request(int,struct timeval *,void *);
-static int reject(int);
-static int disconn(int,struct timeval *,void *);
-static int data_init(void **data);
-
-static struct glite_srvbones_service stab = {
- "JP Primary Storage", -1, newconn, request, reject, disconn
-};
-
-static time_t cert_mtime;
-static char *server_cert, *server_key, *cadir;
-static gss_cred_id_t mycred = GSS_C_NO_CREDENTIAL;
-static char *mysubj;
-
-static char *port = "8901";
-static int debug = 1;
-
-static glite_jp_context_t ctx;
-
-static int call_opts(glite_jp_context_t,char *,char *,int (*)(glite_jp_context_t,int,char **));
-
-char *glite_jp_default_namespace;
-
-int main(int argc, char *argv[])
-{
- int one = 1,opt,i;
- edg_wll_GssStatus gss_code;
- struct sockaddr_in a;
- char *b_argv[20] = { "backend" },*p_argv[20] = { "plugins" },*com;
- int b_argc,p_argc;
-
- glite_jp_init_context(&ctx);
-
- b_argc = p_argc = 1;
-
- while ((opt = getopt(argc,argv,"B:P:a:")) != EOF) switch (opt) {
- case 'B':
- assert(b_argc < 20);
- if (com = strchr(optarg,',')) *com = 0;
-
- /* XXX: memleak -- who cares for once */
- asprintf(&b_argv[b_argc++],"-%s",optarg);
- if (com) b_argv[b_argc++] = com+1;
-
- break;
- case 'P':
- assert(p_argc < 20);
- p_argv[p_argc++] = optarg;
-
- break;
- case 'a':
- if (glite_jpps_readauth(ctx,optarg)) {
- fprintf(stderr,"%s: %s\n",argv[0],glite_jp_error_chain(ctx));
- exit (1);
- }
- break;
- case '?': fprintf(stderr,"usage: %s: -Bb,val ... -Pplugin.so ...\n"
- "b is backend option\n",argv[0]);
- exit (1);
- }
-
- if (b_argc == 1) {
- fputs("-B required\n",stderr);
- exit (1);
- }
-
- optind = 0; /* XXX: getopt used internally */
- if (glite_jppsbe_init(ctx,b_argc,b_argv)) {
- fputs(glite_jp_error_chain(ctx), stderr);
- exit(1);
- }
-
- optind = 0; /* XXX: getopt used internally */
- if (b_argc > 1 && glite_jpps_fplug_load(ctx,p_argc,p_argv)) {
- fputs(glite_jp_error_chain(ctx), stderr);
- exit(1);
- }
-
- srand48(time(NULL)); /* feed id generation */
-
-#if GSOAP_VERSION <= 20602
- for (i=0; jpps__namespaces[i].id && strcmp(jpps__namespaces[i].id,"ns1"); i++);
-#else
- for (i=0; jpps__namespaces[i].id && strcmp(jpps__namespaces[i].id,"jpsrv"); i++);
-#endif
- assert(jpps__namespaces[i].id);
- glite_jp_default_namespace = jpps__namespaces[i].ns;
-
- stab.conn = socket(PF_INET, SOCK_STREAM, 0);
- if (stab.conn < 0) {
- perror("socket");
- return 1;
- }
-
- setsockopt(stab.conn,SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
-
- a.sin_family = AF_INET;
- a.sin_addr.s_addr = INADDR_ANY;
- a.sin_port = htons(atoi(port));
- if (bind(stab.conn,(struct sockaddr *) &a, sizeof(a)) ) {
- char buf[200];
-
- snprintf(buf,sizeof(buf),"bind(%d)",atoi(port));
- perror(buf);
- return 1;
- }
-
- if (listen(stab.conn,CONN_QUEUE)) {
- perror("listen()");
- return 1;
- }
-
- if (!server_cert || !server_key)
- fprintf(stderr, "%s: WARNING: key or certificate file not specified, "
- "can't watch them for changes\n",
- argv[0]);
-
- if ( cadir ) setenv("X509_CERT_DIR", cadir, 1);
- edg_wll_gss_watch_creds(server_cert, &cert_mtime);
-
- if ( !edg_wll_gss_acquire_cred_gsi(server_cert, server_key, &mycred, &mysubj, &gss_code))
- fprintf(stderr,"Server idenity: %s\n",mysubj);
- else fputs("WARNING: Running unauthenticated\n",stderr);
-
- /* XXX: daemonise */
-
- glite_srvbones_set_param(GLITE_SBPARAM_SLAVES_COUNT,1);
- glite_srvbones_run(data_init,&stab,1 /* XXX: entries in stab */,debug);
-
- return 0;
-}
-
-static int data_init(void **data)
-{
- *data = (void *) soap_new();
-
- printf("[%d] slave started\n",getpid());
- glite_jppsbe_init_slave(ctx); /* XXX: global but slave's */
-
- return 0;
-}
-
-static int newconn(int conn,struct timeval *to,void *data)
-{
- struct soap *soap = (struct soap *) data;
- glite_gsplugin_Context plugin_ctx;
-
- gss_cred_id_t newcred = GSS_C_NO_CREDENTIAL;
- edg_wll_GssStatus gss_code;
- gss_name_t client_name = GSS_C_NO_NAME;
- gss_buffer_desc token = GSS_C_EMPTY_BUFFER;
- OM_uint32 maj_stat,min_stat;
-
-
- int ret = 0;
-
- soap_init2(soap,SOAP_IO_KEEPALIVE,SOAP_IO_KEEPALIVE);
- soap_set_namespaces(soap,jpps__namespaces);
- soap->user = (void *) ctx; /* XXX: one instance per slave */
-
-/* not yet: client to JP index
- ctx->other_soap = soap_new();
- soap_init(ctx->other_soap);
- soap_set_namespaces(ctx->other_soap,jpis__namespaces);
-*/
-
-
- glite_gsplugin_init_context(&plugin_ctx);
- plugin_ctx->connection = calloc(1,sizeof *plugin_ctx->connection);
- soap_register_plugin_arg(soap,glite_gsplugin,plugin_ctx);
-
- switch (edg_wll_gss_watch_creds(server_cert,&cert_mtime)) {
- case 0: break;
- case 1: if (!edg_wll_gss_acquire_cred_gsi(server_cert,server_key,
- &newcred,NULL,&gss_code))
- {
-
- printf("[%d] reloading credentials\n",getpid()); /* XXX: log */
- gss_release_cred(&min_stat,&mycred);
- mycred = newcred;
- }
- break;
- case -1:
- printf("[%d] edg_wll_gss_watch_creds failed\n", getpid()); /* XXX: log */
- break;
- }
-
- /* TODO: DNS paranoia etc. */
-
- if (edg_wll_gss_accept(mycred,conn,to,plugin_ctx->connection,&gss_code)) {
- printf("[%d] GSS connection accept failed, closing.\n", getpid());
- ret = 1;
- goto cleanup;
- }
-
- maj_stat = gss_inquire_context(&min_stat,plugin_ctx->connection->context,
- &client_name, NULL, NULL, NULL, NULL, NULL, NULL);
-
- if (!GSS_ERROR(maj_stat))
- maj_stat = gss_display_name(&min_stat,client_name,&token,NULL);
-
- if (ctx->peer) free(ctx->peer);
- if (!GSS_ERROR(maj_stat)) {
- printf("[%d] client DN: %s\n",getpid(),(char *) token.value); /* XXX: log */
-
- ctx->peer = strdup(token.value);
- memset(&token, 0, sizeof(token));
- }
- else {
- printf("[%d] annonymous client\n",getpid());
- ctx->peer = NULL;
- }
-
- if (client_name != GSS_C_NO_NAME) gss_release_name(&min_stat, &client_name);
- if (token.value) gss_release_buffer(&min_stat, &token);
-
- return 0;
-
-cleanup:
- glite_gsplugin_free_context(plugin_ctx);
- soap_end(soap);
-
- return ret;
-}
-
-static int request(int conn,struct timeval *to,void *data)
-{
- struct soap *soap = data;
- glite_jp_context_t ctx = soap->user;
-
- glite_gsplugin_set_timeout(glite_gsplugin_get_context(soap),to);
-
-/* FIXME: does not work, ask nykolas */
- soap->max_keep_alive = 1; /* XXX: prevent gsoap to close connection */
- soap_begin(soap);
- if (soap_begin_recv(soap)) {
- if (soap->error < SOAP_STOP) {
- soap_send_fault(soap);
- return EIO;
- }
- return ENOTCONN;
- }
-
- if (soap_envelope_begin_in(soap)
- || soap_recv_header(soap)
- || soap_body_begin_in(soap)
- || jpps__serve_request(soap)
-#if GSOAP_VERSION >= 20700
- || (soap->fserveloop && soap->fserveloop(soap))
-#endif
- )
- {
- soap_send_fault(soap);
- return ctx->error->code; /* XXX: shall we die on some errors? */
- }
-
- glite_jp_run_deferred(ctx);
- return 0;
-}
-
-static int reject(int conn)
-{
- int flags = fcntl(conn, F_GETFL, 0);
-
- fcntl(conn,F_SETFL,flags | O_NONBLOCK);
- edg_wll_gss_reject(conn);
-
- return 0;
-}
-
-static int disconn(int conn,struct timeval *to,void *data)
-{
- struct soap *soap = (struct soap *) data;
- soap_end(soap); // clean up everything and close socket
-
- return 0;
-}
-
-#define WSPACE "\t\n "
-
-static int call_opts(glite_jp_context_t ctx,char *opt,char *name,int (*f)(glite_jp_context_t,int,char **))
-{
- int ac = 1,ret,my_optind;
- char **av = malloc(sizeof *av),*ap;
-
- *av = name;
- for (ap = strtok(opt,WSPACE); ap; ap = strtok(NULL,WSPACE)) {
- av = realloc(av,(ac+1) * sizeof *av);
- av[ac++] = ap;
- }
-
- my_optind = optind;
- optind = 0;
- ret = f(ctx,ac,av);
- optind = my_optind;
- free(av);
- return ret;
-}
-
-
-/* XXX: we don't use it */
-SOAP_NMAC struct Namespace namespaces[] = { {NULL,NULL} };
+++ /dev/null
-
-#define GLITE_JP_FILETYPE_TAGS "urn:org.glite.jp.primary:tags"
-#define GLITE_JP_FILETYPE_LB "urn:org.glite.jp.primary:lb"
-#define GLITE_JP_FILETYPE_ISB "urn:org.glite.jp.primary:isb"
-#define GLITE_JP_FILETYPE_OSB "urn:org.glite.jp.primary:osb"
-
-#define GLITE_JP_FPLUG_TAGS_APPEND 0
+++ /dev/null
-#ifndef _DB_H
-#define _DB_H
-
-#ident "$Header$"
-
-#include <sys/types.h>
-#include <sys/time.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-typedef struct _glite_jp_db_stmt_t *glite_jp_db_stmt_t;
-
-int glite_jp_db_connect(
- glite_jp_context_t, /* INOUT: */
- char * /* IN: connect string user/password@host:database */
-);
-
-void glite_jp_db_close(glite_jp_context_t);
-
-
-/* Parse and execute SQL statement. Returns number of rows selected, created
- * or affected by update, or -1 on error */
-
-int glite_jp_db_execstmt(
- glite_jp_context_t, /* INOUT: */
- char *, /* IN: SQL statement */
- glite_jp_db_stmt_t * /* OUT: statement handle. Usable for
- select only */
-);
-
-
-/* Fetch next row of select statement.
- * All columns are returned as fresh allocated strings
- *
- * return values:
- * >0 - number of fields of the retrieved row
- * 0 - no more rows
- * -1 - error
- *
- * Errors are stored in context passed to previous glite_jp_db_execstmt() */
-
-int glite_jp_db_fetchrow(
- glite_jp_db_stmt_t, /* IN: statement */
- char ** /* OUT: array of fetched values.
- * As number of columns is fixed and known,
- * expects allocated array of pointers here */
-);
-
-/* Retrieve column names of a query statement */
-
-int glite_jp_db_querycolumns(
- glite_jp_db_stmt_t, /* IN: statement */
- char ** /* OUT: result set column names. Expects allocated array. */
-);
-
-/* Free the statement structure */
-
-void glite_jp_db_freestmt(
- glite_jp_db_stmt_t * /* INOUT: statement */
-);
-
-
-/* convert time_t into database-specific time string
- * returns pointer to static area that is changed by subsequent calls */
-
-char *glite_jp_db_timetodb(time_t);
-time_t glite_jp_db_dbtotime(char *);
-
-
-/**
- * Check database version.
- */
-int glite_jp_db_dbcheckversion(glite_jp_context_t);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+++ /dev/null
-#include <stdio.h>
-#include <time.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-#include <fcntl.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/strmd5.h"
-#include "feed.h"
-#include "file_plugin.h"
-#include "builtin_plugins.h"
-
-
-/*
- * seconds before feed expires: should be
- * XXX: should be configurable, default for real deployment sort of 1 hour
- */
-#define FEED_TTL 120
-
-static int check_qry_item(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t *qry,
- const glite_jp_attrval_t *attr
-)
-{
- int cmp,cmp2;
- long scmp,ucmp;
-
- switch (qry->attr.type) {
- case GLITE_JP_ATTR_OWNER:
- case GLITE_JP_ATTR_TAG:
- cmp = strcmp(attr->value.s,qry->value.s);
- break;
- case GLITE_JP_ATTR_TIME:
- scmp = (ucmp = attr->value.time.tv_usec - qry->value.time.tv_usec) > 0 ? 0 : -1;
- ucmp -= 1000000 * scmp;
- scmp += attr->value.time.tv_sec - qry->value.time.tv_sec;
- cmp = scmp ? scmp : ucmp;
- break;
- }
- switch (qry->op) {
- case GLITE_JP_QUERYOP_EQUAL: return !cmp;
- case GLITE_JP_QUERYOP_UNEQUAL: return cmp;
- case GLITE_JP_QUERYOP_LESS: return cmp < 0;
- case GLITE_JP_QUERYOP_GREATER: return cmp > 0;
-
- case GLITE_JP_QUERYOP_WITHIN:
- switch (qry->attr.type) {
- case GLITE_JP_ATTR_OWNER:
- case GLITE_JP_ATTR_TAG:
- cmp2 = strcmp(attr->value.s,qry->value2.s);
- break;
- case GLITE_JP_ATTR_TIME:
- scmp = (ucmp = attr->value.time.tv_usec - qry->value2.time.tv_usec) > 0 ? 0 : -1;
- ucmp -= 1000000 * scmp;
- scmp += attr->value.time.tv_sec - qry->value2.time.tv_sec;
- cmp2 = scmp ? scmp : ucmp;
- break;
- }
- return cmp >= 0 && cmp2 <= 0;
- }
-}
-
-/* XXX: limit on query size -- I'm lazy to malloc() */
-#define QUERY_MAX 100
-
-static int match_feed(
- glite_jp_context_t ctx,
- const struct jpfeed *feed,
- const char *job,
- const glite_jp_attrval_t attrs[] /* XXX: not checked for correctness */
-)
-{
- int i;
- int attri[GLITE_JP_ATTR__LAST];
- int qi[QUERY_MAX];
-
- glite_jp_attrval_t *newattr = NULL;
-
- glite_jp_clear_error(ctx);
-
- for (i=0; i<GLITE_JP_ATTR__LAST; i++) attri[i] = -1;
- for (i=0; attrs[i].attr.type; i++) attri[attrs[i].attr.type] = i;
-
- if (feed->qry) {
- int j,complete = 1;
-
- memset(qi,0,sizeof qi);
- for (i=0; feed->qry[i].attr.type; i++) {
- assert(i<QUERY_MAX);
- if ((j=attri[feed->qry[i].attr.type]) >=0) {
- if (check_qry_item(ctx,feed->qry+i,attrs+j))
- qi[i] = 1; /* matched */
- else return 0; /* can't be satisfied */
- }
- else complete = 0;
- }
-
- /* not all attributes in query are known from input
- * we have to retrieve job metadata from the backend
- */
- if (!complete) {
- glite_jp_attrval_t meta[GLITE_JP_ATTR__LAST+1];
- int qai[GLITE_JP_ATTR__LAST];
-
- memset(meta,0,sizeof meta);
- j=0;
- for (i=0; feed->qry[i].attr.type; i++) if (!qi[i]) {
- meta[j].attr.type = feed->qry[i].attr.type;
- meta[j].attr.name = feed->qry[i].attr.name;
- qai[feed->qry[i].attr.type] = i;
- j++;
- }
-
- if (glite_jppsbe_get_job_metadata(ctx,job,meta)) {
- glite_jp_error_t err;
- memset(&err,0,sizeof err);
- err.code = EIO;
- err.source = __FUNCTION__;
- err.desc = "complete query";
- return glite_jp_stack_error(ctx,&err);
- }
-
- for (i=0; j=meta[i].attr.type; i++)
- if (!check_qry_item(ctx,feed->qry+qai[j],meta+i))
- return 0;
- }
- }
-
- /* matched completely */
- return glite_jpps_single_feed(ctx,feed->destination,job,attrs);
- return 0;
-}
-
-int glite_jpps_match_attr(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t attrs[]
-)
-{
- struct jpfeed *f = (struct jpfeed *) ctx->feeds;
- int i,j;
- int attri[GLITE_JP_ATTR__LAST];
-
- glite_jp_clear_error(ctx);
-
- for (i=0; i<GLITE_JP_ATTR__LAST; i++) attri[i] = -1;
- for (i=0; attrs[i].attr.type; i++) {
- if (attrs[i].attr.type >= GLITE_JP_ATTR__LAST ||
- attrs[i].attr.type <= 0)
- {
- glite_jp_error_t err;
- memset(&err,0,sizeof err);
- err.code = EINVAL;
- err.source = __FUNCTION__;
- err.desc = "unknown attribute";
- return glite_jp_stack_error(ctx,&err);
- }
- if (attri[attrs[i].attr.type] >= 0) {
- glite_jp_error_t err;
- memset(&err,0,sizeof err);
- err.code = EINVAL;
- err.source = __FUNCTION__;
- err.desc = "double attribute change";
- return glite_jp_stack_error(ctx,&err);
- }
-
- attri[attrs[i].attr.type] = i;
- }
-
- for (;f; f = f->next) {
- for (i=0; f->attrs[i].type && attri[f->attrs[i].type] == -1; i++);
- /* XXX: ignore any errors */
- if (f->attrs[i].type) match_feed(ctx,f,job,attrs);
- }
-
- return glite_jp_clear_error(ctx);
-}
-
-int glite_jpps_match_file(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name
-)
-{
- glite_jpps_fplug_data_t **pd = NULL;
- int pi;
- void *bh = NULL;
- int ret;
-
- fprintf(stderr,"%s: %s %s %s\n",__FUNCTION__,job,class,name);
-
- switch (glite_jpps_fplug_lookup(ctx,class,&pd)) {
- case ENOENT: return 0; /* XXX: shall we complain? */
- case 0: break;
- default: return -1;
- }
-
- for (pi=0; pd[pi]; pi++) {
- int ci;
- for (ci=0; pd[pi]->uris[ci]; ci++) if (!strcmp(pd[pi]->uris[ci],class)) {
- void *ph;
-
- if (!bh && (ret = glite_jppsbe_open_file(ctx,job,pd[pi]->classes[ci],name,O_RDONLY,&bh))) {
- free(pd);
- return ret;
- }
-
- if (pd[pi]->ops.open(pd[pi]->fpctx,bh,class,&ph)) {
- /* XXX: complain more visibly */
- fputs("plugin open failed\n",stderr);
- continue;
- }
-
- /* XXX: does not belong here but I'd like to avoid opening the file twice */
- if (!strcmp(class,GLITE_JP_FILETYPE_LB)) {
- glite_jp_attr_t owner = { GLITE_JP_ATTR_OWNER, NULL };
- glite_jp_attrval_t *val;
-
- switch (pd[pi]->ops.attr(pd[pi]->fpctx,ph,owner,&val)) {
- case ENOENT:
- case ENOSYS: abort();
- case 0: printf("LB plugin: owner = %s\n",val[0].value.s);
- /* TODO: store it in backend */
-
- glite_jp_attrval_free(val,1);
- break;
-
- default: /* TODO: complain */; break;
- }
- }
-
- /* TODO: extract attributes for the feeds */
-
-
- pd[pi]->ops.close(pd[pi]->fpctx,ph);
- }
- }
-
- if (bh) glite_jppsbe_close_file(ctx,bh);
- free(pd);
-
- return 0;
-}
-
-int glite_jpps_match_tag(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_tagval_t *tag
-)
-{
- fprintf(stderr,"%s: \n",__FUNCTION__);
- return 0;
-}
-
-static char *generate_feedid(void)
-{
- char hname[200],buf[1000];
-
- gethostname(hname,sizeof hname);
- snprintf(buf,sizeof buf,"%s%d%ld",hname,getpid(),lrand48());
- buf[sizeof buf-1] = 0;
- return str2md5base64(buf);
-}
-
-
-int glite_jpps_run_feed(
- glite_jp_context_t ctx,
- const char *destination,
- const glite_jp_attr_t *attrs,
- const glite_jp_query_rec_t *qry,
- char **feed_id)
-{
- fprintf(stderr,"%s: \n",__FUNCTION__);
- return 0;
-}
-
-static int register_feed_deferred(glite_jp_context_t ctx,void *feed)
-{
- struct jpfeed *f = feed;
-
- f->next = ctx->feeds;
- ctx->feeds = f;
- return 0;
-}
-
-/* FIXME:
- * - volatile implementation: should store the registrations in a file
- * and recover after restart
- * - should communicate the data among all server slaves
- */
-int glite_jpps_register_feed(
- glite_jp_context_t ctx,
- const char *destination,
- const glite_jp_attr_t *attrs,
- const glite_jp_query_rec_t *qry,
- char **feed_id,
- time_t *expires)
-{
- int i;
- struct jpfeed *f = calloc(1,sizeof *f);
-
- if (!*feed_id) *feed_id = generate_feedid();
- time(expires); *expires += FEED_TTL;
-
- f->id = strdup(*feed_id);
- f->destination = strdup(destination);
- f->expires = *expires;
- for (i=0; attrs[i].type; i++) {
- f->attrs = realloc(f->attrs,(i+2) * sizeof *f->attrs);
- glite_jp_attr_copy(f->attrs+i,attrs+i);
- memset(f->attrs+i+1,0,sizeof *f->attrs);
- }
- for (i=0; qry[i].attr.type; i++) {
- f->qry = realloc(f->qry,(i+2) * sizeof *f->qry);
- glite_jp_queryrec_copy(f->qry+i,qry+i);
- memset(f->qry+i+1,0,sizeof *f->qry);
- }
-
- glite_jp_add_deferred(ctx,register_feed_deferred,f);
-
- return 0;
-}
-
+++ /dev/null
-#ifndef __GLITE_JP_FEED
-#define __GLITE_JP_FEED
-
-
-struct jpfeed {
- char *id,*destination;
- time_t expires;
- glite_jp_attr_t *attrs;
- glite_jp_query_rec_t *qry;
- struct jpfeed *next;
-};
-
-
-int glite_jpps_match_attr(glite_jp_context_t,const char *,const glite_jp_attrval_t[]);
-int glite_jpps_match_file(glite_jp_context_t,const char *,const char *,const char *);
-int glite_jpps_match_tag(glite_jp_context_t,const char *,const glite_jp_tagval_t *);
-int glite_jpps_run_feed(glite_jp_context_t,const char *,const glite_jp_attr_t *,const glite_jp_query_rec_t *,char **);
-int glite_jpps_register_feed(glite_jp_context_t,const char *,const glite_jp_attr_t *,const glite_jp_query_rec_t *,char **,time_t *);
-
-#endif
-
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <getopt.h>
-#include <dlfcn.h>
-#include <errno.h>
-
-#include <glite/jp/types.h>
-#include "file_plugin.h"
-
-static struct option opts[] = {
- { "plugin", 1, NULL, 'p' },
- { NULL }
-};
-
-static int loadit(glite_jp_context_t ctx,const char *so)
-{
-/* XXX: not stored but we never dlclose() yet */
- void *dl_handle = dlopen(so,RTLD_NOW);
-
- glite_jp_error_t err;
- const char *e;
- glite_jpps_fplug_data_t *data,*dp;
- int i;
-
- glite_jpps_fplug_init_t init;
- memset(&err,0,sizeof err);
-
- if (!dl_handle) {
- err.source = "dlopen()";
- err.code = EINVAL;
- err.desc = dlerror();
- return glite_jp_stack_error(ctx,&err);
- }
-
- dlerror();
- init = dlsym(dl_handle,"init");
- e = dlerror();
- if (e) {
- char buf[300];
- snprintf(buf,sizeof buf,"dlsym(\"%s\",\"init\")",so);
- buf[299] = 0;
- err.source = buf;
- err.code = ENOENT;
- err.desc = e;
- return glite_jp_stack_error(ctx,&err);
- }
-
- data = calloc(1,sizeof *data);
-
- if (init(ctx,data)) return -1;
-
- i = 0;
- if (ctx->plugins) for (i=0; ctx->plugins[i]; i++);
- ctx->plugins = realloc(ctx->plugins, (i+2) * sizeof *ctx->plugins);
- ctx->plugins[i] = data;
- ctx->plugins[i+1] = NULL;
-
- /* TODO: check consistency of uri+class pairs wrt. previous plugins */
-
- return 0;
-}
-
-int glite_jpps_fplug_load(glite_jp_context_t ctx,int argc,char **argv)
-{
- int i;
-
- for (i=1; i<argc; i++) if (loadit(ctx,argv[i])) {
- glite_jp_error_t err;
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
- err.code = EINVAL;
- err.desc = argv[i];
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-int glite_jpps_fplug_lookup(glite_jp_context_t ctx,const char *uri, glite_jpps_fplug_data_t ***plugin_data)
-{
- int i;
-
- glite_jpps_fplug_data_t **out = NULL;
- int matches = 0;
-
- glite_jp_error_t err;
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
- err.code = ENOENT;
- err.desc = (char *) uri; /* XXX: we don't modify it, believe me, gcc! */
-
- glite_jp_clear_error(ctx);
- if (!ctx->plugins) {
- return glite_jp_stack_error(ctx,&err);
- }
-
- for (i = 0; ctx->plugins[i]; i++) {
- int j;
- glite_jpps_fplug_data_t *p = ctx->plugins[i];
-
- for (j=0; p->uris && p->uris[j]; j++)
- if (!strcmp(p->uris[j],uri)) {
- out = realloc(out, (matches+2) * sizeof *out);
- out[matches++] = p;
- out[matches] = NULL;
- }
- }
-
- if (matches) {
- *plugin_data = out;
- return 0;
- }
- else return glite_jp_stack_error(ctx,&err);
-}
-
+++ /dev/null
-#ident "$Header$"
-
-#include <getopt.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <assert.h>
-#include <limits.h>
-#include <dirent.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-#include "glite/jp/strmd5.h"
-
-#include "tags.h"
-#include "backend.h"
-
-#define UPLOAD_SUFFIX ".upload"
-#define LOCK_SUFFIX ".lock"
-
-struct ftpbe_config {
- char *internal_path;
- char *external_path;
- char *gridmap;
- char *logname;
-};
-
-static struct ftpbe_config *config = NULL;
-
-struct fhandle_rec {
- int fd;
- int fd_append;
-};
-typedef struct fhandle_rec *fhandle;
-
-static struct option ftpbe_opts[] = {
- { "ftp-internal-path", 1, NULL, 'I' },
- { "ftp-external-path", 1, NULL, 'E' },
- { "ftp-gridmap", 1, NULL, 'G' },
- { NULL, 0, NULL, 0 }
-};
-
-/* obsolete */
-#if 0
-static struct {
- glite_jp_fileclass_t type;
- char * fname;
- } class_to_fname_tab[] = {
- { GLITE_JP_FILECLASS_INPUT, "input" },
- { GLITE_JP_FILECLASS_OUTPUT, "output" },
- { GLITE_JP_FILECLASS_LBLOG, "lblog" },
- { GLITE_JP_FILECLASS_TAGS, "tags" },
- { GLITE_JP_FILECLASS_UNDEF, NULL }
- };
-
-static char *class_to_fname(glite_jp_fileclass_t type)
-{
- int i;
-
- for (i = 0; class_to_fname_tab[i].type != GLITE_JP_FILECLASS_UNDEF; i++)
- if (type == class_to_fname_tab[i].type)
- return class_to_fname_tab[i].fname;
-
- return NULL;
-}
-
-static glite_jp_fileclass_t fname_to_class(char* fname)
-{
- int i;
-
- for (i = 0; class_to_fname_tab[i].type != GLITE_JP_FILECLASS_UNDEF; i++)
- if (!strcmp(fname, class_to_fname_tab[i].fname))
- return class_to_fname_tab[i].type;
-
- return GLITE_JP_FILECLASS_UNDEF;
-}
-#endif
-
-static int config_check(
- glite_jp_context_t ctx,
- struct ftpbe_config *config)
-{
- return config == NULL ||
- config->internal_path == NULL ||
- config->external_path == NULL ||
- config->gridmap == NULL ||
- config->logname == NULL;
-
- /* XXX check reality */
-}
-
-static int jobid_unique_pathname(glite_jp_context_t ctx, const char *job,
- char **unique, char **ju_path, int get_path)
-{
- char *p;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- p = strrchr(job, '/');
- if (!p) {
- err.code = EINVAL;
- err.desc = "Malformed jobid";
- return glite_jp_stack_error(ctx,&err);
- }
- /* XXX thorough checks */
- if (!(*unique = strdup(p+1))) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- if (get_path) {
- if (!(*ju_path = strdup(p+1))) {
- free(*unique);
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- *(*ju_path + 10) = '\0';
- }
- return 0;
-}
-
-static int mkdirpath(const char* path, int prefixlen)
-{
- char *wpath, *p;
- int goout, ret;
-
- wpath = strdup(path);
- if (!wpath) {
- errno = ENOMEM;
- return -1;
- }
-
- p = wpath + prefixlen;
- goout = 0;
- while (!goout) {
- while (*p == '/') p++;
- while (*p != '/' && *p != '\0') p++;
- goout = (*p == '\0');
- *p = '\0';
- ret = mkdir(wpath, S_IRUSR | S_IWUSR | S_IXUSR);
- if (ret < 0 && errno != EEXIST) break;
- *p = '/';
- }
- free(wpath);
- return goout ? 0 : ret;
-}
-
-static long regtime_trunc(long tv_sec)
-{
- return tv_sec / (86400*7);
-}
-
-static long regtime_ceil(long tv_sec)
-{
- return (tv_sec % (86400*7)) ? tv_sec/(86400*7)+1 : tv_sec/(86400*7) ;
-}
-
-/********************************************************************************/
-int glite_jppsbe_init(
- glite_jp_context_t ctx,
- int argc,
- char *argv[]
-)
-{
- glite_jp_error_t err;
- int opt;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- config = (struct ftpbe_config *) calloc(1, sizeof *config);
- if (!config) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
-
- config->logname = getlogin();
-
- while ((opt = getopt_long(argc, argv, "I:E:G:", ftpbe_opts, NULL)) != EOF) {
- switch (opt) {
- case 'I': config->internal_path = optarg; break;
- case 'E': config->external_path = optarg; break;
- case 'G': config->gridmap = optarg; break;
- default: break;
- }
- }
-
- if (config_check(ctx, config)) {
- err.code = EINVAL;
- err.desc = "Invalid FTP backend configuration";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-int glite_jppsbe_init_slave(
- glite_jp_context_t ctx
-)
-{
- /* Nothing to do */
-}
-
-int glite_jppsbe_register_job(
- glite_jp_context_t ctx,
- const char *job,
- const char *owner
-)
-{
- glite_jp_error_t err;
- char *int_dir = NULL;
- char *int_fname = NULL;
- char *data_dir = NULL;
- char *data_fname = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
- char *ownerhash = NULL;
- FILE *regfile = NULL;
- struct timeval reg_tv;
- long reg_tv_trunc;
- struct stat statbuf;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job != NULL);
- assert(owner != NULL);
-
- gettimeofday(®_tv, NULL);
- reg_tv_trunc = regtime_trunc(reg_tv.tv_sec);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&int_dir, "%s/regs/%s",
- config->internal_path, ju_path) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (mkdirpath(int_dir, strlen(config->internal_path)) < 0 &&
- errno != EEXIST) {
- free(int_dir);
- err.code = errno;
- err.desc = "Cannot mkdir jobs's reg directory";
- return glite_jp_stack_error(ctx,&err);
- }
- free(int_dir);
-
- if (asprintf(&int_fname, "%s/regs/%s/%s.info",
- config->internal_path, ju_path, ju) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (stat(int_fname, &statbuf) < 0) {
- if (errno != ENOENT) {
- err.code = errno;
- err.desc = "Cannot stat jobs's reg info file";
- goto error_out;
- }
- } else {
- err.code = EEXIST;
- err.desc = "Job already registered";
- goto error_out;
- }
-
- regfile = fopen(int_fname, "w");
- if (regfile == NULL) {
- err.code = errno;
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
-
- ownerhash = str2md5(owner); /* static buffer */
-
- if (fprintf(regfile, "%d %ld.%06ld %s %s %d %s\n", 1,
- (long)reg_tv.tv_sec, (long)reg_tv.tv_usec, job,
- ownerhash, strlen(owner), owner) < 1 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot write jobs's reg info file";
- goto error_out;
- }
- if (fclose(regfile) != 0 ) {
- err.code = errno;
- err.desc = "Cannot close(write) jobs's reg info file";
- goto error_out;
- }
-
- if (asprintf(&data_dir, "%s/data/%s/%d/%s",
- config->internal_path, ownerhash, regtime_trunc(reg_tv.tv_sec), ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (asprintf(&data_fname, "%s/_info", data_dir) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (mkdirpath(data_dir, strlen(config->internal_path)) < 0 &&
- errno != EEXIST) {
- err.code = errno;
- err.desc = "Cannot mkdir jobs's data directory";
- goto error_out;
- }
-
- if (link(int_fname, data_fname) < 0) {
- err.code = errno;
- err.desc = "Cannot link job's reg and data info files";
- goto error_out;
- }
-
-error_out:
- free(int_fname);
- free(data_fname);
- if (err.code && data_dir) rmdir(data_dir);
- free(data_dir);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-static int add_to_gridmap(glite_jp_context_t ctx, const char *dn)
-{
- FILE *gridmap = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- gridmap = fopen(config->gridmap, "a");
- if (!gridmap) {
- err.code = errno;
- err.desc = "Cannot open gridmap file";
- return glite_jp_stack_error(ctx,&err);
- }
- if (fprintf(gridmap, "\"%s\" %s\n", dn, config->logname) < 6 ||
- ferror(gridmap)) {
- err.code = EIO;
- err.desc = "Cannot write to gridmap file";
- fclose(gridmap);
- return glite_jp_stack_error(ctx,&err);
- }
- fclose(gridmap);
- return 0;
-}
-
-static int remove_from_gridmap(glite_jp_context_t ctx, const char *dn)
-{
- FILE *gridmap = NULL;
- char *temp_name = NULL;
- FILE *temp_file = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- /* XXX */
- return 0;
-}
-
-int glite_jppsbe_start_upload(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name, /* TODO */
- const char *content_type,
- char **destination_out,
- time_t *commit_before_inout
-)
-{
- char *int_fname = NULL;
- char *lock_fname = NULL;
- FILE *lockfile = NULL;
- FILE *regfile = NULL;
- char *data_dir = NULL;
- char *data_lock = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
- char *peername = NULL;
- int info_version;
- long reg_time;
- char ownerhash[33];
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job!=NULL);
- assert(destination_out!=NULL);
-
- assert(class!=NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- peername = glite_jp_peer_name(ctx);
-
- if (asprintf(&int_fname, "%s/regs/%s/%s.info",
- config->internal_path, ju_path, ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- if (errno == ENOENT)
- err.desc = "Job not registered";
- else
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%*ld %*s %s ", &info_version,
- ®_time, ownerhash) < 3 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- fclose(regfile);
-
- /* XXX authorization */
-
- if (asprintf(&data_dir, "%s/data/%s/%d/%s",
- config->internal_path, ownerhash, regtime_trunc(reg_time), ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (asprintf(&lock_fname, "%s/%s" LOCK_SUFFIX,
- data_dir, class) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (commit_before_inout != NULL)
- *commit_before_inout = (time_t) LONG_MAX; /* XXX no timeout enforced */
-
- lockfile = fopen(lock_fname, "w");
- if (lockfile == NULL) {
- err.code = errno;
- err.desc = "Cannot open uploads's lock file";
- goto error_out;
- }
-
- if (fprintf(lockfile, "%ld %d %s\n", (long)*commit_before_inout,
- peername ? peername : 0,
- peername ? peername : "") < 1 || ferror(regfile)) {
- fclose(lockfile);
- err.code = errno;
- err.desc = "Cannot write upload's lock file";
- goto error_out;
- }
- if (fclose(lockfile) != 0 ) {
- err.code = errno;
- err.desc = "Cannot close(write) upload's lock file";
- goto error_out;
- }
-
- if (asprintf(destination_out, "%s/data/%s/%d/%s/%s" UPLOAD_SUFFIX,
- config->external_path, ownerhash, regtime_trunc(reg_time), ju, class) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (add_to_gridmap(ctx, peername)) {
- err.code = EIO;
- err.desc = "Cannot add peer DN to ftp server authorization file";
- goto error_out;
- }
-
-error_out:
- free(int_fname);
- free(data_dir);
- if (err.code && data_lock) unlink(data_lock);
- free(data_lock);
- free(ju); free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_commit_upload(
- glite_jp_context_t ctx,
- const char *destination
-)
-{
- size_t dest_len;
- size_t suff_len;
- size_t extp_len;
- long commit_before;
- int lockpeerlen;
- char *lockpeername = NULL;
- char *peername = NULL;
- char *dest_rw = NULL;
- char *dest_rw_suff = NULL;
- char *dest_rw_lock = NULL;
- FILE *lockfile = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(destination != NULL);
-
- suff_len = strlen(UPLOAD_SUFFIX);
- dest_len = strlen(destination);
- extp_len = strlen(config->external_path);
-
- if (dest_len < suff_len ||
- strcmp(UPLOAD_SUFFIX, destination + (dest_len - suff_len)) ||
- strncmp(destination, config->external_path, extp_len)) {
- err.code = EINVAL;
- err.desc = "Forged destination path";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&dest_rw_suff, "%s%s", config->internal_path,
- destination + extp_len) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- dest_rw = strdup(dest_rw_suff);
- if (!dest_rw) {
- err.code = ENOMEM;
- goto error_out;
- }
- *(dest_rw + (strlen(dest_rw_suff) - suff_len)) = '\0';
-
- if (asprintf(&dest_rw_lock, "%s" LOCK_SUFFIX, dest_rw) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- lockfile = fopen(dest_rw_lock, "r");
- if (lockfile == NULL) {
- err.code = errno;
- err.desc = "Cannot open upload's lock file";
- goto error_out;
- }
- if (fscanf(lockfile, "%ld %d ", &commit_before, &lockpeerlen) < 2 || ferror(lockfile)) {
- fclose(lockfile);
- err.code = errno;
- err.desc = "Cannot read upload's lock file";
- goto error_out;
- }
- if (lockpeerlen) {
- lockpeername = (char*) calloc(1, lockpeerlen+1);
- if (!lockpeername) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (fgets(lockpeername, lockpeerlen+1, lockfile) == NULL) {
- fclose(lockfile);
- err.code = errno;
- err.desc = "Cannot read upload's lock file";
- goto error_out;
- }
- }
- fclose(lockfile);
-
- peername = glite_jp_peer_name(ctx);
- if (lockpeername && (!peername || strcmp(lockpeername, peername))) {
- err.code = EPERM;
- err.desc = "Upload started by client of different identity";
- goto error_out;
- }
-
- if (rename(dest_rw_suff, dest_rw) < 0) {
- err.code = errno;
- err.desc = "Cannot move upload file to the final place";
- goto error_out;
- }
-
- if (unlink(dest_rw_lock) < 0) {
- err.code = errno;
- err.desc = "Cannot unlink upload's lock file";
- goto error_out;
- }
-
-error_out:
- free(dest_rw);
- free(dest_rw_suff);
- free(dest_rw_lock);
- free(peername);
- free(lockpeername);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_destination_info(
- glite_jp_context_t ctx,
- const char *destination,
- char **job,
- char **class,
- char **name
-)
-{
- size_t dest_len;
- size_t suff_len;
- size_t extp_len;
- char *dest_rw = NULL;
- char *dest_rw_suff = NULL;
- char *dest_rw_info = NULL;
- FILE *infofile = NULL;
- char *classname = NULL;
- char jobstr[256+1];
- glite_jp_error_t err;
-
- assert(destination != NULL);
- assert(job != NULL);
- assert(class != NULL);
- assert(name != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- suff_len = strlen(UPLOAD_SUFFIX);
- dest_len = strlen(destination);
- extp_len = strlen(config->external_path);
-
- if (dest_len < suff_len ||
- strcmp(UPLOAD_SUFFIX, destination + (dest_len - suff_len)) ||
- strncmp(destination, config->external_path, extp_len)) {
- err.code = EINVAL;
- err.desc = "Forged destination path";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&dest_rw_suff, "%s%s", config->internal_path,
- destination + extp_len) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- dest_rw = strdup(dest_rw_suff);
- if (!dest_rw) {
- err.code = ENOMEM;
- goto error_out;
- }
- *(dest_rw + (strlen(dest_rw_suff) - suff_len)) = '\0';
-
- classname = strrchr(dest_rw,'/');
- if (classname == NULL) {
- err.code = EINVAL;
- err.desc = "Forged destination path";
- goto error_out;
- }
- *classname++ ='\0';
- *class = strdup(classname);
-
-/* XXX: do we need similar check?
- if (!class == GLITE_JP_FILECLASS_UNDEF) {
- err.code = EINVAL;
- err.desc = "Forged destination path";
- goto error_out;
- }
-*/
-
- /* TODO: */
- *name = NULL;
-
- if (asprintf(&dest_rw_info, "%s/_info", dest_rw) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- infofile = fopen(dest_rw_info, "r");
- if (infofile == NULL) {
- err.code = errno;
- err.desc = "Cannot open _info file";
- goto error_out;
- }
- if (fscanf(infofile, "%*d %*ld.%*ld %256s ", jobstr) < 1 || ferror(infofile)) {
- fclose(infofile);
- err.code = errno;
- err.desc = "Cannot read _info file";
- goto error_out;
- }
- *job = strdup(jobstr);
- fclose(infofile);
-
-error_out:
- free(dest_rw);
- free(dest_rw_suff);
- free(dest_rw_info);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-
-int glite_jppsbe_get_job_url(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name, /* TODO */
- char **url_out
-)
-{
- FILE *regfile = NULL;
- char *int_fname = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
- int info_version;
- long reg_time;
- char ownerhash[33];
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job!=NULL);
- assert(url_out != NULL);
-
- assert(class!=NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&int_fname, "%s/regs/%s/%s.info",
- config->internal_path, ju_path, ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- if (errno == ENOENT)
- err.desc = "Job not registered";
- else
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%*ld %*s %s", &info_version,
- ®_time, ownerhash) < 3 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- fclose(regfile);
-
- if (asprintf(url_out, "%s/data/%s/%d/%s/%s",
- config->external_path, ownerhash, regtime_trunc(reg_time), ju, class) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
-error_out:
- free(int_fname);
- free(ju); free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-static int get_job_fname(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name, /* TODO */
- char **fname_out
-)
-{
- FILE *regfile = NULL;
- char *int_fname = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
- int info_version;
- long reg_time;
- char ownerhash[33];
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job!=NULL);
- assert(fname_out != NULL);
-
- assert(class!=NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&int_fname, "%s/regs/%s/%s.info",
- config->internal_path, ju_path, ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- if (errno == ENOENT)
- err.desc = "Job not registered";
- else
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%*ld %*s %s", &info_version,
- ®_time, ownerhash) < 3 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- fclose(regfile);
-
- if (asprintf(fname_out, "%s/data/%s/%d/%s/%s",
- config->internal_path, ownerhash, regtime_trunc(reg_time), ju, class) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
-error_out:
- free(int_fname);
- free(ju); free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_open_file(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name, /* TODO */
- int mode,
- void **handle_out
-)
-{
- fhandle handle = NULL;
- char* fname = NULL;
- glite_jp_error_t err;
-
- assert(handle_out != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (get_job_fname(ctx, job, class, name, &fname)) {
- err.code = ctx->error->code;
- err.desc = "Cannot construct internal filename";
- return glite_jp_stack_error(ctx,&err);
- }
-
- handle = (fhandle) calloc(1,sizeof(*handle));
- if (handle == NULL) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- handle->fd = open(fname, mode, S_IRUSR | S_IWUSR);
- if (handle->fd < 0) {
- err.code = errno;
- err.desc = "Cannot open requested file";
- free(handle);
- goto error_out;
- }
- handle->fd_append = open(fname, mode | O_APPEND, S_IRUSR | S_IWUSR);
- if (handle->fd_append < 0) {
- err.code = errno;
- err.desc = "Cannot open requested file for append";
- close(handle->fd);
- free(handle);
- goto error_out;
- }
- *handle_out = (void*) handle;
-
-error_out:
- free(fname);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_close_file(
- glite_jp_context_t ctx,
- void *handle
-)
-{
- glite_jp_error_t err;
-
- assert(handle != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (close(((fhandle)handle)->fd_append) < 0) {
- err.code = errno;
- err.desc = "Error closing file descriptor (fd_append)";
- goto error_out;
- }
- if (close(((fhandle)handle)->fd) < 0) {
- err.code = errno;
- err.desc = "Error closing file descriptor";
- goto error_out;
- }
-
-error_out:
- free(handle);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_pread(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset,
- ssize_t *nbytes_ret
-)
-{
- ssize_t ret;
- glite_jp_error_t err;
-
- assert(handle != NULL);
- assert(buf != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if ((ret = pread(((fhandle)handle)->fd, buf, nbytes, offset)) < 0) {
- err.code = errno;
- err.desc = "Error in pread()";
- return glite_jp_stack_error(ctx,&err);
- }
- *nbytes_ret = ret;
-
- return 0;
-}
-
-int glite_jppsbe_pwrite(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset
-)
-{
- glite_jp_error_t err;
-
- assert(handle != NULL);
- assert(buf != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (pwrite(((fhandle)handle)->fd, buf, nbytes, offset) < 0) {
- err.code = errno;
- err.desc = "Error in pwrite()";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-int glite_jppsbe_append(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes
-)
-{
- glite_jp_error_t err;
-
- assert(handle != NULL);
- assert(buf != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (write(((fhandle)handle)->fd_append, buf, nbytes) < 0) {
- err.code = errno;
- err.desc = "Error in write()";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-static int get_job_info(
- glite_jp_context_t ctx,
- const char *job,
- char **owner,
- struct timeval *tv_reg
-)
-{
- char *ju = NULL;
- char *ju_path = NULL;
- FILE *regfile = NULL;
- long reg_time_sec;
- long reg_time_usec;
- int ownerlen = 0;
- int info_version;
- char *int_fname = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&int_fname, "%s/regs/%s/%s.info",
- config->internal_path, ju_path, ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- if (errno == ENOENT)
- err.desc = "Job not registered";
- else
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%ld %*s %*s %d ", &info_version,
- ®_time_sec, ®_time_usec, &ownerlen) < 4 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- if (ownerlen) {
- *owner = (char *) calloc(1, ownerlen+1);
- if (!*owner) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (fgets(*owner, ownerlen+1, regfile) == NULL) {
- fclose(regfile);
- free(*owner);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- }
- fclose(regfile);
-
- tv_reg->tv_sec = reg_time_sec;
- tv_reg->tv_usec = reg_time_usec;
-
-error_out:
- free(int_fname);
- free(ju);
- free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-static int get_job_info_int(
- glite_jp_context_t ctx,
- const char *int_fname,
- char **jobid,
- char **owner,
- struct timeval *tv_reg
-)
-{
- FILE *regfile = NULL;
- long reg_time_sec;
- long reg_time_usec;
- int ownerlen = 0;
- int info_version;
- char jobid_buf[256];
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%ld %s %*s %d ", &info_version,
- ®_time_sec, ®_time_usec, jobid_buf, &ownerlen) < 5 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- *jobid = strdup(jobid_buf);
- if (ownerlen) {
- *owner = (char *) calloc(1, ownerlen+1);
- if (!*owner) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (fgets(*owner, ownerlen+1, regfile) == NULL) {
- fclose(regfile);
- free(*owner);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- }
- fclose(regfile);
-
- tv_reg->tv_sec = reg_time_sec;
- tv_reg->tv_usec = reg_time_usec;
-
-error_out:
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_get_job_metadata(
- glite_jp_context_t ctx,
- const char *job,
- glite_jp_attrval_t attrs_inout[]
-)
-{
- int got_info = 0;
- struct timeval tv_reg;
- char *owner = NULL;
- int got_tags = 0;
- void *tags_handle = NULL;
- glite_jp_tagval_t* tags = NULL;
- int i,j;
- glite_jp_error_t err;
-
- assert(job != NULL);
- assert(attrs_inout != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- for (i = 0; attrs_inout[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (attrs_inout[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
-
-/* must be implemented via filetype plugin
- case GLITE_JP_ATTR_TIME:
-*/
- if (!got_info) {
- if (get_job_info(ctx, job, &owner, &tv_reg)) {
- err.code = ctx->error->code;
- err.desc = "Cannot retrieve job info";
- goto error_out;
- }
- got_info = 1;
- }
- break;
-
-/* must be implemented via filetype plugin
- case GLITE_JP_ATTR_TAG:
- if (!got_tags) {
- if (glite_jppsbe_open_file(ctx, job, GLITE_JP_FILECLASS_TAGS,
- O_RDONLY, &tags_handle)) {
- err.code = ctx->error->code;
- err.desc = "Cannot open tag file";
- goto error_out;
- }
- if (glite_jpps_tag_readall(ctx, tags_handle, &tags)) {
- err.code = ctx->error->code;
- err.desc = "Cannot read tags";
- glite_jppsbe_close_file(ctx, tags_handle);
- goto error_out;
- }
- glite_jppsbe_close_file(ctx, tags_handle);
- got_tags = 1;
- }
- break;
-*/
- default:
- err.code = EINVAL;
- err.desc = "Invalid attribute type";
- goto error_out;
- break;
- }
-
- switch (attrs_inout[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- attrs_inout[i].value.s = strdup(owner);
- if (!attrs_inout[i].value.s) {
- err.code = ENOMEM;
- err.desc = "Cannot copy owner string";
- goto error_out;
- }
- break;
- case GLITE_JP_ATTR_TIME:
- attrs_inout[i].value.time = tv_reg;
- break;
-
-/* must be implemented via filetype plugin
- case GLITE_JP_ATTR_TAG:
- for (j = 0; tags[j].name != NULL; j++) {
- if (!strcmp(tags[j].name, attrs_inout[i].attr.name)) {
- if (glite_jpps_tagval_copy(ctx, &tags[j],
- &attrs_inout[i].value.tag)) {
- err.code = ENOMEM;
- err.desc = "Cannot copy tag value";
- goto error_out;
- }
- break;
- }
- }
- if (!tags[j].name) attrs_inout[i].value.tag.name = NULL;
- break;
-*/
- default:
- break;
- }
- }
-
-error_out:
- free(owner);
- if (tags) for (j = 0; tags[j].name != NULL; j++) {
- free(tags[j].name);
- free(tags[j].value);
- }
- free(tags);
-
- if (err.code) {
- while (i > 0) {
- i--;
- switch (attrs_inout[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- free(attrs_inout[i].value.s);
- break;
- case GLITE_JP_ATTR_TAG:
- free(attrs_inout[i].value.tag.name);
- free(attrs_inout[i].value.tag.value);
- default:
- break;
- }
- }
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-static int compare_timeval(struct timeval a, struct timeval b)
-{
- if (a.tv_sec < b.tv_sec) return -1;
- if (a.tv_sec > b.tv_sec) return 1;
- if (a.tv_usec < b.tv_usec) return -1;
- if (a.tv_usec > b.tv_usec) return 1;
- return 0;
-}
-
-
-/* FIXME: disabled -- clarification wrt. filetype plugin needed */
-
-#if 0
-
-static int query_phase2(
- glite_jp_context_t ctx,
- const char *ownerhash,
- long regtime_tr,
- int q_tags,
- int md_tags,
- const glite_jp_query_rec_t query[],
- glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-);
-
-static int query_phase2(
- glite_jp_context_t ctx,
- const char *ownerhash,
- long regtime_tr,
- int q_tags,
- int md_tags,
- const glite_jp_query_rec_t query[],
- glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-)
-{
- char *time_dirname = NULL;
- DIR *time_dirp = NULL;
- struct dirent *jobent;
- char *info_fname = NULL;
- char *jobid = NULL;
- char *owner = NULL;
- struct timeval tv_reg;
- void *tags_handle = NULL;
- int matching;
- int i, j;
- glite_jp_tagval_t* tags = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (asprintf(&time_dirname, "%s/data/%s/%d", config->internal_path,
- ownerhash, regtime_tr) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- time_dirp = opendir(time_dirname);
- if (!time_dirp) {
- free(time_dirname);
- return 0; /* found nothing */
- }
- while ((jobent = readdir(time_dirp)) != NULL) {
- if (!strcmp(jobent->d_name, ".")) continue;
- if (!strcmp(jobent->d_name, "..")) continue;
- if (asprintf(&info_fname, "%s/%s/_info", time_dirname,
- jobent->d_name) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (get_job_info_int(ctx, info_fname, &jobid, &owner, &tv_reg)) {
- err.code = EIO;
- err.desc = "Cannot retrieve job info";
- goto error_out;
- }
- if (q_tags || md_tags) {
- if (glite_jppsbe_open_file(ctx, jobid, GLITE_JP_FILECLASS_TAGS,
- O_RDONLY, &tags_handle)) {
- err.code = ctx->error->code;
- err.desc = "Cannot open tag file";
- goto error_out;
- }
- if (glite_jpps_tag_readall(ctx, tags_handle, &tags)) {
- err.code = ctx->error->code;
- err.desc = "Cannot read tags";
- glite_jppsbe_close_file(ctx, tags_handle);
- goto error_out;
- }
- glite_jppsbe_close_file(ctx, tags_handle);
- tags_handle = NULL;
- }
-
- matching = 1;
- for (i = 0; matching && query[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (query[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- if (query[i].value.s == NULL ||
- strcmp(query[i].value.s, owner)) matching = 0;
- break;
- case GLITE_JP_ATTR_TIME:
- switch (query[i].op) {
- case GLITE_JP_QUERYOP_EQUAL:
- matching = !compare_timeval(tv_reg, query[i].value.time);
- break;
- case GLITE_JP_QUERYOP_UNEQUAL:
- matching = compare_timeval(tv_reg, query[i].value.time);
- break;
- case GLITE_JP_QUERYOP_LESS:
- matching = compare_timeval(tv_reg, query[i].value.time) < 0;
- break;
- case GLITE_JP_QUERYOP_GREATER:
- matching = compare_timeval(tv_reg, query[i].value.time) > 0;
- break;
- case GLITE_JP_QUERYOP_WITHIN:
- matching = compare_timeval(tv_reg, query[i].value.time) >= 0
- && compare_timeval(tv_reg, query[i].value2.time) <= 0;
- break;
- }
- break;
- case GLITE_JP_ATTR_TAG:
- if (!tags) {
- matching = 0;
- break;
- }
- for (j = 0; tags[j].name != NULL; j++) {
- if (!strcmp(tags[j].name, query[i].attr.name)) {
- switch (query[i].op) {
- case GLITE_JP_QUERYOP_EQUAL:
- matching = !strcmp(tags[j].value, query[i].value.s);
- break;
- case GLITE_JP_QUERYOP_UNEQUAL:
- matching = strcmp(tags[j].value, query[i].value.s);
- break;
- case GLITE_JP_QUERYOP_LESS:
- matching = strcmp(tags[j].value, query[i].value.s) < 0;
- break;
- case GLITE_JP_QUERYOP_GREATER:
- matching = strcmp(tags[j].value, query[i].value.s) > 0;
- break;
- case GLITE_JP_QUERYOP_WITHIN:
- matching = strcmp(tags[j].value, query[i].value.s) >= 0 \
- && strcmp(tags[j].value, query[i].value2.s) <= 0 ;
- break;
- default:
- break;
- }
- }
- }
- break;
- default:
- break;
- }
- }
- if (!matching) {
- free(info_fname); info_fname = NULL;
- free(jobid); jobid = NULL;
- if (tags) for (j = 0; tags[j].name != NULL; j++) {
- free(tags[j].name);
- free(tags[j].value);
- }
- free(tags); tags = NULL;
- continue;
- }
-
- for (i = 0; metadata[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- metadata[i].value.s = owner;
- break;
- case GLITE_JP_ATTR_TIME:
- metadata[i].value.time = tv_reg;
- break;
- case GLITE_JP_ATTR_TAG:
- for (j = 0; tags[j].name != NULL; j++) {
- if (!strcmp(tags[j].name, metadata[i].attr.name)) {
- if (glite_jpps_tagval_copy(ctx, &tags[j],
- &metadata[i].value.tag)) {
- err.code = ENOMEM;
- err.desc = "Cannot copy tag value";
- goto error_out;
- }
- break;
- }
- }
- if (!tags[j].name) {
- metadata[i].value.tag.name = NULL;
- metadata[i].value.tag.value = NULL;
- }
- break;
- default:
- break;
- }
- }
- (*callback)(ctx, jobid, metadata);
- free(jobid); jobid = NULL;
- while (i > 0) {
- i--;
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_TAG:
- free(metadata[i].value.tag.name);
- free(metadata[i].value.tag.value);
- default:
- break;
- }
- }
- }
-
-error_out:
- if (tags) for (j = 0; tags[j].name != NULL; j++) {
- free(tags[j].name);
- free(tags[j].value);
- }
- if (tags_handle) glite_jppsbe_close_file(ctx, tags_handle);
- free(info_fname);
- free(owner);
- free(jobid);
- closedir(time_dirp);
- free(time_dirname);
- if (err.code) {
- while (i > 0) {
- i--;
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_TAG:
- free(metadata[i].value.tag.name);
- free(metadata[i].value.tag.value);
- default:
- break;
- }
- }
- return glite_jp_stack_error(ctx,&err);
- } else
- return 0;
-}
-
-int glite_jppsbe_query(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t query[],
- const glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-)
-{
- /* XXX clone metadata */
- int i;
- char *q_exact_owner = NULL;
- char *ownerhash = NULL;
- long q_min_time = 0;
- long q_max_time = LONG_MAX;
- long q_min_time_tr;
- long q_max_time_tr;
- int q_with_tags = 0;
- int md_info = 0;
- int md_tags = 0;
- char *owner_dirname = NULL;
- DIR *owner_dirp = NULL;
- struct dirent *ttimeent;
- char *data_dirname = NULL;
- DIR *data_dirp = NULL;
- struct dirent *ownerent;
- long ttime = 0;
- glite_jp_attrval_t *metadata_templ = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- for (i = 0; query[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- if (query[i].attr.type == GLITE_JP_ATTR_OWNER && query[i].op == GLITE_JP_QUERYOP_EQUAL) {
- q_exact_owner = query[i].value.s;
- }
- if (query[i].attr.type == GLITE_JP_ATTR_TIME) {
- switch (query[i].op) {
- case GLITE_JP_QUERYOP_EQUAL:
- q_min_time = query[i].value.time.tv_sec;
- q_max_time = query[i].value.time.tv_sec + 1;
- break;
- case GLITE_JP_QUERYOP_LESS:
- if (q_max_time > query[i].value.time.tv_sec + 1)
- q_max_time = query[i].value.time.tv_sec + 1;
- break;
- case GLITE_JP_QUERYOP_WITHIN:
- if (q_max_time > query[i].value2.time.tv_sec + 1)
- q_max_time = query[i].value2.time.tv_sec + 1;
- /* fallthrough */
- case GLITE_JP_QUERYOP_GREATER:
- if (q_min_time < query[i].value.time.tv_sec)
- q_min_time = query[i].value.time.tv_sec;
- break;
- default:
- err.code = EINVAL;
- err.desc = "Invalid query op";
- return glite_jp_stack_error(ctx,&err);
- break;
- }
- }
- if (query[i].attr.type == GLITE_JP_ATTR_TAG)
- q_with_tags = 1;
-
- }
-
- for (i = 0; metadata[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- case GLITE_JP_ATTR_TIME:
- md_info = 1;
- break;
- case GLITE_JP_ATTR_TAG:
- md_tags = 1;
- break;
- default:
- err.code = EINVAL;
- err.desc = "Invalid attribute type in metadata parameter";
- return glite_jp_stack_error(ctx,&err);
- break;
- }
- }
- metadata_templ = (glite_jp_attrval_t *) calloc(i + 1, sizeof(glite_jp_attrval_t));
- if (!metadata_templ) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- memcpy(metadata_templ, metadata, (i + 1) * sizeof(glite_jp_attrval_t));
-
- q_min_time_tr = regtime_trunc(q_min_time);
- q_max_time_tr = regtime_ceil(q_max_time);
-
- if (q_exact_owner) {
- ownerhash = str2md5(q_exact_owner); /* static buffer */
- if (asprintf(&owner_dirname, "%s/data/%s", config->internal_path, ownerhash) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- owner_dirp = opendir(owner_dirname);
- free(owner_dirname);
- if (!owner_dirp) {
- free(metadata_templ);
- return 0; /* found nothing */
- }
- while ((ttimeent = readdir(owner_dirp)) != NULL) {
- if (!strcmp(ttimeent->d_name, ".")) continue;
- if (!strcmp(ttimeent->d_name, "..")) continue;
- ttime = atol(ttimeent->d_name);
- if (ttime >= q_min_time_tr && ttime < q_max_time_tr) {
- if (query_phase2(ctx, ownerhash, ttime, q_with_tags, md_tags,
- query, metadata_templ, callback)) {
- err.code = EIO;
- err.desc = "query_phase2() error";
- goto error_out;
- }
- }
- }
- } else { /* !q_exact_owner */
- if (asprintf(&data_dirname, "%s/data", config->internal_path) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- data_dirp = opendir(data_dirname);
- if (!data_dirp) {
- err.code = EIO;
- err.desc = "Cannot open data directory";
- goto error_out;
- }
- while ((ownerent = readdir(data_dirp)) != NULL) {
- if (!strcmp(ownerent->d_name, ".")) continue;
- if (!strcmp(ownerent->d_name, "..")) continue;
- if (asprintf(&owner_dirname, "%s/data/%s", config->internal_path,
- ownerent->d_name) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- owner_dirp = opendir(owner_dirname);
- free(owner_dirname);
- if (!owner_dirp) {
- err.code = EIO;
- err.desc = "Cannot open owner data directory";
- goto error_out;
- }
- while ((ttimeent = readdir(owner_dirp)) != NULL) {
- if (!strcmp(ttimeent->d_name, ".")) continue;
- if (!strcmp(ttimeent->d_name, "..")) continue;
- ttime = atol(ttimeent->d_name);
- if (ttime >= q_min_time_tr && ttime < q_max_time_tr) {
- if (query_phase2(ctx, ownerent->d_name, ttime, q_with_tags, md_tags,
- query, metadata_templ, callback)) {
- err.code = EIO;
- err.desc = "query_phase2() error";
- goto error_out;
- }
- }
- }
- closedir(owner_dirp); owner_dirp = NULL;
- }
- closedir(data_dirp); data_dirp = NULL;
- }
- return 0;
-
-error_out:
- if (owner_dirp) closedir(owner_dirp);
- if (data_dirp) closedir(data_dirp);
- free(data_dirname);
- free(metadata_templ);
- return glite_jp_stack_error(ctx,&err);
-}
-
-#else
-
-/* placeholder instead */
-int glite_jppsbe_query(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t query[],
- const glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-)
-{
- glite_jp_error_t err;
- err.code = ENOSYS;
- err.desc = "not implemented";
- return glite_jp_stack_error(ctx,&err);
-}
-
-#endif
-
-/* XXX:
-- no primary authorization yet
-- no concurrency control yet
-- partial success in pwrite,append
-- "unique" part of jobid is assumed to be unique across bookkeeping servers
-- repository versioning not fully implemented yet
-*/
+++ /dev/null
-#include <stdio.h>
-#include <time.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-
-#include "glite/jp/types.h"
-
-#include "feed.h"
-/* FIXME
-#include "jpis_H.h"
-#include "jpis_.nsmap"
-*/
-
-int glite_jpps_single_feed(
- glite_jp_context_t ctx,
- const char *destination,
- const char *job,
- const glite_jp_attrval_t attrs[]
-)
-{
- /* TODO: really call JP Index server (via interlogger) */
- printf("feed to %s, job %s\n",destination,job);
-
-/* FIXME */
-#if 0
- if (soap_call_jpsrv__UpdateJobs(ctx->other_soap,destination,"",
- /* FIXME: feedId */ "",
- /* FIXME: UpdateJobsData */ NULL,
- 0,
- NULL
- )) fprintf(stderr,"UpdateJobs: %s %s\n",ctx->other_soap->fault->faultcode,
- ctx->other_soap->fault->faultstring);
-
-#endif
- return 0;
-}
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <getopt.h>
-#include <signal.h>
-#include <string.h>
-#include <assert.h>
-#include <sys/types.h>
-#include <errno.h>
-#include <syslog.h>
-#include <linux/limits.h>
-#include <fcntl.h>
-
-#include "glite/lb/lb_maildir.h"
-#include "glite/security/glite_gsplugin.h"
-
-#include "jpps_H.h"
-#include "jpps_.nsmap"
-
-#include "jptype_map.h"
-
-#include "soap_version.h"
-#if GSOAP_VERSION <= 20602
-#define soap_call___jpsrv__RegisterJob soap_call___ns1__RegisterJob
-#endif
-
-
-#ifndef dprintf
-#define dprintf(x) { if (debug) printf x; }
-#endif
-
-#ifndef GLITE_JPIMPORTER_PIDFILE
-#define GLITE_JPIMPORTER_PIDFILE "/var/run/glite-jpimporter.pid"
-#endif
-
-#ifndef GLITE_JPIMPORTER_MDIR
-#define GLITE_JPIMPORTER_MDIR "/tmp/jpreg"
-#endif
-
-static int debug = 0;
-static int die = 0;
-
-static struct option opts[] = {
- { "help", 0, NULL, 'h'},
- { "debug", 0, NULL, 'd'},
- { "jpps", 1, NULL, 'p'},
- { "mdir", 1, NULL, 'm'},
- { "pidfile", 1, NULL, 'i'},
- { NULL, 0, NULL, 0}
-};
-
-static const char *get_opt_string = "hdp:m:i:";
-
-static void usage(char *me)
-{
- fprintf(stderr,"usage: %s [option]\n"
- "\t-h, --help\t displays this screen\n"
- "\t-d, --debug\t don't run as daemon, additional diagnostics\n"
- "\t-p, --jpps\t JP primary service server\n"
- "\t-m, --mdir\t path to the 'LB maildir' subtree\n"
- "\t-i, --pidfile\t file to store master pid\n",
- me);
-}
-
-static void catchsig(int sig)
-{
- die = sig;
-}
-
-int main(int argc, char *argv[])
-{
- struct sigaction sa;
- struct soap *soap;
- sigset_t sset;
- FILE *fpid;
- int opt;
- char *name,
- *jpps = "http://localhost:8901",
- pidfile[PATH_MAX] = GLITE_JPIMPORTER_PIDFILE,
- mdir[PATH_MAX] = GLITE_JPIMPORTER_MDIR;
-
-
- name = strrchr(argv[0],'/');
- if (name) name++; else name = argv[0];
-
- if ( geteuid() )
- snprintf(pidfile, sizeof pidfile, "%s/glite_jpimporter.pid", getenv("HOME"));
-
- while ( (opt = getopt_long(argc, argv, get_opt_string, opts, NULL)) != EOF )
- switch ( opt ) {
- case 'd': debug = 1; break;
- case 'h': usage(name); return 0;
- case 'p': jpps = optarg; break;
- case 'm': strcpy(mdir, optarg); break;
- case 'i': strcpy(pidfile, optarg); break;
- case '?': usage(name); return 1;
- }
- if ( optind < argc ) { usage(name); return 1; }
-
- soap = soap_new();
- soap_init(soap);
- soap_set_namespaces(soap, jpps__namespaces);
- soap_register_plugin(soap, glite_gsplugin);
-
- setlinebuf(stdout);
- setlinebuf(stderr);
-
- fpid = fopen(pidfile,"r");
- if ( fpid ) {
- int opid = -1;
-
- if ( fscanf(fpid,"%d",&opid) == 1 ) {
- if ( !kill(opid,0) ) {
- fprintf(stderr,"%s: another instance running, pid = %d\n",argv[0],opid);
- return 1;
- }
- else if (errno != ESRCH) { perror("kill()"); return 1; }
- }
- fclose(fpid);
- } else if (errno != ENOENT) { perror(pidfile); return 1; }
- fpid = fopen(pidfile, "w");
- if ( !fpid ) { perror(pidfile); return 1; }
- fprintf(fpid, "%d", getpid());
- fclose(fpid);
-
- if ( !debug ) {
- if ( daemon(1,0) == -1 ) { perror("deamon()"); exit(1); }
-
- fpid = fopen(pidfile,"w");
- if ( !fpid ) { perror(pidfile); return 1; }
- fprintf(fpid, "%d", getpid());
- fclose(fpid);
- openlog(name, LOG_PID, LOG_DAEMON);
- } else { setpgid(0, getpid()); }
-
- dprintf(("Master pid %d\n", getpid()));
-
- memset(&sa, 0, sizeof(sa)); assert(sa.sa_handler == NULL);
- sa.sa_handler = catchsig;
- sigaction(SIGINT, &sa, NULL);
- sigaction(SIGTERM, &sa, NULL);
-
- sa.sa_handler = SIG_IGN;
- sigaction(SIGUSR1, &sa, NULL);
-
- sigemptyset(&sset);
- sigaddset(&sset, SIGTERM);
- sigaddset(&sset, SIGINT);
- sigprocmask(SIG_BLOCK, &sset, NULL);
-
- while ( !die ) {
- int ret;
- char *msg = NULL;
- char *fname = NULL;
-
- ret = edg_wll_MaildirTransStart(mdir, &msg, &fname);
- /* XXX: where should unblocking signal besides? */
- sigprocmask(SIG_UNBLOCK, &sset, NULL);
- sigprocmask(SIG_BLOCK, &sset, NULL);
- if ( ret < 0 ) {
- dprintf(("edg_wll_MaildirTransStart: %s (%s)\n", strerror(errno), lbm_errdesc));
- if ( !debug ) syslog(LOG_ERR, "edg_wll_MaildirTransStart: %s (%s)", strerror(errno), lbm_errdesc);
- exit(1);
- } else if ( ret == 0 ) {
- sleep(2);
- } else {
- struct _jpelem__RegisterJob in;
- struct _jpelem__RegisterJobResponse empty;
- struct SOAP_ENV__Detail *detail;
- struct jptype__genericFault *f;
- char *aux, *reason, indent[200] = " ";
-
-
- dprintf(("JP registration request received\n"));
- if ( !debug ) syslog(LOG_INFO, "JP registration request received\n");
-
- if ( !(aux = strchr(msg, '\n')) ) {
- dprintf(("Wrong format of message!\n"));
- if ( !debug ) syslog(LOG_ERR, "Wrong format of message\n");
- free(msg);
- continue;
- }
- *aux++ = '\0';
- in.job = msg;
- in.owner = aux;
- ret = soap_call___jpsrv__RegisterJob(soap, jpps, "", &in, &empty);
- free(msg);
-
- switch ( ret ) {
- case SOAP_OK:
- /* XXX: checks return error code */
- edg_wll_MaildirTransEnd(mdir, fname, LBMD_TRANS_OK);
- dprintf(("Job '%s' succesfully registered to JP\n", msg));
- if ( !debug ) syslog(LOG_INFO, "Job '%s' succesfully registered to JP\n", msg);
- break;
-
- case SOAP_FAULT:
- case SOAP_SVR_FAULT:
- edg_wll_MaildirTransEnd(mdir, fname, LBMD_TRANS_FAILED);
- if (soap->version == 2) {
- detail = soap->fault->SOAP_ENV__Detail;
- reason = soap->fault->SOAP_ENV__Reason;
- } else {
- detail = soap->fault->detail;
- reason = soap->fault->faultstring;
- }
- dprintf(("%s\n", reason));
- assert(detail->__type == SOAP_TYPE__genericFault);
-#if GSOAP_VERSION >=20700
- f = ((struct _genericFault *) detail->fault)
-#else
- f = ((struct _genericFault *) detail->value)
-#endif
- -> jpelem__genericFault;
-
- while ( f ) {
- dprintf(("%s%s: %s (%s)\n", indent, f->source, f->text, f->description));
- f = f->reason;
- strcat(indent, " ");
- }
- break;
-
- default:
- soap_print_fault(soap, stderr);
- edg_wll_MaildirTransEnd(mdir, fname, LBMD_TRANS_FAILED);
- break;
- }
- free(fname);
- }
- }
-
- /* XXX: some sort of soap_destroy(soap) */
- dprintf(("Terminating on signal %d\n", die));
- if ( !debug ) syslog(LOG_INFO, "Terminating on signal %d\n", die);
-
- unlink(pidfile);
-
- return 0;
-}
-
-/* XXX: we don't use it */
-SOAP_NMAC struct Namespace namespaces[] = { {NULL,NULL} };
-
+++ /dev/null
-#include "soap_version.h"
-
-#if GSOAP_VERSION >= 20700
-#define INPUT_SANDBOX jptype__UploadClass__INPUT_SANDBOX
-#define OUTPUT_SANDBOX jptype__UploadClass__OUTPUT_SANDBOX
-#define JOB_LOG jptype__UploadClass__JOB_LOG
-
-#define OWNER jptype__AttributeType__OWNER
-#define TIME jptype__AttributeType__TIME
-#define TAG jptype__AttributeType__TAG
-
-#define EQUAL jptype__queryOp__EQUAL
-#define UNEQUAL jptype__queryOp__UNEQUAL
-#define LESS jptype__queryOp__LESS
-#define GREATER jptype__queryOp__GREATER
-#define WITHIN jptype__queryOp__WITHIN
-#endif
-
+++ /dev/null
-#ident "$Header$"
-
-#include "mysql.h" // MySql header file
-#include "mysqld_error.h"
-#include "errmsg.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <time.h>
-#include <limits.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-
-#include "db.h"
-
-#define DEFAULTCS "jpps/@localhost:jpps1"
-#define GLITE_JP_LB_MYSQL_VERSION 40018
-
-static int my_err(glite_jp_context_t ctx, char *function)
-{
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = function;
- err.code = EIO; /* XXX */
- err.desc = mysql_error((MYSQL *) ctx->dbhandle);
- return glite_jp_stack_error(ctx,&err);
-}
-
-struct _glite_jp_db_stmt_t {
- MYSQL_RES *result;
- glite_jp_context_t ctx;
-};
-
-int glite_jp_db_connect(glite_jp_context_t ctx,char *cs)
-{
- char *buf = NULL;
- char *host,*user,*pw,*db;
- char *slash,*at,*colon;
-
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (!cs) cs = DEFAULTCS;
-
- if (!(ctx->dbhandle = (void *) mysql_init(NULL))) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
-
- mysql_options(ctx->dbhandle, MYSQL_READ_DEFAULT_FILE, "my");
-
- host = user = pw = db = NULL;
-
- buf = strdup(cs);
- slash = strchr(buf,'/');
- at = strrchr(buf,'@');
- colon = strrchr(buf,':');
-
- if (!slash || !at || !colon) {
- free(buf);
- err.code = EINVAL;
- err.desc = "Invalid DB connect string";
- return glite_jp_stack_error(ctx,&err);
- }
-
- *slash = *at = *colon = 0;
- host = at+1;
- user = buf;
- pw = slash+1;
- db = colon+1;
-
- if (!mysql_real_connect((MYSQL *) ctx->dbhandle,host,user,pw,db,0,NULL,CLIENT_FOUND_ROWS)) {
- free(buf);
- return my_err(ctx, __FUNCTION__);
- }
-
- free(buf);
- return 0;
-}
-
-void glite_jp_db_close(glite_jp_context_t ctx)
-{
- mysql_close((MYSQL *) ctx->dbhandle);
- ctx->dbhandle = NULL;
-}
-
-int glite_jp_db_execstmt(glite_jp_context_t ctx,char *txt,glite_jp_db_stmt_t *stmt)
-{
- int merr;
- int retry_nr = 0;
- int do_reconnect = 0;
-
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (stmt) {
- *stmt = NULL;
- }
-
- while (retry_nr == 0 || do_reconnect) {
- do_reconnect = 0;
- if (mysql_query((MYSQL *) ctx->dbhandle,txt)) {
- /* error occured */
- switch (merr = mysql_errno((MYSQL *) ctx->dbhandle)) {
- case 0:
- break;
- case ER_DUP_ENTRY:
- err.code = EEXIST;
- err.desc = mysql_error((MYSQL *) ctx->dbhandle);
- glite_jp_stack_error(ctx,&err);
- return -1;
- break;
- case CR_SERVER_LOST:
- if (retry_nr <= 0)
- do_reconnect = 1;
- break;
- default:
- my_err(ctx, __FUNCTION__);
- return -1;
- break;
- }
- }
- retry_nr++;
- }
-
- if (stmt) {
- *stmt = malloc(sizeof(**stmt));
- if (!*stmt) {
- err.code = ENOMEM;
- glite_jp_stack_error(ctx,&err);
- return -1;
- }
- memset(*stmt,0,sizeof(**stmt));
- (**stmt).ctx = ctx;
- (**stmt).result = mysql_store_result((MYSQL *) ctx->dbhandle);
- if (!(**stmt).result) {
- if (mysql_errno((MYSQL *) ctx->dbhandle)) {
- my_err(ctx, __FUNCTION__);
- return -1;
- }
- }
- } else {
- MYSQL_RES *r = mysql_store_result((MYSQL *) ctx->dbhandle);
- mysql_free_result(r);
- }
-
- return mysql_affected_rows((MYSQL *) ctx->dbhandle);
-}
-
-int glite_jp_db_fetchrow(glite_jp_db_stmt_t stmt,char **res)
-{
- MYSQL_ROW row;
- glite_jp_context_t ctx = stmt->ctx;
- int nr,i;
- unsigned long *len;
-
- glite_jp_clear_error(ctx);
-
- if (!stmt->result) return 0;
-
- if (!(row = mysql_fetch_row(stmt->result))) {
- if (mysql_errno((MYSQL *) ctx->dbhandle)) {
- my_err(ctx, __FUNCTION__);
- return -1;
- } else return 0;
- }
-
- nr = mysql_num_fields(stmt->result);
- len = mysql_fetch_lengths(stmt->result);
- for (i=0; i<nr; i++) res[i] = len[i] ? strdup(row[i]) : strdup("");
-
- return nr;
-}
-
-int glite_jp_db_querycolumns(glite_jp_db_stmt_t stmt,char **cols)
-{
- int i = 0;
- MYSQL_FIELD *f;
-
- while ((f = mysql_fetch_field(stmt->result))) cols[i++] = f->name;
- return i == 0;
-}
-
-void glite_jp_db_freestmt(glite_jp_db_stmt_t *stmt)
-{
- if (*stmt) {
- if ((**stmt).result) mysql_free_result((**stmt).result);
- free(*stmt);
- *stmt = NULL;
- }
-}
-
-
-char *glite_jp_db_timetodb(time_t t)
-{
- struct tm *tm = gmtime(&t);
- char tbuf[256];
-
- /* XXX: the very end of our days */
- if (!tm && t == (time_t) LONG_MAX) return strdup("9999-12-31 23:59:59");
-
- sprintf(tbuf,"'%4d-%02d-%02d %02d:%02d:%02d'",tm->tm_year+1900,tm->tm_mon+1,
- tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec);
-
- return strdup(tbuf);
-}
-
-time_t glite_jp_db_dbtotime(char *t)
-{
- struct tm tm;
-
- memset(&tm,0,sizeof(tm));
- setenv("TZ","UTC",1); tzset();
- sscanf(t,"%4d-%02d-%02d %02d:%02d:%02d",
- &tm.tm_year,&tm.tm_mon,&tm.tm_mday,
- &tm.tm_hour,&tm.tm_min,&tm.tm_sec);
- tm.tm_year -= 1900;
- tm.tm_mon--;
-
- return mktime(&tm);
-}
-
-int glite_jp_db_dbcheckversion(glite_jp_context_t ctx)
-{
- MYSQL *m = (MYSQL *) ctx->dbhandle;
- const char *ver_s = mysql_get_server_info(m);
- int major,minor,sub,version;
-
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (!ver_s || 3 != sscanf(ver_s,"%d.%d.%d",&major,&minor,&sub)) {
- err.code = EINVAL;
- err.desc = "problem checking MySQL version";
- return glite_jp_stack_error(ctx,&err);
- }
-
- version = 10000*major + 100*minor + sub;
-
- if (version < GLITE_JP_LB_MYSQL_VERSION) {
- char msg[300];
-
- snprintf(msg,sizeof msg,"Your MySQL version is %d. At least %d required.",version, GLITE_JP_LB_MYSQL_VERSION);
- err.code = EINVAL;
- err.desc = msg;
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
+++ /dev/null
-#ident "$Header$"
-
-#include <getopt.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <assert.h>
-#include <limits.h>
-#include <dirent.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-#include "glite/jp/strmd5.h"
-
-#include "tags.h"
-#include "backend.h"
-#include "db.h"
-
-#include "jpps_H.h" /* XXX: SOAP_TYPE___jpsrv__GetJob */
-
-#define FTPBE_DEFAULT_DB_CS "jpps/@localhost:jpps"
-
-struct ftpbe_config {
- char *internal_path;
- char *external_path;
- char *db_cs;
- char *gridmap;
- char *logname;
-};
-
-static struct ftpbe_config *config = NULL;
-
-struct fhandle_rec {
- int fd;
- int fd_append;
-};
-typedef struct fhandle_rec *fhandle;
-
-static struct option ftpbe_opts[] = {
- { "ftp-internal-path", 1, NULL, 'I' },
- { "ftp-external-path", 1, NULL, 'E' },
- { "ftp-db-cs", 1, NULL, 'D' },
- { "ftp-gridmap", 1, NULL, 'G' },
- { NULL, 0, NULL, 0 }
-};
-
-/*******************************************************************************
- Internal helpers
-*******************************************************************************/
-
-
-static int config_check(
- glite_jp_context_t ctx,
- struct ftpbe_config *config)
-{
- return config == NULL ||
- config->internal_path == NULL ||
- config->external_path == NULL ||
- config->db_cs == NULL ||
- config->gridmap == NULL ||
- config->logname == NULL;
-
- /* XXX check reality */
-}
-
-static int jobid_unique_pathname(glite_jp_context_t ctx, const char *job,
- char **unique, char **ju_path, int get_path)
-{
- char *p;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- p = strrchr(job, '/');
- if (!p) {
- err.code = EINVAL;
- err.desc = "Malformed jobid";
- return glite_jp_stack_error(ctx,&err);
- }
- /* XXX thorough checks */
- if (!(*unique = strdup(p+1))) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- if (get_path) {
- if (!(*ju_path = strdup(p+1))) {
- free(*unique);
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- *(*ju_path + 10) = '\0';
- }
- return 0;
-}
-
-static int mkdirpath(const char* path, int prefixlen)
-{
- char *wpath, *p;
- int goout, ret;
-
- wpath = strdup(path);
- if (!wpath) {
- errno = ENOMEM;
- return -1;
- }
-
- p = wpath + prefixlen;
- goout = 0;
- while (!goout) {
- while (*p == '/') p++;
- while (*p != '/' && *p != '\0') p++;
- goout = (*p == '\0');
- *p = '\0';
- ret = mkdir(wpath, S_IRUSR | S_IWUSR | S_IXUSR);
- if (ret < 0 && errno != EEXIST) break;
- *p = '/';
- }
- free(wpath);
- return goout ? 0 : ret;
-}
-
-static int store_user(glite_jp_context_t ctx, const char *userid, const char *subj)
-{
- glite_jp_error_t err;
- char *stmt;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(userid != NULL);
- assert(subj != NULL);
-
- trio_asprintf(&stmt,"insert into users(userid,cert_subj) "
- "values ('%|Ss','%|Ss')",userid,subj);
- if (!stmt) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (glite_jp_db_execstmt(ctx, stmt, NULL) < 0) {
- if (ctx->error->code == EEXIST)
- glite_jp_clear_error(ctx);
- else {
- free(stmt);
- err.code = EIO;
- err.desc = "DB access failed";
- return glite_jp_stack_error(ctx,&err);
- }
- }
- free(stmt);
-
- return 0;
-}
-
-static long regtime_trunc(long tv_sec)
-{
- return tv_sec / (86400*7);
-}
-
-static long regtime_ceil(long tv_sec)
-{
- return (tv_sec % (86400*7)) ? tv_sec/(86400*7)+1 : tv_sec/(86400*7) ;
-}
-
-/********************************************************************************
- Backend calls
-********************************************************************************/
-int glite_jppsbe_init(
- glite_jp_context_t ctx,
- int argc,
- char *argv[]
-)
-{
- glite_jp_error_t err;
- int opt;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- config = (struct ftpbe_config *) calloc(1, sizeof *config);
- if (!config) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
-
- config->logname = getlogin();
-
- while ((opt = getopt_long(argc, argv, "I:E:G:", ftpbe_opts, NULL)) != EOF) {
- switch (opt) {
- case 'I': config->internal_path = optarg; break;
- case 'E': config->external_path = optarg; break;
- case 'D': config->db_cs = optarg; break;
- case 'G': config->gridmap = optarg; break;
- default: break;
- }
- }
-
- /* Defaults */
- if (!config->db_cs) config->db_cs = strdup(FTPBE_DEFAULT_DB_CS);
-
- if (config_check(ctx, config)) {
- err.code = EINVAL;
- err.desc = "Invalid FTP backend configuration";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (glite_jp_db_connect(ctx, config->db_cs)) {
- err.code = EIO;
- err.desc = "Cannot access backend's database (during init)";
- return glite_jp_stack_error(ctx,&err);
- } else {
- glite_jp_db_close(ctx); /* slaves open their own connections */
- }
-
- return 0;
-}
-
-int glite_jppsbe_init_slave(
- glite_jp_context_t ctx
-)
-{
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (glite_jp_db_connect(ctx, config->db_cs)) {
- err.code = EIO;
- err.desc = "Cannot access backend's database";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-int glite_jppsbe_register_job(
- glite_jp_context_t ctx,
- const char *job,
- const char *owner
-)
-{
- glite_jp_error_t err;
- char *data_dir = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
- char *ownerhash = NULL;
- struct timeval reg_tv;
- char *stmt = NULL;
- char *dbtime = NULL;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job != NULL);
- assert(owner != NULL);
-
- gettimeofday(®_tv, NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- ownerhash = str2md5(owner); /* static buffer */
- if (store_user(ctx, ownerhash, owner)) {
- err.code = EIO;
- err.desc = "Cannot store user entry";
- goto error_out;
- }
-
- dbtime = glite_jp_db_timetodb(reg_tv.tv_sec);
- if (!dbtime) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- trio_asprintf(&stmt,"insert into jobs(jobid,dg_jobid,owner,reg_time) "
- "values ('%|Ss','%|Ss','%|Ss', %s)",
- ju, job, ownerhash, dbtime);
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (glite_jp_db_execstmt(ctx, stmt, NULL) < 0) {
- if (ctx->error->code == EEXIST) {
- err.code = EEXIST;
- err.desc = "Job already registered";
- }
- else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
- if (asprintf(&data_dir, "%s/data/%s/%d/%s",
- config->internal_path, ownerhash, regtime_trunc(reg_tv.tv_sec), ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (mkdirpath(data_dir, strlen(config->internal_path)) < 0 &&
- errno != EEXIST) {
- err.code = errno;
- err.desc = "Cannot mkdir jobs's data directory";
- goto error_out;
- }
-
-error_out:
- free(data_dir);
- free(stmt); free(dbtime);
- free(ju); free(ju_path);
-
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-static int add_to_gridmap(glite_jp_context_t ctx, const char *dn)
-{
- FILE *gridmap = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- gridmap = fopen(config->gridmap, "a");
- if (!gridmap) {
- err.code = errno;
- err.desc = "Cannot open gridmap file";
- return glite_jp_stack_error(ctx,&err);
- }
- if (fprintf(gridmap, "\"%s\" %s\n", dn, config->logname) < 6 ||
- ferror(gridmap)) {
- err.code = EIO;
- err.desc = "Cannot write to gridmap file";
- fclose(gridmap);
- return glite_jp_stack_error(ctx,&err);
- }
- fclose(gridmap);
- return 0;
-}
-
-static int remove_from_gridmap(glite_jp_context_t ctx, const char *dn)
-{
- FILE *gridmap = NULL;
- char *temp_name = NULL;
- FILE *temp_file = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- /* XXX */
- return 0;
-}
-
-int glite_jppsbe_start_upload(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name,
- const char *content_type,
- char **destination_out,
- time_t *commit_before_inout
-)
-{
- char *data_basename = NULL;
- char *data_fname = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
- char *peername = NULL;
- char *peerhash = NULL;
-
- char *stmt = NULL;
- glite_jp_db_stmt_t db_res;
- int db_retn;
- char *db_row[2] = { NULL, NULL };
-
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job!=NULL);
- assert(destination_out!=NULL);
-
- assert(class!=NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- peername = glite_jp_peer_name(ctx);
- if (peername == NULL) {
- err.code = EINVAL;
- err.desc = "Cannot obtain client certificate info";
- goto error_out;
- }
-
- trio_asprintf(&stmt, "select owner, reg_time from jobs"
- " where jobid='%|Ss'", ju);
-
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if ((db_retn = glite_jp_db_execstmt(ctx, stmt, &db_res)) <= 0) {
- if (db_retn == 0) {
- err.code = ENOENT;
- err.desc = "No such job registered";
- } else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
- db_retn = glite_jp_db_fetchrow(db_res, db_row);
- if (db_retn != 2) {
- glite_jp_db_freestmt(&db_res);
- err.code = EIO;
- err.desc = "DB access failed";
- goto error_out;
- }
-
- glite_jp_db_freestmt(&db_res);
-
- /* XXX authorization done in soap_ops.c */
-
- /* XXX name length */
- if (asprintf(&data_basename, "%s%s%s", class,
- (name != NULL) ? "." : "",
- (name != NULL) ? name : "") == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (asprintf(&data_fname, "%s/data/%s/%d/%s/%s",
- config->internal_path, db_row[0],
- regtime_trunc(glite_jp_db_dbtotime(db_row[1])),
- ju, data_basename) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (asprintf(destination_out, "%s/data/%s/%d/%s/%s",
- config->external_path, db_row[0],
- regtime_trunc(glite_jp_db_dbtotime(db_row[1])),
- ju, data_basename) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (commit_before_inout != NULL)
- /* XXX no timeout enforced */
- /* XXX: gsoap does not like so much, one year should be enough
- *commit_before_inout = (time_t) LONG_MAX;
- */
- *commit_before_inout = time(NULL) + 365*24*60*60;
-
- /*
- if (add_to_gridmap(ctx, peername)) {
- err.code = EIO;
- err.desc = "Cannot add peer DN to ftp server authorization file";
- goto error_out;
- }
- */
-
- peerhash = str2md5(peername); /* static buffer */
- if (store_user(ctx, peerhash, peername)) {
- err.code = EIO;
- err.desc = "Cannot store upload user entry";
- goto error_out;
- }
-
- free(stmt); stmt = NULL;
- trio_asprintf(&stmt,"insert into files"
- "(jobid,filename,int_path,ext_url,state,deadline,ul_userid) "
- "values ('%|Ss','%|Ss','%|Ss','%|Ss','%|Ss', '%|Ss', '%|Ss')",
- ju, data_basename, data_fname, *destination_out, "uploading",
- glite_jp_db_timetodb(*commit_before_inout), peerhash);
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (glite_jp_db_execstmt(ctx, stmt, NULL) < 0) {
- if (ctx->error->code == EEXIST) {
- err.code = EEXIST;
- err.desc = "File already stored or upload in progress";
- } else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
-error_out:
- free(db_row[0]); free(db_row[1]);
- free(stmt);
- free(data_basename);
- free(data_fname);
- free(ju); free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_commit_upload(
- glite_jp_context_t ctx,
- const char *destination
-)
-{
- char *peername = NULL;
- char *peerhash = NULL;
-
- char *stmt = NULL;
- glite_jp_db_stmt_t db_res;
- int db_retn;
- char *db_row[7] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL };
- int i;
-
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(destination != NULL);
-
- trio_asprintf(&stmt, "select * from files where "
- "ext_url='%|Ss' and state='uploading'", destination);
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if ((db_retn = glite_jp_db_execstmt(ctx, stmt, &db_res)) <= 0) {
- if (db_retn == 0) {
- err.code = ENOENT;
- err.desc = "No such upload in progress";
- } else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
- db_retn = glite_jp_db_fetchrow(db_res, db_row);
- if (db_retn != 7) {
- glite_jp_db_freestmt(&db_res);
- err.code = EIO;
- err.desc = "DB access failed";
- goto error_out;
- }
- glite_jp_db_freestmt(&db_res);
-
- peername = glite_jp_peer_name(ctx);
- if (peername == NULL) {
- err.code = EINVAL;
- err.desc = "Cannot obtain client certificate info";
- goto error_out;
- }
-
- peerhash = str2md5(peername); /* static buffer */
- if (strcmp(peerhash, db_row[6])) {
- err.code = EPERM;
- err.desc = "Upload started by client with different identity";
- goto error_out;
- }
-
- free(stmt);
- trio_asprintf(&stmt,"update files set state='committed', deadline=NULL "
- "where jobid='%|Ss' and filename='%|Ss'", db_row[0], db_row[1]);
-
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (glite_jp_db_execstmt(ctx, stmt, NULL) < 0) {
- err.code = EIO;
- err.desc = "DB access failed";
- goto error_out;
- }
-error_out:
- for (i=0; i<7; i++) free(db_row[i]);
- free(peername);
- free(stmt);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_destination_info(
- glite_jp_context_t ctx,
- const char *destination,
- char **job,
- char **class,
- char **name
-)
-{
- char *stmt = NULL;
- glite_jp_db_stmt_t db_res;
- int db_retn;
- char *db_row[2] = { NULL, NULL};
- int i;
- char *cp = NULL;
-
- char *classname = NULL;
- glite_jp_error_t err;
-
- assert(destination != NULL);
- assert(job != NULL);
- assert(class != NULL);
- assert(name != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
-
- trio_asprintf(&stmt, "select j.dg_jobid,f.filename from jobs j,files f where "
- "f.ext_url='%|Ss' and j.jobid=f.jobid", destination);
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if ((db_retn = glite_jp_db_execstmt(ctx, stmt, &db_res)) <= 0) {
- if (db_retn == 0) {
- err.code = ENOENT;
- err.desc = "Invalid destination string";
- } else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
- db_retn = glite_jp_db_fetchrow(db_res, db_row);
- if (db_retn != 2) {
- glite_jp_db_freestmt(&db_res);
- err.code = EIO;
- err.desc = "DB access failed";
- goto error_out;
- }
- glite_jp_db_freestmt(&db_res);
-
- *job = strdup(db_row[0]);
-
- cp = strchr(db_row[1],'.');
- if (!cp) {
- *name = NULL;
- } else {
- *cp++ = '\0';
- *name = strdup(cp);
- }
- *class = strdup(db_row[1]);
-
- if (!*job || !*class) {
- err.code = ENOMEM;
- goto error_out;
- }
-
-error_out:
- for (i=0; i<2; i++) free(db_row[i]);
- free(stmt);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-
-int glite_jppsbe_get_job_url(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name,
- char **url_out
-)
-{
- char *data_basename = NULL;
- char *data_fname = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
-
- char *stmt = NULL;
- glite_jp_db_stmt_t db_res;
- int db_retn;
- char *db_row[3] = { NULL, NULL, NULL };
-
- long reg_time;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job!=NULL);
- assert(url_out != NULL);
-
- assert(class!=NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/ : ""name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- trio_asprintf(&stmt, "select j.owner,reg_time,u.cert_subj from jobs j, users u "
- "where j.jobid='%|Ss' and j.owner = u.userid", ju);
-
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if ((db_retn = glite_jp_db_execstmt(ctx, stmt, &db_res)) <= 0) {
- if (db_retn == 0) {
- err.code = ENOENT;
- err.desc = "No such job registered";
- } else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
- free(stmt); stmt = NULL;
-
- db_retn = glite_jp_db_fetchrow(db_res, db_row);
- if (db_retn != 3) {
- glite_jp_db_freestmt(&db_res);
- err.code = EIO;
- err.desc = "DB access failed";
- goto error_out;
- }
-
- glite_jp_db_freestmt(&db_res);
-
- if (glite_jpps_authz(ctx,SOAP_TYPE___jpsrv__GetJob,job,db_row[2])) {
- err.code = EPERM;
- goto error_out;
- }
-
- /* XXX name length */
- if (asprintf(&data_basename, "%s%s%s", class,
- (name != NULL) ? "." : "",
- (name != NULL) ? name : "") == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (asprintf(url_out, "%s/data/%s/%d/%s/%s",
- config->external_path, db_row[0],
- regtime_trunc(glite_jp_db_dbtotime(db_row[1])),
- ju, data_basename) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- trio_asprintf(&stmt,"select 'x' from files where jobid='%|Ss' "
- "and ext_url = '%|Ss' "
- "and state='committed' ",ju,*url_out);
-
- if ((db_retn = glite_jp_db_execstmt(ctx,stmt,&db_res)) <= 0) {
- if (db_retn == 0) {
- err.code = ENOENT;
- err.desc = "not uploaded yet";
- }
- else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- /* goto error_out; */
- }
-
-error_out:
- free(db_row[0]); free(db_row[1]);
- free(stmt);
- free(data_basename);
- free(ju); free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-static int get_job_fname(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name,
- char **fname_out
-)
-{
- char *data_basename = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
-
- char *stmt = NULL;
- glite_jp_db_stmt_t db_res;
- int db_retn;
- char *db_row[2] = { NULL, NULL };
-
- long reg_time;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job!=NULL);
- assert(fname_out != NULL);
-
- assert(class!=NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- trio_asprintf(&stmt, "select owner, reg_time from jobs "
- "where jobid='%|Ss'", ju);
-
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if ((db_retn = glite_jp_db_execstmt(ctx, stmt, &db_res)) <= 0) {
- if (db_retn == 0) {
- err.code = ENOENT;
- err.desc = "No such job registered";
- } else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
- db_retn = glite_jp_db_fetchrow(db_res, db_row);
- if (db_retn != 2) {
- glite_jp_db_freestmt(&db_res);
- err.code = EIO;
- err.desc = "DB access failed";
- goto error_out;
- }
-
- glite_jp_db_freestmt(&db_res);
-
- /* XXX name length */
- if (asprintf(&data_basename, "%s%s%s", class,
- (name != NULL) ? "." : "", (name != NULL) ? name : "") == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (asprintf(fname_out, "%s/data/%s/%d/%s/%s",
- config->internal_path, db_row[0],
- regtime_trunc(glite_jp_db_dbtotime(db_row[1])),
- ju, data_basename) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
-error_out:
- free(db_row[0]); free(db_row[1]);
- free(stmt);
- free(data_basename);
- free(ju); free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-
-int glite_jppsbe_open_file(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name,
- int mode,
- void **handle_out
-)
-{
- fhandle handle = NULL;
- char* fname = NULL;
- glite_jp_error_t err;
-
- assert(handle_out != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (get_job_fname(ctx, job, class, name, &fname)) {
- err.code = ctx->error->code;
- err.desc = "Cannot construct internal filename";
- return glite_jp_stack_error(ctx,&err);
- }
-
- handle = (fhandle) calloc(1,sizeof(*handle));
- if (handle == NULL) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- handle->fd = open(fname, mode, S_IRUSR | S_IWUSR);
- if (handle->fd < 0) {
- err.code = errno;
- err.desc = "Cannot open requested file";
- free(handle);
- goto error_out;
- }
- handle->fd_append = open(fname, mode | O_APPEND, S_IRUSR | S_IWUSR);
- if (handle->fd_append < 0) {
- err.code = errno;
- err.desc = "Cannot open requested file for append";
- close(handle->fd);
- free(handle);
- goto error_out;
- }
- *handle_out = (void*) handle;
-
-error_out:
- free(fname);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_close_file(
- glite_jp_context_t ctx,
- void *handle
-)
-{
- glite_jp_error_t err;
-
- assert(handle != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (close(((fhandle)handle)->fd_append) < 0) {
- err.code = errno;
- err.desc = "Error closing file descriptor (fd_append)";
- goto error_out;
- }
- if (close(((fhandle)handle)->fd) < 0) {
- err.code = errno;
- err.desc = "Error closing file descriptor";
- goto error_out;
- }
-
-error_out:
- free(handle);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_pread(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset,
- ssize_t *nbytes_ret
-)
-{
- ssize_t ret;
- glite_jp_error_t err;
-
- assert(handle != NULL);
- assert(buf != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if ((ret = pread(((fhandle)handle)->fd, buf, nbytes, offset)) < 0) {
- err.code = errno;
- err.desc = "Error in pread()";
- return glite_jp_stack_error(ctx,&err);
- }
- *nbytes_ret = ret;
-
- return 0;
-}
-
-int glite_jppsbe_pwrite(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset
-)
-{
- glite_jp_error_t err;
-
- assert(handle != NULL);
- assert(buf != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (pwrite(((fhandle)handle)->fd, buf, nbytes, offset) < 0) {
- err.code = errno;
- err.desc = "Error in pwrite()";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-int glite_jppsbe_append(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes
-)
-{
- glite_jp_error_t err;
-
- assert(handle != NULL);
- assert(buf != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (write(((fhandle)handle)->fd_append, buf, nbytes) < 0) {
- err.code = errno;
- err.desc = "Error in write()";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-static int get_job_info(
- glite_jp_context_t ctx,
- const char *job,
- char **owner,
- struct timeval *tv_reg
-)
-{
- char *ju = NULL;
- char *ju_path = NULL;
- FILE *regfile = NULL;
- long reg_time_sec;
- long reg_time_usec;
- int ownerlen = 0;
- int info_version;
- char *int_fname = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&int_fname, "%s/regs/%s/%s.info",
- config->internal_path, ju_path, ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- if (errno == ENOENT)
- err.desc = "Job not registered";
- else
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%ld %*s %*s %d ", &info_version,
- ®_time_sec, ®_time_usec, &ownerlen) < 4 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- if (ownerlen) {
- *owner = (char *) calloc(1, ownerlen+1);
- if (!*owner) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (fgets(*owner, ownerlen+1, regfile) == NULL) {
- fclose(regfile);
- free(*owner);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- }
- fclose(regfile);
-
- tv_reg->tv_sec = reg_time_sec;
- tv_reg->tv_usec = reg_time_usec;
-
-error_out:
- free(int_fname);
- free(ju);
- free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-static int get_job_info_int(
- glite_jp_context_t ctx,
- const char *int_fname,
- char **jobid,
- char **owner,
- struct timeval *tv_reg
-)
-{
- FILE *regfile = NULL;
- long reg_time_sec;
- long reg_time_usec;
- int ownerlen = 0;
- int info_version;
- char jobid_buf[256];
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%ld %s %*s %d ", &info_version,
- ®_time_sec, ®_time_usec, jobid_buf, &ownerlen) < 5 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- *jobid = strdup(jobid_buf);
- if (ownerlen) {
- *owner = (char *) calloc(1, ownerlen+1);
- if (!*owner) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (fgets(*owner, ownerlen+1, regfile) == NULL) {
- fclose(regfile);
- free(*owner);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- }
- fclose(regfile);
-
- tv_reg->tv_sec = reg_time_sec;
- tv_reg->tv_usec = reg_time_usec;
-
-error_out:
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_get_job_metadata(
- glite_jp_context_t ctx,
- const char *job,
- glite_jp_attrval_t attrs_inout[]
-)
-{
- int got_info = 0;
- struct timeval tv_reg;
- char *owner = NULL;
- int got_tags = 0;
- void *tags_handle = NULL;
- glite_jp_tagval_t* tags = NULL;
- int i,j;
- glite_jp_error_t err;
-
- assert(job != NULL);
- assert(attrs_inout != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- for (i = 0; attrs_inout[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (attrs_inout[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
-
-/* must be implemented via filetype plugin
- case GLITE_JP_ATTR_TIME:
-*/
- if (!got_info) {
- if (get_job_info(ctx, job, &owner, &tv_reg)) {
- err.code = ctx->error->code;
- err.desc = "Cannot retrieve job info";
- goto error_out;
- }
- got_info = 1;
- }
- break;
-
-/* must be implemented via filetype plugin
- case GLITE_JP_ATTR_TAG:
- if (!got_tags) {
- if (glite_jppsbe_open_file(ctx, job, GLITE_JP_FILECLASS_TAGS,
- O_RDONLY, &tags_handle)) {
- err.code = ctx->error->code;
- err.desc = "Cannot open tag file";
- goto error_out;
- }
- if (glite_jpps_tag_readall(ctx, tags_handle, &tags)) {
- err.code = ctx->error->code;
- err.desc = "Cannot read tags";
- glite_jppsbe_close_file(ctx, tags_handle);
- goto error_out;
- }
- glite_jppsbe_close_file(ctx, tags_handle);
- got_tags = 1;
- }
- break;
-*/
- default:
- err.code = EINVAL;
- err.desc = "Invalid attribute type";
- goto error_out;
- break;
- }
-
- switch (attrs_inout[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- attrs_inout[i].value.s = strdup(owner);
- if (!attrs_inout[i].value.s) {
- err.code = ENOMEM;
- err.desc = "Cannot copy owner string";
- goto error_out;
- }
- break;
- case GLITE_JP_ATTR_TIME:
- attrs_inout[i].value.time = tv_reg;
- break;
-
-/* must be implemented via filetype plugin
- case GLITE_JP_ATTR_TAG:
- for (j = 0; tags[j].name != NULL; j++) {
- if (!strcmp(tags[j].name, attrs_inout[i].attr.name)) {
- if (glite_jpps_tagval_copy(ctx, &tags[j],
- &attrs_inout[i].value.tag)) {
- err.code = ENOMEM;
- err.desc = "Cannot copy tag value";
- goto error_out;
- }
- break;
- }
- }
- if (!tags[j].name) attrs_inout[i].value.tag.name = NULL;
- break;
-*/
- default:
- break;
- }
- }
-
-error_out:
- free(owner);
- if (tags) for (j = 0; tags[j].name != NULL; j++) {
- free(tags[j].name);
- free(tags[j].value);
- }
- free(tags);
-
- if (err.code) {
- while (i > 0) {
- i--;
- switch (attrs_inout[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- free(attrs_inout[i].value.s);
- break;
- case GLITE_JP_ATTR_TAG:
- free(attrs_inout[i].value.tag.name);
- free(attrs_inout[i].value.tag.value);
- default:
- break;
- }
- }
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-static int compare_timeval(struct timeval a, struct timeval b)
-{
- if (a.tv_sec < b.tv_sec) return -1;
- if (a.tv_sec > b.tv_sec) return 1;
- if (a.tv_usec < b.tv_usec) return -1;
- if (a.tv_usec > b.tv_usec) return 1;
- return 0;
-}
-
-
-/* FIXME: disabled -- clarification wrt. filetype plugin needed */
-
-#if 0
-
-static int query_phase2(
- glite_jp_context_t ctx,
- const char *ownerhash,
- long regtime_tr,
- int q_tags,
- int md_tags,
- const glite_jp_query_rec_t query[],
- glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-);
-
-static int query_phase2(
- glite_jp_context_t ctx,
- const char *ownerhash,
- long regtime_tr,
- int q_tags,
- int md_tags,
- const glite_jp_query_rec_t query[],
- glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-)
-{
- char *time_dirname = NULL;
- DIR *time_dirp = NULL;
- struct dirent *jobent;
- char *info_fname = NULL;
- char *jobid = NULL;
- char *owner = NULL;
- struct timeval tv_reg;
- void *tags_handle = NULL;
- int matching;
- int i, j;
- glite_jp_tagval_t* tags = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (asprintf(&time_dirname, "%s/data/%s/%d", config->internal_path,
- ownerhash, regtime_tr) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- time_dirp = opendir(time_dirname);
- if (!time_dirp) {
- free(time_dirname);
- return 0; /* found nothing */
- }
- while ((jobent = readdir(time_dirp)) != NULL) {
- if (!strcmp(jobent->d_name, ".")) continue;
- if (!strcmp(jobent->d_name, "..")) continue;
- if (asprintf(&info_fname, "%s/%s/_info", time_dirname,
- jobent->d_name) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (get_job_info_int(ctx, info_fname, &jobid, &owner, &tv_reg)) {
- err.code = EIO;
- err.desc = "Cannot retrieve job info";
- goto error_out;
- }
- if (q_tags || md_tags) {
- if (glite_jppsbe_open_file(ctx, jobid, GLITE_JP_FILECLASS_TAGS,
- O_RDONLY, &tags_handle)) {
- err.code = ctx->error->code;
- err.desc = "Cannot open tag file";
- goto error_out;
- }
- if (glite_jpps_tag_readall(ctx, tags_handle, &tags)) {
- err.code = ctx->error->code;
- err.desc = "Cannot read tags";
- glite_jppsbe_close_file(ctx, tags_handle);
- goto error_out;
- }
- glite_jppsbe_close_file(ctx, tags_handle);
- tags_handle = NULL;
- }
-
- matching = 1;
- for (i = 0; matching && query[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (query[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- if (query[i].value.s == NULL ||
- strcmp(query[i].value.s, owner)) matching = 0;
- break;
- case GLITE_JP_ATTR_TIME:
- switch (query[i].op) {
- case GLITE_JP_QUERYOP_EQUAL:
- matching = !compare_timeval(tv_reg, query[i].value.time);
- break;
- case GLITE_JP_QUERYOP_UNEQUAL:
- matching = compare_timeval(tv_reg, query[i].value.time);
- break;
- case GLITE_JP_QUERYOP_LESS:
- matching = compare_timeval(tv_reg, query[i].value.time) < 0;
- break;
- case GLITE_JP_QUERYOP_GREATER:
- matching = compare_timeval(tv_reg, query[i].value.time) > 0;
- break;
- case GLITE_JP_QUERYOP_WITHIN:
- matching = compare_timeval(tv_reg, query[i].value.time) >= 0
- && compare_timeval(tv_reg, query[i].value2.time) <= 0;
- break;
- }
- break;
- case GLITE_JP_ATTR_TAG:
- if (!tags) {
- matching = 0;
- break;
- }
- for (j = 0; tags[j].name != NULL; j++) {
- if (!strcmp(tags[j].name, query[i].attr.name)) {
- switch (query[i].op) {
- case GLITE_JP_QUERYOP_EQUAL:
- matching = !strcmp(tags[j].value, query[i].value.s);
- break;
- case GLITE_JP_QUERYOP_UNEQUAL:
- matching = strcmp(tags[j].value, query[i].value.s);
- break;
- case GLITE_JP_QUERYOP_LESS:
- matching = strcmp(tags[j].value, query[i].value.s) < 0;
- break;
- case GLITE_JP_QUERYOP_GREATER:
- matching = strcmp(tags[j].value, query[i].value.s) > 0;
- break;
- case GLITE_JP_QUERYOP_WITHIN:
- matching = strcmp(tags[j].value, query[i].value.s) >= 0 \
- && strcmp(tags[j].value, query[i].value2.s) <= 0 ;
- break;
- default:
- break;
- }
- }
- }
- break;
- default:
- break;
- }
- }
- if (!matching) {
- free(info_fname); info_fname = NULL;
- free(jobid); jobid = NULL;
- if (tags) for (j = 0; tags[j].name != NULL; j++) {
- free(tags[j].name);
- free(tags[j].value);
- }
- free(tags); tags = NULL;
- continue;
- }
-
- for (i = 0; metadata[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- metadata[i].value.s = owner;
- break;
- case GLITE_JP_ATTR_TIME:
- metadata[i].value.time = tv_reg;
- break;
- case GLITE_JP_ATTR_TAG:
- for (j = 0; tags[j].name != NULL; j++) {
- if (!strcmp(tags[j].name, metadata[i].attr.name)) {
- if (glite_jpps_tagval_copy(ctx, &tags[j],
- &metadata[i].value.tag)) {
- err.code = ENOMEM;
- err.desc = "Cannot copy tag value";
- goto error_out;
- }
- break;
- }
- }
- if (!tags[j].name) {
- metadata[i].value.tag.name = NULL;
- metadata[i].value.tag.value = NULL;
- }
- break;
- default:
- break;
- }
- }
- (*callback)(ctx, jobid, metadata);
- free(jobid); jobid = NULL;
- while (i > 0) {
- i--;
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_TAG:
- free(metadata[i].value.tag.name);
- free(metadata[i].value.tag.value);
- default:
- break;
- }
- }
- }
-
-error_out:
- if (tags) for (j = 0; tags[j].name != NULL; j++) {
- free(tags[j].name);
- free(tags[j].value);
- }
- if (tags_handle) glite_jppsbe_close_file(ctx, tags_handle);
- free(info_fname);
- free(owner);
- free(jobid);
- closedir(time_dirp);
- free(time_dirname);
- if (err.code) {
- while (i > 0) {
- i--;
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_TAG:
- free(metadata[i].value.tag.name);
- free(metadata[i].value.tag.value);
- default:
- break;
- }
- }
- return glite_jp_stack_error(ctx,&err);
- } else
- return 0;
-}
-
-int glite_jppsbe_query(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t query[],
- const glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-)
-{
- /* XXX clone metadata */
- int i;
- char *q_exact_owner = NULL;
- char *ownerhash = NULL;
- long q_min_time = 0;
- long q_max_time = LONG_MAX;
- long q_min_time_tr;
- long q_max_time_tr;
- int q_with_tags = 0;
- int md_info = 0;
- int md_tags = 0;
- char *owner_dirname = NULL;
- DIR *owner_dirp = NULL;
- struct dirent *ttimeent;
- char *data_dirname = NULL;
- DIR *data_dirp = NULL;
- struct dirent *ownerent;
- long ttime = 0;
- glite_jp_attrval_t *metadata_templ = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- for (i = 0; query[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- if (query[i].attr.type == GLITE_JP_ATTR_OWNER && query[i].op == GLITE_JP_QUERYOP_EQUAL) {
- q_exact_owner = query[i].value.s;
- }
- if (query[i].attr.type == GLITE_JP_ATTR_TIME) {
- switch (query[i].op) {
- case GLITE_JP_QUERYOP_EQUAL:
- q_min_time = query[i].value.time.tv_sec;
- q_max_time = query[i].value.time.tv_sec + 1;
- break;
- case GLITE_JP_QUERYOP_LESS:
- if (q_max_time > query[i].value.time.tv_sec + 1)
- q_max_time = query[i].value.time.tv_sec + 1;
- break;
- case GLITE_JP_QUERYOP_WITHIN:
- if (q_max_time > query[i].value2.time.tv_sec + 1)
- q_max_time = query[i].value2.time.tv_sec + 1;
- /* fallthrough */
- case GLITE_JP_QUERYOP_GREATER:
- if (q_min_time < query[i].value.time.tv_sec)
- q_min_time = query[i].value.time.tv_sec;
- break;
- default:
- err.code = EINVAL;
- err.desc = "Invalid query op";
- return glite_jp_stack_error(ctx,&err);
- break;
- }
- }
- if (query[i].attr.type == GLITE_JP_ATTR_TAG)
- q_with_tags = 1;
-
- }
-
- for (i = 0; metadata[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- case GLITE_JP_ATTR_TIME:
- md_info = 1;
- break;
- case GLITE_JP_ATTR_TAG:
- md_tags = 1;
- break;
- default:
- err.code = EINVAL;
- err.desc = "Invalid attribute type in metadata parameter";
- return glite_jp_stack_error(ctx,&err);
- break;
- }
- }
- metadata_templ = (glite_jp_attrval_t *) calloc(i + 1, sizeof(glite_jp_attrval_t));
- if (!metadata_templ) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- memcpy(metadata_templ, metadata, (i + 1) * sizeof(glite_jp_attrval_t));
-
- q_min_time_tr = regtime_trunc(q_min_time);
- q_max_time_tr = regtime_ceil(q_max_time);
-
- if (q_exact_owner) {
- ownerhash = str2md5(q_exact_owner); /* static buffer */
- if (asprintf(&owner_dirname, "%s/data/%s", config->internal_path, ownerhash) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- owner_dirp = opendir(owner_dirname);
- free(owner_dirname);
- if (!owner_dirp) {
- free(metadata_templ);
- return 0; /* found nothing */
- }
- while ((ttimeent = readdir(owner_dirp)) != NULL) {
- if (!strcmp(ttimeent->d_name, ".")) continue;
- if (!strcmp(ttimeent->d_name, "..")) continue;
- ttime = atol(ttimeent->d_name);
- if (ttime >= q_min_time_tr && ttime < q_max_time_tr) {
- if (query_phase2(ctx, ownerhash, ttime, q_with_tags, md_tags,
- query, metadata_templ, callback)) {
- err.code = EIO;
- err.desc = "query_phase2() error";
- goto error_out;
- }
- }
- }
- } else { /* !q_exact_owner */
- if (asprintf(&data_dirname, "%s/data", config->internal_path) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- data_dirp = opendir(data_dirname);
- if (!data_dirp) {
- err.code = EIO;
- err.desc = "Cannot open data directory";
- goto error_out;
- }
- while ((ownerent = readdir(data_dirp)) != NULL) {
- if (!strcmp(ownerent->d_name, ".")) continue;
- if (!strcmp(ownerent->d_name, "..")) continue;
- if (asprintf(&owner_dirname, "%s/data/%s", config->internal_path,
- ownerent->d_name) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- owner_dirp = opendir(owner_dirname);
- free(owner_dirname);
- if (!owner_dirp) {
- err.code = EIO;
- err.desc = "Cannot open owner data directory";
- goto error_out;
- }
- while ((ttimeent = readdir(owner_dirp)) != NULL) {
- if (!strcmp(ttimeent->d_name, ".")) continue;
- if (!strcmp(ttimeent->d_name, "..")) continue;
- ttime = atol(ttimeent->d_name);
- if (ttime >= q_min_time_tr && ttime < q_max_time_tr) {
- if (query_phase2(ctx, ownerent->d_name, ttime, q_with_tags, md_tags,
- query, metadata_templ, callback)) {
- err.code = EIO;
- err.desc = "query_phase2() error";
- goto error_out;
- }
- }
- }
- closedir(owner_dirp); owner_dirp = NULL;
- }
- closedir(data_dirp); data_dirp = NULL;
- }
- return 0;
-
-error_out:
- if (owner_dirp) closedir(owner_dirp);
- if (data_dirp) closedir(data_dirp);
- free(data_dirname);
- free(metadata_templ);
- return glite_jp_stack_error(ctx,&err);
-}
-
-#else
-
-/* placeholder instead */
-int glite_jppsbe_query(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t query[],
- const glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-)
-{
- glite_jp_error_t err;
- err.code = ENOSYS;
- err.desc = "not implemented";
- return glite_jp_stack_error(ctx,&err);
-}
-
-#endif
-
-/* XXX:
-- no primary authorization yet
-- no concurrency control yet
-- partial success in pwrite,append
-- "unique" part of jobid is assumed to be unique across bookkeeping servers
-- repository versioning not fully implemented yet
-*/
+++ /dev/null
-#include <stdio.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-
-#include "jpps_H.h"
-
-extern SOAP_NMAC struct Namespace jpis__namespaces[],jpps__namespaces[];
-
-int main(int argc, char *argv[]) {
- struct soap soap;
- int i, m, s; // master and slave sockets
-
- glite_jp_context_t ctx;
-
- soap_init(&soap);
- soap_set_namespaces(&soap, jpps__namespaces);
-
- glite_jp_init_context(&ctx);
-
- if (glite_jppsbe_init(ctx, &argc, argv)) {
- /* XXX log */
- fputs(glite_jp_error_chain(ctx), stderr);
- exit(1);
- }
-
- soap.user = (void *) ctx;
-
- ctx->other_soap = soap_new();
- soap_init(ctx->other_soap);
- soap_set_namespaces(ctx->other_soap,jpis__namespaces);
-
- srand48(time(NULL)); /* feed id generation */
-
- m = soap_bind(&soap, NULL, 8901, 100);
- if (m < 0)
- soap_print_fault(&soap, stderr);
- else
- {
- fprintf(stderr, "Socket connection successful: master socket = %d\n", m);
- for (i = 1; ; i++) {
- s = soap_accept(&soap);
- if (s < 0) {
- soap_print_fault(&soap, stderr);
- break;
- }
- jpps__serve(&soap); // process RPC request
- soap_destroy(&soap); // clean up class instances
- soap_end(&soap); // clean up everything and close socket
- glite_jp_run_deferred(ctx);
- }
- }
- soap_done(&soap); // close master socket
-
- return 0;
-}
-
-/* XXX: we don't use it */
-SOAP_NMAC struct Namespace namespaces[] = { {NULL,NULL} };
+++ /dev/null
-#include <stdio.h>
-#include <fcntl.h>
-#include <assert.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-
-#include "feed.h"
-
-#include "jpps_H.h"
-/* #include "JobProvenancePS.nsmap" */
-#include "jpps_.nsmap"
-
-#include "jptype_map.h"
-
-#include "file_plugin.h"
-#include "builtin_plugins.h"
-
-#include "soap_version.h"
-#if GSOAP_VERSION <= 20602
-#define __jpsrv__RegisterJob __ns1__RegisterJob
-#define __jpsrv__StartUpload __ns1__StartUpload
-#define __jpsrv__CommitUpload __ns1__CommitUpload
-#define __jpsrv__RecordTag __ns1__RecordTag
-#define __jpsrv__FeedIndex __ns1__FeedIndex
-#define __jpsrv__FeedIndexRefresh __ns1__FeedIndexRefresh
-#define __jpsrv__GetJob __ns1__GetJob
-#endif
-
-static struct jptype__genericFault *jp2s_error(struct soap *soap,
- const glite_jp_error_t *err)
-{
- struct jptype__genericFault *ret = NULL;
- if (err) {
- ret = soap_malloc(soap,sizeof *ret);
- memset(ret,0,sizeof *ret);
- ret->code = err->code;
- ret->source = soap_strdup(soap,err->source);
- ret->text = soap_strdup(soap,strerror(err->code));
- ret->description = soap_strdup(soap,err->desc);
- ret->reason = jp2s_error(soap,err->reason);
- }
- return ret;
-}
-
-static void err2fault(const glite_jp_context_t ctx,struct soap *soap)
-{
- char *et;
- struct SOAP_ENV__Detail *detail = soap_malloc(soap,sizeof *detail);
- struct _genericFault *f = soap_malloc(soap,sizeof *f);
-
-
- f->jpelem__genericFault = jp2s_error(soap,ctx->error);
-
- detail->__type = SOAP_TYPE__genericFault;
-#if GSOAP_VERSION >= 20700
- detail->fault = f;
-#else
- detail->value = f;
-#endif
- detail->__any = NULL;
-
- soap_receiver_fault(soap,"Oh, shit!",NULL);
- if (soap->version == 2) soap->fault->SOAP_ENV__Detail = detail;
- else soap->fault->detail = detail;
-}
-
-/* deprecated
-static glite_jp_fileclass_t s2jp_fileclass(enum jptype__UploadClass class)
-{
- switch (class) {
- case INPUT_SANDBOX: return GLITE_JP_FILECLASS_INPUT;
- case OUTPUT_SANDBOX: return GLITE_JP_FILECLASS_OUTPUT;
- case JOB_LOG: return GLITE_JP_FILECLASS_LBLOG;
- default: return GLITE_JP_FILECLASS_UNDEF;
- }
-}
-*/
-
-static void s2jp_tag(const struct jptype__tagValue *stag,glite_jp_tagval_t *jptag)
-{
- memset(jptag,0,sizeof *jptag);
- jptag->name = strdup(stag->name);
- jptag->sequence = stag->sequence ? *stag->sequence : 0;
- jptag->timestamp = stag->timestamp ? *stag->timestamp : 0;
- if (stag->stringValue) jptag->value = strdup(stag->stringValue);
- else if (stag->blobValue) {
- jptag->binary = 1;
- jptag->size = stag->blobValue->__size;
- jptag->value = (char *) stag->blobValue->__ptr;
- }
-}
-
-#define CONTEXT_FROM_SOAP(soap,ctx) glite_jp_context_t ctx = (glite_jp_context_t) ((soap)->user)
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__RegisterJob(
- struct soap *soap,
- struct _jpelem__RegisterJob *in,
- struct _jpelem__RegisterJobResponse *empty)
-{
- CONTEXT_FROM_SOAP(soap,ctx);
- glite_jp_attrval_t owner_val[2];
-
- printf("%s %s %s\n",__FUNCTION__,in->job,in->owner);
- if (glite_jpps_authz(ctx,SOAP_TYPE___jpsrv__RegisterJob,in->job,in->owner) ||
- glite_jppsbe_register_job(ctx,in->job,in->owner))
- {
- err2fault(ctx,soap);
- return SOAP_FAULT;
- }
-
- owner_val[0].attr.type = GLITE_JP_ATTR_OWNER;
- owner_val[0].value.s = in->owner;
- owner_val[1].attr.type = GLITE_JP_ATTR_UNDEF;
-
-/* XXX: errrors should be ingored but not silently */
- glite_jpps_match_attr(ctx,in->job,owner_val);
-
- return SOAP_OK;
-}
-
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__StartUpload(
- struct soap *soap,
- struct _jpelem__StartUpload *in,
- struct _jpelem__StartUploadResponse *out)
-{
- CONTEXT_FROM_SOAP(soap,ctx);
- char *destination;
- time_t commit_before = in->commitBefore;
- glite_jp_error_t err;
- glite_jpps_fplug_data_t **pd = NULL;
- int i;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
-
- if (glite_jpps_authz(ctx,SOAP_TYPE___jpsrv__StartUpload,NULL,NULL)) {
- err2fault(ctx,soap);
- return SOAP_FAULT;
- }
-
- switch (glite_jpps_fplug_lookup(ctx,in->class_,&pd)) {
- case ENOENT:
- err.code = ENOENT;
- err.source = __FUNCTION__;
- err.desc = "unknown file class";
- glite_jp_stack_error(ctx,&err);
- err2fault(ctx,soap);
- return SOAP_FAULT;
- case 0: break;
- default:
- err2fault(ctx,soap);
- return SOAP_FAULT;
- }
-
- for (i=0; pd[0]->uris[i] && strcmp(pd[0]->uris[i],in->class_); i++);
- assert(pd[0]->uris[i]);
-
- if (glite_jppsbe_start_upload(ctx,in->job,pd[0]->classes[i],in->name,in->contentType,
- &destination,&commit_before))
- {
- err2fault(ctx,soap);
- free(pd);
- return SOAP_FAULT;
- }
-
- out->destination = soap_strdup(soap,destination);
- free(destination);
- out->commitBefore = commit_before;
-
- free(pd);
- return SOAP_OK;
-}
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__CommitUpload(
- struct soap *soap,
- struct _jpelem__CommitUpload *in,
- struct _jpelem__CommitUploadResponse *out)
-{
- CONTEXT_FROM_SOAP(soap,ctx);
- char *job,*class,*name;
-
- job = class = name = NULL;
-
- if (glite_jpps_authz(ctx,SOAP_TYPE___jpsrv__CommitUpload,NULL,NULL) ||
- glite_jppsbe_commit_upload(ctx,in->destination))
- {
- err2fault(ctx,soap);
- return SOAP_FAULT;
- }
-
- /* XXX: should not fail when commit_upload was OK */
- assert(glite_jppsbe_destination_info(ctx,in->destination,&job,&class,&name) == 0);
-
- /* XXX: ignore errors but don't fail silenty */
- glite_jpps_match_file(ctx,job,class,name);
-
- free(job); free(class); free(name);
-
- return SOAP_OK;
-}
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__RecordTag(
- struct soap *soap,
- struct _jpelem__RecordTag *in,
- struct _jpelem__RecordTagResponse *out)
-{
- CONTEXT_FROM_SOAP(soap,ctx);
- void *file_be,*file_p;
- glite_jpps_fplug_data_t **pd = NULL;
-
- glite_jp_tagval_t mytag;
-
- file_be = file_p = NULL;
-
- /* XXX: we assume just one plugin and also that TAGS plugin handles
- * just one uri/class */
-
- if (glite_jpps_fplug_lookup(ctx,GLITE_JP_FILETYPE_TAGS,&pd)
- || glite_jppsbe_open_file(ctx,in->jobid,pd[0]->classes[0],NULL,
- O_RDWR|O_CREAT,&file_be)
- /* XXX: tags need reading to check magic number */
- ) {
- free(pd);
- err2fault(ctx,soap);
- return SOAP_FAULT;
- }
-
- s2jp_tag(in->tag,&mytag);
-
- /* XXX: assuming tag plugin handles just one type */
- if (pd[0]->ops.open(pd[0]->fpctx,file_be,GLITE_JP_FILETYPE_TAGS,&file_p)
- || pd[0]->ops.generic(pd[0]->fpctx,file_p,GLITE_JP_FPLUG_TAGS_APPEND,&mytag))
- {
- err2fault(ctx,soap);
- if (file_p) pd[0]->ops.close(pd[0]->fpctx,file_p);
- glite_jppsbe_close_file(ctx,file_be);
- free(pd);
- return SOAP_FAULT;
- }
-
- if (pd[0]->ops.close(pd[0]->fpctx,file_p)
- || glite_jppsbe_close_file(ctx,file_be))
- {
- err2fault(ctx,soap);
- free(pd);
- return SOAP_FAULT;
- }
-
- /* XXX: ignore errors but don't fail silenty */
- glite_jpps_match_tag(ctx,in->jobid,&mytag);
-
- free(pd);
- return SOAP_OK;
-}
-
-extern char *glite_jp_default_namespace;
-
-/* XXX: should be public */
-#define GLITE_JP_TAGS_NAMESPACE "http://glite.org/services/jp/tags"
-
-static void s2jp_attr(const char *in,glite_jp_attr_t *out)
-{
- char *buf = strdup(in),*name = strchr(buf,':'),*ns = NULL;
-
- if (name) {
- ns = buf;
- *name++ = 0;
- }
- else {
- name = buf;
- ns = glite_jp_default_namespace;
- }
-
- memset(out,0,sizeof *out);
-
- if (strcmp(ns,glite_jp_default_namespace))
- out->type = strcmp(ns,GLITE_JP_TAGS_NAMESPACE) ?
- GLITE_JP_ATTR_GENERIC : GLITE_JP_ATTR_TAG;
- else {
- if (!strcmp(name,"owner")) out->type = GLITE_JP_ATTR_OWNER;
- else if (!strcmp(name,"time")) out->type = GLITE_JP_ATTR_OWNER;
-
- }
-
- if (out->type) {
- out->name = strdup(name);
- out->namespace = strdup(ns);
- }
-}
-
-static void s2jp_queryval(
- const char *in,
- glite_jp_attrtype_t type,
- union _glite_jp_query_rec_val *out)
-{
- switch (type) {
- case GLITE_JP_ATTR_OWNER:
- case GLITE_JP_ATTR_TAG:
- case GLITE_JP_ATTR_GENERIC:
- out->s = strdup(in);
- break;
- case GLITE_JP_ATTR_TIME:
- out->time.tv_sec = atoi(in);
- break;
- }
-}
-
-static void s2jp_query(const struct jptype__primaryQuery *in, glite_jp_query_rec_t *out)
-{
- s2jp_attr(in->attr,&out->attr);
-
- switch (in->op) {
- case EQUAL: out->op = GLITE_JP_QUERYOP_EQUAL; break;
- case UNEQUAL: out->op = GLITE_JP_QUERYOP_UNEQUAL; break;
- case LESS: out->op = GLITE_JP_QUERYOP_LESS; break;
- case GREATER: out->op = GLITE_JP_QUERYOP_GREATER; break;
- case WITHIN:
- out->op = GLITE_JP_QUERYOP_WITHIN;
- s2jp_queryval(in->value2,out->attr.type,&out->value2);
- break;
- }
-
- s2jp_queryval(in->value,out->attr.type,&out->value);
-}
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__FeedIndex(
- struct soap *soap,
- struct _jpelem__FeedIndex *in,
- struct _jpelem__FeedIndexResponse *out)
-{
-
-/* deferred processing: return feed_id to the index server first,
- * start feeding it afterwards -- not before the index server actually
- * knows feed_id and is ready to accept the feed.
- *
- * Has to be done within the same server slave,
- * passed through the context */
-
- CONTEXT_FROM_SOAP(soap,ctx);
- char *feed_id = NULL;
- time_t expires = 0;
- int ret = SOAP_OK;
-
- glite_jp_attr_t *attrs = calloc(in->__sizeattributes+1,sizeof *attrs);
- glite_jp_query_rec_t *qry = calloc(in->__sizeconditions+1,sizeof *qry);
- int i;
-
- glite_jp_clear_error(ctx);
-
- for (i = 0; i<in->__sizeattributes; i++) s2jp_attr(in->attributes[i],attrs+i);
- for (i = 0; i<in->__sizeconditions; i++) s2jp_query(in->conditions[i],qry+i);
-
- if (in->history) {
- if (glite_jpps_run_feed(ctx,in->destination,attrs,qry,&feed_id)) {
- err2fault(ctx,soap);
- ret = SOAP_FAULT;
- goto cleanup;
- }
- }
-
- if (in->continuous) {
- if (glite_jpps_register_feed(ctx,in->destination,attrs,qry,&feed_id,&expires)) {
- err2fault(ctx,soap);
- ret = SOAP_FAULT;
- goto cleanup;
- }
- }
-
- if (!in->history && !in->continuous) {
- glite_jp_error_t err;
- memset(&err,0,sizeof err);
- err.code = EINVAL;
- err.source = __FUNCTION__;
- err.desc = "at least one of <history> and <continous> must be true";
- glite_jp_stack_error(ctx,&err);
- err2fault(ctx,soap);
- ret = SOAP_FAULT;
- goto cleanup;
- }
-
- out->feedExpires = expires;
- out->feedId = soap_strdup(soap,feed_id);
-
-cleanup:
- free(feed_id);
- for (i=0; attrs[i].type; i++) free(attrs[i].name);
- free(attrs);
- for (i=0; qry[i].attr.type; i++) glite_jp_free_query_rec(qry+i);
- free(qry);
-
- return ret;
-}
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__FeedIndexRefresh(
- struct soap *soap,
- struct _jpelem__FeedIndexRefresh *in,
- struct _jpelem__FeedIndexRefreshResponse *out)
-{
- fprintf(stderr,"%s: not implemented\n",__FUNCTION__);
- abort();
-}
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__GetJob(
- struct soap *soap,
- struct _jpelem__GetJob *in,
- struct _jpelem__GetJobResponse *out)
-{
- CONTEXT_FROM_SOAP(soap,ctx);
- char *url;
-
- int i,n;
- glite_jp_error_t err;
- void **pd;
- struct jptype__jppsFile **f = NULL;
-
- memset(&err,0,sizeof err);
- out->__sizefiles = 0;
-
- for (pd = ctx->plugins; *pd; pd++) {
- glite_jpps_fplug_data_t *plugin = *pd;
-
- for (i=0; plugin->uris[i]; i++) {
- glite_jp_clear_error(ctx);
- switch (glite_jppsbe_get_job_url(ctx,in->jobid,plugin->classes[i],NULL,&url)) {
- case 0: n = out->__sizefiles++;
- f = realloc(f,out->__sizefiles * sizeof *f);
- f[n] = soap_malloc(soap, sizeof **f);
- f[n]->class_ = soap_strdup(soap,plugin->uris[i]);
- f[n]->name = NULL;
- f[n]->url = soap_strdup(soap,url);
- free(url);
- break;
- case ENOENT:
- break;
- default:
- err.code = ctx->error->code;
- err.source = "jpsrv__GetJob()";
- err.desc = plugin->uris[i];
- glite_jp_stack_error(ctx,&err);
- err2fault(ctx,soap);
- glite_jp_clear_error(ctx);
- return SOAP_FAULT;
- }
- }
- }
-
- if (!out->__sizefiles) {
- glite_jp_clear_error(ctx);
- err.code = ENOENT;
- err.source = __FUNCTION__;
- err.desc = "No file found for this job";
- glite_jp_stack_error(ctx,&err);
- err2fault(ctx,soap);
- glite_jp_clear_error(ctx);
- return SOAP_FAULT;
- }
-
- out->files = soap_malloc(soap,out->__sizefiles * sizeof *f);
- memcpy(out->files,f,out->__sizefiles * sizeof *f);
-
- return SOAP_OK;
-}
-
+++ /dev/null
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#include <glite/jp/types.h>
-#include "tags.h"
-#include "backend.h"
-
-/* magic name_len value_len binary sequence timestamp */
-#define HEADER "JP#TAG# %05u %012lu %c %05u %012lu#"
-#define HEADER_SIZE 48
-
-int glite_jpps_tag_append(
- glite_jp_context_t ctx,
- void *handle,
- const glite_jp_tagval_t *tag
-)
-{
- char hdr[HEADER_SIZE+1];
- glite_jp_error_t err;
-
- unsigned long vlen = tag->binary ? tag->size :
- (tag->value ? strlen(tag->value) : 0);
- int nlen;
-
- memset(&err,0,sizeof err);
- err.source = "glite_jpps_tag_append()";
-
- if (!tag->name) {
- err.code = EINVAL;
- err.desc = "tag name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- nlen = strlen(tag->name);
-
- assert(sprintf(hdr,HEADER,nlen,vlen,
- tag->binary ? "B" : "S",
- tag->sequence, tag->timestamp) == HEADER_SIZE);
-
- if (glite_jppsbe_append(ctx,handle,hdr,HEADER_SIZE)) {
- err.code = EIO;
- err.desc = "write tag header";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (glite_jppsbe_append(ctx,handle,tag->name,nlen)) {
- err.code = EIO;
- err.desc = "write tag name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (glite_jppsbe_append(ctx,handle,tag->value,vlen)) {
- err.code = EIO;
- err.desc = "write tag value";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-int glite_jpps_tagval_copy(
- glite_jp_context_t ctx,
- glite_jp_tagval_t *from,
- glite_jp_tagval_t *to
-)
-{
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- to->name = strdup(from->name);
- if (!to->name) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- to->sequence = from->sequence;
- to->timestamp = from->timestamp;
- to->binary = from->binary;
- to->size = from->size;
- to->value = (char *) malloc(to->size);
- if (!to->value) {
- free(to->name);
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- memcpy(from->value, to->value, to->size);
-
- return 0;
-}
-
-int glite_jpps_tag_read(
- glite_jp_context_t ctx,
- void *handle,
- off_t offset,
- glite_jp_tagval_t *tagvalue,
- size_t *shift
-)
-{
- char hdr[HEADER_SIZE+1];
- unsigned int nlen;
- unsigned long vlen;
- char binary;
- unsigned sequence;
- unsigned timestamp;
- char * name = NULL;
- char * value = NULL;
- ssize_t ret;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- hdr[HEADER_SIZE] = '\0';
- if (glite_jppsbe_pread(ctx, handle, hdr, HEADER_SIZE, offset, &ret)) {
- err.code = EIO;
- err.desc = "Cannot read tag header";
- goto error_out;
- }
- if (ret == 0) {
- err.code = ENOENT;
- err.desc = "No more tags in the file";
- goto error_out;
- }
- /* #define HEADER "JP#TAG# %05u %012lu %c %05u %012lu#" */
- if (sscanf(hdr, HEADER, &nlen, &vlen, &binary, &sequence, ×tamp) < 5) {
- err.code = EILSEQ;
- err.desc = "Incorrect tag header format";
- goto error_out;
- }
- name = (char*) malloc(nlen + 1);
- if (!name) {
- err.code = ENOMEM;
- goto error_out;
- }
- name[nlen] = '\0';
- value = (char*) malloc(vlen + 1);
- if (!value) {
- err.code = ENOMEM;
- goto error_out;
- }
- value[vlen] = '\0';
- if (glite_jppsbe_pread(ctx, handle, name, nlen, offset + HEADER_SIZE, &ret)) {
- err.code = EIO;
- err.desc = "Cannot read tag name";
- goto error_out;
- }
- if (glite_jppsbe_pread(ctx, handle, value, vlen, offset + HEADER_SIZE + nlen, &ret)) {
- err.code = EIO;
- err.desc = "Cannot read tag value";
- goto error_out;
- }
-
- tagvalue->name = name;
- tagvalue->sequence = sequence;
- tagvalue->timestamp = timestamp;
- tagvalue->binary = (binary == 'B') ? 1 : 0;
- tagvalue->size = vlen;
- tagvalue->value = value;
-
- *shift = HEADER_SIZE + nlen + vlen;
-
- return 0;
-error_out:
- free(name);
- free(value);
- return glite_jp_stack_error(ctx,&err);
-}
-
-/*
-int glite_jpps_tag_read(glite_jp_context_t, void *, off_t, glite_jp_tagval_t *, size_t);
-int glite_jpps_tag_readall(glite_jp_context_t, void *, glite_jp_tagval_t **);
-*/
-
-int glite_jpps_tag_readall(
- glite_jp_context_t ctx,
- void *handle,
- glite_jp_tagval_t **tags_out
-)
-{
- glite_jp_tagval_t * tags = NULL;
- void * newspace;
- int ntags = 0;
- int ntagspace = 0;
- off_t offset = 0;
- int ret;
- size_t shift;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- ntagspace = 1;
- tags = (glite_jp_tagval_t *) calloc(ntagspace + 1, sizeof(*tags));
- if (!tags) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- while (!(ret = glite_jpps_tag_read(ctx, handle, offset, &tags[ntags], &shift))) {
- offset += shift;
- ntags++;
- if (ntagspace <= ntags) {
- ntagspace += 1;
- newspace = realloc(tags, (ntagspace + 1) * sizeof(*tags));
- if (!newspace) {
- err.code = ENOMEM;
- goto error_out;
- }
- tags = (glite_jp_tagval_t *) newspace;
- }
- }
- if (ret == ENOENT) {
- *tags_out = tags;
- return 0;
- } else {
- err.code = EIO;
- err.desc = "Error reading tag value";
- }
-
-error_out:
- for (; ntags-- ;) {
- free(tags[ntags].name);
- free(tags[ntags].value);
- }
- free(tags);
- return glite_jp_stack_error(ctx,&err);
-}
+++ /dev/null
-int glite_jpps_tag_append(glite_jp_context_t,void *,const glite_jp_tagval_t *);
+++ /dev/null
-#include <stdlib.h>
-#include <assert.h>
-#include <stdarg.h>
-#include <string.h>
-#include <errno.h>
-#include <stdint.h>
-
-#include <glite/jp/types.h>
-
-#include "file_plugin.h"
-#include "builtin_plugins.h"
-
-static int tagappend(void *,void *,int,...);
-static int tagopen(void *,void *,const char *uri,void **);
-static int tagclose(void *,void *);
-
-#define TAGS_MAGIC 0x74c016f2 /* two middle digits encode version, i.e. 01 */
-
-static int tagdummy()
-{
- puts("tagdummy()");
- return -1;
-}
-
-struct tags_handle {
- void *bhandle;
- int n;
- glite_jp_tagval_t *tags;
-};
-
-int init(glite_jp_context_t ctx, glite_jpps_fplug_data_t *data)
-{
- data->fpctx = ctx;
-
- data->uris = calloc(2,sizeof *data->uris);
- data->uris[0] = strdup(GLITE_JP_FILETYPE_TAGS);
-
- data->classes = calloc(2,sizeof *data->classes);
- data->classes[0] = strdup("tags");
-
- data->ops.open = tagopen;
- data->ops.close = tagclose;
- data->ops.attr = tagdummy;
- data->ops.generic = tagappend;
-
- printf("tags_plugin: URI: \"%s\"; magic number: 0x%08lx\n",GLITE_JP_FILETYPE_TAGS,TAGS_MAGIC);
- return 0;
-}
-
-static int tagopen(void *fpctx,void *bhandle,const char *uri,void **handle)
-{
- struct tags_handle *h = calloc(1,sizeof *h);
- h->n = -1;
- h->bhandle = bhandle;
-
- *handle = h;
-
- return 0;
-}
-
-static int tagclose(void *fpctx,void *handle)
-{
- int i;
- struct tags_handle *h = handle;
-
- for (i=0; i<h->n; i++) {
- free(h->tags[i].name);
- free(h->tags[i].value);
- }
- free(h->tags);
- free(h);
-
- return 0;
-}
-
-static int tagappend(void *fpctx,void *handle,int oper,...)
-{
- glite_jp_tagval_t *tag;
- va_list ap;
- char *hdr,*rec;
- glite_jp_context_t ctx = fpctx;
- struct tags_handle *h = handle;
- uint32_t magic,hlen,rlen,rlen_n;
- size_t r;
- glite_jp_error_t err;
-
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
- glite_jp_clear_error(ctx);
-
- va_start(ap,oper);
- tag = va_arg(ap,glite_jp_tagval_t *);
- va_end(ap);
-
- printf("tagappend: %s,%d,%s\n",tag->name,tag->sequence,tag->value);
-
- assert(oper == GLITE_JP_FPLUG_TAGS_APPEND);
-
- if (glite_jppsbe_pread(ctx,h->bhandle,&magic,sizeof magic,0,&r)) {
- err.code = EIO;
- err.desc = "reading magic number";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (r == 0) {
- magic = htonl(TAGS_MAGIC);
- if (glite_jppsbe_pwrite(ctx,h->bhandle,&magic,sizeof magic,0)) {
- err.code = EIO;
- err.desc = "writing magic number";
- return glite_jp_stack_error(ctx,&err);
- }
- }
- else if (r != sizeof magic) {
- err.code = EIO;
- err.desc = "can't read magic number";
- return glite_jp_stack_error(ctx,&err);
- }
- else if (magic != htonl(TAGS_MAGIC)) {
- err.code = EINVAL;
- err.desc = "invalid magic number";
- return glite_jp_stack_error(ctx,&err);
- }
-
- trio_asprintf(&hdr,"%d %ld %c",tag->sequence,
- tag->timestamp,tag->binary ? 'B' : 'S');
-
- rlen = strlen(tag->name) + strlen(hdr) + 2 /* \0 after name and after hdr */ +
- (r = tag->binary ? tag->size : (tag->value ? strlen(tag->value) : 0));
-
- rlen_n = htonl(rlen);
-
- rec = malloc(rlen + sizeof rlen_n);
- *((uint32_t *) rec) = rlen_n;
- strcpy(rec + sizeof rlen_n,tag->name);
- strcpy(rec + (hlen = sizeof rlen_n + strlen(tag->name) + 1),hdr);
-
- if (r) memcpy(rec + hlen + strlen(hdr) + 1,tag->value,r);
- free(hdr);
-
- if (glite_jppsbe_append(ctx,h->bhandle,rec,rlen + sizeof rlen_n)) {
- err.code = EIO;
- err.desc = "writing tag record";
- free(rec);
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
+++ /dev/null
-jpsrv = http://glite.org/wsdl/services/jp
-jptype = http://glite.org/wsdl/types/jp
-jpelem = http://glite.org/wsdl/elements/jp
+++ /dev/null
-# defaults
-top_srcdir=.
-builddir=build
-top_builddir=${top_srcdir}/${builddir}
-stagedir=.
-distdir=.
-globalprefix=glite
-lbprefix=lb
-package=glite-jp-common
-version=0.0.0
-PREFIX=/opt/glite
-
-glite_location=/opt/glite
-globus_prefix=/opt/globus
-nothrflavour=gcc32
-thrflavour=gcc32pthr
-expat_prefix=/opt/expat
-ares_prefix=/opt/ares
-gsoap_prefix=/software/gsoap-2.6
-
-CC=gcc
-
--include Makefile.inc
-
-
-VPATH=${top_srcdir}/src:${top_srcdir}/test:${top_srcdir}/project:${jpproject}
-
-GLOBUSINC:= -I${globus_prefix}/include/${nothrflavour}
-
-
-DEBUG:=-g -O0
-CFLAGS:=${DEBUG} -I. -I${top_srcdir}/interface -I${stagedir}/include \
- ${GLOBUSINC}
-
-LINK:=libtool --mode=link ${CC} ${LDFLAGS} -rpath ${stagedir}/lib
-LINKXX:=libtool --mode=link ${CXX} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-COMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
-
-HDRS:=types.h context.h strmd5.h
-
-SRCS:=context.c strmd5.c attr.c
-OBJS:=${SRCS:.c=.lo}
-
-commonlib:= libglite_jp_common.la
-
-default all: compile
-
-compile: ${commonlib}
-
-${commonlib}: ${OBJS}
- ${LINK} -o $@ ${OBJS}
-
-check:
- -echo nothing yet
-
-doc:
-
-stage: compile
- $(MAKE) install PREFIX=${stagedir}
-
-install:
- -mkdir -p ${PREFIX}/include/${globalprefix}/${jpprefix}
- cd ${top_srcdir}/interface && install -m 644 ${HDRS} ${PREFIX}/include/${globalprefix}/${jpprefix}
- -mkdir -p ${PREFIX}/lib
- ${INSTALL} -m 755 ${commonlib} ${PREFIX}/lib
-
-dist: distsrc distbin
-
-# FIXME: just copied from LB
-distsrc:
- mkdir -p ${top_srcdir}/${package}-${version}
- cd ${top_srcdir} && GLOBIGNORE="${package}-${version}" && cp -Rf * ${package}-${version}
- cd ${top_srcdir} && tar -czf ${distdir}/${package}-${version}_src.tar.gz --exclude-from=project/tar_exclude ${package}-${version}
- rm -rf ${top_srcdir}/${package}-${version}
-
-distbin:
- $(MAKE) install PREFIX=`pwd`/tmpbuilddir${stagedir}
- save_dir=`pwd`; cd tmpbuilddir${stagedir} && tar -czf $$save_dir/${top_srcdir}/${distdir}/${package}-${version}_bin.tar.gz *; cd $$save_dir
- rm -rf tmpbuilddir
-
-clean:
-
-%.lo: %.c
- ${COMPILE} -o $@ -c $<
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Build file for the GLite JP Common module
-
- Authors: Ales Krenek <ljocha@ics.muni.cz>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.2 2004/11/22 13:36:42 dimeglio
- First version of this file
-
- Revision 1.1.1.1 2004/10/15 09:49:02 akrenek
--->
-
-<project name="common" default="dist">
-
- <!-- =========================================
- Builds the GLite JP Primary Module
- ========================================= -->
-
- <!-- =========================================
- Import properties (order is important)
- ========================================= -->
-
- <!-- import baseline & user properties -->
- <import file="../org.glite/project/baseline.properties.xml" />
-
- <!-- import component build properties,
- component properties &
- component common properties -->
- <import file="./project/properties.xml"/>
-
- <!-- import subsystem build properties,
- subsystem properties &
- subsystem common properties -->
- <import file="${subsystem.properties.file}"/>
-
- <!-- import global build properties &
- global properties -->
- <import file="${global.properties.file}" />
-
- <!-- =========================================
- Load dependency property files (order is important)
- ========================================= -->
- <property file="${user.dependencies.file}"/>
- <property file="${component.dependencies.file}" />
- <property file="${subsystem.dependencies.file}" />
- <property file="${global.dependencies.file}"/>
-
- <!-- =========================================
- Load configure options (order is important)
- ========================================= -->
- <import file="${global.configure.options.file}"/>
- <import file="${component.configure.options.file}"/>
-
- <!-- =========================================
- Import task definitions (order is important)
- ========================================= -->
- <import file="${subsystem.taskdefs.file}" />
- <import file="${global.taskdefs.file}" />
-
- <!-- =========================================
- Load common targets
- ========================================= -->
- <import file="${global.targets-simple_make.file}" />
-
- <!-- =========================================
- Load version file
- ========================================= -->
- <property file="${module.version.file}"/>
- <property file="${module.build.file}"/>
-
- <!-- ==============================================
- Local private targets
- ============================================== -->
-
- <target name="localinit"
- description="Module specific initialization tasks">
-
- <antcall target="lbmakefiles" />
- </target>
-
- <target name="localcompile"
- description="Module specific compile tasks">
- </target>
-
- <target name="localclean"
- description="Module specific cleaning tasks">
- </target>
-
-</project>
+++ /dev/null
-#ifndef __GLITE_JP_CONTEXT
-#define __GLITE_JP_CONTEXT
-
-int glite_jp_init_context(glite_jp_context_t *);
-void glite_jp_free_query_rec(glite_jp_query_rec_t *);
-
-char *glite_jp_peer_name(glite_jp_context_t);
-char *glite_jp_error_chain(glite_jp_context_t);
-
-int glite_jp_stack_error(glite_jp_context_t, const glite_jp_error_t *);
-int glite_jp_clear_error(glite_jp_context_t);
-
-int glite_jp_add_deferred(glite_jp_context_t,int (*)(glite_jp_context_t,void *),void *);
-int glite_jp_run_deferred(glite_jp_context_t);
-
-
-#endif
+++ /dev/null
-#ifndef _GLITE_STRMD5_H
-#define _GLITE_STRMD5_H
-
-#ident "$Header$"
-
-/* Compute MD5 sum of the first argument.
- * The sum is returned in the 16-byte array pointed to by 2nd argument
- * (if not NULL)
- *
- * Return value: ASCII string of the sum, i.e. 32 characters [0-9a-f]
- * (pointer to static area, changed by subsequent calls)
- */
-
-char *strmd5(const char *src, unsigned char *dst);
-
-/**
- * Returns: allocated 32bytes long ASCII string with md5 sum
- * of the first argument
- */
-char *str2md5(const char *src);
-
-/**
- * Returns: allocated 22bytes long ASCII string with md5 sum in base64
- * format of the source argument
- */
-char *str2md5base64(const char *src);
-
-#endif /* _GLITE_STRMD5_H */
+++ /dev/null
-#ifndef __GLITE_JP_TYPEPLUGIN
-#define __GLITE_JP_TYPEPLUGIN
-
-typedef struct _glite_jp_tplug_data_t {
-
- char *namespace;
- void *pctx;
-
-/** Compare attribute values.
- * \param[in] a value to compare
- * \param[in] b value to compare
- * \param[out] result like strcmp()
- * \param[out] err set if the values cannot be compared
- * \retval 0 OK
- * \retval other error
- */
- int (*cmp)(
- void *ctx,
- const glite_jp_attrval_t *a,
- const glite_jp_attrval_t *b,
- int *result);
-
-/** Convert to and from XML representation */
- char (*to_xml)(void *,const glite_jp_attrval_t *a);
- glite_jp_attrval_t (*from_xml)(void *,const char *,const char *);
-
-/** Convert to and from database string representation */
- char (*to_db)(void *,const glite_jp_attrval_t *a);
- glite_jp_attrval_t (*from_db)(void *,const char *);
-
-/** Query for database type.
- * Useful for db column dynamic creation etc.
- */
- const char (*db_type)(void *,const glite_jp_attr_t *);
-
-} glite_jp_tplug_data_t;
-
-/** Plugin init function.
- Must be called init, supposed to be called as many times as required
- for different param's (e.g. xsd files).
- */
-
-typedef int (*glite_jp_tplug_init_t)(
- glite_jp_context_t ctx,
- const char *param,
- glite_jp_tplug_data *plugin_data
-);
-
-#endif
+++ /dev/null
-#ifndef __GLITE_JP_TYPES
-#define __GLITE_JP_TYPES
-
-#include <sys/time.h>
-
-#define GLITE_JP_SYSTEM_NS "http://egee.cesnet.cz/en/WSDL/jp-system"
-#define GLITE_JP_ATTR_OWNER GLITE_JP_SYSTEM_NS ":owner"
-
-typedef struct _glite_jp_error_t {
- int code;
- const char *desc;
- const char *source;
- struct _glite_jp_error_t *reason;
-} glite_jp_error_t;
-
-typedef struct _glite_jp_context {
- glite_jp_error_t *error;
- int (**deferred_func)(struct _glite_jp_context *,void *);
- void **deferred_arg;
- void *feeds;
- struct soap *other_soap;
- char *peer;
- void **plugins;
- void *dbhandle;
- char **trusted_peers;
-} *glite_jp_context_t;
-
-typedef enum {
- GLITE_JP_ATTR_ORIG_ANY, /**< for queries: don't care about origin */
- GLITE_JP_ATTR_ORIG_SYSTEM, /**< JP internal, e.g. job owner */
- GLITE_JP_ATTR_ORIG_USER, /**< inserted by user explicitely */
- GLITE_JP_ATTR_ORIG_FILE /**< coming from uploaded file */
-} glite_jp_attr_orig_t;
-
-typedef struct {
- char *name; /**< including namespace */
- char *value;
- int binary; /**< value is binary */
- size_t size; /**< in case of binary value */
- glite_jp_attr_orig_t origin;
- char *origin_detail; /**< where it came from, i.e. file URI:name */
- time_t timestamp;
-} glite_jp_attrval_t;
-
-
-typedef enum {
- GLITE_JP_QUERYOP_UNDEF,
- GLITE_JP_QUERYOP_EQUAL,
- GLITE_JP_QUERYOP_UNEQUAL,
- GLITE_JP_QUERYOP_LESS,
- GLITE_JP_QUERYOP_GREATER,
- GLITE_JP_QUERYOP_WITHIN,
- GLITE_JP_QUERYOP__LAST,
-} glite_jp_queryop_t;
-
-typedef struct {
- char *attr;
- glite_jp_queryop_t op;
- char *value, *value2;
- int binary;
- size_t size,size2;
- glite_jp_attr_orig_t origin;
-} glite_jp_query_rec_t;
-
-void glite_jp_attrval_free(glite_jp_attrval_t *,int);
-
-#endif
+++ /dev/null
-module.build=36
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Configuration options for the gLite JP Common module
-
- Authors: Ales Krenek <ljocha@ics.muni.cz>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.2 2004/11/22 13:36:42 dimeglio
- First version of this file
-
- Revision 1.1.1.1 2004/10/15 09:49:02 akrenek
--->
-
- <!-- ======================================================
- Define extra properties here ...
- ====================================================== -->
-
- <project name="JP Common configuration options">
- <target name="lbmakefiles">
- <exec executable="ln" failonerror="true">
- <arg line="-fs ${component.dir}/Makefile ${module.build.dir}/Makefile"/>
- </exec>
- <echo file="${module.build.dir}/Makefile.inc">
-top_srcdir=..
-builddir=build
-stagedir=${stage.abs.dir}
-distdir=${dist.dir}
-globalprefix=${global.prefix}
-jpprefix=${subsystem.prefix}
-package=${module.package.name}
-PREFIX=${install.dir}
-version=${module.version}
-glite_location=${with.glite.location}
-globus_prefix=${with.globus.prefix}
-expat_prefix=${with.expat.prefix}
-gsoap_prefix=${with.gsoap.prefix}
-ares_prefix=${with.ares.prefix}
-thrflavour=${with.globus.thr.flavor}
-nothrflavour=${with.globus.nothr.flavor}
-cppunit=${with.cppunit.prefix}
-jpproject=${subsystem.project.dir}
-project=${component.project.dir}
- </echo>
- </target>
- </project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Common build properties file for the gLite JP Common component
-
- Authors: Ales Krenek <ljocha@ics.muni.cz>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.1.1.1 2004/10/15 09:49:02 akrenek
--->
-
-<project name="JP Common component common properties">
-
- <!-- Include build properties to allow overwriting
- of properties for subsystem -->
- <property file="project/build.properties" />
-
- <!-- ======================================================
- Define corresponding subsystem properties
- ====================================================== -->
-
- <!-- Subsystem name -->
- <property name="subsystem.name" value="${jp.subsystem.name}"/>
-
- <!-- Subsystem prefix -->
- <property name="subsystem.prefix" value="${jp.subsystem.prefix}"/>
-
- <!-- ======================================================
- Define component properties
- ====================================================== -->
-
- <!-- Component name prefix -->
- <property name="component.prefix" value="common" />
-
- <!-- ======================================================
- Define general component properties
- ====================================================== -->
-
- <import file="${component.general.properties.file}" />
-
- <!-- ======================================================
- Define extra properties here ...
- ====================================================== -->
-
-
-</project>
+++ /dev/null
-tar_exclude
-CVS
-build.xml
-build
-build.properties
-properties.xml
-configure.properties.xml
-.cvsignore
-.project
-.cdtproject
+++ /dev/null
-module.version=1.0.0
-module.age=1
+++ /dev/null
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "types.h"
-
-void glite_jp_attrval_free(glite_jp_attrval_t *a,int f)
-{
- free(a->name);
- free(a->value);
- free(a->origin_detail);
- if (f) free(a);
-}
+++ /dev/null
-#include <string.h>
-#include <stdlib.h>
-
-#include "types.h"
-#include "context.h"
-
-int glite_jp_init_context(glite_jp_context_t *ctx)
-{
- *ctx = calloc(1,sizeof **ctx);
-}
-
-char *glite_jp_peer_name(glite_jp_context_t ctx)
-{
- return strdup(ctx->peer ? ctx->peer : "unknown");
-}
-
-char *glite_jp_error_chain(glite_jp_context_t ctx)
-{
- char *ret = NULL,indent[300] = "";
- int len = 0,add;
- char buf[2000];
-
- glite_jp_error_t *ep = ctx->error;
-
- do {
- add = snprintf(buf,sizeof buf,"%s%s: %s (%s)\n",
- indent,
- ep->source,
- strerror(ep->code),
- ep->desc ? ep->desc : "");
- ret = realloc(ret,len + add + 1);
- strncpy(ret + len,buf,add); ret[len += add] = 0;
- strcat(indent," ");
- } while (ep = ep->reason);
-
- return ret;
-}
-
-int glite_jp_stack_error(glite_jp_context_t ctx, const glite_jp_error_t *err)
-{
- glite_jp_error_t *reason = ctx->error;
-
- ctx->error = calloc(1,sizeof *ctx->error);
- ctx->error->code = err->code;
- ctx->error->desc = err->desc ? strdup(err->desc) : NULL;
- ctx->error->source = err->source ? strdup(err->source) : NULL;
- ctx->error->reason = reason;
-
- return err->code;
-}
-
-int glite_jp_clear_error(glite_jp_context_t ctx)
-{
- glite_jp_error_t *e = ctx->error, *r;
-
- while (e) {
- r = e->reason;
- free((char *) e->source);
- free((char *) e->desc);
- free(e);
- e = r;
- }
- ctx->error = NULL;
- return 0;
-}
-
-
-void glite_jp_free_query_rec(glite_jp_query_rec_t *q)
-{
- free(q->attr);
- free(q->value);
- free(q->value2);
- memset(q,0,sizeof *q);
-}
-
-int glite_jp_queryrec_copy(glite_jp_query_rec_t *dst, const glite_jp_query_rec_t *src)
-{
- if (src->attr) dst->attr = strdup(src->attr);
- if (src->value) dst->value = strdup(src->value);
- if (src->value2) dst->value2 = strdup(src->value2);
- dst->op = src->op;
- dst->origin = src->origin;
- return 0;
-}
-
-int glite_jp_run_deferred(glite_jp_context_t ctx)
-{
- int i,cnt,ret;
-
- if (!ctx->deferred_func) return 0;
-
- glite_jp_clear_error(ctx);
- for (cnt=0;ctx->deferred_func[cnt];cnt++);
- for (i=0; i<cnt; i++) {
- if (ret = (*ctx->deferred_func)(ctx,*ctx->deferred_arg)) {
- glite_jp_error_t err;
- char desc[100];
-
- sprintf(desc,"calling func #%d, %p",i,*ctx->deferred_func);
- err.code = ret;
- err.desc = desc;
- err.source = "glite_jp_run_deferred()";
-
- glite_jp_stack_error(ctx,&err);
- return ret;
- }
- else {
- memmove(ctx->deferred_func,ctx->deferred_func+1,
- (cnt-i) * sizeof *ctx->deferred_func);
- memmove(ctx->deferred_arg,ctx->deferred_arg+1,
- (cnt-i) * sizeof *ctx->deferred_arg);
- }
- }
- free(ctx->deferred_func); ctx->deferred_func = NULL;
- free(ctx->deferred_arg); ctx->deferred_arg = NULL;
- return 0;
-}
-
-int glite_jp_add_deferred(
- glite_jp_context_t ctx,
- int (*func)(glite_jp_context_t, void *),
- void *arg
-)
-{
- int (**v)(glite_jp_context_t, void *) = ctx->deferred_func;
- int i;
-
- for (i=0; v && *v; i++);
-
- ctx->deferred_func = realloc(ctx->deferred_func, (i+1) * sizeof *ctx->deferred_func);
- ctx->deferred_func[i] = func;
- ctx->deferred_func[i+1] = NULL;
-
- ctx->deferred_arg = realloc(ctx->deferred_arg,(i+1) * sizeof *ctx->deferred_arg);
- ctx->deferred_arg[i] = arg;
- ctx->deferred_arg[i+1] = NULL;
-
- return 0;
-}
+++ /dev/null
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "lb/trio.h"
-
-#include "types.h"
-#include "type_plugin.h"
-
-static char *namespace = "http://glite.org/wsdl/types/jp_std_attr";
-
-static int check_namespace(const glite_jp_attr_t *a)
-{
- if (a->namespace && strcmp(a->namespace,namespace)) return -1;
- return 0;
-}
-
-static int *cmp(
- void *ctx,
- const glite_jp_attrval_t *a,
- const glite_jp_attrval_t *b,
- int *result
-{
- struct timeval t;
- int r;
-
- if (check_namespace(&a->attr) || check_namespace(&b->attr)) return -1;
- if (glite_jp_attr_cmp(&a->attr,&b->attr)) return -1;
-
- switch (a->attr.type) {
- case GLITE_JP_ATTR_OWNER:
- r = strcmp(a->value.s,b->value.s);
- break;
- case GLITE_JP_ATTR_TIME:
- t = a->value.time;
- t.tv_sec -= b->value.time.tv_sec;
- if ((t.tv_usec -= b->value.time.tv_usec) < 0) {
- t.tv_usec += 1000000;
- t.tv_sec--;
- }
- r = t.tv_sec ? t.tv_sec : t.tv_usec;
- if (r) r = r > 0 ? 1 : -1;
- break;
- case GLITE_JP_ATTR_TAG:
- if (a->value.tag.binary != b->value.tag.binary) return -1;
- if (a->value.tag.binary) {
- /* FIXME: I'm lazy. */
- abort();
- }
- else r = strcmp(a->value.tag.value,b->value.tag.value);
- default: return -1;
- }
- *result = r;
- return 0;
-}
-
-static char *to_xml(void *ctx,const glite_jp_attrval_t *a)
-{
- char *out = NULL;
-
- if (check_namespace(a)) return NULL;
-
- switch (a->attr.type) {
- case GLITE_JP_ATTR_OWNER:
- trio_asprintf(&out,"%|Xs",a->value.s);
- break;
- case GLITE_JP_ATTR_TIME:
- /* XXX */
- trio_asprintf(&out,"%ld.06%ld",a->value.time.tv_sec,
- a->value.time.tv_usec);
- break;
- case GLITE_JP_ATTR_TAG:
- /* FIXME */ assert(!a->value.tag.binary);
-
- trio_asprintf(&out,"<seq>%d</seq><timestamp>%ld></timestamp>%|Xs",a->value.tag.sequence,a->value.tag.timestamp,a->value.tag.value);
- break;
- default:
- break;
- }
- return out;
-}
-
-static glite_jp_attrval_t *from_xml(void *ctx,const char *name,const char *val)
-{
- /* FIXME: I'm lazy. */
- abort();
-}
-
-static char *to_db(void *ctx,const glite_jp_attrval_t *a)
-{
- /* FIXME: I'm lazy. */
- abort();
-}
-
-static glite_jp_attrval_t *from_db(void *ctx,const char *a)
-{
- /* FIXME: I'm lazy. */
- abort();
-}
-
-static const char *db_type(void *ctx,const glite_jp_attr_t *a)
-{
- if check_namespace(a) return NULL;
- switch (a->type) {
- case GLITE_JP_ATTR_OWNER: return "varchar(250) binary";
- case GLITE_JP_ATTR_TIME: return "datetime";
- case GLITE_JP_ATTR_TAG: return "mediumblob";
- default: return NULL;
- }
-}
-
-int init(
- glite_jp_context_t ctx,
- const char *param,
- glite_jp_tplug_data *pd
-)
-{
- pd->namespace = namespace;
- pd->cmp = cmp;
- pd->to_xml = to_xml;
- pd->from_xml = from_xml;
- pd->to_db = to_db;
- pd->from_db = from_db;
- pd->db_type = db_type;
- pd->pctx = ctx;
-}
-
+++ /dev/null
-#include <openssl/md5.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "strmd5.h"
-
-static char mbuf[33];
-
-static int base64_encode(const void *enc, int enc_size, char *out, int out_max_size)
-{
- static const char* b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
-
- unsigned char* enc_buf = (unsigned char*)enc;
- int out_size = 0;
- unsigned int bits = 0;
- unsigned int shift = 0;
-
- while ( out_size < out_max_size ) {
- if ( enc_size>0 ) {
- // Shift in byte
- bits <<= 8;
- bits |= *enc_buf;
- shift += 8;
- // Next byte
- enc_buf++;
- enc_size--;
- } else if ( shift>0 ) {
- // Pad last bits to 6 bits - will end next loop
- bits <<= 6 - shift;
- shift = 6;
- } else {
- // Terminate with Mime style '='
- *out = '=';
- out_size++;
-
- return out_size;
- }
-
- // Encode 6 bit segments
- while ( shift>=6 ) {
- shift -= 6;
- *out = b64[ (bits >> shift) & 0x3F ];
- out++;
- out_size++;
- }
- }
-
- // Output overflow
- return -1;
-}
-
-char *strmd5(const char *s, unsigned char *digest)
-{
- MD5_CTX md5;
- unsigned char d[16];
- int i;
-
- MD5_Init(&md5);
- MD5_Update(&md5,s,strlen(s));
- MD5_Final(d,&md5);
-
- if (digest) memcpy(digest,d,sizeof(d));
-
- for (i=0; i<16; i++) {
- int dd = d[i] & 0x0f;
- mbuf[2*i+1] = dd<10 ? dd+'0' : dd-10+'a';
- dd = d[i] >> 4;
- mbuf[2*i] = dd<10 ? dd+'0' : dd-10+'a';
- }
- mbuf[32] = 0;
- return (char *) mbuf;
-}
-
-char *str2md5(const char *s)
-{
- MD5_CTX md5;
- unsigned char d[16];
- char* ret = malloc(33);
- int i;
-
- if (!ret)
- return NULL;
-
- MD5_Init(&md5);
- MD5_Update(&md5, s, strlen(s));
- MD5_Final(d, &md5);
-
- for (i=0; i<16; i++) {
- int dd = d[i] & 0x0f;
- ret[2*i+1] = dd<10 ? dd+'0' : dd-10+'a';
- dd = d[i] >> 4;
- ret[2*i] = dd<10 ? dd+'0' : dd-10+'a';
- }
- ret[32] = 0;
- return ret;
-}
-
-char *str2md5base64(const char *s)
-{
- MD5_CTX md5;
- unsigned char d[16];
- char buf[50];
- int l;
-
- MD5_Init(&md5);
- MD5_Update(&md5, s, strlen(s));
- MD5_Final(d, &md5);
-
- l = base64_encode(d, 16, buf, sizeof(buf) - 1);
- if (l < 1)
- return NULL;
- buf[l - 1] = 0;
- return strdup(buf);
-}
+++ /dev/null
-# defaults
-top_srcdir=.
-builddir=build
-top_builddir=${top_srcdir}/${builddir}
-stagedir=.
-distdir=.
-globalprefix=glite
-lbprefix=lb
-package=glite-lb-server
-version=0.0.0
-PREFIX=/opt/glite
-
-glite_location=/opt/glite
-globus_prefix=/opt/globus
-nothrflavour=gcc32
-thrflavour=gcc32pthr
-expat_prefix=/opt/expat
-ares_prefix=/opt/ares
-gsoap_prefix=/software/gsoap-2.6
-
-CC=gcc
-
--include Makefile.inc
-
-
-VPATH=${top_srcdir}/src:${top_srcdir}/examples:${top_srcdir}/test:${top_srcdir}/project:${jpproject}
-
-GLOBUS_LIBS:=-L${globus_prefix}/lib \
- -lglobus_common_${nothrflavour} \
- -lglobus_gssapi_gsi_${nothrflavour}
-
-DEBUG:=-g -O0 -DDEBUG
-
-CFLAGS:=${DEBUG} -I. -I${gsoap_prefix}/include -I${stagedir}/include
-LDFLAGS:=-L${stagedir}/lib
-
-LINK:=libtool --mode=link ${CC} ${LDFLAGS}
-LINKXX:=libtool --mode=link ${CXX} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-
-
-daemon:=glite-jp-indexd
-example:=jpis-test
-soap_prefix:=jpis_
-
-SRCS:= simple_server.c soap_ops.c \
- ${soap_prefix}C.c \
- ${soap_prefix}Server.c
-
-EXA_SRCS:=jpis-test.c ${soap_prefix}C.c ${soap_prefix}Client.c
-
-
-OBJS:=${SRCS:.c=.o} stdsoap2.o
-EXA_OBJS:=${EXA_SRCS:.c=.o} stdsoap2.o
-
-COMMONLIB:=-lglite_jp_common
-
-default all: compile
-
-compile: ${daemon} ${example}
-
-${daemon}: ${OBJS}
- ${LINK} -o $@ ${OBJS} ${COMMONLIB} ${GLOBUS_LIBS}
-
-${example}: ${EXA_OBJS}
- ${LINK} -o $@ ${EXA_OBJS}
-
-JobProvenanceIS.xh: JobProvenanceIS.wsdl JobProvenanceTypes.wsdl typemap.dat
- cp ${jpproject}/JobProvenanceTypes.wsdl .
- ${gsoap_prefix}/bin/wsdl2h -t ${top_srcdir}/src/typemap.dat -c -o $@ $<
- rm -f JobProvenanceTypes.wsdl
-
-${soap_prefix}C.c ${soap_prefix}H.h: JobProvenanceIS.xh
- ${gsoap_prefix}/bin/soapcpp2 -w -c -p ${soap_prefix} JobProvenanceIS.xh
-
-#$(SOAP_PREFIX)H.h $(SOAP_PREFIX)C.c: LB.xh
-# $(GSOAP_BIN_PATH)/soapcpp2 -w -c -p $(SOAP_PREFIX) LB.xh
-#
-#LB.xh: LB.wsdl typemap.dat
-# $(GSOAP_BIN_PATH)/wsdl2h -c -o $@ LB.wsdl
-#
-
-
-check:
- -echo nothing yet
-
-doc:
-
-stage: compile
- ${INSTALL} -m 755 ${daemon} ${stagedir}/bin
-
-dist: distsrc distbin
-
-# FIXME: just copied from LB
-distsrc:
- mkdir -p ${top_srcdir}/${package}-${version}
- cd ${top_srcdir} && GLOBIGNORE="${package}-${version}" && cp -Rf * ${package}-${version}
- cd ${top_srcdir} && tar -czf ${distdir}/${package}-${version}_src.tar.gz --exclude-from=project/tar_exclude ${package}-${version}
- rm -rf ${top_srcdir}/${package}-${version}
-
-distbin:
- $(MAKE) install PREFIX=`pwd`/tmpbuilddir${stagedir}
- save_dir=`pwd`; cd tmpbuilddir${stagedir} && tar -czf $$save_dir/${top_srcdir}/${distdir}/${package}-${version}_bin.tar.gz *; cd $$save_dir
- rm -rf tmpbuilddir
-
-install:
- -mkdir -p ${PREFIX}/bin ${PREFIX}/etc ${PREFIX}/etc/init.d
- for p in bkserverd bkindex; do \
- ${INSTALL} -m 755 "glite_lb_$$p" "${PREFIX}/bin/glite-lb-$$p"; \
- done
-
- for f in dbsetup.sql index.conf.template; do \
- ${INSTALL} -m 644 ${top_srcdir}/config/"glite-lb-$$f" ${PREFIX}/etc; \
- done
-
- ${INSTALL} -m 755 ${top_srcdir}/config/startup ${PREFIX}/etc/init.d/glite-lb-bkserverd
-
-clean:
-
-soap_ops.o jpis-test.o simple_server.o: ${soap_prefix}H.h
-
-# we have no real config.h but have to force gSoap not to use
-# linux ftime with broken (aka obsolete) DST information
-
-stdsoap2.o: ${gsoap_prefix}/devel/stdsoap2.c
- test -f config.h || touch config.h
- @echo 'The following warning "time_t (de)serialization is not MT safe on this platform" is harmless'
- ${CC} -o $@ -c -DHAVE_CONFIG_H ${CFLAGS} ${gsoap_prefix}/devel/stdsoap2.c
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Build file for the gLite JP Index module
-
- Authors: Ales Krenek <ljocha@ics.muni.cz>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.2 2004/11/22 14:00:37 dimeglio
- Updated to use standard files
- Fixed names (was using common instead of real module name)
-
- Revision 1.1.1.1 2004/10/15 09:49:13 akrenek
--->
-
-<project name="index" default="dist">
-
- <!-- =========================================
- Builds the GLite JP Index Module
- ========================================= -->
-
- <!-- =========================================
- Import properties (order is important)
- ========================================= -->
-
- <!-- import baseline & user properties -->
- <import file="../org.glite/project/baseline.properties.xml" />
-
- <!-- import component build properties,
- component properties &
- component common properties -->
- <import file="./project/properties.xml"/>
-
- <!-- import subsystem build properties,
- subsystem properties &
- subsystem common properties -->
- <import file="${subsystem.properties.file}"/>
-
- <!-- import global build properties &
- global properties -->
- <import file="${global.properties.file}" />
-
- <!-- =========================================
- Load dependency property files (order is important)
- ========================================= -->
- <property file="${user.dependencies.file}"/>
- <property file="${component.dependencies.file}" />
- <property file="${subsystem.dependencies.file}" />
- <property file="${global.dependencies.file}"/>
-
- <!-- =========================================
- Load configure options (order is important)
- ========================================= -->
- <import file="${global.configure.options.file}"/>
- <import file="${component.configure.options.file}"/>
-
- <!-- =========================================
- Import task definitions (order is important)
- ========================================= -->
- <import file="${subsystem.taskdefs.file}" />
- <import file="${global.taskdefs.file}" />
-
- <!-- =========================================
- Load common targets
- ========================================= -->
- <import file="${global.targets-simple_make.file}" />
-
- <!-- =========================================
- Load version file
- ========================================= -->
- <property file="${module.version.file}"/>
- <property file="${module.build.file}"/>
-
- <!-- ==============================================
- Local private targets
- ============================================== -->
-
- <target name="localinit"
- description="Module specific initialization tasks">
-
- <antcall target="lbmakefiles" />
- </target>
-
- <target name="localcompile"
- description="Module specific compile tasks">
- </target>
-
- <target name="localclean"
- description="Module specific cleaning tasks">
- </target>
-
-</project>
+++ /dev/null
-<WSDL:definitions
- xmlns:tns="http://glite.org/wsdl/services/jp"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:jp="http://glite.org/wsdl/types/jp"
- xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- targetNamespace="http://glite.org/wsdl/services/jp"
- name="JobProvenance">
-
- <WSDL:types>
- <schema
- targetNamespace="http://glite.org/wsdl/types/jp"
- xmlns="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="unqualified" attributeFormDefault="unqualified">
- <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
-
- <simpleType name="Attribute">
- <restriction base="xsd:string">
- </restriction>
- </simpleType>
- <simpleType name="UploadClass">
- <restriction base="xsd:string">
- <enumeration value="INPUT-SANDBOX"/>
- <enumeration value="OUTPUT-SANDBOX"/>
- <enumeration value="JOB-LOG"/>
- </restriction>
- </simpleType>
- <simpleType name="QueryOp">
- <restriction base="xsd:string">
- <enumeration value="EQUAL"/>
- <enumeration value="UNEQUAL"/>
- <enumeration value="LESS"/>
- <enumeration value="GREATER"/>
- <enumeration value="WITHIN"/>
- </restriction>
- </simpleType>
- <complexType name="TagValue">
- <sequence>
- <element name="name" type="xsd:string" minOccurs="1" maxOccurs="1" nillable="true"/>
- <element name="sequence" type="xsd:int" minOccurs="0" maxOccurs="1"/>
- <element name="timestamp" type="xsd:dateTime" minOccurs="0" maxOccurs="1" nillable="true"/>
- <element name="stringValue" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
- <element name="blobValue" type="xsd:base64Binary" minOccurs="0" maxOccurs="1" nillable="true"/>
- </sequence>
- </complexType>
- <complexType name="Attributes">
- <sequence>
- <element name="item" type="jp:Attribute" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
- </sequence>
- </complexType>
- <complexType name="GenericJPFaultType">
- <sequence>
- <element name="source" type="xsd:string" minOccurs="1" maxOccurs="1"/>
- <element name="code" type="xsd:int" minOccurs="1" maxOccurs="1"/>
- <element name="text" type="xsd:string" minOccurs="1" maxOccurs="1"/>
- <element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- <element name="reason" type="jp:GenericJPFaultType" minOccurs="0" maxOccurs="1"/>
- </sequence>
- </complexType>
- <complexType name="PrimaryQueryElement">
- <sequence>
- <element name="attr" type="jp:Attribute" minOccurs="1" maxOccurs="1"/>
- <element name="op" type="jp:QueryOp" minOccurs="1" maxOccurs="1"/>
- <element name="value" type="xsd:string" minOccurs="1" maxOccurs="1"/>
- </sequence>
- </complexType>
- <complexType name="PrimaryQuery">
- <sequence>
- <element name="item" type="jp:PrimaryQueryElement" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- <complexType name="IndexQueryRecord">
- <sequence>
- <element name="op" type="jp:QueryOp" minOccurs="1" maxOccurs="1"/>
- <element name="value" type="xsd:string" minOccurs="1" maxOccurs="1"/>
- </sequence>
- </complexType>
- <complexType name="IndexQueryElement">
- <sequence>
- <element name="attr" type="jp:Attribute" minOccurs="1" maxOccurs="1"/>
- <element name="record" type="jp:IndexQueryRecord" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- <complexType name="IndexQuery">
- <sequence>
- <element name="item" type="jp:IndexQueryElement" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
- <complexType name="JobRecord">
- <sequence>
- <element name="jobid" type="xsd:string" minOccurs="1" maxOccurs="1"/>
- <element name="PSContact" type="xsd:string" minOccurs="1" maxOccurs="1"/>
- </sequence>
- </complexType>
- <complexType name="JobRecords">
- <sequence>
- <element name="record" type="jp:JobRecord" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="AttrUpdate">
- <sequence>
- <element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"/>
- <element name="value" type="xsd:string" minOccurs="0" maxOccurs="1"/>
- </sequence>
- </complexType>
- <complexType name="AttrUpdates">
- <sequence>
- <element name="item" type="jp:AttrUpdate" minOccurs="0" maxOccurs="unbounded" nillable="true"/>
- </sequence>
- </complexType>
- <complexType name="JobUpdate">
- <sequence>
- <element name="jobid" type="xsd:string" minOccurs="1" maxOccurs="1"/>
- <element name="attributes" type="jp:AttrUpdates" minOccurs="1" maxOccurs="1"/>
- <element name="tags" type="jp:AttrUpdates" minOccurs="1" maxOccurs="1"/>
- </sequence>
- </complexType>
- <complexType name="UpdateJobsData">
- <sequence>
- <element name="job" type="jp:JobUpdate" minOccurs="0" maxOccurs="unbounded"/>
- </sequence>
- </complexType>
-
- <complexType name="FeedIndexResponse">
- <sequence>
- <element name="feedId" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
- <element name="expires" type="xsd:dateTime" minOccurs="0" maxOccurs="1" nillable="true"/>
- </sequence>
- </complexType>
- <complexType name="GetJobResponse">
- <sequence>
- <element name="jobLog" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
- <element name="inputSandbox" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
- <element name="outputSandbox" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
- <element name="tags" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
- </sequence>
- </complexType>
- <complexType name="StartUploadResponse">
- <sequence>
- <element name="destination" type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true"/>
- <element name="commitBefore" type="xsd:dateTime" minOccurs="0" maxOccurs="1" nillable="true"/>
- </sequence>
- </complexType>
- <element name="GenericJPFault" type="jp:GenericJPFaultType"/>
- </schema>
- </WSDL:types>
- <message name="RegisterJobRequest">
- <part name="x" type="xsd:string"/>
- </message>
- <message name="StartUploadRequest">
- <part name="uclass" type="jp:UploadClass"/>
- <part name="commitTimeout" type="xsd:duration"/>
- <part name="contentType" type="xsd:string"/>
- </message>
- <message name="StartUploadResponse">
- <part name="destination" type="xsd:string"/>
- <part name="commitBefore" type="xsd:dateTime"/>
- </message>
- <message name="CommitUploadRequest">
- <part name="destination" type="xsd:string"/>
- </message>
- <message name="RecordTagRequest">
- <part name="jobid" type="xsd:string"/>
- <part name="tag" type="jp:TagValue"/>
- </message>
- <message name="FeedIndexRequest">
- <part name="destination" type="xsd:string"/>
- <part name="attributes" type="jp:Attributes"/>
- <part name="conditions" type="jp:PrimaryQuery"/>
- <part name="continuous" type="xsd:boolean"/>
- </message>
- <message name="FeedIndexResponse">
- <part name="feedId" type="xsd:string"/>
- <part name="expires" type="xsd:dateTime"/>
- </message>
- <message name="FeedIndexRefreshRequest">
- <part name="feedId" type="xsd:string"/>
- </message>
- <message name="GetJobRequest">
- <part name="jobid" type="xsd:string"/>
- </message>
- <message name="GetJobResponse">
- <part name="jobLog" type="xsd:string"/>
- <part name="inputSandbox" type="xsd:string"/>
- <part name="outputSandbox" type="xsd:string"/>
- <part name="tags" type="xsd:string"/>
- </message>
- <message name="GenericJPFault">
- <part name="fault" element="jp:GenericJPFault"/>
- </message>
- <message name="EmptyResponse"/>
- <portType name="JobProvenancePS_PortType">
- <operation name="RegisterJob">
- <documentation>Register job with JP primary storage.
-Job registration in LB is propagated to JP immediately so that JP is aware of the job,
-despite no furhter information is available in it.
-
-Input: JobId
-
-Output: N/A
-
-Faults: GenericJPFault
- </documentation>
- <input message="tns:RegisterJobRequest"/>
- <output message="tns:EmptyResponse"/>
- <fault name="f" message="tns:GenericJPFault"/>
- </operation>
- <operation name="StartUpload">
- <documentation>Initiate upload of of sandbox/dump of job life log from LB.
-WM component responsible for job sandbox management and LB server call JP to declare
-intention to upload intput/output sandbox and job life log.
-
-Input:
-
-uclass: type of the upload - INPUT_SANDBOX, OUTPUT_SANDBOX, JOB_LOG
-
-commitTimeout: upper limit on time for which JP waits for committing this upload transaction
-
-contentType: MIME type of the uploaded file
-
-Output:
-
-destination: URL where the client should upload the file
-
-commitBefore: acutual time when the upload transaction times out
-
-Faults: GenericJPFault
-
-
-Initiate upload of of sandbox/dump of job life log from LB.</documentation>
- <input message="tns:StartUploadRequest"/>
- <output message="tns:StartUploadResponse"/>
- <fault name="f" message="tns:GenericJPFault"/>
- </operation>
- <operation name="CommitUpload">
- <documentation>Confirm upload.
-Should be called after a file upload initiaded with StartUpload is finished.
-
-Input:
-
-destination: Upload destination URL (to match with the original request)
-
-Output:
-
-Faults: GenericJPFault
- </documentation>
- <input message="tns:CommitUploadRequest"/>
- <output message="tns:EmptyResponse"/>
- <fault name="f" message="tns:GenericJPFault"/>
- </operation>
- <operation name="RecordTag">
- <documentation>Record a value of user tag.
-JP tags are either standalone or override values of their LB counterparts.
-However, JP tag values are still distinguishable those inherited from LB.
-JP tags may be either strings or blobs.
-
-Input:
-
-jobid:
-
-tag: structure containing name, timestamp, optional sequence number to order tag values
-without relying on timestamps, and string or blob value.
-
-Output: N/A
-
-Faults: GenericJPFault
- </documentation>
- <input message="tns:RecordTagRequest"/>
- <output message="tns:EmptyResponse"/>
- <fault name="f" message="tns:GenericJPFault"/>
- </operation>
- <operation name="FeedIndex">
- <documentation>Start feeding JP index server.
-Called by the index server to start batch feed, and optionally also subscribe for incremental feed.
-
-JP index server subscribes with JP primary storage using a query
-containing conditions on primary metadata and a list of queryable attributes
-of the index server (i.e. data which should be sent to the index server).
-
-When a matching job record is created or modified within the primary storage
-the job record data are sent to the subscribed index server.
-
-The subscription is soft-state, it expires after certain time unless refreshed by the client explicitely.
-
-In the batch mode the query has the same form
-with additional flag asking for all matching records (i.e.\ not only
-arriving afterwards).
-
-Input:
-
-destination: where to send the job record data
-
-attributes: which job record attributes should be sent to the requesting index server
-
-conditions: list of query conditions. Each conditions has the form Attribute Operator Value,
-where Attribute is any of job record attributes and Operator is one of EQUAL, UNEQUAL, LESS, GREATER, WITHIN.
-
-continuous: flag determining that the query is incremental (not batch)
-
-Output:
-
-feedId: unique Id of the feed request, to be used in refresh, cancelation etc.
-
-expires: when the feed times out. Must be refreshed before this time.
-
-Faults: GenericJPFault
- </documentation>
- <input message="tns:FeedIndexRequest"/>
- <output message="tns:FeedIndexResponse"/>
- <fault name="f" message="tns:GenericJPFault"/>
- </operation>
- <operation name="FeedIndexRefresh">
- <documentation>Extend batch feed subscription (used by index server)
-
-Input: feedId returned previously by FeedIndex
-
-Output: the same as for FeedIndex
-
-Faults: GenericJPFault
- </documentation>
- <input message="tns:FeedIndexRefreshRequest"/>
- <output message="tns:FeedIndexResponse"/>
- <fault name="f" message="tns:GenericJPFault"/>
- </operation>
- <operation name="GetJob">
- <documentation>Retrieve job record URL's when jobid is known
-Used either to bypass JP index server query for this specific case, or after the index server query to
-retrieve actual job record.
-
-Input: jobid
-
-Output:
-
-jobLog, inputSandbox, outputSandbox, tags: URL's to components of the job record.
-
-Faults: GenericJPFault
- </documentation>
- <input message="tns:GetJobRequest"/>
- <output message="tns:GetJobResponse"/>
- <fault name="f" message="tns:GenericJPFault"/>
- </operation>
- </portType>
- <binding name="JobProvenancePS" type="tns:JobProvenancePS_PortType">
- <SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="RegisterJob">
- <SOAP:operation style="rpc"/>
- <input>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </input>
- <output>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </output>
- <fault name="f">
- <SOAP:fault name="f" use="literal"/>
- </fault>
- </operation>
- <operation name="StartUpload">
- <SOAP:operation style="rpc"/>
- <input>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </input>
- <output>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </output>
- <fault name="f">
- <SOAP:fault name="f" use="literal"/>
- </fault>
- </operation>
- <operation name="CommitUpload">
- <SOAP:operation style="rpc"/>
- <input>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </input>
- <output>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </output>
- <fault name="f">
- <SOAP:fault name="f" use="literal"/>
- </fault>
- </operation>
- <operation name="RecordTag">
- <SOAP:operation style="rpc"/>
- <input>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </input>
- <output>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </output>
- <fault name="f">
- <SOAP:fault name="f" use="literal"/>
- </fault>
- </operation>
- <operation name="FeedIndex">
- <SOAP:operation style="rpc"/>
- <input>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </input>
- <output>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </output>
- <fault name="f">
- <SOAP:fault name="f" use="literal"/>
- </fault>
- </operation>
- <operation name="FeedIndexRefresh">
- <SOAP:operation style="rpc"/>
- <input>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </input>
- <output>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </output>
- <fault name="f">
- <SOAP:fault name="f" use="literal"/>
- </fault>
- </operation>
- <operation name="GetJob">
- <SOAP:operation style="rpc"/>
- <input>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </input>
- <output>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </output>
- <fault name="f">
- <SOAP:fault name="f" use="literal"/>
- </fault>
- </operation>
- </binding>
- <service name="JobProvenancePS">
- <documentation>Job Provenance Primary Storage service</documentation>
- <port name="JobProvenancePS" binding="tns:JobProvenancePS">
- <SOAP:address location="http://localhost:10001"/>
- </port>
- </service>
-
- <message name="QueryJobsRequest">
- <part name="conditions" type="jp:IndexQuery"/>
- </message>
-
- <message name="QueryJobsResponse">
- <part name="jobs" type="jp:JobRecords"/>
- </message>
-
- <message name="UpdateJobsRequest">
- <part name="feedId" type="xsd:string"/>
- <part name="data" type="jp:UpdateJobsData"/>
- <part name="feedDone" type="xsd:boolean"/>
- </message>
-
- <portType name="JobProvenanceIS_PortType">
- <operation name="UpdateJobs">
- <documentation>Store or update information on jobs within the JP index server.
-Called directly by the primary storage, used for both batch and incremental feed.
-
-Input:
-
-data: list of job record updates. Each contains jobid, list of JP attribute values and user tag values.
-
-feedDone: flag indicating end of batch feed. (In order to avoid potential problems with buffer allocation
-the huge dataset of batch feed is split into reasonable chunks and delivered with more UpdateJobs calls.)
-
-Output: N/A
-
-Faults: GenericJPFault
-
-
- </documentation>
- <input message="tns:UpdateJobsRequest"/>
- <output message="tns:EmptyResponse"/>
- <fault name="f" message="tns:GenericJPFault"/>
- </operation>
- <operation name="QueryJobs">
- <documentation>Retrieve pointers to job records of jobs matching a query.
-Input: conditions - list of lists of query conditions.
- Elements of the inner lists refer to a single job attribute, the conditions are or-ed.
- Elements of the outer list may refer to different job attributes, they are and-ed.
-
-Output:
-
-jobs: list of JobId, PSContact (URL of the primary storage which manges this job) pairs
-
-Faults: GenericJPFault
- </documentation>
- <input message="tns:QueryJobsRequest"/>
- <output message="tns:QueryJobsResponse"/>
- <fault name="f" message="tns:GenericJPFault"/>
- </operation>
- </portType>
-
- <binding name="JobProvenanceIS" type="tns:JobProvenanceIS_PortType">
- <SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="UpdateJobs">
- <SOAP:operation style="rpc"/>
- <input>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </input>
- <output>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </output>
- <fault name="f">
- <SOAP:fault name="f" use="literal"/>
- </fault>
- </operation>
- <operation name="QueryJobs">
- <SOAP:operation style="rpc"/>
- <input>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </input>
- <output>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </output>
- <fault name="f">
- <SOAP:fault name="f" use="literal"/>
- </fault>
- </operation>
- </binding>
-
- <service name="JobProvenanceIS">
- <documentation>Job Provenance Index service</documentation>
- <port name="JobProvenanceIS" binding="tns:JobProvenanceIS">
- <SOAP:address location="http://localhost:10001"/>
- </port>
- </service>
-
-
-</WSDL:definitions>
+++ /dev/null
-module.build=9
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Configuration options for the gLite JP Index module
-
- Authors: Ales Krenek <ljocha@ics.muni.cz>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.2 2004/11/22 14:00:37 dimeglio
- Updated to use standard files
- Fixed names (was using common instead of real module name)
-
- Revision 1.1.1.1 2004/10/15 09:49:13 akrenek
--->
-
- <!-- ======================================================
- Define extra properties here ...
- ====================================================== -->
-
- <project name="JP Common configuration options">
- <target name="lbmakefiles">
- <exec executable="ln" failonerror="true">
- <arg line="-fs ${component.dir}/Makefile ${module.build.dir}/Makefile"/>
- </exec>
- <echo file="${module.build.dir}/Makefile.inc">
-top_srcdir=..
-builddir=build
-stagedir=${stage.abs.dir}
-distdir=${dist.dir}
-globalprefix=${global.prefix}
-lbprefix=${subsystem.prefix}
-package=${module.package.name}
-PREFIX=${install.dir}
-version=${module.version}
-glite_location=${with.glite.location}
-globus_prefix=${with.globus.prefix}
-expat_prefix=${with.expat.prefix}
-gsoap_prefix=${with.gsoap.prefix}
-ares_prefix=${with.ares.prefix}
-thrflavour=${with.globus.thr.flavor}
-nothrflavour=${with.globus.nothr.flavor}
-cppunit=${with.cppunit.prefix}
-jpproject=${subsystem.project.dir}
-project=${component.project.dir}
- </echo>
- </target>
- </project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Common build properties file for the gLite JP Index component
-
- Authors: Ales Krenek <ljocha@ics.muni.cz>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.1.1.1 2004/10/15 09:49:13 akrenek
--->
-
-<project name="JP Index component common properties">
-
- <!-- Include build properties to allow overwriting
- of properties for subsystem -->
- <property file="project/build.properties" />
-
- <!-- ======================================================
- Define corresponding subsystem properties
- ====================================================== -->
-
- <!-- Subsystem name -->
- <property name="subsystem.name" value="${jp.subsystem.name}"/>
-
- <!-- Subsystem prefix -->
- <property name="subsystem.prefix" value="${jp.subsystem.prefix}"/>
-
- <!-- ======================================================
- Define component properties
- ====================================================== -->
-
- <!-- Component name prefix -->
- <property name="component.prefix" value="index" />
-
- <!-- ======================================================
- Define general component properties
- ====================================================== -->
-
- <import file="${component.general.properties.file}" />
-
- <!-- ======================================================
- Define extra properties here ...
- ====================================================== -->
-
-
-</project>
+++ /dev/null
-tar_exclude
-CVS
-build.xml
-build
-build.properties
-properties.xml
-configure.properties.xml
-.cvsignore
-.project
-.cdtproject
+++ /dev/null
-module.version=1.0.0
-module.age=1
+++ /dev/null
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-
-#include "jpis_H.h"
-
-int main() {
- struct soap soap;
- int i, m, s; // master and slave sockets
-
- glite_jp_context_t ctx;
-
- soap_init(&soap);
- glite_jp_init_context(&ctx);
- soap.user = (void *) ctx;
-
- srand48(time(NULL)); /* feed id generation */
-
- m = soap_bind(&soap, NULL, 8902, 100);
- if (m < 0)
- soap_print_fault(&soap, stderr);
- else
- {
- fprintf(stderr, "Socket connection successful: master socket = %d\n", m);
- for (i = 1; ; i++) {
- s = soap_accept(&soap);
- if (s < 0) {
- soap_print_fault(&soap, stderr);
- break;
- }
- soap_serve(&soap); // process RPC request
- soap_destroy(&soap); // clean up class instances
- soap_end(&soap); // clean up everything and close socket
- glite_jp_run_deferred(ctx);
- }
- }
- soap_done(&soap); // close master socket
-
- return 0;
-}
+++ /dev/null
-#include <stdio.h>
-#include <fcntl.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-
-#include "jpis_H.h"
-#include "JobProvenanceIS.nsmap"
-
-static struct jptype__GenericJPFaultType *jp2s_error(struct soap *soap,
- const glite_jp_error_t *err)
-{
- struct jptype__GenericJPFaultType *ret = NULL;
- if (err) {
- ret = soap_malloc(soap,sizeof *ret);
- memset(ret,0,sizeof *ret);
- ret->code = err->code;
- ret->source = soap_strdup(soap,err->source);
- ret->text = soap_strdup(soap,strerror(err->code));
- ret->description = soap_strdup(soap,err->desc);
- ret->reason = jp2s_error(soap,err->reason);
- }
- return ret;
-}
-
-static void err2fault(const glite_jp_context_t ctx,struct soap *soap)
-{
- char *et;
- struct SOAP_ENV__Detail *detail = soap_malloc(soap,sizeof *detail);
- struct _GenericJPFault *f = soap_malloc(soap,sizeof *f);
-
-
- f->jptype__GenericJPFault = jp2s_error(soap,ctx->error);
-
- detail->__type = SOAP_TYPE__GenericJPFault;
- detail->value = f;
- detail->__any = NULL;
-
- soap_receiver_fault(soap,"Oh, shit!",NULL);
- if (soap->version == 2) soap->fault->SOAP_ENV__Detail = detail;
- else soap->fault->detail = detail;
-}
-
-static void s2jp_tag(const struct jptype__TagValue *stag,glite_jp_tagval_t *jptag)
-{
- memset(jptag,0,sizeof *jptag);
- jptag->name = strdup(stag->name);
- jptag->sequence = stag->sequence ? *stag->sequence : 0;
- jptag->timestamp = stag->timestamp ? *stag->timestamp : 0;
- if (stag->stringValue) jptag->value = strdup(stag->stringValue);
- else if (stag->blobValue) {
- jptag->binary = 1;
- jptag->size = stag->blobValue->__size;
- jptag->value = (char *) stag->blobValue->__ptr;
- }
-}
-
-#define CONTEXT_FROM_SOAP(soap,ctx) glite_jp_context_t ctx = (glite_jp_context_t) ((soap)->user)
-
-SOAP_FMAC5 int SOAP_FMAC6 jpsrv__UpdateJobs(
- struct soap *soap,
- char *feed_id,
- struct jptype__UpdateJobsData *jobs,
- enum xsd__boolean done
-)
-{
- printf("%s items %d jobid %s\n",__FUNCTION__,jobs->__sizejob,
- jobs->job[0]->jobid);
- return SOAP_OK;
-}
-
-SOAP_FMAC5 int SOAP_FMAC6 jpsrv__QueryJobs(
- struct soap *soap,
- struct jptype__IndexQuery *query,
- struct jpsrv__QueryJobsResponse *resp
-)
-{
- puts(__FUNCTION__);
- return SOAP_OK;
-}
-
+++ /dev/null
-jpsrv = http://glite.org/wsdl/services/jp
-jptype = http://glite.org/wsdl/types/jp
+++ /dev/null
-# defaults
-top_srcdir=.
-builddir=build
-top_builddir=${top_srcdir}/${builddir}
-stagedir=.
-distdir=.
-globalprefix=glite
-jpprefix=jp
-package=glite-jp-primary
-version=0.0.0
-PREFIX=/opt/glite
-
-glite_location=/opt/glite
-globus_prefix=/opt/globus
-nothrflavour=gcc32
-thrflavour=gcc32pthr
-expat_prefix=/opt/expat
-ares_prefix=/opt/ares
-gsoap_prefix=/software/gsoap-2.6
-
-CC=gcc
-
--include Makefile.inc
-
-
-VPATH=${top_srcdir}/src:${top_srcdir}/examples:${top_srcdir}/test:${top_srcdir}/project:${stagedir}/interface
-
-GLOBUS_LIBS:=-L${globus_prefix}/lib \
- -lglobus_common_${nothrflavour} \
- -lglobus_gssapi_gsi_${nothrflavour}
-
-GLOBUS_CFLAGS:=-I${globus_prefix}/include/${nothrflavour}
-
-DEBUG:=-g -O0 -DDEBUG
-
-CFLAGS:=${DEBUG} -I. -I${top_srcdir}/interface -I${top_srcdir}/src -I${gsoap_prefix}/include -I${stagedir}/include ${GLOBUS_CFLAGS} -I${mysql_prefix}/include -I${mysql_prefix}/include/mysql
-LDFLAGS:=-L${stagedir}/lib
-
-LINK:=libtool --mode=link ${CC} ${LDFLAGS}
-LTCOMPILE:=libtool --mode=compile ${CC} ${CFLAGS}
-SOLINK:=libtool --mode=link ${CC} -module ${LDFLAGS} -rpath ${stagedir}/lib
-LINKXX:=libtool --mode=link ${CXX} ${LDFLAGS}
-INSTALL:=libtool --mode=install install
-
-daemon:=glite-jp-primarystoraged
-example:=jpps-test
-ps_prefix:=jpps_
-is_prefix:=jpis_
-
-plugins:=glite-jp-tags.la
-
-HDRS_I=file_plugin.h
-HDRS_S=builtin_plugins.h backend.h
-
-SRCS:= bones_server.c soap_ops.c \
- new_ftp_backend.c mysql.c file_plugin.c \
- feed.c authz.c\
- is_client.c \
- ${ps_prefix}ServerLib.c \
- ${is_prefix}ClientLib.c jpps_C.c
-# env_C.c
-
-EXA_SRCS:=jpps-test.c ${ps_prefix}C.c ${ps_prefix}Client.c
-
-
-OBJS:=${SRCS:.c=.o}
-EXA_OBJS:=${EXA_SRCS:.c=.o}
-
-COMMONLIB:=-lglite_jp_common
-BONESLIB:=-lglite_lb_server_bones
-GSOAPLIB:=-lglite_security_gsoap_plugin_${nothrflavour} -lglite_security_gss_${nothrflavour} \
- -L${gsoap_prefix}/lib -lgsoap${GSOAP_DEBUG} -L${ares_prefix}/lib -lares
-TRIOLIB:=-lglite_lb_trio
-
-ifneq (${mysql_prefix},/usr)
- ifeq ($(shell echo ${mysql_version} | cut -d. -f1,2),4.1)
- MYSQLIB := -L${mysql_prefix}/lib/mysql -lmysqlclient
- else
- MYSQLIB := -L${mysql_prefix}/lib -lmysqlclient
- endif
-else
- MYSQLIB := -lmysqlclient
-endif
-
-default all: compile
-
-compile: ${daemon} ${example} ${plugins}
-
-${daemon}: ${OBJS}
- ${LINK} -o $@ -export-dynamic ${OBJS} ${BONESLIB} ${TRIOLIB} ${COMMONLIB} ${GSOAPLIB} ${GLOBUS_LIBS} ${MYSQLIB}
-
-${example}: ${EXA_OBJS}
- ${LINK} -o $@ ${EXA_OBJS} ${GSOAPLIB} ${GLOBUS_LIBS}
-
-# XXX: piss off
-JobProvenanceIS.xh:
- touch $@
-
-JobProvenancePS.xh: %.xh: %.wsdl JobProvenanceTypes.wsdl typemap.dat
- cp ${stagedir}/interface/JobProvenanceTypes.wsdl .
- ${gsoap_prefix}/bin/wsdl2h -t ${top_srcdir}/src/typemap.dat -c -o $@ $<
- rm -f JobProvenanceTypes.wsdl
-
-${ps_prefix}Client.c ${ps_prefix}ClientLib.c \
-${ps_prefix}Server.c ${ps_prefix}ServerLib.c \
-${ps_prefix}C.c ${ps_prefix}H.h: JobProvenancePS.xh
- ${gsoap_prefix}/bin/soapcpp2 -n -w -c -p ${ps_prefix} JobProvenancePS.xh
-
-${is_prefix}ClientLib.c ${is_prefix}Client.c \
-${is_prefix}C.c ${is_prefix}H.h: JobProvenanceIS.xh
- ${gsoap_prefix}/bin/soapcpp2 -n -w -c -p ${is_prefix} JobProvenanceIS.xh
-
-env_C.c env_Server.c:
- touch env.xh
- cp ${jpproject}/JobProvenanceTypes.wsdl .
- ${gsoap_prefix}/bin/wsdl2h -t ${top_srcdir}/src/typemap.dat -c -o env.xh JobProvenanceTypes.wsdl
- rm -f JobProvenanceTypes.wsdl
- ${gsoap_prefix}/bin/soapcpp2 -w -c -p env_ env.xh
-
-#$(SOAP_PREFIX)H.h $(SOAP_PREFIX)C.c: LB.xh
-# $(GSOAP_BIN_PATH)/soapcpp2 -w -c -p $(SOAP_PREFIX) LB.xh
-#
-#LB.xh: LB.wsdl typemap.dat
-# $(GSOAP_BIN_PATH)/wsdl2h -c -o $@ LB.wsdl
-#
-
-
-bones_server.o simple_server.o: ${is_prefix}H.h ${ps_prefix}H.h
-
-check:
- -echo nothing yet
-
-doc:
-
-stage: compile
- ${MAKE} PREFIX=${stagedir} DOSTAGE=yes install
-
-dist: distsrc distbin
-
-distsrc:
- mkdir -p ${top_srcdir}/${package}-${version}
- cd ${top_srcdir} && GLOBIGNORE="${package}-${version}" && cp -Rf * ${package}-${version}
- cd ${top_srcdir} && tar -czf ${distdir}/${package}-${version}_src.tar.gz --exclude-from=project/tar_exclude ${package}-${version}
- rm -rf ${top_srcdir}/${package}-${version}
-
-distbin:
- $(MAKE) install PREFIX=`pwd`/tmpbuilddir${stagedir}
- save_dir=`pwd`; cd tmpbuilddir${stagedir} && tar -czf $$save_dir/${top_srcdir}/${distdir}/${package}-${version}_bin.tar.gz *; cd $$save_dir
- rm -rf tmpbuilddir
-
-install:
- -mkdir -p ${PREFIX}/bin ${PREFIX}/etc ${PREFIX}/examples ${PREFIX}/etc/init.d
- ${INSTALL} -m 755 ${daemon} ${PREFIX}/bin
- ${INSTALL} -m 755 jpps-test ${PREFIX}/examples/glite-jp-primary-test
- if [ x${DOSTAGE} = xyes ]; then \
- mkdir -p ${PREFIX}/include/${globalprefix}/${jpprefix} ; \
- (cd ${top_srcdir}/interface && install -m 644 ${HDRS_I} ${PREFIX}/include/${globalprefix}/${jpprefix}) ; \
- (cd ${top_srcdir}/src && install -m 644 ${HDRS_S} ${PREFIX}/include/${globalprefix}/${jpprefix}) ; \
- fi
-
-
-clean:
-
-simple_server.o soap_ops.o jpps-test.o: ${ps_prefix}H.h
-
-# we have no real config.h but have to force gSoap not to use
-# linux ftime with broken (aka obsolete) DST information
-
-stdsoap2.o: ${gsoap_prefix}/devel/stdsoap2.c
- test -f config.h || touch config.h
- @echo 'The following warning "time_t (de)serialization is not MT safe on this platform" is harmless'
- ${CC} -o $@ -c -DWITH_NONAMESPACES -DHAVE_CONFIG_H ${CFLAGS} ${gsoap_prefix}/devel/stdsoap2.c
-
-
-glite-jp-tags.la: tags_plugin.lo
- ${SOLINK} -o $@ tags_plugin.lo
-
-%.lo: %.c
- ${LTCOMPILE} -o $@ -c $<
-
-soap_ops.o bones_server.o: soap_version.h
-
-soap_version.h:
- ${gsoap_prefix}/bin/soapcpp2 /dev/null
- perl -ne '$$. == 2 && /.*([0-9])\.([0-9])\.([0-9]).*/ && printf "#define GSOAP_VERSION %d%02d%02d\n",$$1,$$2,$$3' soapH.h >$@
- -rm soapC.cpp soapH.h soapStub.h soapClient.cpp soapServer.cpp soapClientLib.cpp soapServerLib.cpp
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Build file for the GLite JP Primary module
-
- Authors: Ales Krenek <ljocha@ics.muni.cz>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.3 2004/11/22 14:00:19 dimeglio
- Updated to use standard files
- Fixed names (was using common instead of real module name)
-
- Revision 1.2 2004/11/22 13:55:30 dimeglio
- First version of this file
- Use central subsystem definition
-
- Revision 1.1.1.1 2004/10/15 09:49:24 akrenek
--->
-
-<project name="primary" default="dist">
-
- <!-- =========================================
- Builds the gLite JP Primary Module
- ========================================= -->
-
- <!-- =========================================
- Import properties (order is important)
- ========================================= -->
-
- <!-- import baseline & user properties -->
- <import file="../org.glite/project/baseline.properties.xml" />
-
- <!-- import component build properties,
- component properties &
- component common properties -->
- <import file="./project/properties.xml"/>
-
- <!-- import subsystem build properties,
- subsystem properties &
- subsystem common properties -->
- <import file="${subsystem.properties.file}"/>
-
- <!-- import global build properties &
- global properties -->
- <import file="${global.properties.file}" />
-
- <!-- =========================================
- Load dependency property files (order is important)
- ========================================= -->
- <property file="${user.dependencies.file}"/>
- <property file="${component.dependencies.file}" />
- <property file="${subsystem.dependencies.file}" />
- <property file="${global.dependencies.file}"/>
-
- <!-- =========================================
- Load configure options (order is important)
- ========================================= -->
- <import file="${global.configure.options.file}"/>
- <import file="${component.configure.options.file}"/>
-
- <!-- =========================================
- Import task definitions (order is important)
- ========================================= -->
- <import file="${subsystem.taskdefs.file}" />
- <import file="${global.taskdefs.file}" />
-
- <!-- =========================================
- Load common targets
- ========================================= -->
- <import file="${global.targets-simple_make.file}" />
-
- <!-- =========================================
- Load version file
- ========================================= -->
- <property file="${module.version.file}"/>
- <property file="${module.build.file}"/>
-
- <!-- ==============================================
- Local private targets
- ============================================== -->
-
- <target name="localinit"
- description="Module specific initialization tasks">
-
- <antcall target="lbmakefiles" />
- </target>
-
- <target name="localcompile"
- description="Module specific compile tasks">
- </target>
-
- <target name="localclean"
- description="Module specific cleaning tasks">
- </target>
-
-</project>
+++ /dev/null
-create table jobs (
- jobid char(32) binary not null,
- dg_jobid varchar(255) binary not null,
- owner char(32) binary not null,
-
- reg_time datetime not null,
-
- primary key (jobid),
- unique (dg_jobid),
- index (owner),
- index (owner,reg_time)
-);
-
-create table files (
- jobid char(32) binary not null,
- filename varchar(255) binary not null,
- int_path mediumblob null,
- ext_url mediumblob null,
-
- state char(32) binary not null,
- deadline datetime null,
- ul_userid char(32) binary not null,
-
- primary key (jobid,filename),
- index (ext_url(255))
-);
-
-create table attrs (
- jobid char(32) binary not null,
- name varchar(255) binary not null,
- value mediumblob null,
-
- primary key (jobid,name)
-);
-
-create table users (
- userid char(32) binary not null,
- cert_subj varchar(255) binary not null,
-
- primary key (userid),
- unique (cert_subj)
-);
-
-create table backend_info (
- version char(32) binary not null
-);
+++ /dev/null
-Create database:
-----------------
-
-$ mysqladmin -u root -p create jpps
-$ mysql -u root -p
-mysql> grant all privileges on jpps.* to jpps@localhost identified by '';
-
-$ mysql -p -u jpps jpps <config/glite-jp-primary-dbsetup.sql
-
-
-Start server:
--------------
-
-$ glite-jp-primarystoraged -P .libs/glite-jp-tags.so -BI,/INTERNAL/PATH -BE,ftp://`hostname`/EXT/PREFIX -a trusted_peers
-
-/INTENAL/PATH points to the directory where JP files are stored
-
-/EXT/PREFIX prefix in URLs to manipulate with these files -- ftp should be
-configured to map ftp://`hostname`/EXT/PREFIX/file to
-
-trusted_peers line-by-line list of X509 subjects to be considered "trusted",
- i.e. services (like LB) we accept data from
-
-
-
-Register job:
--------------
-
-$ jpps-test RegisterJob JOBID OWNER
-
-Returns:
-- OK
-- File exists (Job already registered)
-- Operation not permitted (you are not a trusted peer)
-
-
-Record JP tag:
---------------
-
-$ jpps-test RecordTag JPBID TagA 1 blah
+++ /dev/null
-#include <stdio.h>
-#include <sysexits.h>
-#include <string.h>
-#include <assert.h>
-
-#include "glite/security/glite_gsplugin.h"
-
-#include "jpps_H.h"
-#include "jpps_.nsmap"
-
-#include "jptype_map.h"
-
-#include "soap_version.h"
-#if GSOAP_VERSION <= 20602
-#define soap_call___jpsrv__RegisterJob soap_call___ns1__RegisterJob
-#define soap_call___jpsrv__StartUpload soap_call___ns1__StartUpload
-#define soap_call___jpsrv__CommitUpload soap_call___ns1__CommitUpload
-#define soap_call___jpsrv__RecordTag soap_call___ns1__RecordTag
-#define soap_call___jpsrv__FeedIndex soap_call___ns1__FeedIndex
-#define soap_call___jpsrv__FeedIndexRefresh soap_call___ns1__FeedIndexRefresh
-#define soap_call___jpsrv__GetJob soap_call___ns1__GetJob
-#endif
-
-
-static void usage(const char *me)
-{
- fprintf(stderr,"%s: [-s server-url] operation args \n\n"
- " operations are:\n"
- " RegisterJob jobid owner\n"
- " StartUpload jobid class commit_before mimetype\n"
- " CommitUpload destination\n"
- " RecordTag jobid tagname sequence stringvalue\n"
- " GetJob jobid\n"
- " FeedIndex destination query_number history continuous\n"
- " FeedIndexRefresh feedid\n"
- ,me);
-
- exit (EX_USAGE);
-}
-
-static int check_fault(struct soap *soap,int err) {
- struct SOAP_ENV__Detail *detail;
- struct jptype__genericFault *f;
- char *reason,indent[200] = " ";
-
- switch(err) {
- case SOAP_OK: puts("OK");
- break;
- case SOAP_FAULT:
- case SOAP_SVR_FAULT:
- if (soap->version == 2) {
- detail = soap->fault->SOAP_ENV__Detail;
- reason = soap->fault->SOAP_ENV__Reason;
- }
- else {
- detail = soap->fault->detail;
- reason = soap->fault->faultstring;
- }
- fputs(reason,stderr);
- putc('\n',stderr);
- assert(detail->__type == SOAP_TYPE__genericFault);
-#if GSOAP_VERSION >=20700
- f = ((struct _genericFault *) detail->fault)
-#else
- f = ((struct _genericFault *) detail->value)
-#endif
- -> jpelem__genericFault;
-
- while (f) {
- fprintf(stderr,"%s%s: %s (%s)\n",indent,
- f->source,f->text,f->description);
- f = f->reason;
- strcat(indent," ");
- }
- return -1;
-
- default: soap_print_fault(soap,stderr);
- return -1;
- }
- return 0;
-}
-
-/* FIXME: new wsdl */
-#if 0
-static struct jptype__Attribute sample_attr[] = {
- { OWNER, NULL },
- { TIME, "submitted" },
- { TAG, "test" },
-};
-
-static struct jptype__PrimaryQueryElement sample_query[][5] = {
- {
- { sample_attr+OWNER, EQUAL, "unknown", NULL },
- { NULL, 0, NULL, NULL }
- },
-};
-#endif
-
-int main(int argc,char *argv[])
-{
- char *server = "http://localhost:8901";
- int opt;
- struct soap *soap = soap_new();
-
- if (argc < 2) usage(argv[0]);
-
- soap_init(soap);
- soap_set_namespaces(soap, jpps__namespaces);
-
- soap_register_plugin(soap,glite_gsplugin);
-
- while ((opt = getopt(argc,argv,"s:")) >= 0) switch (opt) {
- case 's': server = optarg;
- argv += 2;
- break;
- case '?': usage(argv[0]);
- }
-
- if (!strcasecmp(argv[1],"RegisterJob")) {
- struct _jpelem__RegisterJob in;
- struct _jpelem__RegisterJobResponse empty;
-
- if (argc != 4) usage(argv[0]);
- in.job = argv[2];
- in.owner = argv[3];
- check_fault(soap,
- soap_call___jpsrv__RegisterJob(soap,server,"",&in,&empty));
- } else if (!strcasecmp(argv[1], "StartUpload")) {
- struct _jpelem__StartUpload in;
- struct _jpelem__StartUploadResponse out;
-
- in.job = argv[2];
- in.class_ = argv[3];
- in.name = NULL;
- in.commitBefore = atoi(argv[4]) + time(NULL);
- in.contentType = argv[5];
-
- if (argc != 6) usage(argv[0]);
- if (!check_fault(soap,
- soap_call___jpsrv__StartUpload(soap, server, "",&in,&out)))
- {
- printf("Destination: %s\nCommit before: %s\n", out.destination, ctime(&out.commitBefore));
- }
- } else if (!strcasecmp(argv[1], "CommitUpload")) {
- struct _jpelem__CommitUpload in;
- struct _jpelem__CommitUploadResponse empty;
-
- in.destination = argv[2];
-
- if (argc != 3) usage(argv[0]);
- if (!check_fault(soap,
- soap_call___jpsrv__CommitUpload(soap, server, "",&in,&empty))) {
- /* OK */
- }
- } else if (!strcasecmp(argv[1], "RecordTag")) {
- struct _jpelem__RecordTag in;
- struct _jpelem__RecordTagResponse empty;
- struct jptype__tagValue tagval;
-
- int seq = 0;
-
- if (argc != 6) usage(argv[0]);
-
- in.jobid = argv[2];
- in.tag = &tagval;
- tagval.name = argv[3];
- seq = atoi(argv[4]);
- tagval.sequence = &seq;
- tagval.timestamp = NULL;
- tagval.stringValue = argv[5];
- tagval.blobValue = NULL;
-
- if (!check_fault(soap,
- soap_call___jpsrv__RecordTag(soap, server, "",&in, &empty))) {
- /* OK */
- }
- }
-/* FIXME: new wsdl */
-#if 0
- else if (!strcasecmp(argv[1],"FeedIndex")) {
- struct jpsrv__FeedIndexResponse r;
- struct jptype__Attribute *ap[2];
- struct jptype__Attributes attr = { 2, ap };
- struct jptype__PrimaryQueryElement *qp[100];
- struct jptype__PrimaryQuery qry = { 0, qp };
-
- int i,j,qi = atoi(argv[3])-1;
-
- if (argc != 6) usage(argv[0]);
-
- for (i=0; i<attr.__sizeitem; i++) ap[i] = sample_attr+i;
-
- for (i=0; sample_query[qi][i].attr; i++)
- qp[i] = &sample_query[qi][i];
- qry.__sizeitem = i;
-
- if (!check_fault(soap,soap_call_jpsrv__FeedIndex(soap,server,"",
- argv[2],&attr,&qry,!strcasecmp(argv[4],"true"),
- !strcasecmp(argv[5],"true"),
- &r)))
- {
- printf("FeedId: %s\nExpires: %s\n",r.feedId,ctime(&r.expires));
- }
- } else if (!strcasecmp(argv[1], "FeedIndexRefresh")) {
- struct jpsrv__FeedIndexRefreshResponse r;
-
- if (argc != 3) usage(argv[0]);
- if (!check_fault(soap,
- soap_call_jpsrv__FeedIndexRefresh(soap, server, "",
- argv[2], &r))) {
- printf("FeedId: %s\nExpires: %s\n",r.feedId,ctime(&r.expires));
- }
- }
-#endif
- else if (!strcasecmp(argv[1],"GetJob")) {
- struct _jpelem__GetJob in;
- struct _jpelem__GetJobResponse out;
-
- if (argc != 3) usage(argv[0]);
- in.jobid = argv[2];
-
- if (!check_fault(soap,soap_call___jpsrv__GetJob(soap,server,"",
- &in,&out)))
- {
- int i;
-
- printf("JobLog:\n");
-
- for (i=0; i<out.__sizefiles;i++) {
- printf("\tclass = %s, name = %s, url = %s\n",
- out.files[i]->class_,
- out.files[i]->name,
- out.files[i]->url);
- }
- }
-
- }
- else usage(argv[0]);
-
- return 0;
-}
-
-
-/* XXX: we don't use it */
-SOAP_NMAC struct Namespace namespaces[] = { {NULL,NULL} };
+++ /dev/null
-#ifndef __GLITE_JP_FILEPLUGIN
-#define __GLITE_JP_FILEPLUGIN
-
-/** Methods of the file plugin. */
-
-typedef struct _glite_jpps_fplug_op_t {
-
-/** Open a file.
-\param[in] fpctx Context of the plugin, returned by its init.
-\param[in] bhandle Handle of the file via JPPS backend.
-\param[in] uri URI (type) of the opened file.
-\param[out] handle Handle to the opened file structure, to be passed to other plugin functions.
-*/
- int (*open)(void *fpctx,void *bhandle,const char *uri,void **handle);
-
-/** Close the file. Free data associated to a handle */
- int (*close)(void *fpctx,void *handle);
-
-/** Retrieve value(s) of an attribute.
-\param[in] fpctx Plugin context.
-\param[in] handle Handle of the opened file.
-\param[in] attr Queried attribute.
-\param[out] attrval GLITE_JP_ATTR_UNDEF-terminated list of value(s) of the attribute.
- If there are more and there is an interpretation of their order
- they must be sorted, eg. current value of tag is the last one.
-\retval 0 success
-\retval ENOSYS this attribute is not defined by this type of file
-\retval ENOENT no value is present
-*/
- int (*attr)(void *fpctx,void *handle,const char *attr,glite_jp_attrval_t **attrval);
-
-/** File type specific operation.
-\param[in] fpctx Plugin context.
-\param[in] handle Handle of the opened file.
-\param[in] oper Code of the operation, specific for a concrete plugin.
-*/
- int (*generic)(void *fpctx,void *handle,int oper,...);
-
-} glite_jpps_fplug_op_t;
-
-/** Data describing a plugin. */
-typedef struct _glite_jpps_fplug_data_t {
- void *fpctx; /**< Context passed to plugin operations. */
- char **uris; /**< NULL-terminated list of file types (URIs)
- handled by the plugin. */
- char **classes; /**< The same as uris but filesystem-friendly
- (can be used to construct file names).*/
- char **namespaces; /**< Which attribute namespaces this plugin handles. */
-
- glite_jpps_fplug_op_t ops; /**< Plugin operations. */
-} glite_jpps_fplug_data_t;
-
-/** Initialisation function of the plugin.
- Called after dlopen(), must be named "init".
-\param[in] ctx JPPS context
-\param[out] data filled-in plugin data
-*/
-
-typedef int (*glite_jpps_fplug_init_t)(
- glite_jp_context_t ctx,
- glite_jpps_fplug_data_t *plugin_data
-);
-
-
-
-
-/* XXX: not really public interface follows */
-
-int glite_jpps_fplug_load(glite_jp_context_t ctx,int argc,char **argv);
-int glite_jpps_fplug_lookup(glite_jp_context_t ctx,const char *uri, glite_jpps_fplug_data_t ***plugin_data);
-int glite_jpps_fplug_lookup_byclass(glite_jp_context_t, const char *class,glite_jpps_fplug_data_t ***plugin_data,char **uri);
-
-#endif
+++ /dev/null
-module.build=36
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Configuration options for the gLite JP Primary module
-
- Authors: Ales Krenek <ljocha@ics.muni.cz>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.3 2004/11/22 13:55:30 dimeglio
- First version of this file
- Use central subsystem definition
-
- Revision 1.2 2004/10/15 12:19:28 akrenek
- build with gsoap 2.7 too
-
- Revision 1.1.1.1 2004/10/15 09:49:24 akrenek
--->
-
- <!-- ======================================================
- Define extra properties here ...
- ====================================================== -->
-
- <project name="LB Common configuration options">
- <target name="lbmakefiles">
- <exec executable="ln" failonerror="true">
- <arg line="-fs ${component.dir}/Makefile ${module.build.dir}/Makefile"/>
- </exec>
- <echo file="${module.build.dir}/Makefile.inc">
-top_srcdir=..
-builddir=build
-stagedir=${stage.abs.dir}
-distdir=${dist.dir}
-globalprefix=${global.prefix}
-lbprefix=${subsystem.prefix}
-package=${module.package.name}
-PREFIX=${install.dir}
-version=${module.version}
-glite_location=${with.glite.location}
-globus_prefix=${with.globus.prefix}
-expat_prefix=${with.expat.prefix}
-ares_prefix=${with.ares.prefix}
-gsoap_prefix=${with.gsoap.prefix}
-mysql_prefix=${with.mysql.prefix}
-mysql_version=${ext.mysql.version}
-thrflavour=${with.globus.thr.flavor}
-nothrflavour=${with.globus.nothr.flavor}
-cppunit=${with.cppunit.prefix}
-jpproject=${subsystem.project.dir}
-project=${component.project.dir}
- </echo>
- </target>
- </project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Common build properties file for the gLite JP Primary component
-
- Authors: Ales Krenek <ljocha@ics.muni.cz>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
--->
-
-<project name="JP Primary component common properties">
-
- <!-- Include build properties to allow overwriting
- of properties for subsystem -->
- <property file="project/build.properties" />
-
- <!-- ======================================================
- Define corresponding subsystem properties
- ====================================================== -->
-
- <!-- Subsystem name -->
- <property name="subsystem.name" value="${jp.subsystem.name}"/>
-
- <!-- Subsystem prefix -->
- <property name="subsystem.prefix" value="${jp.subsystem.prefix}"/>
-
- <!-- ======================================================
- Define component properties
- ====================================================== -->
-
- <!-- Component name prefix -->
- <property name="component.prefix" value="primary" />
-
- <!-- ======================================================
- Define general component properties
- ====================================================== -->
-
- <import file="${component.general.properties.file}" />
-
- <!-- ======================================================
- Define extra properties here ...
- ====================================================== -->
-
-
-</project>
+++ /dev/null
-tar_exclude
-CVS
-build.xml
-build
-build.properties
-properties.xml
-configure.properties.xml
-.cvsignore
-.project
-.cdtproject
+++ /dev/null
-module.version=1.0.0
-module.age=1
+++ /dev/null
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <assert.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-
-#include "jpps_H.h"
-#include "jptype_map.h"
-
-int glite_jpps_authz(glite_jp_context_t ctx,int op,const char *job,const char *owner)
-{
- glite_jp_error_t err;
- char buf[200];
- int i;
-
- memset(&err,0,sizeof err);
- glite_jp_clear_error(ctx);
- err.source = __FUNCTION__;
- err.code = EPERM;
-
- switch (op) {
- case SOAP_TYPE___jpsrv__RegisterJob:
- case SOAP_TYPE___jpsrv__StartUpload:
- case SOAP_TYPE___jpsrv__CommitUpload:
- for (i=0; ctx->trusted_peers && ctx->trusted_peers[i]; i++)
- if (!strcmp(ctx->trusted_peers[i],ctx->peer)) return 0;
- err.desc = "you are not a trusted peer";
- return glite_jp_stack_error(ctx,&err);
-
- case SOAP_TYPE___jpsrv__GetJobFiles:
- case SOAP_TYPE___jpsrv__GetJobAttributes:
- assert(owner);
- return strcmp(owner,ctx->peer) ? glite_jp_stack_error(ctx,&err) : 0;
- break;
-
- default:
- snprintf(buf,sizeof buf,"%d: unknown operation",op);
- err.desc = buf;
- err.code = EINVAL;
- return glite_jp_stack_error(ctx,&err);
- }
-}
-
-int glite_jpps_readauth(glite_jp_context_t ctx,const char *file)
-{
- FILE *f = fopen(file,"r");
- glite_jp_error_t err;
- int cnt = 0;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
- if (!f) {
- err.code = errno;
- err.desc = file;
- return glite_jp_stack_error(ctx,&err);
- }
-
- ctx->trusted_peers = NULL;
- while (!feof(f)) {
- char buf[BUFSIZ];
-
- if (fscanf(f,"%[^\n]\n",buf) != 1) {
- err.code = EINVAL;
- err.desc = file;
- fclose(f);
- return glite_jp_stack_error(ctx,&err);
- }
-
- ctx->trusted_peers = realloc(ctx->trusted_peers, (cnt+2) * sizeof *ctx->trusted_peers);
- ctx->trusted_peers[cnt++] = strdup(buf);
- ctx->trusted_peers[cnt] = NULL;
- }
- fclose(f);
- return 0;
-}
+++ /dev/null
-/**
- * Check authorisation of JPPS operation on job.
- *
- * \param[in] ctx JP context including peer name & other credentials (VOMS etc.)
- * \param[in] op operation, one of SOAP_TYPE___jpsrv__*
- * \param[in] job jobid of the job to decide upon
- * \param[in] owner current known owner of the job (may be NULL), shortcut to avoid
- * unnecessary database query.
- *
- * \retval 0 OK, operation permitted
- * \retval EPERM denied
- * \retval other error
- */
-
-int glite_jpps_authz(glite_jp_context_t ctx,int op,const char *job,const char *owner);
-
-int glite_jpps_readauth(glite_jp_context_t ctx,const char *file);
-
+++ /dev/null
-#ifndef __GLITE_JP_BACKEND
-#define __GLITE_JP_BACKEND
-
-#include <sys/types.h>
-#include <unistd.h>
-
-int glite_jppsbe_init(
- glite_jp_context_t ctx,
- int argc,
- char *argv[]
-);
-
-int glite_jppsbe_init_slave(
- glite_jp_context_t ctx
-);
-
-int glite_jppsbe_register_job(
- glite_jp_context_t ctx,
- const char *job,
- const char *owner
-);
-
-int glite_jppsbe_start_upload(
- glite_jp_context_t ctx,
- const char *job,
- const char *class, /* must be filesystem-friendly */
- const char *name, /* optional name within the class */
- const char *content_type,
- char **destination_out,
- time_t *commit_before_inout
-);
-
-int glite_jppsbe_commit_upload(
- glite_jp_context_t ctx,
- const char *destination
-);
-
-int glite_jppsbe_get_names(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- char ***names_out
-);
-
-int glite_jppsbe_destination_info(
- glite_jp_context_t ctx,
- const char *destination,
- char **job_out,
- char **class_out,
- char **name_out
-);
-
-int glite_jppsbe_get_job_url(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name, /* optional within class */
- char **url_out
-);
-
-int glite_jppsbe_open_file(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name, /* optional within class */
- int mode,
- void **handle_out
-);
-
-int glite_jppsbe_close_file(
- glite_jp_context_t ctx,
- void *handle
-);
-
-int glite_jppsbe_pread(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset,
- ssize_t *nbytes_ret
-);
-
-int glite_jppsbe_pwrite(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset
-);
-
-int glite_jppsbe_append(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes
-);
-
-int glite_jppsbe_get_job_metadata(
- glite_jp_context_t ctx,
- const char *job,
- glite_jp_attrval_t attrs_inout[]
-);
-
-int glite_jppsbe_query(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t query[],
- const glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-);
-
-#endif
+++ /dev/null
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-
-#include "glite/lb/srvbones.h"
-#include "glite/security/glite_gss.h"
-
-#include <stdsoap2.h>
-#include "glite/security/glite_gsplugin.h"
-
-#include "backend.h"
-#include "file_plugin.h"
-
-#include "soap_version.h"
-#include "jpps_H.h"
-
-#define CONN_QUEUE 20
-
-extern SOAP_NMAC struct Namespace jpis__namespaces[],jpps__namespaces[];
-
-static int newconn(int,struct timeval *,void *);
-static int request(int,struct timeval *,void *);
-static int reject(int);
-static int disconn(int,struct timeval *,void *);
-static int data_init(void **data);
-
-static struct glite_srvbones_service stab = {
- "JP Primary Storage", -1, newconn, request, reject, disconn
-};
-
-static time_t cert_mtime;
-static char *server_cert, *server_key, *cadir;
-static gss_cred_id_t mycred = GSS_C_NO_CREDENTIAL;
-static char *mysubj;
-
-static char *port = "8901";
-static int debug = 1;
-
-static glite_jp_context_t ctx;
-
-static int call_opts(glite_jp_context_t,char *,char *,int (*)(glite_jp_context_t,int,char **));
-
-char *glite_jp_default_namespace;
-
-int main(int argc, char *argv[])
-{
- int one = 1,opt,i;
- edg_wll_GssStatus gss_code;
- struct sockaddr_in a;
- char *b_argv[20] = { "backend" },*p_argv[20] = { "plugins" },*com;
- int b_argc,p_argc;
-
- glite_jp_init_context(&ctx);
-
- b_argc = p_argc = 1;
-
- while ((opt = getopt(argc,argv,"B:P:a:")) != EOF) switch (opt) {
- case 'B':
- assert(b_argc < 20);
- if (com = strchr(optarg,',')) *com = 0;
-
- /* XXX: memleak -- who cares for once */
- asprintf(&b_argv[b_argc++],"-%s",optarg);
- if (com) b_argv[b_argc++] = com+1;
-
- break;
- case 'P':
- assert(p_argc < 20);
- p_argv[p_argc++] = optarg;
-
- break;
- case 'a':
- if (glite_jpps_readauth(ctx,optarg)) {
- fprintf(stderr,"%s: %s\n",argv[0],glite_jp_error_chain(ctx));
- exit (1);
- }
- break;
- case '?': fprintf(stderr,"usage: %s: -Bb,val ... -Pplugin.so ...\n"
- "b is backend option\n",argv[0]);
- exit (1);
- }
-
- if (b_argc == 1) {
- fputs("-B required\n",stderr);
- exit (1);
- }
-
- optind = 0; /* XXX: getopt used internally */
- if (glite_jppsbe_init(ctx,b_argc,b_argv)) {
- fputs(glite_jp_error_chain(ctx), stderr);
- exit(1);
- }
-
- optind = 0; /* XXX: getopt used internally */
- if (b_argc > 1 && glite_jpps_fplug_load(ctx,p_argc,p_argv)) {
- fputs(glite_jp_error_chain(ctx), stderr);
- exit(1);
- }
-
- srand48(time(NULL)); /* feed id generation */
-
-#if GSOAP_VERSION <= 20602
- for (i=0; jpps__namespaces[i].id && strcmp(jpps__namespaces[i].id,"ns1"); i++);
-#else
- for (i=0; jpps__namespaces[i].id && strcmp(jpps__namespaces[i].id,"jpsrv"); i++);
-#endif
- assert(jpps__namespaces[i].id);
- glite_jp_default_namespace = jpps__namespaces[i].ns;
-
- stab.conn = socket(PF_INET, SOCK_STREAM, 0);
- if (stab.conn < 0) {
- perror("socket");
- return 1;
- }
-
- setsockopt(stab.conn,SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one));
-
- a.sin_family = AF_INET;
- a.sin_addr.s_addr = INADDR_ANY;
- a.sin_port = htons(atoi(port));
- if (bind(stab.conn,(struct sockaddr *) &a, sizeof(a)) ) {
- char buf[200];
-
- snprintf(buf,sizeof(buf),"bind(%d)",atoi(port));
- perror(buf);
- return 1;
- }
-
- if (listen(stab.conn,CONN_QUEUE)) {
- perror("listen()");
- return 1;
- }
-
- if (!server_cert || !server_key)
- fprintf(stderr, "%s: WARNING: key or certificate file not specified, "
- "can't watch them for changes\n",
- argv[0]);
-
- if ( cadir ) setenv("X509_CERT_DIR", cadir, 1);
- edg_wll_gss_watch_creds(server_cert, &cert_mtime);
-
- if ( !edg_wll_gss_acquire_cred_gsi(server_cert, server_key, &mycred, &mysubj, &gss_code))
- fprintf(stderr,"Server idenity: %s\n",mysubj);
- else fputs("WARNING: Running unauthenticated\n",stderr);
-
- /* XXX: daemonise */
-
- glite_srvbones_set_param(GLITE_SBPARAM_SLAVES_COUNT,1);
- glite_srvbones_run(data_init,&stab,1 /* XXX: entries in stab */,debug);
-
- return 0;
-}
-
-static int data_init(void **data)
-{
- *data = (void *) soap_new();
-
- printf("[%d] slave started\n",getpid());
- glite_jppsbe_init_slave(ctx); /* XXX: global but slave's */
-
- return 0;
-}
-
-static int newconn(int conn,struct timeval *to,void *data)
-{
- struct soap *soap = (struct soap *) data;
- glite_gsplugin_Context plugin_ctx;
-
- gss_cred_id_t newcred = GSS_C_NO_CREDENTIAL;
- edg_wll_GssStatus gss_code;
- gss_name_t client_name = GSS_C_NO_NAME;
- gss_buffer_desc token = GSS_C_EMPTY_BUFFER;
- OM_uint32 maj_stat,min_stat;
-
-
- int ret = 0;
-
- soap_init2(soap,SOAP_IO_KEEPALIVE,SOAP_IO_KEEPALIVE);
- soap_set_namespaces(soap,jpps__namespaces);
- soap->user = (void *) ctx; /* XXX: one instance per slave */
-
-/* not yet: client to JP index
- ctx->other_soap = soap_new();
- soap_init(ctx->other_soap);
- soap_set_namespaces(ctx->other_soap,jpis__namespaces);
-*/
-
-
- glite_gsplugin_init_context(&plugin_ctx);
- plugin_ctx->connection = calloc(1,sizeof *plugin_ctx->connection);
- soap_register_plugin_arg(soap,glite_gsplugin,plugin_ctx);
-
- switch (edg_wll_gss_watch_creds(server_cert,&cert_mtime)) {
- case 0: break;
- case 1: if (!edg_wll_gss_acquire_cred_gsi(server_cert,server_key,
- &newcred,NULL,&gss_code))
- {
-
- printf("[%d] reloading credentials\n",getpid()); /* XXX: log */
- gss_release_cred(&min_stat,&mycred);
- mycred = newcred;
- }
- break;
- case -1:
- printf("[%d] edg_wll_gss_watch_creds failed\n", getpid()); /* XXX: log */
- break;
- }
-
- /* TODO: DNS paranoia etc. */
-
- if (edg_wll_gss_accept(mycred,conn,to,plugin_ctx->connection,&gss_code)) {
- printf("[%d] GSS connection accept failed, closing.\n", getpid());
- ret = 1;
- goto cleanup;
- }
-
- maj_stat = gss_inquire_context(&min_stat,plugin_ctx->connection->context,
- &client_name, NULL, NULL, NULL, NULL, NULL, NULL);
-
- if (!GSS_ERROR(maj_stat))
- maj_stat = gss_display_name(&min_stat,client_name,&token,NULL);
-
- if (ctx->peer) free(ctx->peer);
- if (!GSS_ERROR(maj_stat)) {
- printf("[%d] client DN: %s\n",getpid(),(char *) token.value); /* XXX: log */
-
- ctx->peer = strdup(token.value);
- memset(&token, 0, sizeof(token));
- }
- else {
- printf("[%d] annonymous client\n",getpid());
- ctx->peer = NULL;
- }
-
- if (client_name != GSS_C_NO_NAME) gss_release_name(&min_stat, &client_name);
- if (token.value) gss_release_buffer(&min_stat, &token);
-
- return 0;
-
-cleanup:
- glite_gsplugin_free_context(plugin_ctx);
- soap_end(soap);
-
- return ret;
-}
-
-static int request(int conn,struct timeval *to,void *data)
-{
- struct soap *soap = data;
- glite_jp_context_t ctx = soap->user;
-
- glite_gsplugin_set_timeout(glite_gsplugin_get_context(soap),to);
-
- soap->max_keep_alive = 1; /* XXX: prevent gsoap to close connection */
- soap_begin(soap);
- if (soap_begin_recv(soap)) {
- if (soap->error < SOAP_STOP) {
- soap_send_fault(soap);
- return EIO;
- }
- return ENOTCONN;
- }
-
- soap->keep_alive = 1;
- if (soap_envelope_begin_in(soap)
- || soap_recv_header(soap)
- || soap_body_begin_in(soap)
- || jpps__serve_request(soap)
-#if GSOAP_VERSION >= 20700
- || (soap->fserveloop && soap->fserveloop(soap))
-#endif
- )
- {
- soap_send_fault(soap);
- if (ctx->error) {
- /* XXX: shall we die on some errors? */
- int err = ctx->error->code;
- glite_jp_clear_error(ctx);
- return err;
- }
- return 0;
- }
-
- glite_jp_run_deferred(ctx);
- return 0;
-}
-
-static int reject(int conn)
-{
- int flags = fcntl(conn, F_GETFL, 0);
-
- fcntl(conn,F_SETFL,flags | O_NONBLOCK);
- edg_wll_gss_reject(conn);
-
- return 0;
-}
-
-static int disconn(int conn,struct timeval *to,void *data)
-{
- struct soap *soap = (struct soap *) data;
- soap_end(soap); // clean up everything and close socket
-
- return 0;
-}
-
-#define WSPACE "\t\n "
-
-static int call_opts(glite_jp_context_t ctx,char *opt,char *name,int (*f)(glite_jp_context_t,int,char **))
-{
- int ac = 1,ret,my_optind;
- char **av = malloc(sizeof *av),*ap;
-
- *av = name;
- for (ap = strtok(opt,WSPACE); ap; ap = strtok(NULL,WSPACE)) {
- av = realloc(av,(ac+1) * sizeof *av);
- av[ac++] = ap;
- }
-
- my_optind = optind;
- optind = 0;
- ret = f(ctx,ac,av);
- optind = my_optind;
- free(av);
- return ret;
-}
-
-
-/* XXX: we don't use it */
-SOAP_NMAC struct Namespace namespaces[] = { {NULL,NULL} };
+++ /dev/null
-
-#define GLITE_JP_FILETYPE_TAGS "urn:org.glite.jp.primary:tags"
-#define GLITE_JP_FILETYPE_LB "urn:org.glite.jp.primary:lb"
-#define GLITE_JP_FILETYPE_ISB "urn:org.glite.jp.primary:isb"
-#define GLITE_JP_FILETYPE_OSB "urn:org.glite.jp.primary:osb"
-
-#define GLITE_JP_FPLUG_TAGS_APPEND 0
+++ /dev/null
-#ifndef _DB_H
-#define _DB_H
-
-#ident "$Header$"
-
-#include <sys/types.h>
-#include <sys/time.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-typedef struct _glite_jp_db_stmt_t *glite_jp_db_stmt_t;
-
-int glite_jp_db_connect(
- glite_jp_context_t, /* INOUT: */
- char * /* IN: connect string user/password@host:database */
-);
-
-void glite_jp_db_close(glite_jp_context_t);
-
-
-/* Parse and execute SQL statement. Returns number of rows selected, created
- * or affected by update, or -1 on error */
-
-int glite_jp_db_execstmt(
- glite_jp_context_t, /* INOUT: */
- char *, /* IN: SQL statement */
- glite_jp_db_stmt_t * /* OUT: statement handle. Usable for
- select only */
-);
-
-
-/* Fetch next row of select statement.
- * All columns are returned as fresh allocated strings
- *
- * return values:
- * >0 - number of fields of the retrieved row
- * 0 - no more rows
- * -1 - error
- *
- * Errors are stored in context passed to previous glite_jp_db_execstmt() */
-
-int glite_jp_db_fetchrow(
- glite_jp_db_stmt_t, /* IN: statement */
- char ** /* OUT: array of fetched values.
- * As number of columns is fixed and known,
- * expects allocated array of pointers here */
-);
-
-/* Retrieve column names of a query statement */
-
-int glite_jp_db_querycolumns(
- glite_jp_db_stmt_t, /* IN: statement */
- char ** /* OUT: result set column names. Expects allocated array. */
-);
-
-/* Free the statement structure */
-
-void glite_jp_db_freestmt(
- glite_jp_db_stmt_t * /* INOUT: statement */
-);
-
-
-/* convert time_t into database-specific time string
- * returns pointer to static area that is changed by subsequent calls */
-
-char *glite_jp_db_timetodb(time_t);
-time_t glite_jp_db_dbtotime(char *);
-
-
-/**
- * Check database version.
- */
-int glite_jp_db_dbcheckversion(glite_jp_context_t);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+++ /dev/null
-#include <stdio.h>
-#include <time.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-#include <fcntl.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/strmd5.h"
-#include "feed.h"
-#include "file_plugin.h"
-#include "builtin_plugins.h"
-#include "is_client.h"
-
-/*
- * seconds before feed expires: should be
- * XXX: should be configurable, default for real deployment sort of 1 hour
- */
-#define FEED_TTL 120
-
-static int check_qry_item(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t *qry,
- const glite_jp_attrval_t *attr
-)
-{
- int cmp,cmp2;
- long scmp,ucmp;
-
- if (strcmp(qry->attr,attr->name)) return 0;
-
- if (qry->origin && qry->origin != attr->origin) return 0;
-
- /* FIXME: fallback only, loop over type plugins and use plugin compare function */
- cmp = strcmp(attr->value,qry->value);
-
- switch (qry->op) {
- case GLITE_JP_QUERYOP_EQUAL: return !cmp;
- case GLITE_JP_QUERYOP_UNEQUAL: return cmp;
- case GLITE_JP_QUERYOP_LESS: return cmp < 0;
- case GLITE_JP_QUERYOP_GREATER: return cmp > 0;
-
- case GLITE_JP_QUERYOP_WITHIN:
- /* FIXME: the same */
- cmp2 = strcmp(attr->value,qry->value);
- return cmp >= 0 && cmp2 <= 0;
- }
-}
-
-/* XXX: limit on query size -- I'm lazy to malloc() */
-#define QUERY_MAX 100
-
-static int match_feed(
- glite_jp_context_t ctx,
- const struct jpfeed *feed,
- const char *job,
-
-/* XXX: not checked for correctness,
- assuming single occurence only */
- const glite_jp_attrval_t attrs[]
-)
-{
- int i;
- int qi[QUERY_MAX];
-
- glite_jp_attrval_t *newattr = NULL;
-
- glite_jp_clear_error(ctx);
-
- if (feed->qry) {
- int j,complete = 1;
-
- memset(qi,0,sizeof qi);
- for (i=0; feed->qry[i].attr; i++) {
- int sat = 0;
- assert(i<QUERY_MAX);
- for (j=0; !sat && attrs[j].name; j++)
- if (!strcmp(attrs[j].name,feed->qry[i].attr)) {
- if (check_qry_item(ctx,feed->qry+i,attrs+j)) {
- qi[i] = 1;
- sat = 1; /* matched, needn't loop further */
- }
- else return 0; /* can't be satisfied either */
- }
-
- if (!sat) complete = 0;
- }
-
- /* not all attributes in query are known from input
- * we have to retrieve job metadata from the backend
- *
- * XXX: It is not optimal to retrieve it here without sharing
- * over multiple invocations of match_feed() for the same job.
- */
- if (!complete) {
- glite_jp_attrval_t meta[QUERY_MAX+1];
- int qi2[QUERY_MAX];
-
- memset(meta,0,sizeof meta);
- j=0;
- for (i=0; feed->qry[i].attr; i++) if (!qi[i]) {
- assert(j<QUERY_MAX);
- meta[j].name = feed->qry[i].attr;
- qi2[j] = i;
- j++;
- }
-
- if (glite_jppsbe_get_job_metadata(ctx,job,meta)) {
- glite_jp_error_t err;
- memset(&err,0,sizeof err);
- err.code = EIO;
- err.source = __FUNCTION__;
- err.desc = "complete query";
- return glite_jp_stack_error(ctx,&err);
- }
-
- for (i=0; meta[i].name; i++)
- if (!check_qry_item(ctx,feed->qry+qi2[i],meta+i))
- return 0;
- }
- }
-
- /* matched completely */
- return glite_jpps_single_feed(ctx,feed->destination,job,attrs);
- return 0;
-}
-
-int glite_jpps_match_attr(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t attrs[]
-)
-{
- struct jpfeed *f = (struct jpfeed *) ctx->feeds;
- int i,j,doit;
-
- for (;f; f = f->next) {
- doit = 0;
-
- for (i=0; !doit && f->attrs[i]; i++)
- for (j=0; !doit && attrs[j].name; j++)
- if (!strcmp(f->attrs[i],attrs[j].name)) doit = 1;
-
- /* XXX: ignore any errors */
- if (doit) match_feed(ctx,f,job,attrs);
- }
-
- return glite_jp_clear_error(ctx);
-}
-
-static int attr_void_cmp(const void *a, const void *b)
-{
- char const * const *ca = (char const * const *) a;
- char const * const *cb = (char const * const *) b;
- return strcmp(*ca,*cb);
-}
-
-static void attr_union(char **a, char **b, char ***c)
-{
- int ca = 0,cb = 0,cnt,i,j;
- char **out;
-
- if (a) for (ca = 0; a[ca]; ca++);
- if (b) for (cb = 0; b[cb]; cb++);
- out = malloc((ca+cb+1) * sizeof *out);
- if (a) memcpy(out,a,ca * sizeof *out);
- if (b) memcpy(out+ca,b,cb * sizeof *out);
- out[cnt = ca+cb] = NULL;
- qsort(out,cnt,sizeof *out,attr_void_cmp);
-
- for (i=0; i<cnt; i++) {
- for (j=i; j<cnt && !strcmp(out[i],out[j]); j++);
- if (j < cnt && j > i+1) memmove(out+i+1,out+j,(cnt-j) * sizeof *out);
- cnt -= j-i-1;
- }
-
- *c = out;
-}
-
-int glite_jpps_match_file(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name
-)
-{
- glite_jpps_fplug_data_t **pd = NULL;
- int pi;
- void *bh = NULL;
- int ret;
- struct jpfeed *f = ctx->feeds;
-
- int nvals = 0,j,i;
- char **attrs = NULL, **attrs2;
- glite_jp_attrval_t *vals = NULL,*oneval;
-
- fprintf(stderr,"%s: %s %s %s\n",__FUNCTION__,job,class,name);
-
-
- switch (glite_jpps_fplug_lookup(ctx,class,&pd)) {
- case ENOENT: return 0; /* XXX: shall we complain? */
- case 0: break;
- default: return -1;
- }
-
- for (;f;f=f->next) {
- attr_union(attrs,f->attrs,&attrs2);
- free(attrs);
- attrs = attrs2;
- }
-
- for (pi=0; pd[pi]; pi++) {
- int ci;
- for (ci=0; pd[pi]->uris[ci]; ci++) if (!strcmp(pd[pi]->uris[ci],class)) {
- void *ph;
-
- if (!bh && (ret = glite_jppsbe_open_file(ctx,job,pd[pi]->classes[ci],name,O_RDONLY,&bh))) {
- free(pd);
- return ret;
- }
-
- if (pd[pi]->ops.open(pd[pi]->fpctx,bh,class,&ph)) {
- /* XXX: complain more visibly */
- fputs("plugin open failed\n",stderr);
- continue;
- }
-
- for (i=0; attrs[i]; i++)
- if (!pd[pi]->ops.attr(pd[pi]->fpctx,ph,attrs[i],&oneval)) {
- /* XXX: ignore error */
- for (j=0; oneval[j].name; j++);
- vals = realloc(vals,(nvals+j+1) * sizeof *vals);
- memcpy(vals+nvals,oneval,(j+1) * sizeof *vals);
- nvals += j;
- free(oneval);
- }
-
- pd[pi]->ops.close(pd[pi]->fpctx,ph);
- }
- }
-
- free(attrs);
-
- for (f = ctx->feeds; f; f=f->next) {
- int k;
- glite_jp_attrval_t * fattr = malloc((nvals+1) * sizeof *fattr);
-
- j = 0;
- for (i=0; i<nvals; i++) for (k=0; f->attrs[k]; k++)
- if (!strcmp(f->attrs[k],vals[i].name))
- memcpy(fattr+j++,vals+i,sizeof *fattr);
-
- memset(fattr+j,0,sizeof *fattr);
- glite_jpps_single_feed(ctx,f->destination,job,fattr);
- free(fattr);
- }
-
- for (i=0; vals[i].name; i++) glite_jp_attrval_free(vals+i,0);
- free(vals);
-
- if (bh) glite_jppsbe_close_file(ctx,bh);
- free(pd);
-
- return 0;
-}
-
-static char *generate_feedid(void)
-{
- char hname[200],buf[1000];
-
- gethostname(hname,sizeof hname);
- snprintf(buf,sizeof buf,"%s%d%ld",hname,getpid(),lrand48());
- buf[sizeof buf-1] = 0;
- return str2md5base64(buf);
-}
-
-
-int glite_jpps_run_feed(
- glite_jp_context_t ctx,
- const char *destination,
- char const * const *attrs,
- const glite_jp_query_rec_t *qry,
- char **feed_id)
-{
- fprintf(stderr,"%s: \n",__FUNCTION__);
- return 0;
-}
-
-static int register_feed_deferred(glite_jp_context_t ctx,void *feed)
-{
- struct jpfeed *f = feed;
-
- f->next = ctx->feeds;
- ctx->feeds = f;
- return 0;
-}
-
-/* FIXME:
- * - volatile implementation: should store the registrations in a file
- * and recover after restart
- * - should communicate the data among all server slaves
- */
-int glite_jpps_register_feed(
- glite_jp_context_t ctx,
- const char *destination,
- char const *const *attrs,
- const glite_jp_query_rec_t *qry,
- char **feed_id,
- time_t *expires)
-{
- int i;
- struct jpfeed *f = calloc(1,sizeof *f);
-
- if (!*feed_id) *feed_id = generate_feedid();
- time(expires); *expires += FEED_TTL;
-
- f->id = strdup(*feed_id);
- f->destination = strdup(destination);
- f->expires = *expires;
- for (i=0; attrs[i]; i++) {
- f->attrs = realloc(f->attrs,(i+2) * sizeof *f->attrs);
- f->attrs[i] = strdup(attrs[i]);
- f->attrs[i+1] = NULL;
- }
- for (i=0; qry[i].attr; i++) {
- f->qry = realloc(f->qry,(i+2) * sizeof *f->qry);
- glite_jp_queryrec_copy(f->qry+i,qry+i);
- memset(f->qry+i+1,0,sizeof *f->qry);
- }
-
- glite_jp_add_deferred(ctx,register_feed_deferred,f);
-
- return 0;
-}
-
+++ /dev/null
-#ifndef __GLITE_JP_FEED
-#define __GLITE_JP_FEED
-
-
-struct jpfeed {
- char *id,*destination;
- time_t expires;
- char **attrs;
- glite_jp_query_rec_t *qry;
- struct jpfeed *next;
-};
-
-
-int glite_jpps_match_attr(glite_jp_context_t,const char *,const glite_jp_attrval_t[]);
-int glite_jpps_match_file(glite_jp_context_t,const char *,const char *,const char *);
-int glite_jpps_match_tag(glite_jp_context_t,const char *,const char *,const char *);
-int glite_jpps_run_feed(glite_jp_context_t,const char *,char const * const *,const glite_jp_query_rec_t *,char **);
-int glite_jpps_register_feed(glite_jp_context_t,const char *,char const * const *,const glite_jp_query_rec_t *,char **,time_t *);
-
-#endif
-
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <getopt.h>
-#include <dlfcn.h>
-#include <errno.h>
-
-#include <glite/jp/types.h>
-#include "file_plugin.h"
-
-static struct option opts[] = {
- { "plugin", 1, NULL, 'p' },
- { NULL }
-};
-
-static int loadit(glite_jp_context_t ctx,const char *so)
-{
-/* XXX: not stored but we never dlclose() yet */
- void *dl_handle = dlopen(so,RTLD_NOW);
-
- glite_jp_error_t err;
- const char *e;
- glite_jpps_fplug_data_t *data,*dp;
- int i;
-
- glite_jpps_fplug_init_t init;
- memset(&err,0,sizeof err);
-
- if (!dl_handle) {
- err.source = "dlopen()";
- err.code = EINVAL;
- err.desc = dlerror();
- return glite_jp_stack_error(ctx,&err);
- }
-
- dlerror();
- init = dlsym(dl_handle,"init");
- e = dlerror();
- if (e) {
- char buf[300];
- snprintf(buf,sizeof buf,"dlsym(\"%s\",\"init\")",so);
- buf[299] = 0;
- err.source = buf;
- err.code = ENOENT;
- err.desc = e;
- return glite_jp_stack_error(ctx,&err);
- }
-
- data = calloc(1,sizeof *data);
-
- if (init(ctx,data)) return -1;
-
- i = 0;
- if (ctx->plugins) for (i=0; ctx->plugins[i]; i++);
- ctx->plugins = realloc(ctx->plugins, (i+2) * sizeof *ctx->plugins);
- ctx->plugins[i] = data;
- ctx->plugins[i+1] = NULL;
-
- /* TODO: check consistency of uri+class pairs wrt. previous plugins */
-
- return 0;
-}
-
-int glite_jpps_fplug_load(glite_jp_context_t ctx,int argc,char **argv)
-{
- int i;
-
- for (i=1; i<argc; i++) if (loadit(ctx,argv[i])) {
- glite_jp_error_t err;
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
- err.code = EINVAL;
- err.desc = argv[i];
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-int glite_jpps_fplug_lookup(glite_jp_context_t ctx,const char *uri, glite_jpps_fplug_data_t ***plugin_data)
-{
- int i;
-
- glite_jpps_fplug_data_t **out = NULL;
- int matches = 0;
-
- glite_jp_error_t err;
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
- err.code = ENOENT;
- err.desc = (char *) uri; /* XXX: we don't modify it, believe me, gcc! */
-
- glite_jp_clear_error(ctx);
- if (!ctx->plugins) {
- return glite_jp_stack_error(ctx,&err);
- }
-
- for (i = 0; ctx->plugins[i]; i++) {
- int j;
- glite_jpps_fplug_data_t *p = ctx->plugins[i];
-
- for (j=0; p->uris && p->uris[j]; j++)
- if (!strcmp(p->uris[j],uri)) {
- out = realloc(out, (matches+2) * sizeof *out);
- out[matches++] = p;
- out[matches] = NULL;
- }
- }
-
- if (matches) {
- *plugin_data = out;
- return 0;
- }
- else return glite_jp_stack_error(ctx,&err);
-}
-
+++ /dev/null
-#ident "$Header$"
-
-#include <getopt.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <assert.h>
-#include <limits.h>
-#include <dirent.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-#include "glite/jp/strmd5.h"
-
-#include "tags.h"
-#include "backend.h"
-
-#define UPLOAD_SUFFIX ".upload"
-#define LOCK_SUFFIX ".lock"
-
-struct ftpbe_config {
- char *internal_path;
- char *external_path;
- char *gridmap;
- char *logname;
-};
-
-static struct ftpbe_config *config = NULL;
-
-struct fhandle_rec {
- int fd;
- int fd_append;
-};
-typedef struct fhandle_rec *fhandle;
-
-static struct option ftpbe_opts[] = {
- { "ftp-internal-path", 1, NULL, 'I' },
- { "ftp-external-path", 1, NULL, 'E' },
- { "ftp-gridmap", 1, NULL, 'G' },
- { NULL, 0, NULL, 0 }
-};
-
-/* obsolete */
-#if 0
-static struct {
- glite_jp_fileclass_t type;
- char * fname;
- } class_to_fname_tab[] = {
- { GLITE_JP_FILECLASS_INPUT, "input" },
- { GLITE_JP_FILECLASS_OUTPUT, "output" },
- { GLITE_JP_FILECLASS_LBLOG, "lblog" },
- { GLITE_JP_FILECLASS_TAGS, "tags" },
- { GLITE_JP_FILECLASS_UNDEF, NULL }
- };
-
-static char *class_to_fname(glite_jp_fileclass_t type)
-{
- int i;
-
- for (i = 0; class_to_fname_tab[i].type != GLITE_JP_FILECLASS_UNDEF; i++)
- if (type == class_to_fname_tab[i].type)
- return class_to_fname_tab[i].fname;
-
- return NULL;
-}
-
-static glite_jp_fileclass_t fname_to_class(char* fname)
-{
- int i;
-
- for (i = 0; class_to_fname_tab[i].type != GLITE_JP_FILECLASS_UNDEF; i++)
- if (!strcmp(fname, class_to_fname_tab[i].fname))
- return class_to_fname_tab[i].type;
-
- return GLITE_JP_FILECLASS_UNDEF;
-}
-#endif
-
-static int config_check(
- glite_jp_context_t ctx,
- struct ftpbe_config *config)
-{
- return config == NULL ||
- config->internal_path == NULL ||
- config->external_path == NULL ||
- config->gridmap == NULL ||
- config->logname == NULL;
-
- /* XXX check reality */
-}
-
-static int jobid_unique_pathname(glite_jp_context_t ctx, const char *job,
- char **unique, char **ju_path, int get_path)
-{
- char *p;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- p = strrchr(job, '/');
- if (!p) {
- err.code = EINVAL;
- err.desc = "Malformed jobid";
- return glite_jp_stack_error(ctx,&err);
- }
- /* XXX thorough checks */
- if (!(*unique = strdup(p+1))) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- if (get_path) {
- if (!(*ju_path = strdup(p+1))) {
- free(*unique);
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- *(*ju_path + 10) = '\0';
- }
- return 0;
-}
-
-static int mkdirpath(const char* path, int prefixlen)
-{
- char *wpath, *p;
- int goout, ret;
-
- wpath = strdup(path);
- if (!wpath) {
- errno = ENOMEM;
- return -1;
- }
-
- p = wpath + prefixlen;
- goout = 0;
- while (!goout) {
- while (*p == '/') p++;
- while (*p != '/' && *p != '\0') p++;
- goout = (*p == '\0');
- *p = '\0';
- ret = mkdir(wpath, S_IRUSR | S_IWUSR | S_IXUSR);
- if (ret < 0 && errno != EEXIST) break;
- *p = '/';
- }
- free(wpath);
- return goout ? 0 : ret;
-}
-
-static long regtime_trunc(long tv_sec)
-{
- return tv_sec / (86400*7);
-}
-
-static long regtime_ceil(long tv_sec)
-{
- return (tv_sec % (86400*7)) ? tv_sec/(86400*7)+1 : tv_sec/(86400*7) ;
-}
-
-/********************************************************************************/
-int glite_jppsbe_init(
- glite_jp_context_t ctx,
- int argc,
- char *argv[]
-)
-{
- glite_jp_error_t err;
- int opt;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- config = (struct ftpbe_config *) calloc(1, sizeof *config);
- if (!config) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
-
- config->logname = getlogin();
-
- while ((opt = getopt_long(argc, argv, "I:E:G:", ftpbe_opts, NULL)) != EOF) {
- switch (opt) {
- case 'I': config->internal_path = optarg; break;
- case 'E': config->external_path = optarg; break;
- case 'G': config->gridmap = optarg; break;
- default: break;
- }
- }
-
- if (config_check(ctx, config)) {
- err.code = EINVAL;
- err.desc = "Invalid FTP backend configuration";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-int glite_jppsbe_init_slave(
- glite_jp_context_t ctx
-)
-{
- /* Nothing to do */
-}
-
-int glite_jppsbe_register_job(
- glite_jp_context_t ctx,
- const char *job,
- const char *owner
-)
-{
- glite_jp_error_t err;
- char *int_dir = NULL;
- char *int_fname = NULL;
- char *data_dir = NULL;
- char *data_fname = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
- char *ownerhash = NULL;
- FILE *regfile = NULL;
- struct timeval reg_tv;
- long reg_tv_trunc;
- struct stat statbuf;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job != NULL);
- assert(owner != NULL);
-
- gettimeofday(®_tv, NULL);
- reg_tv_trunc = regtime_trunc(reg_tv.tv_sec);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&int_dir, "%s/regs/%s",
- config->internal_path, ju_path) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (mkdirpath(int_dir, strlen(config->internal_path)) < 0 &&
- errno != EEXIST) {
- free(int_dir);
- err.code = errno;
- err.desc = "Cannot mkdir jobs's reg directory";
- return glite_jp_stack_error(ctx,&err);
- }
- free(int_dir);
-
- if (asprintf(&int_fname, "%s/regs/%s/%s.info",
- config->internal_path, ju_path, ju) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (stat(int_fname, &statbuf) < 0) {
- if (errno != ENOENT) {
- err.code = errno;
- err.desc = "Cannot stat jobs's reg info file";
- goto error_out;
- }
- } else {
- err.code = EEXIST;
- err.desc = "Job already registered";
- goto error_out;
- }
-
- regfile = fopen(int_fname, "w");
- if (regfile == NULL) {
- err.code = errno;
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
-
- ownerhash = str2md5(owner); /* static buffer */
-
- if (fprintf(regfile, "%d %ld.%06ld %s %s %d %s\n", 1,
- (long)reg_tv.tv_sec, (long)reg_tv.tv_usec, job,
- ownerhash, strlen(owner), owner) < 1 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot write jobs's reg info file";
- goto error_out;
- }
- if (fclose(regfile) != 0 ) {
- err.code = errno;
- err.desc = "Cannot close(write) jobs's reg info file";
- goto error_out;
- }
-
- if (asprintf(&data_dir, "%s/data/%s/%d/%s",
- config->internal_path, ownerhash, regtime_trunc(reg_tv.tv_sec), ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (asprintf(&data_fname, "%s/_info", data_dir) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (mkdirpath(data_dir, strlen(config->internal_path)) < 0 &&
- errno != EEXIST) {
- err.code = errno;
- err.desc = "Cannot mkdir jobs's data directory";
- goto error_out;
- }
-
- if (link(int_fname, data_fname) < 0) {
- err.code = errno;
- err.desc = "Cannot link job's reg and data info files";
- goto error_out;
- }
-
-error_out:
- free(int_fname);
- free(data_fname);
- if (err.code && data_dir) rmdir(data_dir);
- free(data_dir);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-static int add_to_gridmap(glite_jp_context_t ctx, const char *dn)
-{
- FILE *gridmap = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- gridmap = fopen(config->gridmap, "a");
- if (!gridmap) {
- err.code = errno;
- err.desc = "Cannot open gridmap file";
- return glite_jp_stack_error(ctx,&err);
- }
- if (fprintf(gridmap, "\"%s\" %s\n", dn, config->logname) < 6 ||
- ferror(gridmap)) {
- err.code = EIO;
- err.desc = "Cannot write to gridmap file";
- fclose(gridmap);
- return glite_jp_stack_error(ctx,&err);
- }
- fclose(gridmap);
- return 0;
-}
-
-static int remove_from_gridmap(glite_jp_context_t ctx, const char *dn)
-{
- FILE *gridmap = NULL;
- char *temp_name = NULL;
- FILE *temp_file = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- /* XXX */
- return 0;
-}
-
-int glite_jppsbe_start_upload(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name, /* TODO */
- const char *content_type,
- char **destination_out,
- time_t *commit_before_inout
-)
-{
- char *int_fname = NULL;
- char *lock_fname = NULL;
- FILE *lockfile = NULL;
- FILE *regfile = NULL;
- char *data_dir = NULL;
- char *data_lock = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
- char *peername = NULL;
- int info_version;
- long reg_time;
- char ownerhash[33];
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job!=NULL);
- assert(destination_out!=NULL);
-
- assert(class!=NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- peername = glite_jp_peer_name(ctx);
-
- if (asprintf(&int_fname, "%s/regs/%s/%s.info",
- config->internal_path, ju_path, ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- if (errno == ENOENT)
- err.desc = "Job not registered";
- else
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%*ld %*s %s ", &info_version,
- ®_time, ownerhash) < 3 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- fclose(regfile);
-
- /* XXX authorization */
-
- if (asprintf(&data_dir, "%s/data/%s/%d/%s",
- config->internal_path, ownerhash, regtime_trunc(reg_time), ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (asprintf(&lock_fname, "%s/%s" LOCK_SUFFIX,
- data_dir, class) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (commit_before_inout != NULL)
- *commit_before_inout = (time_t) LONG_MAX; /* XXX no timeout enforced */
-
- lockfile = fopen(lock_fname, "w");
- if (lockfile == NULL) {
- err.code = errno;
- err.desc = "Cannot open uploads's lock file";
- goto error_out;
- }
-
- if (fprintf(lockfile, "%ld %d %s\n", (long)*commit_before_inout,
- peername ? peername : 0,
- peername ? peername : "") < 1 || ferror(regfile)) {
- fclose(lockfile);
- err.code = errno;
- err.desc = "Cannot write upload's lock file";
- goto error_out;
- }
- if (fclose(lockfile) != 0 ) {
- err.code = errno;
- err.desc = "Cannot close(write) upload's lock file";
- goto error_out;
- }
-
- if (asprintf(destination_out, "%s/data/%s/%d/%s/%s" UPLOAD_SUFFIX,
- config->external_path, ownerhash, regtime_trunc(reg_time), ju, class) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (add_to_gridmap(ctx, peername)) {
- err.code = EIO;
- err.desc = "Cannot add peer DN to ftp server authorization file";
- goto error_out;
- }
-
-error_out:
- free(int_fname);
- free(data_dir);
- if (err.code && data_lock) unlink(data_lock);
- free(data_lock);
- free(ju); free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_commit_upload(
- glite_jp_context_t ctx,
- const char *destination
-)
-{
- size_t dest_len;
- size_t suff_len;
- size_t extp_len;
- long commit_before;
- int lockpeerlen;
- char *lockpeername = NULL;
- char *peername = NULL;
- char *dest_rw = NULL;
- char *dest_rw_suff = NULL;
- char *dest_rw_lock = NULL;
- FILE *lockfile = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(destination != NULL);
-
- suff_len = strlen(UPLOAD_SUFFIX);
- dest_len = strlen(destination);
- extp_len = strlen(config->external_path);
-
- if (dest_len < suff_len ||
- strcmp(UPLOAD_SUFFIX, destination + (dest_len - suff_len)) ||
- strncmp(destination, config->external_path, extp_len)) {
- err.code = EINVAL;
- err.desc = "Forged destination path";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&dest_rw_suff, "%s%s", config->internal_path,
- destination + extp_len) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- dest_rw = strdup(dest_rw_suff);
- if (!dest_rw) {
- err.code = ENOMEM;
- goto error_out;
- }
- *(dest_rw + (strlen(dest_rw_suff) - suff_len)) = '\0';
-
- if (asprintf(&dest_rw_lock, "%s" LOCK_SUFFIX, dest_rw) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- lockfile = fopen(dest_rw_lock, "r");
- if (lockfile == NULL) {
- err.code = errno;
- err.desc = "Cannot open upload's lock file";
- goto error_out;
- }
- if (fscanf(lockfile, "%ld %d ", &commit_before, &lockpeerlen) < 2 || ferror(lockfile)) {
- fclose(lockfile);
- err.code = errno;
- err.desc = "Cannot read upload's lock file";
- goto error_out;
- }
- if (lockpeerlen) {
- lockpeername = (char*) calloc(1, lockpeerlen+1);
- if (!lockpeername) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (fgets(lockpeername, lockpeerlen+1, lockfile) == NULL) {
- fclose(lockfile);
- err.code = errno;
- err.desc = "Cannot read upload's lock file";
- goto error_out;
- }
- }
- fclose(lockfile);
-
- peername = glite_jp_peer_name(ctx);
- if (lockpeername && (!peername || strcmp(lockpeername, peername))) {
- err.code = EPERM;
- err.desc = "Upload started by client of different identity";
- goto error_out;
- }
-
- if (rename(dest_rw_suff, dest_rw) < 0) {
- err.code = errno;
- err.desc = "Cannot move upload file to the final place";
- goto error_out;
- }
-
- if (unlink(dest_rw_lock) < 0) {
- err.code = errno;
- err.desc = "Cannot unlink upload's lock file";
- goto error_out;
- }
-
-error_out:
- free(dest_rw);
- free(dest_rw_suff);
- free(dest_rw_lock);
- free(peername);
- free(lockpeername);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_destination_info(
- glite_jp_context_t ctx,
- const char *destination,
- char **job,
- char **class,
- char **name
-)
-{
- size_t dest_len;
- size_t suff_len;
- size_t extp_len;
- char *dest_rw = NULL;
- char *dest_rw_suff = NULL;
- char *dest_rw_info = NULL;
- FILE *infofile = NULL;
- char *classname = NULL;
- char jobstr[256+1];
- glite_jp_error_t err;
-
- assert(destination != NULL);
- assert(job != NULL);
- assert(class != NULL);
- assert(name != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- suff_len = strlen(UPLOAD_SUFFIX);
- dest_len = strlen(destination);
- extp_len = strlen(config->external_path);
-
- if (dest_len < suff_len ||
- strcmp(UPLOAD_SUFFIX, destination + (dest_len - suff_len)) ||
- strncmp(destination, config->external_path, extp_len)) {
- err.code = EINVAL;
- err.desc = "Forged destination path";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&dest_rw_suff, "%s%s", config->internal_path,
- destination + extp_len) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- dest_rw = strdup(dest_rw_suff);
- if (!dest_rw) {
- err.code = ENOMEM;
- goto error_out;
- }
- *(dest_rw + (strlen(dest_rw_suff) - suff_len)) = '\0';
-
- classname = strrchr(dest_rw,'/');
- if (classname == NULL) {
- err.code = EINVAL;
- err.desc = "Forged destination path";
- goto error_out;
- }
- *classname++ ='\0';
- *class = strdup(classname);
-
-/* XXX: do we need similar check?
- if (!class == GLITE_JP_FILECLASS_UNDEF) {
- err.code = EINVAL;
- err.desc = "Forged destination path";
- goto error_out;
- }
-*/
-
- /* TODO: */
- *name = NULL;
-
- if (asprintf(&dest_rw_info, "%s/_info", dest_rw) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- infofile = fopen(dest_rw_info, "r");
- if (infofile == NULL) {
- err.code = errno;
- err.desc = "Cannot open _info file";
- goto error_out;
- }
- if (fscanf(infofile, "%*d %*ld.%*ld %256s ", jobstr) < 1 || ferror(infofile)) {
- fclose(infofile);
- err.code = errno;
- err.desc = "Cannot read _info file";
- goto error_out;
- }
- *job = strdup(jobstr);
- fclose(infofile);
-
-error_out:
- free(dest_rw);
- free(dest_rw_suff);
- free(dest_rw_info);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-
-int glite_jppsbe_get_job_url(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name, /* TODO */
- char **url_out
-)
-{
- FILE *regfile = NULL;
- char *int_fname = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
- int info_version;
- long reg_time;
- char ownerhash[33];
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job!=NULL);
- assert(url_out != NULL);
-
- assert(class!=NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&int_fname, "%s/regs/%s/%s.info",
- config->internal_path, ju_path, ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- if (errno == ENOENT)
- err.desc = "Job not registered";
- else
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%*ld %*s %s", &info_version,
- ®_time, ownerhash) < 3 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- fclose(regfile);
-
- if (asprintf(url_out, "%s/data/%s/%d/%s/%s",
- config->external_path, ownerhash, regtime_trunc(reg_time), ju, class) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
-error_out:
- free(int_fname);
- free(ju); free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-static int get_job_fname(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name, /* TODO */
- char **fname_out
-)
-{
- FILE *regfile = NULL;
- char *int_fname = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
- int info_version;
- long reg_time;
- char ownerhash[33];
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job!=NULL);
- assert(fname_out != NULL);
-
- assert(class!=NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&int_fname, "%s/regs/%s/%s.info",
- config->internal_path, ju_path, ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- if (errno == ENOENT)
- err.desc = "Job not registered";
- else
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%*ld %*s %s", &info_version,
- ®_time, ownerhash) < 3 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- fclose(regfile);
-
- if (asprintf(fname_out, "%s/data/%s/%d/%s/%s",
- config->internal_path, ownerhash, regtime_trunc(reg_time), ju, class) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
-error_out:
- free(int_fname);
- free(ju); free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_open_file(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name, /* TODO */
- int mode,
- void **handle_out
-)
-{
- fhandle handle = NULL;
- char* fname = NULL;
- glite_jp_error_t err;
-
- assert(handle_out != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (get_job_fname(ctx, job, class, name, &fname)) {
- err.code = ctx->error->code;
- err.desc = "Cannot construct internal filename";
- return glite_jp_stack_error(ctx,&err);
- }
-
- handle = (fhandle) calloc(1,sizeof(*handle));
- if (handle == NULL) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- handle->fd = open(fname, mode, S_IRUSR | S_IWUSR);
- if (handle->fd < 0) {
- err.code = errno;
- err.desc = "Cannot open requested file";
- free(handle);
- goto error_out;
- }
- handle->fd_append = open(fname, mode | O_APPEND, S_IRUSR | S_IWUSR);
- if (handle->fd_append < 0) {
- err.code = errno;
- err.desc = "Cannot open requested file for append";
- close(handle->fd);
- free(handle);
- goto error_out;
- }
- *handle_out = (void*) handle;
-
-error_out:
- free(fname);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_close_file(
- glite_jp_context_t ctx,
- void *handle
-)
-{
- glite_jp_error_t err;
-
- assert(handle != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (close(((fhandle)handle)->fd_append) < 0) {
- err.code = errno;
- err.desc = "Error closing file descriptor (fd_append)";
- goto error_out;
- }
- if (close(((fhandle)handle)->fd) < 0) {
- err.code = errno;
- err.desc = "Error closing file descriptor";
- goto error_out;
- }
-
-error_out:
- free(handle);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_pread(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset,
- ssize_t *nbytes_ret
-)
-{
- ssize_t ret;
- glite_jp_error_t err;
-
- assert(handle != NULL);
- assert(buf != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if ((ret = pread(((fhandle)handle)->fd, buf, nbytes, offset)) < 0) {
- err.code = errno;
- err.desc = "Error in pread()";
- return glite_jp_stack_error(ctx,&err);
- }
- *nbytes_ret = ret;
-
- return 0;
-}
-
-int glite_jppsbe_pwrite(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset
-)
-{
- glite_jp_error_t err;
-
- assert(handle != NULL);
- assert(buf != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (pwrite(((fhandle)handle)->fd, buf, nbytes, offset) < 0) {
- err.code = errno;
- err.desc = "Error in pwrite()";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-int glite_jppsbe_append(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes
-)
-{
- glite_jp_error_t err;
-
- assert(handle != NULL);
- assert(buf != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (write(((fhandle)handle)->fd_append, buf, nbytes) < 0) {
- err.code = errno;
- err.desc = "Error in write()";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-static int get_job_info(
- glite_jp_context_t ctx,
- const char *job,
- char **owner,
- struct timeval *tv_reg
-)
-{
- char *ju = NULL;
- char *ju_path = NULL;
- FILE *regfile = NULL;
- long reg_time_sec;
- long reg_time_usec;
- int ownerlen = 0;
- int info_version;
- char *int_fname = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&int_fname, "%s/regs/%s/%s.info",
- config->internal_path, ju_path, ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- if (errno == ENOENT)
- err.desc = "Job not registered";
- else
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%ld %*s %*s %d ", &info_version,
- ®_time_sec, ®_time_usec, &ownerlen) < 4 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- if (ownerlen) {
- *owner = (char *) calloc(1, ownerlen+1);
- if (!*owner) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (fgets(*owner, ownerlen+1, regfile) == NULL) {
- fclose(regfile);
- free(*owner);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- }
- fclose(regfile);
-
- tv_reg->tv_sec = reg_time_sec;
- tv_reg->tv_usec = reg_time_usec;
-
-error_out:
- free(int_fname);
- free(ju);
- free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-static int get_job_info_int(
- glite_jp_context_t ctx,
- const char *int_fname,
- char **jobid,
- char **owner,
- struct timeval *tv_reg
-)
-{
- FILE *regfile = NULL;
- long reg_time_sec;
- long reg_time_usec;
- int ownerlen = 0;
- int info_version;
- char jobid_buf[256];
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%ld %s %*s %d ", &info_version,
- ®_time_sec, ®_time_usec, jobid_buf, &ownerlen) < 5 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- *jobid = strdup(jobid_buf);
- if (ownerlen) {
- *owner = (char *) calloc(1, ownerlen+1);
- if (!*owner) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (fgets(*owner, ownerlen+1, regfile) == NULL) {
- fclose(regfile);
- free(*owner);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- }
- fclose(regfile);
-
- tv_reg->tv_sec = reg_time_sec;
- tv_reg->tv_usec = reg_time_usec;
-
-error_out:
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_get_job_metadata(
- glite_jp_context_t ctx,
- const char *job,
- glite_jp_attrval_t attrs_inout[]
-)
-{
- int got_info = 0;
- struct timeval tv_reg;
- char *owner = NULL;
- int got_tags = 0;
- void *tags_handle = NULL;
- glite_jp_tagval_t* tags = NULL;
- int i,j;
- glite_jp_error_t err;
-
- assert(job != NULL);
- assert(attrs_inout != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- for (i = 0; attrs_inout[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (attrs_inout[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
-
-/* must be implemented via filetype plugin
- case GLITE_JP_ATTR_TIME:
-*/
- if (!got_info) {
- if (get_job_info(ctx, job, &owner, &tv_reg)) {
- err.code = ctx->error->code;
- err.desc = "Cannot retrieve job info";
- goto error_out;
- }
- got_info = 1;
- }
- break;
-
-/* must be implemented via filetype plugin
- case GLITE_JP_ATTR_TAG:
- if (!got_tags) {
- if (glite_jppsbe_open_file(ctx, job, GLITE_JP_FILECLASS_TAGS,
- O_RDONLY, &tags_handle)) {
- err.code = ctx->error->code;
- err.desc = "Cannot open tag file";
- goto error_out;
- }
- if (glite_jpps_tag_readall(ctx, tags_handle, &tags)) {
- err.code = ctx->error->code;
- err.desc = "Cannot read tags";
- glite_jppsbe_close_file(ctx, tags_handle);
- goto error_out;
- }
- glite_jppsbe_close_file(ctx, tags_handle);
- got_tags = 1;
- }
- break;
-*/
- default:
- err.code = EINVAL;
- err.desc = "Invalid attribute type";
- goto error_out;
- break;
- }
-
- switch (attrs_inout[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- attrs_inout[i].value.s = strdup(owner);
- if (!attrs_inout[i].value.s) {
- err.code = ENOMEM;
- err.desc = "Cannot copy owner string";
- goto error_out;
- }
- break;
- case GLITE_JP_ATTR_TIME:
- attrs_inout[i].value.time = tv_reg;
- break;
-
-/* must be implemented via filetype plugin
- case GLITE_JP_ATTR_TAG:
- for (j = 0; tags[j].name != NULL; j++) {
- if (!strcmp(tags[j].name, attrs_inout[i].attr.name)) {
- if (glite_jpps_tagval_copy(ctx, &tags[j],
- &attrs_inout[i].value.tag)) {
- err.code = ENOMEM;
- err.desc = "Cannot copy tag value";
- goto error_out;
- }
- break;
- }
- }
- if (!tags[j].name) attrs_inout[i].value.tag.name = NULL;
- break;
-*/
- default:
- break;
- }
- }
-
-error_out:
- free(owner);
- if (tags) for (j = 0; tags[j].name != NULL; j++) {
- free(tags[j].name);
- free(tags[j].value);
- }
- free(tags);
-
- if (err.code) {
- while (i > 0) {
- i--;
- switch (attrs_inout[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- free(attrs_inout[i].value.s);
- break;
- case GLITE_JP_ATTR_TAG:
- free(attrs_inout[i].value.tag.name);
- free(attrs_inout[i].value.tag.value);
- default:
- break;
- }
- }
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-static int compare_timeval(struct timeval a, struct timeval b)
-{
- if (a.tv_sec < b.tv_sec) return -1;
- if (a.tv_sec > b.tv_sec) return 1;
- if (a.tv_usec < b.tv_usec) return -1;
- if (a.tv_usec > b.tv_usec) return 1;
- return 0;
-}
-
-
-/* FIXME: disabled -- clarification wrt. filetype plugin needed */
-
-#if 0
-
-static int query_phase2(
- glite_jp_context_t ctx,
- const char *ownerhash,
- long regtime_tr,
- int q_tags,
- int md_tags,
- const glite_jp_query_rec_t query[],
- glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-);
-
-static int query_phase2(
- glite_jp_context_t ctx,
- const char *ownerhash,
- long regtime_tr,
- int q_tags,
- int md_tags,
- const glite_jp_query_rec_t query[],
- glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-)
-{
- char *time_dirname = NULL;
- DIR *time_dirp = NULL;
- struct dirent *jobent;
- char *info_fname = NULL;
- char *jobid = NULL;
- char *owner = NULL;
- struct timeval tv_reg;
- void *tags_handle = NULL;
- int matching;
- int i, j;
- glite_jp_tagval_t* tags = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (asprintf(&time_dirname, "%s/data/%s/%d", config->internal_path,
- ownerhash, regtime_tr) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- time_dirp = opendir(time_dirname);
- if (!time_dirp) {
- free(time_dirname);
- return 0; /* found nothing */
- }
- while ((jobent = readdir(time_dirp)) != NULL) {
- if (!strcmp(jobent->d_name, ".")) continue;
- if (!strcmp(jobent->d_name, "..")) continue;
- if (asprintf(&info_fname, "%s/%s/_info", time_dirname,
- jobent->d_name) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (get_job_info_int(ctx, info_fname, &jobid, &owner, &tv_reg)) {
- err.code = EIO;
- err.desc = "Cannot retrieve job info";
- goto error_out;
- }
- if (q_tags || md_tags) {
- if (glite_jppsbe_open_file(ctx, jobid, GLITE_JP_FILECLASS_TAGS,
- O_RDONLY, &tags_handle)) {
- err.code = ctx->error->code;
- err.desc = "Cannot open tag file";
- goto error_out;
- }
- if (glite_jpps_tag_readall(ctx, tags_handle, &tags)) {
- err.code = ctx->error->code;
- err.desc = "Cannot read tags";
- glite_jppsbe_close_file(ctx, tags_handle);
- goto error_out;
- }
- glite_jppsbe_close_file(ctx, tags_handle);
- tags_handle = NULL;
- }
-
- matching = 1;
- for (i = 0; matching && query[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (query[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- if (query[i].value.s == NULL ||
- strcmp(query[i].value.s, owner)) matching = 0;
- break;
- case GLITE_JP_ATTR_TIME:
- switch (query[i].op) {
- case GLITE_JP_QUERYOP_EQUAL:
- matching = !compare_timeval(tv_reg, query[i].value.time);
- break;
- case GLITE_JP_QUERYOP_UNEQUAL:
- matching = compare_timeval(tv_reg, query[i].value.time);
- break;
- case GLITE_JP_QUERYOP_LESS:
- matching = compare_timeval(tv_reg, query[i].value.time) < 0;
- break;
- case GLITE_JP_QUERYOP_GREATER:
- matching = compare_timeval(tv_reg, query[i].value.time) > 0;
- break;
- case GLITE_JP_QUERYOP_WITHIN:
- matching = compare_timeval(tv_reg, query[i].value.time) >= 0
- && compare_timeval(tv_reg, query[i].value2.time) <= 0;
- break;
- }
- break;
- case GLITE_JP_ATTR_TAG:
- if (!tags) {
- matching = 0;
- break;
- }
- for (j = 0; tags[j].name != NULL; j++) {
- if (!strcmp(tags[j].name, query[i].attr.name)) {
- switch (query[i].op) {
- case GLITE_JP_QUERYOP_EQUAL:
- matching = !strcmp(tags[j].value, query[i].value.s);
- break;
- case GLITE_JP_QUERYOP_UNEQUAL:
- matching = strcmp(tags[j].value, query[i].value.s);
- break;
- case GLITE_JP_QUERYOP_LESS:
- matching = strcmp(tags[j].value, query[i].value.s) < 0;
- break;
- case GLITE_JP_QUERYOP_GREATER:
- matching = strcmp(tags[j].value, query[i].value.s) > 0;
- break;
- case GLITE_JP_QUERYOP_WITHIN:
- matching = strcmp(tags[j].value, query[i].value.s) >= 0 \
- && strcmp(tags[j].value, query[i].value2.s) <= 0 ;
- break;
- default:
- break;
- }
- }
- }
- break;
- default:
- break;
- }
- }
- if (!matching) {
- free(info_fname); info_fname = NULL;
- free(jobid); jobid = NULL;
- if (tags) for (j = 0; tags[j].name != NULL; j++) {
- free(tags[j].name);
- free(tags[j].value);
- }
- free(tags); tags = NULL;
- continue;
- }
-
- for (i = 0; metadata[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- metadata[i].value.s = owner;
- break;
- case GLITE_JP_ATTR_TIME:
- metadata[i].value.time = tv_reg;
- break;
- case GLITE_JP_ATTR_TAG:
- for (j = 0; tags[j].name != NULL; j++) {
- if (!strcmp(tags[j].name, metadata[i].attr.name)) {
- if (glite_jpps_tagval_copy(ctx, &tags[j],
- &metadata[i].value.tag)) {
- err.code = ENOMEM;
- err.desc = "Cannot copy tag value";
- goto error_out;
- }
- break;
- }
- }
- if (!tags[j].name) {
- metadata[i].value.tag.name = NULL;
- metadata[i].value.tag.value = NULL;
- }
- break;
- default:
- break;
- }
- }
- (*callback)(ctx, jobid, metadata);
- free(jobid); jobid = NULL;
- while (i > 0) {
- i--;
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_TAG:
- free(metadata[i].value.tag.name);
- free(metadata[i].value.tag.value);
- default:
- break;
- }
- }
- }
-
-error_out:
- if (tags) for (j = 0; tags[j].name != NULL; j++) {
- free(tags[j].name);
- free(tags[j].value);
- }
- if (tags_handle) glite_jppsbe_close_file(ctx, tags_handle);
- free(info_fname);
- free(owner);
- free(jobid);
- closedir(time_dirp);
- free(time_dirname);
- if (err.code) {
- while (i > 0) {
- i--;
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_TAG:
- free(metadata[i].value.tag.name);
- free(metadata[i].value.tag.value);
- default:
- break;
- }
- }
- return glite_jp_stack_error(ctx,&err);
- } else
- return 0;
-}
-
-int glite_jppsbe_query(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t query[],
- const glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-)
-{
- /* XXX clone metadata */
- int i;
- char *q_exact_owner = NULL;
- char *ownerhash = NULL;
- long q_min_time = 0;
- long q_max_time = LONG_MAX;
- long q_min_time_tr;
- long q_max_time_tr;
- int q_with_tags = 0;
- int md_info = 0;
- int md_tags = 0;
- char *owner_dirname = NULL;
- DIR *owner_dirp = NULL;
- struct dirent *ttimeent;
- char *data_dirname = NULL;
- DIR *data_dirp = NULL;
- struct dirent *ownerent;
- long ttime = 0;
- glite_jp_attrval_t *metadata_templ = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- for (i = 0; query[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- if (query[i].attr.type == GLITE_JP_ATTR_OWNER && query[i].op == GLITE_JP_QUERYOP_EQUAL) {
- q_exact_owner = query[i].value.s;
- }
- if (query[i].attr.type == GLITE_JP_ATTR_TIME) {
- switch (query[i].op) {
- case GLITE_JP_QUERYOP_EQUAL:
- q_min_time = query[i].value.time.tv_sec;
- q_max_time = query[i].value.time.tv_sec + 1;
- break;
- case GLITE_JP_QUERYOP_LESS:
- if (q_max_time > query[i].value.time.tv_sec + 1)
- q_max_time = query[i].value.time.tv_sec + 1;
- break;
- case GLITE_JP_QUERYOP_WITHIN:
- if (q_max_time > query[i].value2.time.tv_sec + 1)
- q_max_time = query[i].value2.time.tv_sec + 1;
- /* fallthrough */
- case GLITE_JP_QUERYOP_GREATER:
- if (q_min_time < query[i].value.time.tv_sec)
- q_min_time = query[i].value.time.tv_sec;
- break;
- default:
- err.code = EINVAL;
- err.desc = "Invalid query op";
- return glite_jp_stack_error(ctx,&err);
- break;
- }
- }
- if (query[i].attr.type == GLITE_JP_ATTR_TAG)
- q_with_tags = 1;
-
- }
-
- for (i = 0; metadata[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- case GLITE_JP_ATTR_TIME:
- md_info = 1;
- break;
- case GLITE_JP_ATTR_TAG:
- md_tags = 1;
- break;
- default:
- err.code = EINVAL;
- err.desc = "Invalid attribute type in metadata parameter";
- return glite_jp_stack_error(ctx,&err);
- break;
- }
- }
- metadata_templ = (glite_jp_attrval_t *) calloc(i + 1, sizeof(glite_jp_attrval_t));
- if (!metadata_templ) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- memcpy(metadata_templ, metadata, (i + 1) * sizeof(glite_jp_attrval_t));
-
- q_min_time_tr = regtime_trunc(q_min_time);
- q_max_time_tr = regtime_ceil(q_max_time);
-
- if (q_exact_owner) {
- ownerhash = str2md5(q_exact_owner); /* static buffer */
- if (asprintf(&owner_dirname, "%s/data/%s", config->internal_path, ownerhash) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- owner_dirp = opendir(owner_dirname);
- free(owner_dirname);
- if (!owner_dirp) {
- free(metadata_templ);
- return 0; /* found nothing */
- }
- while ((ttimeent = readdir(owner_dirp)) != NULL) {
- if (!strcmp(ttimeent->d_name, ".")) continue;
- if (!strcmp(ttimeent->d_name, "..")) continue;
- ttime = atol(ttimeent->d_name);
- if (ttime >= q_min_time_tr && ttime < q_max_time_tr) {
- if (query_phase2(ctx, ownerhash, ttime, q_with_tags, md_tags,
- query, metadata_templ, callback)) {
- err.code = EIO;
- err.desc = "query_phase2() error";
- goto error_out;
- }
- }
- }
- } else { /* !q_exact_owner */
- if (asprintf(&data_dirname, "%s/data", config->internal_path) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- data_dirp = opendir(data_dirname);
- if (!data_dirp) {
- err.code = EIO;
- err.desc = "Cannot open data directory";
- goto error_out;
- }
- while ((ownerent = readdir(data_dirp)) != NULL) {
- if (!strcmp(ownerent->d_name, ".")) continue;
- if (!strcmp(ownerent->d_name, "..")) continue;
- if (asprintf(&owner_dirname, "%s/data/%s", config->internal_path,
- ownerent->d_name) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- owner_dirp = opendir(owner_dirname);
- free(owner_dirname);
- if (!owner_dirp) {
- err.code = EIO;
- err.desc = "Cannot open owner data directory";
- goto error_out;
- }
- while ((ttimeent = readdir(owner_dirp)) != NULL) {
- if (!strcmp(ttimeent->d_name, ".")) continue;
- if (!strcmp(ttimeent->d_name, "..")) continue;
- ttime = atol(ttimeent->d_name);
- if (ttime >= q_min_time_tr && ttime < q_max_time_tr) {
- if (query_phase2(ctx, ownerent->d_name, ttime, q_with_tags, md_tags,
- query, metadata_templ, callback)) {
- err.code = EIO;
- err.desc = "query_phase2() error";
- goto error_out;
- }
- }
- }
- closedir(owner_dirp); owner_dirp = NULL;
- }
- closedir(data_dirp); data_dirp = NULL;
- }
- return 0;
-
-error_out:
- if (owner_dirp) closedir(owner_dirp);
- if (data_dirp) closedir(data_dirp);
- free(data_dirname);
- free(metadata_templ);
- return glite_jp_stack_error(ctx,&err);
-}
-
-#else
-
-/* placeholder instead */
-int glite_jppsbe_query(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t query[],
- const glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-)
-{
- glite_jp_error_t err;
- err.code = ENOSYS;
- err.desc = "not implemented";
- return glite_jp_stack_error(ctx,&err);
-}
-
-#endif
-
-/* XXX:
-- no primary authorization yet
-- no concurrency control yet
-- partial success in pwrite,append
-- "unique" part of jobid is assumed to be unique across bookkeeping servers
-- repository versioning not fully implemented yet
-*/
+++ /dev/null
-#include <stdio.h>
-#include <time.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-
-#include "glite/jp/types.h"
-
-#include "feed.h"
-#include "is_client.h"
-/* FIXME
-#include "jpis_H.h"
-#include "jpis_.nsmap"
-*/
-
-int glite_jpps_single_feed(
- glite_jp_context_t ctx,
- const char *destination,
- const char *job,
- glite_jp_attrval_t const *attrs
-)
-{
- /* TODO: really call JP Index server (via interlogger) */
- printf("feed to %s, job %s\n",destination,job);
-
-/* FIXME */
-#if 0
- if (soap_call_jpsrv__UpdateJobs(ctx->other_soap,destination,"",
- /* FIXME: feedId */ "",
- /* FIXME: UpdateJobsData */ NULL,
- 0,
- NULL
- )) fprintf(stderr,"UpdateJobs: %s %s\n",ctx->other_soap->fault->faultcode,
- ctx->other_soap->fault->faultstring);
-
-#endif
- return 0;
-}
+++ /dev/null
-int glite_jpps_single_feed(glite_jp_context_t,const char *,const char *,glite_jp_attrval_t const *);
+++ /dev/null
-#include "soap_version.h"
-
-#if GSOAP_VERSION >= 20700
-#define INPUT_SANDBOX jptype__UploadClass__INPUT_SANDBOX
-#define OUTPUT_SANDBOX jptype__UploadClass__OUTPUT_SANDBOX
-#define JOB_LOG jptype__UploadClass__JOB_LOG
-
-#define OWNER jptype__AttributeType__OWNER
-#define TIME jptype__AttributeType__TIME
-#define TAG jptype__AttributeType__TAG
-
-#define EQUAL jptype__queryOp__EQUAL
-#define UNEQUAL jptype__queryOp__UNEQUAL
-#define LESS jptype__queryOp__LESS
-#define GREATER jptype__queryOp__GREATER
-#define WITHIN jptype__queryOp__WITHIN
-
-#else
-
-#define __jpsrv__RegisterJob __ns1__RegisterJob
-#define __jpsrv__StartUpload __ns1__StartUpload
-#define __jpsrv__CommitUpload __ns1__CommitUpload
-#define __jpsrv__RecordTag __ns1__RecordTag
-#define __jpsrv__FeedIndex __ns1__FeedIndex
-#define __jpsrv__FeedIndexRefresh __ns1__FeedIndexRefresh
-#define __jpsrv__GetJob __ns1__GetJob
-
-#define SOAP_TYPE___jpsrv__RegisterJob SOAP_TYPE___ns1__RegisterJob
-#define SOAP_TYPE___jpsrv__StartUpload SOAP_TYPE___ns1__StartUpload
-#define SOAP_TYPE___jpsrv__CommitUpload SOAP_TYPE___ns1__CommitUpload
-#define SOAP_TYPE___jpsrv__GetJob SOAP_TYPE___ns1__GetJob
-
-#endif
-
+++ /dev/null
-#ident "$Header$"
-
-#include "mysql.h" // MySql header file
-#include "mysqld_error.h"
-#include "errmsg.h"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <time.h>
-#include <limits.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-
-#include "db.h"
-
-#define DEFAULTCS "jpps/@localhost:jpps1"
-#define GLITE_JP_LB_MYSQL_VERSION 40018
-
-static int my_err(glite_jp_context_t ctx, char *function)
-{
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = function;
- err.code = EIO; /* XXX */
- err.desc = mysql_error((MYSQL *) ctx->dbhandle);
- return glite_jp_stack_error(ctx,&err);
-}
-
-struct _glite_jp_db_stmt_t {
- MYSQL_RES *result;
- glite_jp_context_t ctx;
-};
-
-int glite_jp_db_connect(glite_jp_context_t ctx,char *cs)
-{
- char *buf = NULL;
- char *host,*user,*pw,*db;
- char *slash,*at,*colon;
-
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (!cs) cs = DEFAULTCS;
-
- if (!(ctx->dbhandle = (void *) mysql_init(NULL))) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
-
- mysql_options(ctx->dbhandle, MYSQL_READ_DEFAULT_FILE, "my");
-
- host = user = pw = db = NULL;
-
- buf = strdup(cs);
- slash = strchr(buf,'/');
- at = strrchr(buf,'@');
- colon = strrchr(buf,':');
-
- if (!slash || !at || !colon) {
- free(buf);
- err.code = EINVAL;
- err.desc = "Invalid DB connect string";
- return glite_jp_stack_error(ctx,&err);
- }
-
- *slash = *at = *colon = 0;
- host = at+1;
- user = buf;
- pw = slash+1;
- db = colon+1;
-
- if (!mysql_real_connect((MYSQL *) ctx->dbhandle,host,user,pw,db,0,NULL,CLIENT_FOUND_ROWS)) {
- free(buf);
- return my_err(ctx, __FUNCTION__);
- }
-
- free(buf);
- return 0;
-}
-
-void glite_jp_db_close(glite_jp_context_t ctx)
-{
- mysql_close((MYSQL *) ctx->dbhandle);
- ctx->dbhandle = NULL;
-}
-
-int glite_jp_db_execstmt(glite_jp_context_t ctx,char *txt,glite_jp_db_stmt_t *stmt)
-{
- int merr;
- int retry_nr = 0;
- int do_reconnect = 0;
-
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (stmt) {
- *stmt = NULL;
- }
-
- while (retry_nr == 0 || do_reconnect) {
- do_reconnect = 0;
- if (mysql_query((MYSQL *) ctx->dbhandle,txt)) {
- /* error occured */
- switch (merr = mysql_errno((MYSQL *) ctx->dbhandle)) {
- case 0:
- break;
- case ER_DUP_ENTRY:
- err.code = EEXIST;
- err.desc = mysql_error((MYSQL *) ctx->dbhandle);
- glite_jp_stack_error(ctx,&err);
- return -1;
- break;
- case CR_SERVER_LOST:
- if (retry_nr <= 0)
- do_reconnect = 1;
- break;
- default:
- my_err(ctx, __FUNCTION__);
- return -1;
- break;
- }
- }
- retry_nr++;
- }
-
- if (stmt) {
- *stmt = malloc(sizeof(**stmt));
- if (!*stmt) {
- err.code = ENOMEM;
- glite_jp_stack_error(ctx,&err);
- return -1;
- }
- memset(*stmt,0,sizeof(**stmt));
- (**stmt).ctx = ctx;
- (**stmt).result = mysql_store_result((MYSQL *) ctx->dbhandle);
- if (!(**stmt).result) {
- if (mysql_errno((MYSQL *) ctx->dbhandle)) {
- my_err(ctx, __FUNCTION__);
- return -1;
- }
- }
- } else {
- MYSQL_RES *r = mysql_store_result((MYSQL *) ctx->dbhandle);
- mysql_free_result(r);
- }
-
- return mysql_affected_rows((MYSQL *) ctx->dbhandle);
-}
-
-int glite_jp_db_fetchrow(glite_jp_db_stmt_t stmt,char **res)
-{
- MYSQL_ROW row;
- glite_jp_context_t ctx = stmt->ctx;
- int nr,i;
- unsigned long *len;
-
- glite_jp_clear_error(ctx);
-
- if (!stmt->result) return 0;
-
- if (!(row = mysql_fetch_row(stmt->result))) {
- if (mysql_errno((MYSQL *) ctx->dbhandle)) {
- my_err(ctx, __FUNCTION__);
- return -1;
- } else return 0;
- }
-
- nr = mysql_num_fields(stmt->result);
- len = mysql_fetch_lengths(stmt->result);
- for (i=0; i<nr; i++) res[i] = len[i] ? strdup(row[i]) : strdup("");
-
- return nr;
-}
-
-int glite_jp_db_querycolumns(glite_jp_db_stmt_t stmt,char **cols)
-{
- int i = 0;
- MYSQL_FIELD *f;
-
- while ((f = mysql_fetch_field(stmt->result))) cols[i++] = f->name;
- return i == 0;
-}
-
-void glite_jp_db_freestmt(glite_jp_db_stmt_t *stmt)
-{
- if (*stmt) {
- if ((**stmt).result) mysql_free_result((**stmt).result);
- free(*stmt);
- *stmt = NULL;
- }
-}
-
-
-char *glite_jp_db_timetodb(time_t t)
-{
- struct tm *tm = gmtime(&t);
- char tbuf[256];
-
- /* XXX: the very end of our days */
- if (!tm && t == (time_t) LONG_MAX) return strdup("9999-12-31 23:59:59");
-
- sprintf(tbuf,"'%4d-%02d-%02d %02d:%02d:%02d'",tm->tm_year+1900,tm->tm_mon+1,
- tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec);
-
- return strdup(tbuf);
-}
-
-time_t glite_jp_db_dbtotime(char *t)
-{
- struct tm tm;
-
- memset(&tm,0,sizeof(tm));
- setenv("TZ","UTC",1); tzset();
- sscanf(t,"%4d-%02d-%02d %02d:%02d:%02d",
- &tm.tm_year,&tm.tm_mon,&tm.tm_mday,
- &tm.tm_hour,&tm.tm_min,&tm.tm_sec);
- tm.tm_year -= 1900;
- tm.tm_mon--;
-
- return mktime(&tm);
-}
-
-int glite_jp_db_dbcheckversion(glite_jp_context_t ctx)
-{
- MYSQL *m = (MYSQL *) ctx->dbhandle;
- const char *ver_s = mysql_get_server_info(m);
- int major,minor,sub,version;
-
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (!ver_s || 3 != sscanf(ver_s,"%d.%d.%d",&major,&minor,&sub)) {
- err.code = EINVAL;
- err.desc = "problem checking MySQL version";
- return glite_jp_stack_error(ctx,&err);
- }
-
- version = 10000*major + 100*minor + sub;
-
- if (version < GLITE_JP_LB_MYSQL_VERSION) {
- char msg[300];
-
- snprintf(msg,sizeof msg,"Your MySQL version is %d. At least %d required.",version, GLITE_JP_LB_MYSQL_VERSION);
- err.code = EINVAL;
- err.desc = msg;
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
+++ /dev/null
-#ident "$Header$"
-
-#include <getopt.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <assert.h>
-#include <limits.h>
-#include <dirent.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-#include "glite/jp/strmd5.h"
-
-#include "tags.h"
-#include "backend.h"
-#include "db.h"
-
-#include "jpps_H.h" /* XXX: SOAP_TYPE___jpsrv__GetJob */
-
-#include "jptype_map.h"
-
-#define FTPBE_DEFAULT_DB_CS "jpps/@localhost:jpps"
-
-struct ftpbe_config {
- char *internal_path;
- char *external_path;
- char *db_cs;
-// char *gridmap;
- char *logname;
-};
-
-static struct ftpbe_config *config = NULL;
-
-struct fhandle_rec {
- int fd;
- int fd_append;
-};
-typedef struct fhandle_rec *fhandle;
-
-static struct option ftpbe_opts[] = {
- { "ftp-internal-path", 1, NULL, 'I' },
- { "ftp-external-path", 1, NULL, 'E' },
- { "ftp-db-cs", 1, NULL, 'D' },
-// { "ftp-gridmap", 1, NULL, 'G' },
- { NULL, 0, NULL, 0 }
-};
-
-/*******************************************************************************
- Internal helpers
-*******************************************************************************/
-
-
-static int config_check(
- glite_jp_context_t ctx,
- struct ftpbe_config *config)
-{
- return config == NULL ||
- config->internal_path == NULL ||
- config->external_path == NULL ||
- config->db_cs == NULL ||
-// config->gridmap == NULL ||
- config->logname == NULL;
-
- /* XXX check reality */
-}
-
-static int jobid_unique_pathname(glite_jp_context_t ctx, const char *job,
- char **unique, char **ju_path, int get_path)
-{
- char *p;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- p = strrchr(job, '/');
- if (!p) {
- err.code = EINVAL;
- err.desc = "Malformed jobid";
- return glite_jp_stack_error(ctx,&err);
- }
- /* XXX thorough checks */
- if (!(*unique = strdup(p+1))) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- if (get_path) {
- if (!(*ju_path = strdup(p+1))) {
- free(*unique);
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- *(*ju_path + 10) = '\0';
- }
- return 0;
-}
-
-static int mkdirpath(const char* path, int prefixlen)
-{
- char *wpath, *p;
- int goout, ret;
-
- wpath = strdup(path);
- if (!wpath) {
- errno = ENOMEM;
- return -1;
- }
-
- p = wpath + prefixlen;
- goout = 0;
- while (!goout) {
- while (*p == '/') p++;
- while (*p != '/' && *p != '\0') p++;
- goout = (*p == '\0');
- *p = '\0';
- ret = mkdir(wpath, S_IRUSR | S_IWUSR | S_IXUSR);
- if (ret < 0 && errno != EEXIST) break;
- *p = '/';
- }
- free(wpath);
- return goout ? 0 : ret;
-}
-
-static int store_user(glite_jp_context_t ctx, const char *userid, const char *subj)
-{
- glite_jp_error_t err;
- char *stmt;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(userid != NULL);
- assert(subj != NULL);
-
- trio_asprintf(&stmt,"insert into users(userid,cert_subj) "
- "values ('%|Ss','%|Ss')",userid,subj);
- if (!stmt) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (glite_jp_db_execstmt(ctx, stmt, NULL) < 0) {
- if (ctx->error->code == EEXIST)
- glite_jp_clear_error(ctx);
- else {
- free(stmt);
- err.code = EIO;
- err.desc = "DB access failed";
- return glite_jp_stack_error(ctx,&err);
- }
- }
- free(stmt);
-
- return 0;
-}
-
-static long regtime_trunc(long tv_sec)
-{
- return tv_sec / (86400*7);
-}
-
-static long regtime_ceil(long tv_sec)
-{
- return (tv_sec % (86400*7)) ? tv_sec/(86400*7)+1 : tv_sec/(86400*7) ;
-}
-
-/********************************************************************************
- Backend calls
-********************************************************************************/
-int glite_jppsbe_init(
- glite_jp_context_t ctx,
- int argc,
- char *argv[]
-)
-{
- glite_jp_error_t err;
- int opt;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- config = (struct ftpbe_config *) calloc(1, sizeof *config);
- if (!config) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
-
- config->logname = getlogin();
-
- while ((opt = getopt_long(argc, argv, "I:E:" /* G: */, ftpbe_opts, NULL)) != EOF) {
- switch (opt) {
- case 'I': config->internal_path = optarg; break;
- case 'E': config->external_path = optarg; break;
- case 'D': config->db_cs = optarg; break;
-// case 'G': config->gridmap = optarg; break;
- default: break;
- }
- }
-
- /* Defaults */
- if (!config->db_cs) config->db_cs = strdup(FTPBE_DEFAULT_DB_CS);
-
- if (config_check(ctx, config)) {
- err.code = EINVAL;
- err.desc = "Invalid FTP backend configuration";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (glite_jp_db_connect(ctx, config->db_cs)) {
- err.code = EIO;
- err.desc = "Cannot access backend's database (during init)";
- return glite_jp_stack_error(ctx,&err);
- } else {
- glite_jp_db_close(ctx); /* slaves open their own connections */
- }
-
- return 0;
-}
-
-int glite_jppsbe_init_slave(
- glite_jp_context_t ctx
-)
-{
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (glite_jp_db_connect(ctx, config->db_cs)) {
- err.code = EIO;
- err.desc = "Cannot access backend's database";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-int glite_jppsbe_register_job(
- glite_jp_context_t ctx,
- const char *job,
- const char *owner
-)
-{
- glite_jp_error_t err;
- char *data_dir = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
- char *ownerhash = NULL;
- struct timeval reg_tv;
- char *stmt = NULL;
- char *dbtime = NULL;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job != NULL);
- assert(owner != NULL);
-
- gettimeofday(®_tv, NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- ownerhash = str2md5(owner); /* static buffer */
- if (store_user(ctx, ownerhash, owner)) {
- err.code = EIO;
- err.desc = "Cannot store user entry";
- goto error_out;
- }
-
- dbtime = glite_jp_db_timetodb(reg_tv.tv_sec);
- if (!dbtime) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- trio_asprintf(&stmt,"insert into jobs(jobid,dg_jobid,owner,reg_time) "
- "values ('%|Ss','%|Ss','%|Ss', %s)",
- ju, job, ownerhash, dbtime);
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (glite_jp_db_execstmt(ctx, stmt, NULL) < 0) {
- if (ctx->error->code == EEXIST) {
- err.code = EEXIST;
- err.desc = "Job already registered";
- }
- else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
- if (asprintf(&data_dir, "%s/data/%s/%d/%s",
- config->internal_path, ownerhash, regtime_trunc(reg_tv.tv_sec), ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (mkdirpath(data_dir, strlen(config->internal_path)) < 0 &&
- errno != EEXIST) {
- err.code = errno;
- err.desc = "Cannot mkdir jobs's data directory";
- goto error_out;
- }
-
-error_out:
- free(data_dir);
- free(stmt); free(dbtime);
- free(ju); free(ju_path);
-
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-#if 0
-static int add_to_gridmap(glite_jp_context_t ctx, const char *dn)
-{
- FILE *gridmap = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- gridmap = fopen(config->gridmap, "a");
- if (!gridmap) {
- err.code = errno;
- err.desc = "Cannot open gridmap file";
- return glite_jp_stack_error(ctx,&err);
- }
- if (fprintf(gridmap, "\"%s\" %s\n", dn, config->logname) < 6 ||
- ferror(gridmap)) {
- err.code = EIO;
- err.desc = "Cannot write to gridmap file";
- fclose(gridmap);
- return glite_jp_stack_error(ctx,&err);
- }
- fclose(gridmap);
- return 0;
-}
-
-static int remove_from_gridmap(glite_jp_context_t ctx, const char *dn)
-{
- FILE *gridmap = NULL;
- char *temp_name = NULL;
- FILE *temp_file = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- /* XXX */
- return 0;
-}
-#endif
-
-int glite_jppsbe_start_upload(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name,
- const char *content_type,
- char **destination_out,
- time_t *commit_before_inout
-)
-{
- char *data_basename = NULL;
- char *data_fname = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
- char *peername = NULL;
- char *peerhash = NULL;
-
- char *stmt = NULL;
- glite_jp_db_stmt_t db_res;
- int db_retn;
- char *db_row[2] = { NULL, NULL };
-
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job!=NULL);
- assert(destination_out!=NULL);
-
- assert(class!=NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- peername = glite_jp_peer_name(ctx);
- if (peername == NULL) {
- err.code = EINVAL;
- err.desc = "Cannot obtain client certificate info";
- goto error_out;
- }
-
- trio_asprintf(&stmt, "select owner, reg_time from jobs"
- " where jobid='%|Ss'", ju);
-
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if ((db_retn = glite_jp_db_execstmt(ctx, stmt, &db_res)) <= 0) {
- if (db_retn == 0) {
- err.code = ENOENT;
- err.desc = "No such job registered";
- } else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
- db_retn = glite_jp_db_fetchrow(db_res, db_row);
- if (db_retn != 2) {
- glite_jp_db_freestmt(&db_res);
- err.code = EIO;
- err.desc = "DB access failed";
- goto error_out;
- }
-
- glite_jp_db_freestmt(&db_res);
-
- /* XXX authorization done in soap_ops.c */
-
- /* XXX name length */
- if (asprintf(&data_basename, "%s%s%s", class,
- (name != NULL) ? "." : "",
- (name != NULL) ? name : "") == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (asprintf(&data_fname, "%s/data/%s/%d/%s/%s",
- config->internal_path, db_row[0],
- regtime_trunc(glite_jp_db_dbtotime(db_row[1])),
- ju, data_basename) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (asprintf(destination_out, "%s/data/%s/%d/%s/%s",
- config->external_path, db_row[0],
- regtime_trunc(glite_jp_db_dbtotime(db_row[1])),
- ju, data_basename) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (commit_before_inout != NULL)
- /* XXX no timeout enforced */
- /* XXX: gsoap does not like so much, one year should be enough
- *commit_before_inout = (time_t) LONG_MAX;
- */
- *commit_before_inout = time(NULL) + 365*24*60*60;
-
- /*
- if (add_to_gridmap(ctx, peername)) {
- err.code = EIO;
- err.desc = "Cannot add peer DN to ftp server authorization file";
- goto error_out;
- }
- */
-
- peerhash = str2md5(peername); /* static buffer */
- if (store_user(ctx, peerhash, peername)) {
- err.code = EIO;
- err.desc = "Cannot store upload user entry";
- goto error_out;
- }
-
- free(stmt); stmt = NULL;
- trio_asprintf(&stmt,"insert into files"
- "(jobid,filename,int_path,ext_url,state,deadline,ul_userid) "
- "values ('%|Ss','%|Ss','%|Ss','%|Ss','%|Ss', '%|Ss', '%|Ss')",
- ju, data_basename, data_fname, *destination_out, "uploading",
- glite_jp_db_timetodb(*commit_before_inout), peerhash);
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (glite_jp_db_execstmt(ctx, stmt, NULL) < 0) {
- if (ctx->error->code == EEXIST) {
- err.code = EEXIST;
- err.desc = "File already stored or upload in progress";
- } else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
-error_out:
- free(db_row[0]); free(db_row[1]);
- free(stmt);
- free(data_basename);
- free(data_fname);
- free(ju); free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_commit_upload(
- glite_jp_context_t ctx,
- const char *destination
-)
-{
- char *peername = NULL;
- char *peerhash = NULL;
-
- char *stmt = NULL;
- glite_jp_db_stmt_t db_res;
- int db_retn;
- char *db_row[7] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL };
- int i;
-
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(destination != NULL);
-
- trio_asprintf(&stmt, "select * from files where "
- "ext_url='%|Ss' and state='uploading'", destination);
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if ((db_retn = glite_jp_db_execstmt(ctx, stmt, &db_res)) <= 0) {
- if (db_retn == 0) {
- err.code = ENOENT;
- err.desc = "No such upload in progress";
- } else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
- db_retn = glite_jp_db_fetchrow(db_res, db_row);
- if (db_retn != 7) {
- glite_jp_db_freestmt(&db_res);
- err.code = EIO;
- err.desc = "DB access failed";
- goto error_out;
- }
- glite_jp_db_freestmt(&db_res);
-
- peername = glite_jp_peer_name(ctx);
- if (peername == NULL) {
- err.code = EINVAL;
- err.desc = "Cannot obtain client certificate info";
- goto error_out;
- }
-
- peerhash = str2md5(peername); /* static buffer */
- if (strcmp(peerhash, db_row[6])) {
- err.code = EPERM;
- err.desc = "Upload started by client with different identity";
- goto error_out;
- }
-
- free(stmt);
- trio_asprintf(&stmt,"update files set state='committed', deadline=NULL "
- "where jobid='%|Ss' and filename='%|Ss'", db_row[0], db_row[1]);
-
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (glite_jp_db_execstmt(ctx, stmt, NULL) < 0) {
- err.code = EIO;
- err.desc = "DB access failed";
- goto error_out;
- }
-error_out:
- for (i=0; i<7; i++) free(db_row[i]);
- free(peername);
- free(stmt);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_destination_info(
- glite_jp_context_t ctx,
- const char *destination,
- char **job,
- char **class,
- char **name
-)
-{
- char *stmt = NULL;
- glite_jp_db_stmt_t db_res;
- int db_retn;
- char *db_row[2] = { NULL, NULL};
- int i;
- char *cp = NULL;
-
- char *classname = NULL;
- glite_jp_error_t err;
-
- assert(destination != NULL);
- assert(job != NULL);
- assert(class != NULL);
- assert(name != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
-
- trio_asprintf(&stmt, "select j.dg_jobid,f.filename from jobs j,files f where "
- "f.ext_url='%|Ss' and j.jobid=f.jobid", destination);
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if ((db_retn = glite_jp_db_execstmt(ctx, stmt, &db_res)) <= 0) {
- if (db_retn == 0) {
- err.code = ENOENT;
- err.desc = "Invalid destination string";
- } else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
- db_retn = glite_jp_db_fetchrow(db_res, db_row);
- if (db_retn != 2) {
- glite_jp_db_freestmt(&db_res);
- err.code = EIO;
- err.desc = "DB access failed";
- goto error_out;
- }
- glite_jp_db_freestmt(&db_res);
-
- *job = strdup(db_row[0]);
-
- cp = strchr(db_row[1],'.');
- if (!cp) {
- *name = NULL;
- } else {
- *cp++ = '\0';
- *name = strdup(cp);
- }
- *class = strdup(db_row[1]);
-
- if (!*job || !*class) {
- err.code = ENOMEM;
- goto error_out;
- }
-
-error_out:
- for (i=0; i<2; i++) free(db_row[i]);
- free(stmt);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-
-int glite_jppsbe_get_job_url(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name,
- char **url_out
-)
-{
- char *data_basename = NULL;
- char *data_fname = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
-
- char *stmt = NULL;
- glite_jp_db_stmt_t db_res;
- int db_retn;
- char *db_row[3] = { NULL, NULL, NULL };
-
- long reg_time;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job!=NULL);
- assert(url_out != NULL);
-
- assert(class!=NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/ : ""name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- trio_asprintf(&stmt, "select j.owner,reg_time,u.cert_subj from jobs j, users u "
- "where j.jobid='%|Ss' and j.owner = u.userid", ju);
-
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if ((db_retn = glite_jp_db_execstmt(ctx, stmt, &db_res)) <= 0) {
- if (db_retn == 0) {
- err.code = ENOENT;
- err.desc = "No such job registered";
- } else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
- free(stmt); stmt = NULL;
-
- db_retn = glite_jp_db_fetchrow(db_res, db_row);
- if (db_retn != 3) {
- glite_jp_db_freestmt(&db_res);
- err.code = EIO;
- err.desc = "DB access failed";
- goto error_out;
- }
-
- glite_jp_db_freestmt(&db_res);
-
- if (glite_jpps_authz(ctx,SOAP_TYPE___jpsrv__GetJobFiles,job,db_row[2])) {
- err.code = EPERM;
- goto error_out;
- }
-
- /* XXX name length */
- if (asprintf(&data_basename, "%s%s%s", class,
- (name != NULL) ? "." : "",
- (name != NULL) ? name : "") == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (asprintf(url_out, "%s/data/%s/%d/%s/%s",
- config->external_path, db_row[0],
- regtime_trunc(glite_jp_db_dbtotime(db_row[1])),
- ju, data_basename) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- trio_asprintf(&stmt,"select 'x' from files where jobid='%|Ss' "
- "and ext_url = '%|Ss' "
- "and state='committed' ",ju,*url_out);
-
- if ((db_retn = glite_jp_db_execstmt(ctx,stmt,&db_res)) <= 0) {
- if (db_retn == 0) {
- err.code = ENOENT;
- err.desc = "not uploaded yet";
- }
- else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- /* goto error_out; */
- }
-
-error_out:
- free(db_row[0]); free(db_row[1]);
- free(stmt);
- free(data_basename);
- free(ju); free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-static int get_job_fname(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name,
- char **fname_out
-)
-{
- char *data_basename = NULL;
- char *ju = NULL;
- char *ju_path = NULL;
-
- char *stmt = NULL;
- glite_jp_db_stmt_t db_res;
- int db_retn;
- char *db_row[2] = { NULL, NULL };
-
- long reg_time;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- assert(job!=NULL);
- assert(fname_out != NULL);
-
- assert(class!=NULL);
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- trio_asprintf(&stmt, "select owner, reg_time from jobs "
- "where jobid='%|Ss'", ju);
-
- if (!stmt) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if ((db_retn = glite_jp_db_execstmt(ctx, stmt, &db_res)) <= 0) {
- if (db_retn == 0) {
- err.code = ENOENT;
- err.desc = "No such job registered";
- } else {
- err.code = EIO;
- err.desc = "DB access failed";
- }
- goto error_out;
- }
-
- db_retn = glite_jp_db_fetchrow(db_res, db_row);
- if (db_retn != 2) {
- glite_jp_db_freestmt(&db_res);
- err.code = EIO;
- err.desc = "DB access failed";
- goto error_out;
- }
-
- glite_jp_db_freestmt(&db_res);
-
- /* XXX name length */
- if (asprintf(&data_basename, "%s%s%s", class,
- (name != NULL) ? "." : "", (name != NULL) ? name : "") == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- if (asprintf(fname_out, "%s/data/%s/%d/%s/%s",
- config->internal_path, db_row[0],
- regtime_trunc(glite_jp_db_dbtotime(db_row[1])),
- ju, data_basename) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
-
-error_out:
- free(db_row[0]); free(db_row[1]);
- free(stmt);
- free(data_basename);
- free(ju); free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-
-int glite_jppsbe_open_file(
- glite_jp_context_t ctx,
- const char *job,
- const char *class,
- const char *name,
- int mode,
- void **handle_out
-)
-{
- fhandle handle = NULL;
- char* fname = NULL;
- glite_jp_error_t err;
-
- assert(handle_out != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (get_job_fname(ctx, job, class, name, &fname)) {
- err.code = ctx->error->code;
- err.desc = "Cannot construct internal filename";
- return glite_jp_stack_error(ctx,&err);
- }
-
- handle = (fhandle) calloc(1,sizeof(*handle));
- if (handle == NULL) {
- err.code = ENOMEM;
- goto error_out;
- }
-
- handle->fd = open(fname, mode, S_IRUSR | S_IWUSR);
- if (handle->fd < 0) {
- err.code = errno;
- err.desc = "Cannot open requested file";
- free(handle);
- goto error_out;
- }
- handle->fd_append = open(fname, mode | O_APPEND, S_IRUSR | S_IWUSR);
- if (handle->fd_append < 0) {
- err.code = errno;
- err.desc = "Cannot open requested file for append";
- close(handle->fd);
- free(handle);
- goto error_out;
- }
- *handle_out = (void*) handle;
-
-error_out:
- free(fname);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_close_file(
- glite_jp_context_t ctx,
- void *handle
-)
-{
- glite_jp_error_t err;
-
- assert(handle != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (close(((fhandle)handle)->fd_append) < 0) {
- err.code = errno;
- err.desc = "Error closing file descriptor (fd_append)";
- goto error_out;
- }
- if (close(((fhandle)handle)->fd) < 0) {
- err.code = errno;
- err.desc = "Error closing file descriptor";
- goto error_out;
- }
-
-error_out:
- free(handle);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_pread(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset,
- ssize_t *nbytes_ret
-)
-{
- ssize_t ret;
- glite_jp_error_t err;
-
- assert(handle != NULL);
- assert(buf != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if ((ret = pread(((fhandle)handle)->fd, buf, nbytes, offset)) < 0) {
- err.code = errno;
- err.desc = "Error in pread()";
- return glite_jp_stack_error(ctx,&err);
- }
- *nbytes_ret = ret;
-
- return 0;
-}
-
-int glite_jppsbe_pwrite(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes,
- off_t offset
-)
-{
- glite_jp_error_t err;
-
- assert(handle != NULL);
- assert(buf != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (pwrite(((fhandle)handle)->fd, buf, nbytes, offset) < 0) {
- err.code = errno;
- err.desc = "Error in pwrite()";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-int glite_jppsbe_append(
- glite_jp_context_t ctx,
- void *handle,
- void *buf,
- size_t nbytes
-)
-{
- glite_jp_error_t err;
-
- assert(handle != NULL);
- assert(buf != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (write(((fhandle)handle)->fd_append, buf, nbytes) < 0) {
- err.code = errno;
- err.desc = "Error in write()";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-static int get_job_info(
- glite_jp_context_t ctx,
- const char *job,
- char **owner,
- struct timeval *tv_reg
-)
-{
- char *ju = NULL;
- char *ju_path = NULL;
- FILE *regfile = NULL;
- long reg_time_sec;
- long reg_time_usec;
- int ownerlen = 0;
- int info_version;
- char *int_fname = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (jobid_unique_pathname(ctx, job, &ju, &ju_path, 1) != 0) {
- err.code = ctx->error->code;
- err.desc = "Cannot obtain jobid unique path/name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (asprintf(&int_fname, "%s/regs/%s/%s.info",
- config->internal_path, ju_path, ju) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- if (errno == ENOENT)
- err.desc = "Job not registered";
- else
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%ld %*s %*s %d ", &info_version,
- ®_time_sec, ®_time_usec, &ownerlen) < 4 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- if (ownerlen) {
- *owner = (char *) calloc(1, ownerlen+1);
- if (!*owner) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (fgets(*owner, ownerlen+1, regfile) == NULL) {
- fclose(regfile);
- free(*owner);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- }
- fclose(regfile);
-
- tv_reg->tv_sec = reg_time_sec;
- tv_reg->tv_usec = reg_time_usec;
-
-error_out:
- free(int_fname);
- free(ju);
- free(ju_path);
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-static int get_job_info_int(
- glite_jp_context_t ctx,
- const char *int_fname,
- char **jobid,
- char **owner,
- struct timeval *tv_reg
-)
-{
- FILE *regfile = NULL;
- long reg_time_sec;
- long reg_time_usec;
- int ownerlen = 0;
- int info_version;
- char jobid_buf[256];
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- regfile = fopen(int_fname, "r");
- if (regfile == NULL) {
- err.code = errno;
- err.desc = "Cannot open jobs's reg info file";
- goto error_out;
- }
- if (fscanf(regfile, "%d %ld.%ld %s %*s %d ", &info_version,
- ®_time_sec, ®_time_usec, jobid_buf, &ownerlen) < 5 || ferror(regfile)) {
- fclose(regfile);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- *jobid = strdup(jobid_buf);
- if (ownerlen) {
- *owner = (char *) calloc(1, ownerlen+1);
- if (!*owner) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (fgets(*owner, ownerlen+1, regfile) == NULL) {
- fclose(regfile);
- free(*owner);
- err.code = errno;
- err.desc = "Cannot read jobs's reg info file";
- goto error_out;
- }
- }
- fclose(regfile);
-
- tv_reg->tv_sec = reg_time_sec;
- tv_reg->tv_usec = reg_time_usec;
-
-error_out:
- if (err.code) {
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-
-int glite_jppsbe_get_job_metadata(
- glite_jp_context_t ctx,
- const char *job,
- glite_jp_attrval_t attrs_inout[]
-)
-{
- int got_info = 0;
- struct timeval tv_reg;
- char *owner = NULL;
-/* do in plugin
- int got_tags = 0;
- void *tags_handle = NULL;
- glite_jp_tagval_t* tags = NULL;
-*/
- int i,j;
- glite_jp_error_t err;
-
- assert(job != NULL);
- assert(attrs_inout != NULL);
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- for (i = 0; attrs_inout[i].name; i++) {
-/* must be implemented via filetype plugin
- case GLITE_JP_ATTR_TIME:
-*/
- if (!strcmp(attrs_inout[i].name,GLITE_JP_ATTR_OWNER)) {
- if (!got_info) {
- if (get_job_info(ctx, job, &owner, &tv_reg)) {
- err.code = ctx->error->code;
- err.desc = "Cannot retrieve job info";
- goto error_out;
- }
- got_info = 1;
- }
- }
-
-/* must be implemented via filetype plugin
- case GLITE_JP_ATTR_TAG:
- if (!got_tags) {
- if (glite_jppsbe_open_file(ctx, job, GLITE_JP_FILECLASS_TAGS,
- O_RDONLY, &tags_handle)) {
- err.code = ctx->error->code;
- err.desc = "Cannot open tag file";
- goto error_out;
- }
- if (glite_jpps_tag_readall(ctx, tags_handle, &tags)) {
- err.code = ctx->error->code;
- err.desc = "Cannot read tags";
- glite_jppsbe_close_file(ctx, tags_handle);
- goto error_out;
- }
- glite_jppsbe_close_file(ctx, tags_handle);
- got_tags = 1;
- }
- break;
-*/
- else {
- err.code = EINVAL;
- err.desc = "Invalid attribute type";
- goto error_out;
- break;
- }
-
- if (!strcmp(attrs_inout[i].name,GLITE_JP_ATTR_OWNER)) {
- attrs_inout[i].value = strdup(owner);
- if (!attrs_inout[i].value) {
- err.code = ENOMEM;
- err.desc = "Cannot copy owner string";
- goto error_out;
- }
- attrs_inout[i].origin = GLITE_JP_ATTR_ORIG_SYSTEM;
- attrs_inout[i].origin_detail = NULL;
-
- /* FIXME: we must store job registration time somewhere */
- attrs_inout[i].timestamp = 0;
- }
-
-/* TODO:
- case GLITE_JP_ATTR_TIME:
- attrs_inout[i].value.time = tv_reg;
- break;
-*/
-
-/* must be implemented via filetype plugin
- case GLITE_JP_ATTR_TAG:
- for (j = 0; tags[j].name != NULL; j++) {
- if (!strcmp(tags[j].name, attrs_inout[i].attr.name)) {
- if (glite_jpps_tagval_copy(ctx, &tags[j],
- &attrs_inout[i].value.tag)) {
- err.code = ENOMEM;
- err.desc = "Cannot copy tag value";
- goto error_out;
- }
- break;
- }
- }
- if (!tags[j].name) attrs_inout[i].value.tag.name = NULL;
- break;
-*/
- }
-
-error_out:
- free(owner);
-/* plugin
- if (tags) for (j = 0; tags[j].name != NULL; j++) {
- free(tags[j].name);
- free(tags[j].value);
- }
- free(tags);
-*/
-
- if (err.code) {
- while (i > 0) {
- i--;
- glite_jp_attrval_free(attrs_inout+i,0);
- }
- return glite_jp_stack_error(ctx,&err);
- } else {
- return 0;
- }
-}
-static int compare_timeval(struct timeval a, struct timeval b)
-{
- if (a.tv_sec < b.tv_sec) return -1;
- if (a.tv_sec > b.tv_sec) return 1;
- if (a.tv_usec < b.tv_usec) return -1;
- if (a.tv_usec > b.tv_usec) return 1;
- return 0;
-}
-
-
-/* FIXME: disabled -- clarification wrt. filetype plugin needed */
-
-#if 0
-
-static int query_phase2(
- glite_jp_context_t ctx,
- const char *ownerhash,
- long regtime_tr,
- int q_tags,
- int md_tags,
- const glite_jp_query_rec_t query[],
- glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-);
-
-static int query_phase2(
- glite_jp_context_t ctx,
- const char *ownerhash,
- long regtime_tr,
- int q_tags,
- int md_tags,
- const glite_jp_query_rec_t query[],
- glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-)
-{
- char *time_dirname = NULL;
- DIR *time_dirp = NULL;
- struct dirent *jobent;
- char *info_fname = NULL;
- char *jobid = NULL;
- char *owner = NULL;
- struct timeval tv_reg;
- void *tags_handle = NULL;
- int matching;
- int i, j;
- glite_jp_tagval_t* tags = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- if (asprintf(&time_dirname, "%s/data/%s/%d", config->internal_path,
- ownerhash, regtime_tr) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- time_dirp = opendir(time_dirname);
- if (!time_dirp) {
- free(time_dirname);
- return 0; /* found nothing */
- }
- while ((jobent = readdir(time_dirp)) != NULL) {
- if (!strcmp(jobent->d_name, ".")) continue;
- if (!strcmp(jobent->d_name, "..")) continue;
- if (asprintf(&info_fname, "%s/%s/_info", time_dirname,
- jobent->d_name) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- if (get_job_info_int(ctx, info_fname, &jobid, &owner, &tv_reg)) {
- err.code = EIO;
- err.desc = "Cannot retrieve job info";
- goto error_out;
- }
- if (q_tags || md_tags) {
- if (glite_jppsbe_open_file(ctx, jobid, GLITE_JP_FILECLASS_TAGS,
- O_RDONLY, &tags_handle)) {
- err.code = ctx->error->code;
- err.desc = "Cannot open tag file";
- goto error_out;
- }
- if (glite_jpps_tag_readall(ctx, tags_handle, &tags)) {
- err.code = ctx->error->code;
- err.desc = "Cannot read tags";
- glite_jppsbe_close_file(ctx, tags_handle);
- goto error_out;
- }
- glite_jppsbe_close_file(ctx, tags_handle);
- tags_handle = NULL;
- }
-
- matching = 1;
- for (i = 0; matching && query[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (query[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- if (query[i].value.s == NULL ||
- strcmp(query[i].value.s, owner)) matching = 0;
- break;
- case GLITE_JP_ATTR_TIME:
- switch (query[i].op) {
- case GLITE_JP_QUERYOP_EQUAL:
- matching = !compare_timeval(tv_reg, query[i].value.time);
- break;
- case GLITE_JP_QUERYOP_UNEQUAL:
- matching = compare_timeval(tv_reg, query[i].value.time);
- break;
- case GLITE_JP_QUERYOP_LESS:
- matching = compare_timeval(tv_reg, query[i].value.time) < 0;
- break;
- case GLITE_JP_QUERYOP_GREATER:
- matching = compare_timeval(tv_reg, query[i].value.time) > 0;
- break;
- case GLITE_JP_QUERYOP_WITHIN:
- matching = compare_timeval(tv_reg, query[i].value.time) >= 0
- && compare_timeval(tv_reg, query[i].value2.time) <= 0;
- break;
- }
- break;
- case GLITE_JP_ATTR_TAG:
- if (!tags) {
- matching = 0;
- break;
- }
- for (j = 0; tags[j].name != NULL; j++) {
- if (!strcmp(tags[j].name, query[i].attr.name)) {
- switch (query[i].op) {
- case GLITE_JP_QUERYOP_EQUAL:
- matching = !strcmp(tags[j].value, query[i].value.s);
- break;
- case GLITE_JP_QUERYOP_UNEQUAL:
- matching = strcmp(tags[j].value, query[i].value.s);
- break;
- case GLITE_JP_QUERYOP_LESS:
- matching = strcmp(tags[j].value, query[i].value.s) < 0;
- break;
- case GLITE_JP_QUERYOP_GREATER:
- matching = strcmp(tags[j].value, query[i].value.s) > 0;
- break;
- case GLITE_JP_QUERYOP_WITHIN:
- matching = strcmp(tags[j].value, query[i].value.s) >= 0 \
- && strcmp(tags[j].value, query[i].value2.s) <= 0 ;
- break;
- default:
- break;
- }
- }
- }
- break;
- default:
- break;
- }
- }
- if (!matching) {
- free(info_fname); info_fname = NULL;
- free(jobid); jobid = NULL;
- if (tags) for (j = 0; tags[j].name != NULL; j++) {
- free(tags[j].name);
- free(tags[j].value);
- }
- free(tags); tags = NULL;
- continue;
- }
-
- for (i = 0; metadata[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- metadata[i].value.s = owner;
- break;
- case GLITE_JP_ATTR_TIME:
- metadata[i].value.time = tv_reg;
- break;
- case GLITE_JP_ATTR_TAG:
- for (j = 0; tags[j].name != NULL; j++) {
- if (!strcmp(tags[j].name, metadata[i].attr.name)) {
- if (glite_jpps_tagval_copy(ctx, &tags[j],
- &metadata[i].value.tag)) {
- err.code = ENOMEM;
- err.desc = "Cannot copy tag value";
- goto error_out;
- }
- break;
- }
- }
- if (!tags[j].name) {
- metadata[i].value.tag.name = NULL;
- metadata[i].value.tag.value = NULL;
- }
- break;
- default:
- break;
- }
- }
- (*callback)(ctx, jobid, metadata);
- free(jobid); jobid = NULL;
- while (i > 0) {
- i--;
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_TAG:
- free(metadata[i].value.tag.name);
- free(metadata[i].value.tag.value);
- default:
- break;
- }
- }
- }
-
-error_out:
- if (tags) for (j = 0; tags[j].name != NULL; j++) {
- free(tags[j].name);
- free(tags[j].value);
- }
- if (tags_handle) glite_jppsbe_close_file(ctx, tags_handle);
- free(info_fname);
- free(owner);
- free(jobid);
- closedir(time_dirp);
- free(time_dirname);
- if (err.code) {
- while (i > 0) {
- i--;
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_TAG:
- free(metadata[i].value.tag.name);
- free(metadata[i].value.tag.value);
- default:
- break;
- }
- }
- return glite_jp_stack_error(ctx,&err);
- } else
- return 0;
-}
-
-int glite_jppsbe_query(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t query[],
- const glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-)
-{
- /* XXX clone metadata */
- int i;
- char *q_exact_owner = NULL;
- char *ownerhash = NULL;
- long q_min_time = 0;
- long q_max_time = LONG_MAX;
- long q_min_time_tr;
- long q_max_time_tr;
- int q_with_tags = 0;
- int md_info = 0;
- int md_tags = 0;
- char *owner_dirname = NULL;
- DIR *owner_dirp = NULL;
- struct dirent *ttimeent;
- char *data_dirname = NULL;
- DIR *data_dirp = NULL;
- struct dirent *ownerent;
- long ttime = 0;
- glite_jp_attrval_t *metadata_templ = NULL;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- for (i = 0; query[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- if (query[i].attr.type == GLITE_JP_ATTR_OWNER && query[i].op == GLITE_JP_QUERYOP_EQUAL) {
- q_exact_owner = query[i].value.s;
- }
- if (query[i].attr.type == GLITE_JP_ATTR_TIME) {
- switch (query[i].op) {
- case GLITE_JP_QUERYOP_EQUAL:
- q_min_time = query[i].value.time.tv_sec;
- q_max_time = query[i].value.time.tv_sec + 1;
- break;
- case GLITE_JP_QUERYOP_LESS:
- if (q_max_time > query[i].value.time.tv_sec + 1)
- q_max_time = query[i].value.time.tv_sec + 1;
- break;
- case GLITE_JP_QUERYOP_WITHIN:
- if (q_max_time > query[i].value2.time.tv_sec + 1)
- q_max_time = query[i].value2.time.tv_sec + 1;
- /* fallthrough */
- case GLITE_JP_QUERYOP_GREATER:
- if (q_min_time < query[i].value.time.tv_sec)
- q_min_time = query[i].value.time.tv_sec;
- break;
- default:
- err.code = EINVAL;
- err.desc = "Invalid query op";
- return glite_jp_stack_error(ctx,&err);
- break;
- }
- }
- if (query[i].attr.type == GLITE_JP_ATTR_TAG)
- q_with_tags = 1;
-
- }
-
- for (i = 0; metadata[i].attr.type != GLITE_JP_ATTR_UNDEF; i++) {
- switch (metadata[i].attr.type) {
- case GLITE_JP_ATTR_OWNER:
- case GLITE_JP_ATTR_TIME:
- md_info = 1;
- break;
- case GLITE_JP_ATTR_TAG:
- md_tags = 1;
- break;
- default:
- err.code = EINVAL;
- err.desc = "Invalid attribute type in metadata parameter";
- return glite_jp_stack_error(ctx,&err);
- break;
- }
- }
- metadata_templ = (glite_jp_attrval_t *) calloc(i + 1, sizeof(glite_jp_attrval_t));
- if (!metadata_templ) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- memcpy(metadata_templ, metadata, (i + 1) * sizeof(glite_jp_attrval_t));
-
- q_min_time_tr = regtime_trunc(q_min_time);
- q_max_time_tr = regtime_ceil(q_max_time);
-
- if (q_exact_owner) {
- ownerhash = str2md5(q_exact_owner); /* static buffer */
- if (asprintf(&owner_dirname, "%s/data/%s", config->internal_path, ownerhash) == -1) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- owner_dirp = opendir(owner_dirname);
- free(owner_dirname);
- if (!owner_dirp) {
- free(metadata_templ);
- return 0; /* found nothing */
- }
- while ((ttimeent = readdir(owner_dirp)) != NULL) {
- if (!strcmp(ttimeent->d_name, ".")) continue;
- if (!strcmp(ttimeent->d_name, "..")) continue;
- ttime = atol(ttimeent->d_name);
- if (ttime >= q_min_time_tr && ttime < q_max_time_tr) {
- if (query_phase2(ctx, ownerhash, ttime, q_with_tags, md_tags,
- query, metadata_templ, callback)) {
- err.code = EIO;
- err.desc = "query_phase2() error";
- goto error_out;
- }
- }
- }
- } else { /* !q_exact_owner */
- if (asprintf(&data_dirname, "%s/data", config->internal_path) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- data_dirp = opendir(data_dirname);
- if (!data_dirp) {
- err.code = EIO;
- err.desc = "Cannot open data directory";
- goto error_out;
- }
- while ((ownerent = readdir(data_dirp)) != NULL) {
- if (!strcmp(ownerent->d_name, ".")) continue;
- if (!strcmp(ownerent->d_name, "..")) continue;
- if (asprintf(&owner_dirname, "%s/data/%s", config->internal_path,
- ownerent->d_name) == -1) {
- err.code = ENOMEM;
- goto error_out;
- }
- owner_dirp = opendir(owner_dirname);
- free(owner_dirname);
- if (!owner_dirp) {
- err.code = EIO;
- err.desc = "Cannot open owner data directory";
- goto error_out;
- }
- while ((ttimeent = readdir(owner_dirp)) != NULL) {
- if (!strcmp(ttimeent->d_name, ".")) continue;
- if (!strcmp(ttimeent->d_name, "..")) continue;
- ttime = atol(ttimeent->d_name);
- if (ttime >= q_min_time_tr && ttime < q_max_time_tr) {
- if (query_phase2(ctx, ownerent->d_name, ttime, q_with_tags, md_tags,
- query, metadata_templ, callback)) {
- err.code = EIO;
- err.desc = "query_phase2() error";
- goto error_out;
- }
- }
- }
- closedir(owner_dirp); owner_dirp = NULL;
- }
- closedir(data_dirp); data_dirp = NULL;
- }
- return 0;
-
-error_out:
- if (owner_dirp) closedir(owner_dirp);
- if (data_dirp) closedir(data_dirp);
- free(data_dirname);
- free(metadata_templ);
- return glite_jp_stack_error(ctx,&err);
-}
-
-#else
-
-/* placeholder instead */
-int glite_jppsbe_query(
- glite_jp_context_t ctx,
- const glite_jp_query_rec_t query[],
- const glite_jp_attrval_t metadata[],
- int (*callback)(
- glite_jp_context_t ctx,
- const char *job,
- const glite_jp_attrval_t metadata[]
- )
-)
-{
- glite_jp_error_t err;
- err.code = ENOSYS;
- err.desc = "not implemented";
- return glite_jp_stack_error(ctx,&err);
-}
-
-#endif
-
-/* XXX:
-- no primary authorization yet
-- no concurrency control yet
-- partial success in pwrite,append
-- "unique" part of jobid is assumed to be unique across bookkeeping servers
-- repository versioning not fully implemented yet
-*/
+++ /dev/null
-#include <stdio.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-
-#include "jpps_H.h"
-
-extern SOAP_NMAC struct Namespace jpis__namespaces[],jpps__namespaces[];
-
-int main(int argc, char *argv[]) {
- struct soap soap;
- int i, m, s; // master and slave sockets
-
- glite_jp_context_t ctx;
-
- soap_init(&soap);
- soap_set_namespaces(&soap, jpps__namespaces);
-
- glite_jp_init_context(&ctx);
-
- if (glite_jppsbe_init(ctx, &argc, argv)) {
- /* XXX log */
- fputs(glite_jp_error_chain(ctx), stderr);
- exit(1);
- }
-
- soap.user = (void *) ctx;
-
- ctx->other_soap = soap_new();
- soap_init(ctx->other_soap);
- soap_set_namespaces(ctx->other_soap,jpis__namespaces);
-
- srand48(time(NULL)); /* feed id generation */
-
- m = soap_bind(&soap, NULL, 8901, 100);
- if (m < 0)
- soap_print_fault(&soap, stderr);
- else
- {
- fprintf(stderr, "Socket connection successful: master socket = %d\n", m);
- for (i = 1; ; i++) {
- s = soap_accept(&soap);
- if (s < 0) {
- soap_print_fault(&soap, stderr);
- break;
- }
- jpps__serve(&soap); // process RPC request
- soap_destroy(&soap); // clean up class instances
- soap_end(&soap); // clean up everything and close socket
- glite_jp_run_deferred(ctx);
- }
- }
- soap_done(&soap); // close master socket
-
- return 0;
-}
-
-/* XXX: we don't use it */
-SOAP_NMAC struct Namespace namespaces[] = { {NULL,NULL} };
+++ /dev/null
-#include <stdio.h>
-#include <fcntl.h>
-#include <assert.h>
-
-#include "glite/jp/types.h"
-#include "glite/jp/context.h"
-
-#include "feed.h"
-
-#include "jpps_H.h"
-/* #include "JobProvenancePS.nsmap" */
-#include "jpps_.nsmap"
-
-#include "jptype_map.h"
-
-#include "file_plugin.h"
-#include "builtin_plugins.h"
-
-static struct jptype__genericFault *jp2s_error(struct soap *soap,
- const glite_jp_error_t *err)
-{
- struct jptype__genericFault *ret = NULL;
- if (err) {
- ret = soap_malloc(soap,sizeof *ret);
- memset(ret,0,sizeof *ret);
- ret->code = err->code;
- ret->source = soap_strdup(soap,err->source);
- ret->text = soap_strdup(soap,strerror(err->code));
- ret->description = soap_strdup(soap,err->desc);
- ret->reason = jp2s_error(soap,err->reason);
- }
- return ret;
-}
-
-static void err2fault(const glite_jp_context_t ctx,struct soap *soap)
-{
- char *et;
- struct SOAP_ENV__Detail *detail = soap_malloc(soap,sizeof *detail);
- struct _genericFault *f = soap_malloc(soap,sizeof *f);
-
-
- f->jpelem__genericFault = jp2s_error(soap,ctx->error);
-
- detail->__type = SOAP_TYPE__genericFault;
-#if GSOAP_VERSION >= 20700
- detail->fault = f;
-#else
- detail->value = f;
-#endif
- detail->__any = NULL;
-
- soap_receiver_fault(soap,"Oh, shit!",NULL);
- if (soap->version == 2) soap->fault->SOAP_ENV__Detail = detail;
- else soap->fault->detail = detail;
-}
-
-#define CONTEXT_FROM_SOAP(soap,ctx) glite_jp_context_t ctx = (glite_jp_context_t) ((soap)->user)
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__RegisterJob(
- struct soap *soap,
- struct _jpelem__RegisterJob *in,
- struct _jpelem__RegisterJobResponse *empty)
-{
- CONTEXT_FROM_SOAP(soap,ctx);
- glite_jp_attrval_t owner_val[2];
-
- printf("%s %s %s\n",__FUNCTION__,in->job,in->owner);
- if (glite_jpps_authz(ctx,SOAP_TYPE___jpsrv__RegisterJob,in->job,in->owner) ||
- glite_jppsbe_register_job(ctx,in->job,in->owner))
- {
- err2fault(ctx,soap);
- return SOAP_FAULT;
- }
-
- owner_val[0].name = GLITE_JP_ATTR_OWNER;
- owner_val[0].value = in->owner;
- owner_val[0].origin = GLITE_JP_ATTR_ORIG_SYSTEM;
- owner_val[0].timestamp = time(NULL);
- owner_val[0].origin_detail = NULL;
- owner_val[1].name = NULL;
-
-/* XXX: errrors should be ingored but not silently */
- glite_jpps_match_attr(ctx,in->job,owner_val);
-
- return SOAP_OK;
-}
-
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__StartUpload(
- struct soap *soap,
- struct _jpelem__StartUpload *in,
- struct _jpelem__StartUploadResponse *out)
-{
- CONTEXT_FROM_SOAP(soap,ctx);
- char *destination;
- time_t commit_before = in->commitBefore;
- glite_jp_error_t err;
- glite_jpps_fplug_data_t **pd = NULL;
- int i;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
-
- if (glite_jpps_authz(ctx,SOAP_TYPE___jpsrv__StartUpload,NULL,NULL)) {
- err2fault(ctx,soap);
- return SOAP_FAULT;
- }
-
- switch (glite_jpps_fplug_lookup(ctx,in->class_,&pd)) {
- case ENOENT:
- err.code = ENOENT;
- err.source = __FUNCTION__;
- err.desc = "unknown file class";
- glite_jp_stack_error(ctx,&err);
- err2fault(ctx,soap);
- return SOAP_FAULT;
- case 0: break;
- default:
- err2fault(ctx,soap);
- return SOAP_FAULT;
- }
-
- for (i=0; pd[0]->uris[i] && strcmp(pd[0]->uris[i],in->class_); i++);
- assert(pd[0]->uris[i]);
-
- if (glite_jppsbe_start_upload(ctx,in->job,pd[0]->classes[i],in->name,in->contentType,
- &destination,&commit_before))
- {
- err2fault(ctx,soap);
- free(pd);
- return SOAP_FAULT;
- }
-
- out->destination = soap_strdup(soap,destination);
- free(destination);
- out->commitBefore = commit_before;
-
- free(pd);
- return SOAP_OK;
-}
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__CommitUpload(
- struct soap *soap,
- struct _jpelem__CommitUpload *in,
- struct _jpelem__CommitUploadResponse *out)
-{
- CONTEXT_FROM_SOAP(soap,ctx);
- char *job,*class,*name;
-
- job = class = name = NULL;
-
- if (glite_jpps_authz(ctx,SOAP_TYPE___jpsrv__CommitUpload,NULL,NULL) ||
- glite_jppsbe_commit_upload(ctx,in->destination))
- {
- err2fault(ctx,soap);
- return SOAP_FAULT;
- }
-
- /* XXX: should not fail when commit_upload was OK */
- assert(glite_jppsbe_destination_info(ctx,in->destination,&job,&class,&name) == 0);
-
- /* XXX: ignore errors but don't fail silenty */
- glite_jpps_match_file(ctx,job,class,name);
-
- free(job); free(class); free(name);
-
- return SOAP_OK;
-}
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__RecordTag(
- struct soap *soap,
- struct _jpelem__RecordTag *in,
- struct _jpelem__RecordTagResponse *out)
-{
- CONTEXT_FROM_SOAP(soap,ctx);
- void *file_be,*file_p;
- glite_jpps_fplug_data_t **pd = NULL;
- glite_jp_attrval_t attr[2];
-
- file_be = file_p = NULL;
-
- /* XXX: we assume just one plugin and also that TAGS plugin handles
- * just one uri/class */
-
- if (glite_jpps_fplug_lookup(ctx,GLITE_JP_FILETYPE_TAGS,&pd)
- || glite_jppsbe_open_file(ctx,in->jobid,pd[0]->classes[0],NULL,
- O_RDWR|O_CREAT,&file_be)
- /* XXX: tags need reading to check magic number */
- ) {
- free(pd);
- err2fault(ctx,soap);
- return SOAP_FAULT;
- }
-
- /* XXX: assuming tag plugin handles just one type */
- if (pd[0]->ops.open(pd[0]->fpctx,file_be,GLITE_JP_FILETYPE_TAGS,&file_p)
- || pd[0]->ops.generic(pd[0]->fpctx,file_p,GLITE_JP_FPLUG_TAGS_APPEND,in->tag->name,in->tag->value))
- {
- err2fault(ctx,soap);
- if (file_p) pd[0]->ops.close(pd[0]->fpctx,file_p);
- glite_jppsbe_close_file(ctx,file_be);
- free(pd);
- return SOAP_FAULT;
- }
-
- if (pd[0]->ops.close(pd[0]->fpctx,file_p)
- || glite_jppsbe_close_file(ctx,file_be))
- {
- err2fault(ctx,soap);
- free(pd);
- return SOAP_FAULT;
- }
-
- attr[0].name = in->tag->name;
- attr[0].value = in->tag->value;
- attr[0].origin = GLITE_JP_ATTR_ORIG_USER;
- attr[0].timestamp = time(NULL);
- attr[0].origin_detail = NULL; /* XXX */
-
- /* XXX: ignore errors but don't fail silenty */
- glite_jpps_match_attr(ctx,in->jobid,attr);
-
- free(pd);
- return SOAP_OK;
-}
-
-static void s2jp_qval(const struct jptype__stringOrBlob *in, char **value, int *binary, size_t *size)
-{
- if (in->string) {
- *value = in->string;
- *binary = 0;
- *size = 0;
- }
- else {
- assert(in->blob); /* XXX: should report error instead */
- *value = in->blob->__ptr;
- *binary = 1;
- *size = in->blob->__size;
- }
-}
-
-static void s2jp_query(const struct jptype__primaryQuery *in, glite_jp_query_rec_t *out)
-{
- int b;
-
- out->attr = in->attr;
-
- s2jp_qval(in->value,&out->value,&out->binary,&out->size);
- switch (in->op) {
- case EQUAL: out->op = GLITE_JP_QUERYOP_EQUAL; break;
- case UNEQUAL: out->op = GLITE_JP_QUERYOP_UNEQUAL; break;
- case LESS: out->op = GLITE_JP_QUERYOP_LESS; break;
- case GREATER: out->op = GLITE_JP_QUERYOP_GREATER; break;
- case WITHIN:
- out->op = GLITE_JP_QUERYOP_WITHIN;
- s2jp_qval(in->value2,&out->value2,&b,&out->size2);
- assert(out->binary == b); /* XXX: report error instead */
-
- break;
- }
-
- if (in->origin) switch (*in->origin) {
- case jptype__attrOrig__SYSTEM: out->origin = GLITE_JP_ATTR_ORIG_SYSTEM; break;
- case jptype__attrOrig__USER: out->origin = GLITE_JP_ATTR_ORIG_USER; break;
- case jptype__attrOrig__FILE_: out->origin = GLITE_JP_ATTR_ORIG_FILE; break;
- }
- else out->origin = GLITE_JP_ATTR_ORIG_ANY;
-}
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__FeedIndex(
- struct soap *soap,
- struct _jpelem__FeedIndex *in,
- struct _jpelem__FeedIndexResponse *out)
-{
-
-/* deferred processing: return feed_id to the index server first,
- * start feeding it afterwards -- not before the index server actually
- * knows feed_id and is ready to accept the feed.
- *
- * Has to be done within the same server slave,
- * passed through the context */
-
- CONTEXT_FROM_SOAP(soap,ctx);
- char *feed_id = NULL;
- time_t expires = 0;
- int ret = SOAP_OK;
-
- char const **attrs = calloc(in->__sizeattributes+1,sizeof *attrs);
- glite_jp_query_rec_t *qry = calloc(in->__sizeconditions+1,sizeof *qry);
- int i;
-
- glite_jp_clear_error(ctx);
-
- memcpy(attrs,in->attributes,sizeof *attrs * in->__sizeattributes);
- for (i = 0; i<in->__sizeconditions; i++) s2jp_query(in->conditions[i],qry+i);
-
- if (in->history) {
- if (glite_jpps_run_feed(ctx,in->destination,attrs,qry,&feed_id)) {
- err2fault(ctx,soap);
- ret = SOAP_FAULT;
- goto cleanup;
- }
- }
-
- if (in->continuous) {
- if (glite_jpps_register_feed(ctx,in->destination,attrs,qry,&feed_id,&expires)) {
- err2fault(ctx,soap);
- ret = SOAP_FAULT;
- goto cleanup;
- }
- }
-
- if (!in->history && !in->continuous) {
- glite_jp_error_t err;
- memset(&err,0,sizeof err);
- err.code = EINVAL;
- err.source = __FUNCTION__;
- err.desc = "at least one of <history> and <continous> must be true";
- glite_jp_stack_error(ctx,&err);
- err2fault(ctx,soap);
- ret = SOAP_FAULT;
- goto cleanup;
- }
-
- out->feedExpires = expires;
- out->feedId = soap_strdup(soap,feed_id);
-
-cleanup:
- free(feed_id);
- free(attrs);
- free(qry);
-
- return ret;
-}
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__FeedIndexRefresh(
- struct soap *soap,
- struct _jpelem__FeedIndexRefresh *in,
- struct _jpelem__FeedIndexRefreshResponse *out)
-{
- fprintf(stderr,"%s: not implemented\n",__FUNCTION__);
- abort();
-}
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__GetJobFiles(
- struct soap *soap,
- struct _jpelem__GetJobFiles *in,
- struct _jpelem__GetJobFilesResponse *out)
-{
- CONTEXT_FROM_SOAP(soap,ctx);
- char *url;
-
- int i,n;
- glite_jp_error_t err;
- void **pd;
- struct jptype__jppsFile **f = NULL;
-
- memset(&err,0,sizeof err);
- out->__sizefiles = 0;
-
- for (pd = ctx->plugins; *pd; pd++) {
- glite_jpps_fplug_data_t *plugin = *pd;
-
- for (i=0; plugin->uris[i]; i++) {
- glite_jp_clear_error(ctx);
- switch (glite_jppsbe_get_job_url(ctx,in->jobid,plugin->classes[i],NULL,&url)) {
- case 0: n = out->__sizefiles++;
- f = realloc(f,out->__sizefiles * sizeof *f);
- f[n] = soap_malloc(soap, sizeof **f);
- f[n]->class_ = soap_strdup(soap,plugin->uris[i]);
- f[n]->name = NULL;
- f[n]->url = soap_strdup(soap,url);
- free(url);
- break;
- case ENOENT:
- break;
- default:
- err.code = ctx->error->code;
- err.source = "jpsrv__GetJob()";
- err.desc = plugin->uris[i];
- glite_jp_stack_error(ctx,&err);
- err2fault(ctx,soap);
- glite_jp_clear_error(ctx);
- return SOAP_FAULT;
- }
- }
- }
-
- if (!out->__sizefiles) {
- glite_jp_clear_error(ctx);
- err.code = ENOENT;
- err.source = __FUNCTION__;
- err.desc = "No file found for this job";
- glite_jp_stack_error(ctx,&err);
- err2fault(ctx,soap);
-// glite_jp_clear_error(ctx);
- return SOAP_FAULT;
- }
-
- out->files = soap_malloc(soap,out->__sizefiles * sizeof *f);
- memcpy(out->files,f,out->__sizefiles * sizeof *f);
-
- return SOAP_OK;
-}
-
-SOAP_FMAC5 int SOAP_FMAC6 __jpsrv__GetJobAttributes(
- struct soap *soap,
- struct _jpelem__GetJobAttributes *in,
- struct _jpelem__GetJobAttributesResponse *out)
-{
- CONTEXT_FROM_SOAP(soap,ctx);
-
- /* TODO */
- abort();
-}
+++ /dev/null
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#include <glite/jp/types.h>
-#include "tags.h"
-#include "backend.h"
-
-/* magic name_len value_len binary sequence timestamp */
-#define HEADER "JP#TAG# %05u %012lu %c %05u %012lu#"
-#define HEADER_SIZE 48
-
-int glite_jpps_tag_append(
- glite_jp_context_t ctx,
- void *handle,
- const glite_jp_tagval_t *tag
-)
-{
- char hdr[HEADER_SIZE+1];
- glite_jp_error_t err;
-
- unsigned long vlen = tag->binary ? tag->size :
- (tag->value ? strlen(tag->value) : 0);
- int nlen;
-
- memset(&err,0,sizeof err);
- err.source = "glite_jpps_tag_append()";
-
- if (!tag->name) {
- err.code = EINVAL;
- err.desc = "tag name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- nlen = strlen(tag->name);
-
- assert(sprintf(hdr,HEADER,nlen,vlen,
- tag->binary ? "B" : "S",
- tag->sequence, tag->timestamp) == HEADER_SIZE);
-
- if (glite_jppsbe_append(ctx,handle,hdr,HEADER_SIZE)) {
- err.code = EIO;
- err.desc = "write tag header";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (glite_jppsbe_append(ctx,handle,tag->name,nlen)) {
- err.code = EIO;
- err.desc = "write tag name";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (glite_jppsbe_append(ctx,handle,tag->value,vlen)) {
- err.code = EIO;
- err.desc = "write tag value";
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
-
-int glite_jpps_tagval_copy(
- glite_jp_context_t ctx,
- glite_jp_tagval_t *from,
- glite_jp_tagval_t *to
-)
-{
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- to->name = strdup(from->name);
- if (!to->name) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- to->sequence = from->sequence;
- to->timestamp = from->timestamp;
- to->binary = from->binary;
- to->size = from->size;
- to->value = (char *) malloc(to->size);
- if (!to->value) {
- free(to->name);
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- memcpy(from->value, to->value, to->size);
-
- return 0;
-}
-
-int glite_jpps_tag_read(
- glite_jp_context_t ctx,
- void *handle,
- off_t offset,
- glite_jp_tagval_t *tagvalue,
- size_t *shift
-)
-{
- char hdr[HEADER_SIZE+1];
- unsigned int nlen;
- unsigned long vlen;
- char binary;
- unsigned sequence;
- unsigned timestamp;
- char * name = NULL;
- char * value = NULL;
- ssize_t ret;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- hdr[HEADER_SIZE] = '\0';
- if (glite_jppsbe_pread(ctx, handle, hdr, HEADER_SIZE, offset, &ret)) {
- err.code = EIO;
- err.desc = "Cannot read tag header";
- goto error_out;
- }
- if (ret == 0) {
- err.code = ENOENT;
- err.desc = "No more tags in the file";
- goto error_out;
- }
- /* #define HEADER "JP#TAG# %05u %012lu %c %05u %012lu#" */
- if (sscanf(hdr, HEADER, &nlen, &vlen, &binary, &sequence, ×tamp) < 5) {
- err.code = EILSEQ;
- err.desc = "Incorrect tag header format";
- goto error_out;
- }
- name = (char*) malloc(nlen + 1);
- if (!name) {
- err.code = ENOMEM;
- goto error_out;
- }
- name[nlen] = '\0';
- value = (char*) malloc(vlen + 1);
- if (!value) {
- err.code = ENOMEM;
- goto error_out;
- }
- value[vlen] = '\0';
- if (glite_jppsbe_pread(ctx, handle, name, nlen, offset + HEADER_SIZE, &ret)) {
- err.code = EIO;
- err.desc = "Cannot read tag name";
- goto error_out;
- }
- if (glite_jppsbe_pread(ctx, handle, value, vlen, offset + HEADER_SIZE + nlen, &ret)) {
- err.code = EIO;
- err.desc = "Cannot read tag value";
- goto error_out;
- }
-
- tagvalue->name = name;
- tagvalue->sequence = sequence;
- tagvalue->timestamp = timestamp;
- tagvalue->binary = (binary == 'B') ? 1 : 0;
- tagvalue->size = vlen;
- tagvalue->value = value;
-
- *shift = HEADER_SIZE + nlen + vlen;
-
- return 0;
-error_out:
- free(name);
- free(value);
- return glite_jp_stack_error(ctx,&err);
-}
-
-/*
-int glite_jpps_tag_read(glite_jp_context_t, void *, off_t, glite_jp_tagval_t *, size_t);
-int glite_jpps_tag_readall(glite_jp_context_t, void *, glite_jp_tagval_t **);
-*/
-
-int glite_jpps_tag_readall(
- glite_jp_context_t ctx,
- void *handle,
- glite_jp_tagval_t **tags_out
-)
-{
- glite_jp_tagval_t * tags = NULL;
- void * newspace;
- int ntags = 0;
- int ntagspace = 0;
- off_t offset = 0;
- int ret;
- size_t shift;
- glite_jp_error_t err;
-
- glite_jp_clear_error(ctx);
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
-
- ntagspace = 1;
- tags = (glite_jp_tagval_t *) calloc(ntagspace + 1, sizeof(*tags));
- if (!tags) {
- err.code = ENOMEM;
- return glite_jp_stack_error(ctx,&err);
- }
- while (!(ret = glite_jpps_tag_read(ctx, handle, offset, &tags[ntags], &shift))) {
- offset += shift;
- ntags++;
- if (ntagspace <= ntags) {
- ntagspace += 1;
- newspace = realloc(tags, (ntagspace + 1) * sizeof(*tags));
- if (!newspace) {
- err.code = ENOMEM;
- goto error_out;
- }
- tags = (glite_jp_tagval_t *) newspace;
- }
- }
- if (ret == ENOENT) {
- *tags_out = tags;
- return 0;
- } else {
- err.code = EIO;
- err.desc = "Error reading tag value";
- }
-
-error_out:
- for (; ntags-- ;) {
- free(tags[ntags].name);
- free(tags[ntags].value);
- }
- free(tags);
- return glite_jp_stack_error(ctx,&err);
-}
+++ /dev/null
-int glite_jpps_tag_append(glite_jp_context_t,void *,const char *, const char *);
+++ /dev/null
-#include <stdlib.h>
-#include <assert.h>
-#include <stdarg.h>
-#include <string.h>
-#include <errno.h>
-#include <stdint.h>
-
-#include <glite/jp/types.h>
-
-#include "file_plugin.h"
-#include "builtin_plugins.h"
-#include "backend.h"
-
-static int tagappend(void *,void *,int,...);
-static int tagopen(void *,void *,const char *uri,void **);
-static int tagclose(void *,void *);
-
-#define TAGS_MAGIC 0x74c016f2 /* two middle digits encode version, i.e. 01 */
-
-static int tagdummy()
-{
- puts("tagdummy()");
- return -1;
-}
-
-struct tags_handle {
- void *bhandle;
- int n;
- glite_jp_tagval_t *tags;
-};
-
-int init(glite_jp_context_t ctx, glite_jpps_fplug_data_t *data)
-{
- data->fpctx = ctx;
-
- data->uris = calloc(2,sizeof *data->uris);
- data->uris[0] = strdup(GLITE_JP_FILETYPE_TAGS);
-
- data->classes = calloc(2,sizeof *data->classes);
- data->classes[0] = strdup("tags");
-
- data->ops.open = tagopen;
- data->ops.close = tagclose;
- data->ops.attr = tagdummy;
- data->ops.generic = tagappend;
-
- printf("tags_plugin: URI: \"%s\"; magic number: 0x%08lx\n",GLITE_JP_FILETYPE_TAGS,TAGS_MAGIC);
- return 0;
-}
-
-static int tagopen(void *fpctx,void *bhandle,const char *uri,void **handle)
-{
- struct tags_handle *h = calloc(1,sizeof *h);
- h->n = -1;
- h->bhandle = bhandle;
-
- *handle = h;
-
- return 0;
-}
-
-static int tagclose(void *fpctx,void *handle)
-{
- int i;
- struct tags_handle *h = handle;
-
- for (i=0; i<h->n; i++) {
- free(h->tags[i].name);
- free(h->tags[i].value);
- }
- free(h->tags);
- free(h);
-
- return 0;
-}
-
-static int tagappend(void *fpctx,void *handle,int oper,...)
-{
- glite_jp_tagval_t *tag;
- va_list ap;
- char *hdr,*rec;
- glite_jp_context_t ctx = fpctx;
- struct tags_handle *h = handle;
- uint32_t magic,hlen,rlen,rlen_n;
- size_t r;
- glite_jp_error_t err;
-
- memset(&err,0,sizeof err);
- err.source = __FUNCTION__;
- glite_jp_clear_error(ctx);
-
- va_start(ap,oper);
- tag = va_arg(ap,glite_jp_tagval_t *);
- va_end(ap);
-
- printf("tagappend: %s,%d,%s\n",tag->name,tag->sequence,tag->value);
-
- assert(oper == GLITE_JP_FPLUG_TAGS_APPEND);
-
- if (glite_jppsbe_pread(ctx,h->bhandle,&magic,sizeof magic,0,&r)) {
- err.code = EIO;
- err.desc = "reading magic number";
- return glite_jp_stack_error(ctx,&err);
- }
-
- if (r == 0) {
- magic = htonl(TAGS_MAGIC);
- if (glite_jppsbe_pwrite(ctx,h->bhandle,&magic,sizeof magic,0)) {
- err.code = EIO;
- err.desc = "writing magic number";
- return glite_jp_stack_error(ctx,&err);
- }
- }
- else if (r != sizeof magic) {
- err.code = EIO;
- err.desc = "can't read magic number";
- return glite_jp_stack_error(ctx,&err);
- }
- else if (magic != htonl(TAGS_MAGIC)) {
- err.code = EINVAL;
- err.desc = "invalid magic number";
- return glite_jp_stack_error(ctx,&err);
- }
-
- trio_asprintf(&hdr,"%d %ld %c",tag->sequence,
- tag->timestamp,tag->binary ? 'B' : 'S');
-
- rlen = strlen(tag->name) + strlen(hdr) + 2 /* \0 after name and after hdr */ +
- (r = tag->binary ? tag->size : (tag->value ? strlen(tag->value) : 0));
-
- rlen_n = htonl(rlen);
-
- rec = malloc(rlen + sizeof rlen_n);
- *((uint32_t *) rec) = rlen_n;
- strcpy(rec + sizeof rlen_n,tag->name);
- strcpy(rec + (hlen = sizeof rlen_n + strlen(tag->name) + 1),hdr);
-
- if (r) memcpy(rec + hlen + strlen(hdr) + 1,tag->value,r);
- free(hdr);
-
- if (glite_jppsbe_append(ctx,h->bhandle,rec,rlen + sizeof rlen_n)) {
- err.code = EIO;
- err.desc = "writing tag record";
- free(rec);
- return glite_jp_stack_error(ctx,&err);
- }
-
- return 0;
-}
+++ /dev/null
-jpsrv = http://glite.org/wsdl/services/jp
-jptype = http://glite.org/wsdl/types/jp
-jpelem = http://glite.org/wsdl/elements/jp
+++ /dev/null
-.project
-.cdtproject
\ No newline at end of file
+++ /dev/null
-LICENSE file for EGEE Middleware
-================================
-
-Copyright (c) 2004 on behalf of the EU EGEE Project:
-The European Organization for Nuclear Research (CERN),
-Istituto Nazionale di Fisica Nucleare (INFN), Italy
-Datamat Spa, Italy
-Centre National de la Recherche Scientifique (CNRS), France
-CS Systeme d'Information (CSSI), France
-Royal Institute of Technology, Center for Parallel Computers (KTH-PDC), Sweden
-Universiteit van Amsterdam (UvA), Netherlands
-University of Helsinki (UH.HIP), Finlan
-University of Bergen (UiB), Norway
-Council for the Central Laboratory of the Research Councils (CCLRC), United Kingdom
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-1. Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-3. The end-user documentation included with the redistribution, if
-any, must include the following acknowledgment: "This product includes
-software developed by The EU EGEE Project (http://cern.ch/eu-egee/)."
-Alternatively, this acknowledgment may appear in the software itself, if
-and wherever such third-party acknowledgments normally appear.
-
-4. The names EGEE and the EU EGEE Project must not be
-used to endorse or promote products derived from this software without
-prior written permission. For written permission, please contact
-<email address>.
-
-5. You are under no obligation whatsoever to provide anyone with any
-bug fixes, patches, or upgrades to the features, functionality or
-performance of the Software ("Enhancements") that you may develop over
-time; however, if you choose to provide your Enhancements to The EU
-EGEE Project, or if you choose to otherwise publish or distribute your
-Enhancements, in source code form without contemporaneously requiring
-end users of The EU EGEE Proejct to enter into a separate written license
-agreement for such Enhancements, then you hereby grant The EU EGEE Project
-a non-exclusive, royalty-free perpetual license to install, use, copy,
-modify, prepare derivative works, incorporate into the EGEE Middleware
-or any other computer software, distribute, and sublicense your
-Enhancements or derivative works thereof, in binary and source code
-form (if any), whether developed by The EU EGEE Project or third parties.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL PROJECT OR ITS CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-This software consists of voluntary contributions made by many
-individuals on behalf of the EU EGEE Prject. For more information on The
-EU EGEE Project, please see http://cern.ch/eu-egee/. For more information on
-EGEE Middleware, please see http://egee-jra1.web.cern.ch/egee-jra1/
-
-
+++ /dev/null
-# Default values
-top_srcdir=.
-builddir=build
-top_builddir=${top_srcdir}/${builddir}
-stagedir=.
-distdir=.
-globalprefix=glite
-package=glite-jp-ws-interface
-version=0.0.0
-PREFIX=/opt/glite
-
--include Makefile.inc
-
-VPATH=${top_srcdir}/interface:${top_srcdir}/src
-STAGETO=interface
-
-XSLTPROC=xsltproc
-XMLLINT:=xmllint
-docbookxls:=http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
-
-#WSDL=JobProvenancePS.wsdl JobProvenanceIS.wsdl JobProvenanceTypes.wsdl
-WSDL=JobProvenancePS.wsdl JobProvenanceTypes.wsdl
-
-all compile: ${WSDL}
-
-check:
- @echo No unit test required for interface-only module.
-
-stage: ${WSDL}
- $(MAKE) install PREFIX=${stagedir}
-
-dist: distsrc distbin
-
-distsrc:
- mkdir -p ${top_srcdir}/${package}-${version}
- cd ${top_srcdir} && GLOBIGNORE="${package}-${version}" && cp -Rf * ${package}-${version}
- cd ${top_srcdir} && tar -czf ${distdir}/${package}-${version}_src.tar.gz --exclude-from=project/tar_exclude ${package}-${version}
- rm -rf ${top_srcdir}/${package}-${version}
-
-distbin:
- $(MAKE) install PREFIX=${top_srcdir}/tmpbuilddir
- cd ${top_srcdir}/tmpbuilddir && tar -czf ${top_srcdir}/${distdir}/${package}-${version}_bin.tar.gz *
- rm -rf ${top_srcdir}/tmpbuilddir
-
-install:
- -mkdir -p ${PREFIX}/${STAGETO}
- -mkdir -p ${PREFIX}/share/doc/${package}-${version}
- install -m 644 ${top_srcdir}/LICENSE ${PREFIX}/share/doc/${package}-${version}
-# cd ${top_srcdir}/interface && install -m 644 ${WSDL} ${PREFIX}/${STAGETO}
- install -m 644 ${WSDL} ${PREFIX}/${STAGETO}
-
-clean:
- rm -f *.h
-
-%.wsdl: %.xml
- ${XSLTPROC} ../src/puke-wsdl.xsl $< >$@
-
-JobProvenancePS.html: doc.xml JobProvenancePS.xml JobProvenanceTypes.xml puke-ug.xsl
- ${XSLTPROC} --novalid ../src/puke-ug.xsl $< >doc-html.xml
- ${XMLLINT} --valid --noout doc-html.xml
- ${XSLTPROC} --stringparam chapter.autolabel 0 ${docbookxls} doc-html.xml >$@
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright (c) 2004 on behalf of the EU EGEE Project:
- The European Organization for Nuclear Research (CERN),
- Istituto Nazionale di Fisica Nucleare (INFN), Italy
- Datamat Spa, Italy
- Centre National de la Recherche Scientifique (CNRS), France
- CS Systeme d'Information (CSSI), France
- Royal Institute of Technology, Center for Parallel Computers (KTH-PDC), Sweden
- Universiteit van Amsterdam (UvA), Netherlands
- University of Helsinki (UH.HIP), Finland
- University of Bergen (UiB), Norway
- Council for the Central Laboratory of the Research Councils (CCLRC), United Kingdom
-
- Build file for the GLite jp ws-interface component
-
- Authors: Joachim Flammer <Joachim.Flammer@Cern.ch>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.1.1.1 2004/12/10 09:32:29 akrenek
-
-
- Revision 1.5 2004/07/20 16:08:30 flammer
- Changed incorrect my_... instead of .._template entries for subsystem and component.
-
- Revision 1.4 2004/07/16 16:32:53 flammer
- Added comment where to add language target.
-
- Revision 1.3 2004/07/16 14:56:55 flammer
- Corrected input path of build.properties.
-
- Revision 1.2 2004/07/06 20:43:19 flammer
- Update of configure & targets.
-
- Revision 1.1.1.1 2004/06/18 12:40:17 flammer
- Added general component template.
-
-
--->
-
-<project name="ws-interface" default="dist">
-
- <!-- ==============================================
- Builds the GLite jp ws-interface component
- ============================================== -->
-
- <!-- =========================================
- Import properties (order is important)
- ========================================= -->
-
- <!-- Import baseline properties & user properties -->
- <import file="../org.glite/project/baseline.properties.xml" />
-
- <!-- import component build properties,
- component properties &
- component common properties -->
- <import file="./project/properties.xml"/>
-
- <!-- import subsystem build properties,
- subsystem properties &
- subsystem common properties -->
- <import file="${subsystem.properties.file}"/>
-
- <!-- import global build properties &
- global properties -->
- <import file="${global.properties.file}" />
-
- <!-- =========================================
- Load dependency property files (order is important)
- ========================================= -->
- <property file="${user.dependencies.file}"/>
- <property file="${component.dependencies.file}" />
- <property file="${subsystem.dependencies.file}" />
- <property file="${global.dependencies.file}"/>
-
- <!-- =========================================
- Load configuration definitions (order is important)
- ========================================= -->
- <import file="${global.configure.options.file}"/>
- <import file="${component.configure.options.file}"/>
-
- <!-- =========================================
- Import task definitions (order is important)
- ========================================= -->
- <import file="${subsystem.taskdefs.file}" />
- <import file="${global.taskdefs.file}" />
-
- <!-- =========================================
- Load common targets
- ========================================= -->
- <!-- Put your language target (java/c++-ant/c++-autotool/perl) here -->
- <import file="${global.targets-simple_make.file}" />
-
- <!-- =========================================
- Load version file
- ========================================= -->
- <property file="${module.version.file}"/>
- <property file="${module.build.file}"/>
-
- <!-- ==============================================
- Local private targets
- ============================================== -->
-
- <target name="localinit"
- description="Module specific initialization tasks">
- <antcall target="lbmakefiles" />
- </target>
-
- <target name="localcompile"
- description="Module specific compile tasks">
- </target>
-
- <target name="localclean"
- description="Module specific cleaning tasks">
- </target>
-
-</project>
+++ /dev/null
-<WSDL:definitions
- xmlns:tns="http://glite.org/wsdl/services/jp"
- xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:jp="http://glite.org/wsdl/types/jp"
- xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
- xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- targetNamespace="http://glite.org/wsdl/services/jp"
- name="JobProvenanceIS">
-
- <import namespace="http://glite.org/wsdl/types/jp" location="JobProvenanceTypes.wsdl"/>
-
- <message name="GenericJPFault">
- <part name="fault" element="jp:GenericJPFault"/>
- </message>
-
- <message name="QueryJobsRequest">
- <part name="conditions" type="jp:IndexQuery"/>
- </message>
-
- <message name="QueryJobsResponse">
- <part name="jobs" type="jp:JobRecords"/>
- </message>
-
- <message name="UpdateJobsRequest">
- <part name="feedId" type="xsd:string"/>
- <part name="data" type="jp:UpdateJobsData"/>
- <part name="feedDone" type="xsd:boolean"/>
- </message>
- <message name="EmptyResponse"/>
-
- <portType name="JobProvenanceIS_PortType">
- <operation name="UpdateJobs">
- <documentation>Store or update information on jobs within the JP index server.
-Called directly by the primary storage, used for both batch and incremental feed.
-
-Input:
-
-data: list of job record updates. Each contains jobid, list of JP attribute values and user tag values.
-
-feedDone: flag indicating end of batch feed. (In order to avoid potential problems with buffer allocation
-the huge dataset of batch feed is split into reasonable chunks and delivered with more UpdateJobs calls.)
-
-Output: N/A
-
-Faults: GenericJPFault
-
-
- </documentation>
- <input message="tns:UpdateJobsRequest"/>
- <output message="tns:EmptyResponse"/>
- <fault name="f" message="tns:GenericJPFault"/>
- </operation>
- <operation name="QueryJobs">
- <documentation>Retrieve pointers to job records of jobs matching a query.
-Input: conditions - list of lists of query conditions.
- Elements of the inner lists refer to a single job attribute, the conditions are or-ed.
- Elements of the outer list may refer to different job attributes, they are and-ed.
-
-Output:
-
-jobs: list of JobId, PSContact (URL of the primary storage which manges this job) pairs
-
-Faults: GenericJPFault
- </documentation>
- <input message="tns:QueryJobsRequest"/>
- <output message="tns:QueryJobsResponse"/>
- <fault name="f" message="tns:GenericJPFault"/>
- </operation>
- </portType>
-
- <binding name="JobProvenanceIS" type="tns:JobProvenanceIS_PortType">
- <SOAP:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
- <operation name="UpdateJobs">
- <SOAP:operation style="rpc"/>
- <input>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </input>
- <output>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </output>
- <fault name="f">
- <SOAP:fault name="f" use="literal"/>
- </fault>
- </operation>
- <operation name="QueryJobs">
- <SOAP:operation style="rpc"/>
- <input>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </input>
- <output>
- <SOAP:body use="literal" namespace="http://glite.org/wsdl/services/jp"/>
- </output>
- <fault name="f">
- <SOAP:fault name="f" use="literal"/>
- </fault>
- </operation>
- </binding>
-
- <service name="JobProvenanceIS">
- <documentation>Job Provenance Index service</documentation>
- <port name="JobProvenanceIS" binding="tns:JobProvenanceIS">
- <SOAP:address location="http://localhost:10001"/>
- </port>
- </service>
-
-
-</WSDL:definitions>
+++ /dev/null
-module.build=33
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2004 on behalf of the EU EGEE Project:
- The European Organization for Nuclear Research (CERN),
- Istituto Nazionale di Fisica Nucleare (INFN), Italy
- Datamat Spa, Italy
- Centre National de la Recherche Scientifique (CNRS), France
- CS Systeme d'Information (CSSI), France
- Royal Institute of Technology, Center for Parallel Computers (KTH-PDC), Sweden
- Universiteit van Amsterdam (UvA), Netherlands
- University of Helsinki (UH.HIP), Finland
- University of Bergen (UiB), Norway
- Council for the Central Laboratory of the Research Councils (CCLRC), United Kingdom
-
- Configuration build properties file for the GLite jp ws-interface component
-
- Authors: Joachim Flammer <Joachim.Flammer@cern.ch>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.3 2004/07/20 16:08:30 flammer
- Changed incorrect my_... instead of .._template entries for subsystem and component.
-
- Revision 1.2 2004/07/16 14:56:55 flammer
- Corrected input path of build.properties.
-
- Revision 1.1 2004/07/06 20:43:19 flammer
- Update of configure & targets.
-
-
-
--->
-<project name="jp ws-interface component configuration properties">
-
-<target name="lbmakefiles">
- <exec executable="ln" failonerror="true">
- <arg line="-fs ${component.dir}/Makefile ${module.build.dir}/Makefile"/>
- </exec>
- <echo file="${module.build.dir}/Makefile.inc">
-top_srcdir=..
-builddir=build
-stagedir=${stage.abs.dir}
-distdir=${dist.dir}
-globalprefix=${global.prefix}
-jpprefix=${subsystem.prefix}
-package=${module.package.name}
-PREFIX=${install.dir}
-version=${module.version}
-glite_location=${with.glite.location}
- </echo>
- </target>
-</project>
+++ /dev/null
-Summary:Change me !!!
-Name:glite-jp-ws-interface
-Version:0.0.0
-Release:0
-Copyright:Open Source EGEE License
-Vendor:EU EGEE project
-Group:System/Application
-Prefix:/opt/glite
-BuildArch:x86_64
-BuildRoot:%{_builddir}/%{name}-%{version}
-Source:glite-jp-ws-interface-0.0.0_bin.tar.gz
-
-%define debug_package %{nil}
-
-%description
-Change me !!!
-
-%prep
-
-
-%setup -c
-
-%build
-
-
-%install
-
-
-%clean
-
-%pre
-%post
-%preun
-%postun
-%files
-%defattr(-,root,root)
-%{prefix}/interface/JobProvenancePS.wsdl
-%{prefix}/interface/JobProvenanceTypes.wsdl
-%{prefix}/share/doc/glite-jp-ws-interface-0.0.0/LICENSE
-
-%changelog
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2004 on behalf of the EU EGEE Project:
- The European Organization for Nuclear Research (CERN),
- Istituto Nazionale di Fisica Nucleare (INFN), Italy
- Datamat Spa, Italy
- Centre National de la Recherche Scientifique (CNRS), France
- CS Systeme d'Information (CSSI), France
- Royal Institute of Technology, Center for Parallel Computers (KTH-PDC), Sweden
- Universiteit van Amsterdam (UvA), Netherlands
- University of Helsinki (UH.HIP), Finland
- University of Bergen (UiB), Norway
- Council for the Central Laboratory of the Research Councils (CCLRC), United Kingdom
-
- Common build properties file for the GLite jp ws-interface component
-
- Authors: Joachim Flammer <Joachim.Flammer@cern.ch>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.4 2004/07/20 16:08:30 flammer
- Changed incorrect my_... instead of .._template entries for subsystem and component.
-
- Revision 1.3 2004/07/16 14:56:55 flammer
- Corrected input path of build.properties.
-
- Revision 1.2 2004/07/16 14:36:49 flammer
-
- Corrected build.properties include.
-
- Revision 1.1.1.1 2004/06/18 12:40:17 flammer
- Added general component template.
-
-
--->
-
-<project name="jp ws-interface component common properties">
-
- <!-- Include build properties to allow overwriting
- of properties for subsystem -->
- <property file="project/build.properties" />
-
- <!-- ======================================================
- Define corresponding subsystem properties
- ====================================================== -->
-
- <!-- Subsystem name -->
- <property name="subsystem.name" value="${jp.subsystem.name}"/>
-
- <!-- Subsystem prefix -->
- <property name="subsystem.prefix" value="${jp.subsystem.prefix}"/>
-
- <!-- ======================================================
- Define component properties
- ====================================================== -->
-
- <!-- Component name prefix -->
- <property name="component.prefix" value="ws-interface" />
-
- <!-- ======================================================
- Define general component properties
- ====================================================== -->
-
- <import file="${component.general.properties.file}" />
-
- <!-- ======================================================
- Define extra properties here ...
- ====================================================== -->
-
-
-</project>
+++ /dev/null
-module.version=1.0.0
-module.age=0
+++ /dev/null
-<service name="JobProvenancePS"
- ns="http://glite.org/wsdl/services/jp"
- prefix="jp"
- typeNs="http://glite.org/wsdl/types/jp"
- typePrefix="jpt"
- elemNs="http://glite.org/wsdl/elements/jp"
- elemPrefix="jpe"
- xmlns:jpt="http://glite.org/wsdl/types/jp">
-
- <version>CVS revision: <![CDATA[ $Header$ ]]></version>
-
- <import namespace="http://glite.org/wsdl/services/jp" location="JobProvenanceTypes.wsdl"/>
-
- <doc>
- <para>
- The Job Provenance (JP) Primary Storage Service is responsible
- to keep the JP data
- (definition of submitted jobs, execution conditions and environment,
- and important points of the job life cycle) in a compact and
- economic form.
- </para>
-
- <para>
- The JP Primary storage, as described in section 8.4 of
- the
- <ulink url="https://edms.cern.ch/document/594698/">
- Architecture deliverable DJRA1.1
- </ulink>
- provides public interfaces for data storing,
- retrieval based on basic metadata, and registration of Index servers for
- incremental feed.
- </para>
-
- <para>
- Command interface to JP is completely covered by the WS interface covered here.
- Bulk file transfers are done via specialised protocols, currently gsiftp only.
- </para>
- </doc>
-
- <fault name="genericFault"/>
-
- <operations>
- <op name="RegisterJob">
- Register job with the JP primary storage.
- <input name="job" type="xsd:string">Jobid of the registered job.</input>
- <input name="owner" type="xsd:string">Owner of the job (DN of X509 certificate).</input>
- <fault name="genericFault" type="genericFault">Any error.</fault>
- </op>
-
- <op name="StartUpload">
- Start uploading a file.
- <input name="job" type="xsd:string">Jobid to which this file is related.</input>
- <input name="class" type="xsd:string">
- Type of the file (URI). The server must have a plugin handing this type.
- </input>
- <input name="name" type="xsd:string">Name of the file (used to distinguish among more files of the same type).</input>
- <input name="commitBefore" type="xsd:dateTime">The client promisses to finish the upload before this time.</input>
- <input name="contentType" type="xsd:string">MIME type of the file.</input>
- <output name="destination" type="xsd:string">URL where the client should upload the file.</output>
- <output name="commitBefore" type="xsd:dateTime">Server's view on when the upload must be finished.</output>
- <fault name="genericFault" type="genericFault">Any error.</fault>
- </op>
-
- <op name="CommitUpload">
- Confirm a successfully finished file apload.
- <input name="destination" type="xsd:string">Destination URL returned by StartUpload before.</input>
- <fault name="genericFault" type="genericFault">Any error.</fault>
- </op>
-
- <op name="RecordTag">
- Record an additional user tag.
- <input name="jobid" type="xsd:string">Job to which the tag is added.</input>
- <input name="tag" type="tagValue">Name and value of the tag.</input>
- <fault name="genericFault" type="genericFault">Any error.</fault>
- </op>
-
- <op name="FeedIndex">
- Request for feeding a JP Index server (issued by this server).
- <input name="destination" type="xsd:string">Endpoint of the listening index server.</input>
- <input name="attributes" type="xsd:string" list="yes">Which attributes of jobs is the index server interested in.</input>
- <input name="conditions" type="primaryQuery" list="yes">Which jobs is the server interested in.</input>
- <input name="history" type="xsd:boolean">Data on jobs stored at PS in the past are required.</input>
- <input name="continuous" type="xsd:boolean">Data on jobs that will arrive in future are required.</input>
- <output name="feedId" type="xsd:string">Unique ID of the created feed session.</output>
- <output name="feedExpires" type="xsd:dateTime">When the session expires.</output>
- <fault name="genericFault" type="genericFault">Any error.</fault>
- </op>
-
- <op name="FeedIndexRefresh">
- Refresh an existing feed session.
- <input name="feedId" type="xsd:string">Existing feed session ID to be refreshed.</input>
- <output name="feedExpires" type="xsd:dateTime">New session expiration time.</output>
- <fault name="genericFault" type="genericFault">Any error.</fault>
- </op>
-
- <op name="GetJobFiles">
- Return URL's of files for a given single job.
- <input name="jobid" type="xsd:string">The job.</input>
- <output name="files" type="jppsFile" list="yes" optional="yes">List of the stored files.</output>
- <fault name="genericFault" type="genericFault">Any error.</fault>
- </op>
-
- <op name="GetJobAttributes">
- Query concrete attributes of a given job.
- <input name="jobid" type="xsd:string">The job.</input>
- <input name="attributes" type="xsd:string" list="yes">Which attributes should be retrieved.</input>
- <output name="attrValues" type="attrValue">Values of the queried attributes.</output>
- <fault name="genericFault" type="genericFault">Any error.</fault>
- </op>
- </operations>
-
-</service>
+++ /dev/null
-<?xml version="1.0"?>
-
-<service name="JobProvenanceTypes"
- ns="http://glite.org/wsdl/services/jp"
- typePrefix="jpt">
-
- <version>CVS revision: <![CDATA[ $Header$ ]]></version>
-
- <types ns="http://glite.org/wsdl/types/jp">
-
- <enum name="queryOp">
- Operators used in queries. Most are self-explanatory.
- <val name="EQUAL"></val>
- <val name="UNEQUAL"></val>
- <val name="LESS"></val>
- <val name="GREATER"></val>
- <val name="WITHIN">The attribute is between two specified values.</val>
- </enum>
-
- <struct name="tagValue">
- A single user-recorded value for a job attribute.
- <elem name="name" type="xsd:string">Name of the attribute, including namespace.</elem>
- <elem name="value" type="xsd:string" optional="yes">Value - printable string.</elem>
- </struct>
-
- <struct name="genericFault" fault="yes">
- <elem name="source" type="xsd:string"></elem>
- <elem name="code" type="xsd:int"></elem>
- <elem name="text" type="xsd:string"></elem>
- <elem name="description" type="xsd:string" optional="yes"></elem>
- <elem name="reason" type="genericFault" optional="yes"></elem>
- </struct>
-
- <struct name="primaryQuery">
- A single condition on job.
- <elem name="attr" type="xsd:string">Attribute name to query.</elem>
- <elem name="op" type="queryOp">Operation.</elem>
- <elem name="origin" type="attrOrig" optional="yes">Where the attribute value came from.</elem>
- <elem name="value" type="stringOrBlob">Value to compare the job attribute with.</elem>
- <elem name="value2" type="stringOrBlob" optional="yes">Another value (for op = WITHIN).</elem>
- </struct>
-
- <struct name="jppsFile">
- JP primary storage file identification.
- <elem name="class" type="xsd:string">Type of the file (as set on StartUpload).</elem>
- <elem name="name" type="xsd:string">Name of the file (if there are more of the same type per job).</elem>
- <elem name="url" type="xsd:string">Where the file is stored on JP primary storage.</elem>
- </struct>
-
- <struct name="attrValue">
- Single value of an attribute.
- <elem name="name" type="xsd:string">Name of the attribute, including namespace.</elem>
- <elem name="value" type="stringOrBlob" optional="yes">String value.</elem>
- <elem name="timestamp" type="xsd:dateTime">When this value was recorded.</elem>
- <elem name="origin" type="attrOrig">Where this value came from.</elem>
- <elem name="originDetail" type="xsd:string" optional="yes"></elem>
- </struct>
-
- <choice name="stringOrBlob">
- <elem name="string" type="xsd:string">String value.</elem>
- <elem name="blob" type="xsd:base64Binary">Binary value.</elem>
- </choice>
-
- <enum name="attrOrig">
- Specification of attribute origin.
- <val name="SYSTEM">JP system value, e.g. job owner.</val>
- <val name="USER">Explicitely stored by the user via RecordTag operation.</val>
- <val name="FILE">Coming from uploaded file.</val>
- </enum>
-
- <list name="string"/>
- </types>
-
-</service>
-
+++ /dev/null
-<?xml version="1.0"?>
-<book/>
+++ /dev/null
-<?xml version="1.0"?>
-
-<!-- $Header$ -->
-
-<xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<xsl:output indent="yes" doctype-public="-//OASIS//DTD DocBook XML V4.4//EN"
- doctype-system="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"/>
-
-<xsl:template match="book">
- <chapter>
- <title><xsl:value-of select="document('JobProvenancePS.xml')/service/@name"/></title>
-
- <sect1>
- <title>Overview</title>
- <xsl:copy-of select="document('JobProvenancePS.xml')/service/doc/*"/>
- </sect1>
-
- <sect1>
- <title>Operations</title>
- <para> <emphasis><xsl:value-of select="document('JobProvenancePS.xml')/service/version"/></emphasis> </para>
- <!-- xsl:apply-templates select="operations/op" -->
- <xsl:apply-templates select="document('JobProvenancePS.xml')/service/operations/op">
- <xsl:sort select="@name"/>
- </xsl:apply-templates>
- </sect1>
-
- <sect1>
- <title>Types</title>
- <!--xsl:apply-templates select="types"/ -->
- <para> <emphasis><xsl:value-of select="document('JobProvenanceTypes.xml')/service/version"/></emphasis> </para>
- <xsl:apply-templates select="document('JobProvenanceTypes.xml')/service/types"/>
- </sect1>
- </chapter>
-</xsl:template>
-
-
-<xsl:template match="input|output|fault">
- <varlistentry>
- <term>
- <!--type-->
- <xsl:if test = "@list = 'yes'">list of </xsl:if>
- <xsl:choose>
- <xsl:when test="not(starts-with(@type,'xsd:'))">
- <link linkend="type:{@type}">
- <type><xsl:value-of select="@type "/> </type> </link>
- </xsl:when>
- <xsl:otherwise><type><xsl:value-of select="@type "/> </type> </xsl:otherwise>
- </xsl:choose>
- <!--/type-->
- <parameter> <xsl:value-of select=" @name"/></parameter>
- </term>
- <listitem>
- <simpara><xsl:value-of select="text()"/></simpara>
- </listitem>
- </varlistentry>
-</xsl:template>
-
-<xsl:template match="op" >
- <sect2 id="op:{@name}">
- <title><xsl:value-of select="@name"/></title>
- <para><xsl:value-of select="text()"/></para>
- <para>
- Inputs:
- <xsl:choose>
- <xsl:when test="count(./input)>0">
- <variablelist>
- <xsl:apply-templates select="./input"/>
- </variablelist>
- </xsl:when>
- <xsl:otherwise>N/A</xsl:otherwise>
- </xsl:choose>
- </para>
- <para>
- Outputs:
- <xsl:choose>
- <xsl:when test="count(./output)>0">
- <variablelist>
- <xsl:apply-templates select="./output"/>
- </variablelist>
- </xsl:when>
- <xsl:otherwise>N/A</xsl:otherwise>
- </xsl:choose>
- </para>
- </sect2>
-</xsl:template>
-
-<xsl:template match="types">
- <xsl:for-each select="flags|enum|struct|choice">
- <xsl:sort select="@name"/>
- <sect2 id="type:{@name}">
- <title> <xsl:value-of select="@name"/> </title>
- <para> <xsl:value-of select="text()"/> </para>
- <xsl:choose>
- <xsl:when test="name(.)='struct'">
- <para> <emphasis>Structure</emphasis> (sequence complex type in WSDL)</para>
- <para> Fields: ( <type>type </type> <structfield>name</structfield> description )</para>
- </xsl:when>
- <xsl:when test="name(.)='choice'">
- <para> <emphasis>Union</emphasis> (choice complex type in WSDL)</para>
- <para> Fields: ( <type>type </type> <structfield>name</structfield> description )</para>
- </xsl:when>
- <xsl:when test="name(.)='enum'">
- <para> <emphasis>Enumeration</emphasis> (restriction of xsd:string in WSDL),
- exactly one of the values must be specified.
- </para>
- <para> Values: </para>
- </xsl:when>
- <xsl:when test="name(.)='flags'">
- <para> <emphasis>Flags</emphasis> (sequence of restricted xsd:string in WSDL),
- any number of values can be specified together.
- </para>
- <para> Values: </para>
- </xsl:when>
- </xsl:choose>
- <variablelist>
- <xsl:for-each select="elem|val">
- <varlistentry>
- <term>
- <xsl:choose>
- <xsl:when test="name(.)='elem'">
- <xsl:if test="@list = 'yes'">list of </xsl:if>
- <xsl:choose>
- <xsl:when test="@type!='string' and @type!='int' and not(starts-with(@type,'xsd:'))">
- <link linkend="type:{@type}">
- <type><xsl:value-of select="@type "/> </type>
- </link>
- </xsl:when>
- <xsl:otherwise><type><xsl:value-of select="@type "/></type></xsl:otherwise>
- </xsl:choose>
- <!-- <type><xsl:value-of select="@type"/></type> -->
- <xsl:value-of select="' '"/>
- <structfield><xsl:value-of select="@name"/></structfield>
- </xsl:when>
- <xsl:otherwise>
- <constant><xsl:value-of select="@name"/></constant>
- </xsl:otherwise>
- </xsl:choose>
- </term>
- <listitem>
- <simpara>
- <xsl:if test="@optional = 'yes'"> (optional) </xsl:if>
- <!-- <xsl:if test="@list = 'yes'"> (multiple occurence) </xsl:if> -->
- <xsl:value-of select=" text()"/>
- </simpara>
- </listitem>
- </varlistentry>
- </xsl:for-each>
- </variablelist>
- </sect2>
- </xsl:for-each>
-</xsl:template>
-
-
-</xsl:stylesheet>
+++ /dev/null
-<?xml version="1.0"?>
-
-<xsl:stylesheet version="1.0"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
- xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
-
- xmlns:jp="http://glite.org/wsdl/services/jp"
- xmlns:jpe="http://glite.org/wsdl/elements/jp"
- xmlns:jpt="http://glite.org/wsdl/types/jp">
-
-<xsl:output indent="yes"/>
-
-<xsl:template match="/service">
- <definitions
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- name="{@name}"
- targetNamespace="{@ns}">
- <documentation>
- <xsl:value-of select="version"/>
- <xsl:value-of select="text()"/>
- </documentation>
-
- <xsl:apply-templates select="import"/>
-
- <xsl:apply-templates select="types"/>
-
-<!-- <xsl:apply-templates select="fault"/> -->
-
- <xsl:apply-templates select="operations"/>
-
- </definitions>
-</xsl:template>
-
-<xsl:template match="types">
- <wsdl:types>
- <xsd:schema targetNamespace="{@ns}"
- elementFormDefault="unqualified"
- attributeFormDefault="unqualified">
-
- <xsl:apply-templates/>
- </xsd:schema>
- </wsdl:types>
- <!-- <xsl:apply-templates select="struct[@fault='yes']" mode="message"/> -->
-</xsl:template>
-
-<!--
-<xsl:template match="simple">
- <xsd:element name="{@name}" type="xsd:{@name}"/>
- <xsd:complexType name="{@name}List">
- <xsd:sequence>
- <xsd:element name="{@name}" type="xsd:{@name}" minOccurs="0" maxOccurs="unbounded"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:element name="{@name}List" type="{/service/@typePrefix}:{@name}List"/>
-</xsl:template>
-
-<xsl:template match="list">
- <xsd:complexType name="{@name}List">
- <xsd:sequence>
- <xsd:element name="{@name}" type="xsd:{@name}" minOccurs="0" maxOccurs="unbounded"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-</xsl:template>
--->
-
-<xsl:template match="enum">
- <xsd:simpleType name="{@name}">
- <xsd:restriction base="xsd:string">
- <xsl:for-each select="val"><xsd:enumeration value="{@name}"/></xsl:for-each>
- </xsd:restriction>
- </xsd:simpleType>
-<!-- <xsd:element name="{@name}" type="{/service/@typePrefix}:{@name}"/> -->
-</xsl:template>
-
-<xsl:template match="flags">
- <xsd:simpleType name="{@name}Value">
- <xsd:restriction base="xsd:string">
- <xsl:for-each select="val"><xsd:enumeration value="{@name}"/></xsl:for-each>
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:complexType name="{@name}">
- <xsd:sequence>
- <xsd:element name="flag" type="{/service/@typePrefix}:{@name}Value" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- </xsd:complexType>
-<!-- <xsd:element name="{@name}" type="{/service/@typePrefix}:{@name}"/> -->
-</xsl:template>
-
-<xsl:template match="struct">
- <xsd:complexType name="{@name}">
- <xsd:sequence>
- <xsl:call-template name="inner-struct"/>
- </xsd:sequence>
- </xsd:complexType>
-</xsl:template>
-
-<xsl:template match="choice">
- <xsd:complexType name="{@name}">
- <xsd:choice>
- <xsl:call-template name="inner-struct"/>
- </xsd:choice>
- </xsd:complexType>
-</xsl:template>
-
-
-<xsl:template name="inner-struct">
- <xsl:variable name="nillable">
- <xsl:choose>
- <xsl:when test="local-name(.)='choice'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:for-each select="elem">
- <xsl:variable name="type">
- <xsl:choose>
- <xsl:when test="contains(@type,':')">
- <xsl:value-of select="@type"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="/service/@typePrefix"/>:<xsl:value-of select="@type"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="min">
- <xsl:choose>
- <xsl:when test="@optional='yes'">0</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="max">
- <xsl:choose>
- <xsl:when test="@list='yes'">unbounded</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsd:element name="{@name}" type="{$type}" minOccurs="{$min}" maxOccurs="{$max}" nillable="{$nillable}"/>
- </xsl:for-each>
-<!--
- <xsd:complexType name="{@name}List">
- <xsd:sequence>
- <xsd:element name="{@name}" type="{/service/@typePrefix}:{@name}" minOccurs="0" maxOccurs="unbounded"></xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- <xsd:element name="{@name}" type="{/service/@typePrefix}:{@name}"/>
- <xsd:element name="{@name}List" type="{/service/@typePrefix}:{@name}List"/>
--->
-</xsl:template>
-
-<xsl:template match="op" mode="message">
- <wsdl:message name="{@name}Request">
- <wsdl:part name="input" element="{/service/@elemPrefix}:{@name}">
- <wsdl:documentation><xsl:value-of select="text()"/></wsdl:documentation>
- </wsdl:part>
- </wsdl:message>
- <wsdl:message name="{@name}Response">
- <wsdl:part name="output" element="{/service/@elemPrefix}:{@name}Response">
- <wsdl:documentation><xsl:value-of select="text()"/></wsdl:documentation>
- </wsdl:part>
- </wsdl:message>
-</xsl:template>
-
-<xsl:template match="op" mode="element">
- <xsd:element name="{@name}">
- <xsd:complexType>
- <xsd:sequence>
- <xsl:for-each select="input">
- <xsl:variable name="prefix">
- <xsl:choose>
- <xsl:when test="starts-with(@type,'xsd:')"/>
- <xsl:otherwise><xsl:value-of select="/service/@typePrefix"/>:</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="max">
- <xsl:choose>
- <xsl:when test="@list='yes'">unbounded</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsd:element name="{@name}" type="{$prefix}{@type}" minOccurs="1" maxOccurs="{$max}"/>
- </xsl:for-each>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="{@name}Response">
- <xsd:complexType>
- <xsd:sequence>
- <xsl:for-each select="output">
- <xsl:variable name="prefix">
- <xsl:choose>
- <xsl:when test="starts-with(@type,'xsd:')"/>
- <xsl:otherwise><xsl:value-of select="/service/@typePrefix"/>:</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="max">
- <xsl:choose>
- <xsl:when test="@list='yes'">unbounded</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsd:element name="{@name}" type="{$prefix}{@type}" minOccurs="1" maxOccurs="{$max}"/>
- </xsl:for-each>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-</xsl:template>
-
-
-<xsl:template match="struct[@fault='yes']" mode="message">
- <wsdl:message name="{@name}">
- <wsdl:part name="{@name}" element="{/service/@typePrefix}:{@name}">
- <wsdl:documentation><xsl:value-of select="text()"/></wsdl:documentation>
- </wsdl:part>
- </wsdl:message>
-</xsl:template>
-
-<xsl:template match="op" mode="port-type">
- <wsdl:operation name="{@name}">
- <wsdl:documentation><xsl:value-of select="text()"/></wsdl:documentation>
- <wsdl:input name="i" message="{/service/@prefix}:{@name}Request"/>
- <wsdl:output name="o" message="{/service/@prefix}:{@name}Response"/>
- <wsdl:fault name="f" message="{/service/@prefix}:{fault/@name}"/>
- </wsdl:operation>
-</xsl:template>
-
-<xsl:template match="op" mode="binding">
- <wsdl:operation name="{@name}">
- <soap:operation style="document"/>
- <wsdl:input name="i">
- <soap:body use="literal"/>
- </wsdl:input>
- <wsdl:output name="o">
- <soap:body use="literal"/>
- </wsdl:output>
- <wsdl:fault name="f">
- <soap:fault name="f" use="literal"/>
- </wsdl:fault>
- </wsdl:operation>
-</xsl:template>
-
-<xsl:template match="import">
- <wsdl:import namespace="{@namespace}" location="{@location}"/>
-</xsl:template>
-
-<xsl:template match="operations">
- <wsdl:types>
- <xsd:schema targetNamespace="{/service/@elemNs}"
- elementFormDefault="unqualified"
- attributeFormDefault="unqualified">
-
- <xsl:apply-templates select="op" mode="element"/>
-
- <xsl:for-each select="/service/fault">
- <xsd:element name="{@name}" type="{/service/@typePrefix}:{@name}"/>
- </xsl:for-each>
- </xsd:schema>
- </wsdl:types>
-
- <xsl:apply-templates select="/service/fault"/>
-
- <xsl:apply-templates select="op" mode="message"/>
-
- <wsdl:portType name="{/service/@name}PortType">
- <xsl:apply-templates select="op" mode="port-type"/>
- </wsdl:portType>
-
- <binding name="{/service/@name}" type="{/service/@prefix}:{/service/@name}PortType">
- <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
- <xsl:apply-templates select="op" mode="binding"/>
- </binding>
-
- <service name="{/service/@name}">
- <documentation><xsl:value-of select="text()"/></documentation>
- <port name="{/service/@name}" binding="{/service/@prefix}:{/service/@name}">
- <soap:address location="http://test.glite.org/{/service/@prefix}:8080"/>
- </port>
-
- </service>
-
-</xsl:template>
-
-<xsl:template match="fault">
- <wsdl:message name="{@name}">
- <wsdl:part name="{@name}" element="{/service/@elemPrefix}:{@name}" />
- </wsdl:message>
-</xsl:template>
-
-
-</xsl:stylesheet>
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Build file for the GLite Middleware Job Provenance Subsystem
-
- Authors: Ales Krenek <ljocha@ics.muni.cz>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.4 2004/12/17 20:26:46 dimeglio
- Removed index
-
- Revision 1.3 2004/12/10 09:46:41 akrenek
- included ws-interface
-
- Revision 1.2 2004/12/01 18:36:00 zsalvet
- Add component targets.
-
- Revision 1.1 2004/11/22 13:21:49 dimeglio
- First version of this file
-
--->
-
-<project name="jp" default="dist">
-
- <description>
- Ant build file to build the GLite Job Provenance Subsystem
- </description>
-
- <!-- =========================================
- Builds the GLite JP subsystem
- ========================================= -->
-
- <!-- Import baseline & user properties -->
- <import file="../org.glite/project/baseline.properties.xml" />
-
- <!-- Import subsystem build properties,
- subsystem properties &
- subsystem common properties -->
- <import file="./project/properties.xml" />
-
- <!-- Import global build properties and global properties -->
- <import file="${global.properties.file}" />
-
- <!-- =========================================
- Load dependencies properties files (order is important)
- ========================================= -->
- <property file="${user.dependencies.file}"/>
- <property file="${subsystem.dependencies.file}"/>
- <property file="${global.dependencies.file}"/>
-
- <!-- =========================================
- Load configure options
- ========================================= -->
- <import file="${global.configure.options.file}"/>
-
- <!-- =========================================
- Import global task definitions
- ========================================= -->
- <import file="${global.taskdefs.file}" />
-
- <!-- =========================================
- Import global compiler definitions
- ========================================= -->
- <import file="${global.compilerdefs.file}" />
-
- <!-- =========================================
- Import targets
- ========================================= -->
- <import file="${global.targets-common.file}"/>
-
- <!-- =========================================
- Load version file
- ========================================= -->
- <property file="${module.version.file}"/>
- <property file="${module.build.file}"/>
-
- <!-- ===============================================
- Public common targets
- =============================================== -->
-
- <target name="localinit" depends="envcheck">
-
- <echo> Preparing directories ... </echo>
-
- <mkdir dir="${stage.bin.dir}" />
- <mkdir dir="${stage.lib.dir}" />
- <mkdir dir="${stage.java.dir}" />
- <mkdir dir="${stage.inc.dir}" />
- <mkdir dir="${stage.int.dir}" />
-
- <mkdir dir="${dist.dir}" />
-
- </target>
-
- <target name="init" depends="localinit">
- <antcall target="buildmodules">
- <param name="target" value="init"/>
- </antcall>
- </target>
-
- <target name="checkstyle" depends="localinit">
- <antcall target="buildmodules">
- <param name="target" value="checkstyle"/>
- </antcall>
- </target>
-
- <target name="compile" depends="localinit">
- <antcall target="buildmodules">
- <param name="target" value="compile"/>
- </antcall>
- </target>
-
- <target name="compiletest" depends="localinit">
- <antcall target="buildmodules">
- <param name="target" value="compiletest"/>
- </antcall>
- </target>
-
- <target name="unittest" depends="localinit">
- <antcall target="buildmodules">
- <param name="target" value="unittest"/>
- </antcall>
- </target>
-
- <target name="unitcoverage" depends="localinit">
- <antcall target="buildmodules">
- <param name="target" value="unitcoverage"/>
- </antcall>
- </target>
-
- <target name="stage" depends="localinit">
- <antcall target="buildmodules">
- <param name="target" value="stage"/>
- </antcall>
- </target>
-
- <target name="dist" depends="localinit">
- <antcall target="buildmodules">
- <param name="target" value="dist"/>
- </antcall>
- </target>
-
- <target name="install" depends="localinit">
- <antcall target="buildmodules">
- <param name="target" value="install"/>
- </antcall>
- </target>
-
- <target name="doc" depends="localinit">
- <antcall target="buildmodules">
- <param name="target" value="doc"/>
- </antcall>
- </target>
-
- <target name="all" depends="localinit">
- <antcall target="buildmodules">
- <param name="target" value="all"/>
- </antcall>
- </target>
-
- <target name="clean" depends="envcheck">
-
- <property name="offline.repository" value="true" />
- <antcall target="buildmodules">
- <param name="target" value="clean"/>
- </antcall>
-
- <delete dir="${module.bin.dir}" />
- <delete dir="${module.lib.dir}" />
- <delete dir="${module.autosrc.dir}" />
- <delete dir="${module.autodoc.dir}" />
- <delete dir="${module.test.reports.dir}" />
-
- </target>
-
- <target name="cleanAll" depends="clean"/>
-
- <!-- ===============================================
- Private targets
- =============================================== -->
-
- <!-- ===============================================
- Modules proxy targets
- =============================================== -->
-
- <!-- component targets definitions tag = do not remove = -->
-
- <target name="ws-interface" unless="setenvonly" depends="envset" >
- <if>
- <isset property="small.memory" />
- <then>
- <exec dir="${jp.subsystem.dir}.ws-interface" executable="${antExec}" failonerror="${failonerror}">
- <arg line="${target} "-Dsmall.memory=true" "-Dbootstrap=${bootstrap}" "-Dfailonerror=${failonerror}" "-Ddo.cvs.tag=${do.cvs.tag}""/>
- </exec>
- </then>
- <else>
- <ant dir="${jp.subsystem.dir}.ws-interface"
- target="${target}"
- inheritall="false" />
- </else>
- </if>
- </target>
-
- <target name="common" unless="setenvonly" depends="envset" >
- <if>
- <isset property="small.memory" />
- <then>
- <exec dir="${jp.subsystem.dir}.common" executable="${antExec}" failonerror="${failonerror}">
- <arg line="${target} "-Dsmall.memory=true" "-Dbootstrap=${bootstrap}" "-Dfailonerror=${failonerror}" "-Ddo.cvs.tag=${do.cvs.tag}""/>
- </exec>
- </then>
- <else>
- <ant dir="${jp.subsystem.dir}.common"
- target="${target}"
- inheritall="false" />
- </else>
- </if>
- </target>
-
- <target name="index" unless="setenvonly" depends="envset, common" >
- <if>
- <isset property="small.memory" />
- <then>
- <exec dir="${jp.subsystem.dir}.index" executable="${antExec}" failonerror="${failonerror}">
- <arg line="${target} "-Dsmall.memory=true" "-Dbootstrap=${bootstrap}" "-Dfailonerror=${failonerror}" "-Ddo.cvs.tag=${do.cvs.tag}""/>
- </exec>
- </then>
- <else>
- <ant dir="${jp.subsystem.dir}.index"
- target="${target}"
- inheritall="false" />
- </else>
- </if>
- </target>
-
- <target name="primary" unless="setenvonly" depends="envset, ws-interface, common" >
- <if>
- <isset property="small.memory" />
- <then>
- <exec dir="${jp.subsystem.dir}.primary" executable="${antExec}" failonerror="${failonerror}">
- <arg line="${target} "-Dsmall.memory=true" "-Dbootstrap=${bootstrap}" "-Dfailonerror=${failonerror}" "-Ddo.cvs.tag=${do.cvs.tag}""/>
- </exec>
- </then>
- <else>
- <ant dir="${jp.subsystem.dir}.primary"
- target="${target}"
- inheritall="false" />
- </else>
- </if>
- </target>
-
- <!-- Main proxy -->
- <target name="buildmodules" depends="envset,
- ws-interface,
- common,
- primary">
- <echo append="true" file="${global.project.dir}/cruisecontrol-stub.xml">
- <project name="${subsystem.name}" type="post-subsystem" packageName="${global.prefix}-${subsystem.prefix}"/>
- </echo>
- </target>
-
-</project>
+++ /dev/null
-module.build=36
+++ /dev/null
-###################################################################
-# System dependencies
-###################################################################
-
-org.glite.version = HEAD
-org.glite.jp.version = HEAD
-
-# Component dependencies tag = do not remove this line =
-org.glite.jp.ws-interface.version = HEAD
-org.glite.jp.common.version = HEAD
-org.glite.jp.index.version = HEAD
-org.glite.jp.primary.version = HEAD
+++ /dev/null
-<?xml version="1.0"?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- GLite Middleware Job Provenance Configuration Specification File
-
- Authors: Alberto Di Meglio <alberto.di.meglio@cern.ch>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
- Revision 1.2 2004/12/01 18:24:25 zsalvet
- common, index, and primary components defined
-
- Revision 1.1 2004/11/22 13:21:49 dimeglio
- First version of this file
-
--->
-
-
-<project name="GLite Middleware JP CSF" default="all">
-
- <!-- ===============================================
- Determine workspace directory
- =============================================== -->
-
- <!-- Relative workspace root directory -->
- <property name="workspace.dir" value="../.." />
-
- <!-- ===============================================
- Load properties
- =============================================== -->
-
- <!-- load baseline and user properties -->
- <import file="${workspace.dir}/org.glite/project/baseline.properties.xml" />
-
- <!-- define build properties file location since we are already in project dir -->
- <property name="subsystem.build.properties.file" value="./build.properties" />
-
- <!-- Load subsystem-specific property file -->
- <property file="./properties.xml"/>
-
- <!-- load global properties -->
- <import file="${global.properties.file}" />
-
- <!-- ===============================================
- Load dependencies
- =============================================== -->
-
- <!-- Load user dependencies file -->
- <property file="${user.dependencies.file}" />
-
- <!-- Load subsystem dependencies file -->
- <property file="./dependencies.properties" />
-
- <!-- Load global dependencies file -->
- <property file="${global.dependencies.file}" />
-
- <!-- ===============================================
- Load targets
- =============================================== -->
- <import file="${global.targets-envchecks.file}" />
- <import file="${global.targets-external-dependencies.file}" />
-
- <!-- ===============================================
- Evaluate CVS tags
- =============================================== -->
-
- <target name="evaluate.cvs.tags" description="Figure out if we need tagged CVS checkout">
-
- <condition property="glite.head">
- <and>
- <equals arg1="${org.glite.version}" arg2="HEAD" />
- <or>
- <istrue value="${update}" />
- <not>
- <available file="${global.dependencies.file}" type="file" />
- </not>
- </or>
- </and>
- </condition>
-
- <condition property="glite.tag">
- <and>
- <not>
- <equals arg1="${org.glite.version}" arg2="HEAD" />
- </not>
- <or>
- <istrue value="${update}" />
- <not>
- <available file="${global.dependencies.file}" type="file" />
- </not>
- </or>
- </and>
- </condition>
-
- <condition property="glite-jp.head">
- <and>
- <equals arg1="${org.glite.jp.version}" arg2="HEAD" />
- <istrue value="${update}" />
- </and>
- </condition>
-
- <condition property="glite-jp.tag">
- <and>
- <not>
- <equals arg1="${org.glite.jp.version}" arg2="HEAD" />
- </not>
- <istrue value="${update}" />
- </and>
- </condition>
-
- <!-- condition property tag = do not remove = -->
-
- <condition property="common.head">
- <equals arg1="${org.glite.jp.common.version}" arg2="HEAD" />
- </condition>
-
- <condition property="ws-interface.head">
- <equals arg1="${org.glite.jp.ws-interface.version}" arg2="HEAD" />
- </condition>
-
- <condition property="index.head">
- <equals arg1="${org.glite.jp.index.version}" arg2="HEAD" />
- </condition>
-
- <condition property="primary.head">
- <equals arg1="${org.glite.jp.primary.version}" arg2="HEAD" />
- </condition>
-
- </target>
-
- <presetdef name="cvs-co">
- <cvs command="checkout" dest="${workspace.dir}" />
- </presetdef>
-
- <!-- =====================================================
- Self-update if required
- ===================================================== -->
-
- <!-- Update main GLite module -->
- <target name="org.glite" depends="get.glite.head, get.glite.tag"/>
-
- <target name="get.glite.head" if="glite.head">
- <cvs-co package="org.glite" />
- </target>
-
- <target name="get.glite.tag" if="glite.tag">
- <cvs-co package="org.glite"
- tag="${org.glite.version}" />
- </target>
-
- <!-- Update the current module -->
- <target name="org.glite.jp" depends="get.glite-jp.head,
- get.glite-jp.tag"/>
-
- <target name="get.glite-jp.head" if="glite-jp.head">
- <cvs-co package="org.glite.jp" />
- <fail>The org.glite and org.glite.jp modules have been updated, please rerun the configuration file</fail>
- </target>
-
- <target name="get.glite-jp.tag" if="glite-jp.tag">
- <cvs-co package="org.glite.jp"
- tag="${org.glite.jp.version}" />
- <fail>The org.glite and org.glite.jp modules have been updated, please rerun the configuration file</fail>
- </target>
-
- <!-- *****************************************************-->
- <!-- Development tools -->
- <!-- *****************************************************-->
-
- <!-- All development tools -->
- <target name="devtools" depends="oscheck,
- junitcheck,
- junit,
- chkstyle,
- jalopy,
- ant-contrib,
- cpptasks,
- log4j,
- egee-ant-ext"
- description="Get development tools into repository."/>
-
- <!-- =====================================================
- External libraries
- ===================================================== -->
-
- <!-- All external libraries -->
- <target name="external"
- description="Install external packages" depends="oscheck"/>
-
- <!-- =====================================================
- GLite Middleware jp modules
- ===================================================== -->
-
- <!-- component targets tag = do not remove = -->
-
- <!-- ws-interface -->
- <target name="ws-interface" depends="evaluate.cvs.tags, get.ws-interface.head, get.ws-interface.tag"/>
- <target name="get.ws-interface.head" if="ws-interface.head">
- <cvs-co package="org.glite.jp.ws-interface" />
- </target>
- <target name="get.ws-interface.tag" unless="ws-interface.head">
- <cvs-co package="org.glite.jp.ws-interface"
- tag="${org.glite.jp.ws-interface.version}" />
- </target>
-
- <!-- common -->
- <target name="common" depends="evaluate.cvs.tags, get.common.head, get.common.tag"/>
- <target name="get.common.head" if="common.head">
- <cvs-co package="org.glite.jp.common" />
- </target>
- <target name="get.common.tag" unless="common.head">
- <cvs-co package="org.glite.jp.common"
- tag="${org.glite.jp.common.version}" />
- </target>
-
- <!-- index -->
- <target name="index" depends="evaluate.cvs.tags, get.index.head, get.index.tag"/>
- <target name="get.index.head" if="index.head">
- <cvs-co package="org.glite.jp.index" />
- </target>
- <target name="get.index.tag" unless="index.head">
- <cvs-co package="org.glite.jp.index"
- tag="${org.glite.jp.index.version}" />
- </target>
-
- <!-- primary -->
- <target name="primary" depends="evaluate.cvs.tags, get.primary.head, get.primary.tag"/>
- <target name="get.primary.head" if="primary.head">
- <cvs-co package="org.glite.jp.primary" />
- </target>
- <target name="get.primary.tag" unless="primary.head">
- <cvs-co package="org.glite.jp.primary"
- tag="${org.glite.jp.primary.version}" />
- </target>
-
- <!-- All project modules -->
- <target name="project" depends="ws-interface,
- common,
- index,
- primary" />
-
- <!-- ====================================================
- Checkout all
- ==================================================== -->
-
- <!-- All libraries -->
- <target name="all" depends="oscheck,
- evaluate.cvs.tags,
- defaultenvchecks,
- org.glite,
- org.glite.jp,
- devtools,
- external,
- project" />
-
- <!-- ====================================================
- Print dependecies to console
- ==================================================== -->
-
- <target name="dependencies">
- <concat>
- <fileset dir="." includes="dependencies.properties" />
- </concat>
- </target>
-
-</project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Common build properties file for the gLite JP modules
-
- Authors: Ales Krenek <ljocha@ics.muni.cz>
- Alberto Di Meglio <alberto.di.meglio@cern.ch>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
--->
-
-<project name="Job Provenance subsystem common properties">
-
- <!-- Include build properties to allow overwriting
- of properties for subsystem -->
- <property name="subsystem.build.properties.file" value="./project/build.properties" />
- <property file="${subsystem.build.properties.file}" />
-
- <!-- ======================================================
- Define subsystem properties
- ====================================================== -->
-
- <!-- Subsystem name -->
- <property name="subsystem.name" value="${jp.subsystem.name}"/>
-
- <!-- Subsystem prefix -->
- <property name="subsystem.prefix" value="${jp.subsystem.prefix}"/>
-
- <!-- ======================================================
- Define general subsystem properties
- ====================================================== -->
-
- <!-- Include common subsystem properties -->
- <import file="${subsystem.general.properties.file}" />
-
- <!-- ======================================================
- Define extra properties here ...
- ====================================================== -->
-
-
-</project>
+++ /dev/null
-#!/bin/sh
-
-cd ../..
-
-cvs co org.glite
-cvs co org.glite.jp
-
-cd org.glite.jp/project
-ant -f glite.jp.csf.xml
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) Members of the EGEE Collaboration. 2004
- See http://eu-egee.org/partners/ for details on the copyright holders
- For license conditions see the license file or http://eu-egee.org/license.html
-
- Common Ant task definition file for the gLite Job Provenance modules
-
- Authors: Ales Krenek <ljocha@ics.muni.cz>
- Alberto Di Meglio <alberto.di.meglio@cern.ch>
- Version info: $Id$
- Release: $Name$
-
- Revision history:
- $Log$
--->
-
-<project name="Job Provenance subsystem common tasks and types definitions">
-
- <!-- ======================================================
- Subsystem task definitions
- ====================================================== -->
-
-</project>
\ No newline at end of file
+++ /dev/null
-module.version=1.0.0
-module.age=1
#Thu May 19 13:15:52 CEST 2005
-module.version=2.0.0
+module.version=2.0.1
module.age=1
}
-static edg_wll_Context tmp_context;
-static edg_wll_PlainConnection *tmp_conn;
+static int
+read_il_data_thr(char **buffer,
+ int (*reader)(char *, const int,edg_wll_Context,void *),edg_wll_Context ctx,void *conn)
+{
+ char buf[17];
+ int ret, len;
+
+ /* read 17 byte header */
+ len = (*reader)(buf, 17,ctx,conn);
+ if(len < 0) {
+ goto err;
+ }
+ buf[16] = 0;
+ if((len=atoi(buf)) <= 0) {
+ len = -1;
+ goto err;
+ }
+
+ /* allocate room for the body */
+ *buffer = malloc(len+1);
+ if(*buffer == NULL) {
+ len = -1;
+ goto err;
+ }
+
+ /* read body */
+ ret = (*reader)(*buffer, len,ctx,conn);
+ if(ret < 0) {
+ free(*buffer);
+ *buffer = NULL;
+ len = ret;
+ goto err;
+ }
+
+ (*buffer)[len] = 0;
+
+ err:
+ return(len);
+}
static
int
-plain_reader(char *buffer, int max_len)
+plain_reader(char *buffer, int max_len,edg_wll_Context ctx,void *conn)
{
int len;
- len = edg_wll_plain_read_full(tmp_conn, buffer, max_len, &tmp_context->p_tmp_timeout);
+ len = edg_wll_plain_read_full(conn, buffer, max_len, &ctx->p_tmp_timeout);
if(len < 0)
- edg_wll_SetError(tmp_context, LB_PROTO, "get_reply_plain(): error reading message data");
+ edg_wll_SetError(ctx, LB_PROTO, "get_reply_plain(): error reading message data");
return(len);
}
int len, code;
code = 0;
- tmp_context = context;
- tmp_conn = conn;
- len = read_il_data(&msg, plain_reader);
+ len = read_il_data_thr(&msg, plain_reader,context,conn);
if(len < 0)
goto get_reply_plain_end;
}
-static edg_wll_GssConnection *tmp_gss_conn;
-
static
int
-gss_reader(char *buffer, int max_len)
+gss_reader(char *buffer, int max_len,edg_wll_Context ctx,void *conn)
{
int ret, len;
edg_wll_GssStatus gss_code;
- ret = edg_wll_gss_read_full(tmp_gss_conn, buffer, max_len, &tmp_context->p_tmp_timeout,
+ ret = edg_wll_gss_read_full(conn, buffer, max_len, &ctx->p_tmp_timeout,
&len, &gss_code);
if(ret < 0) {
- edg_wll_log_proto_handle_gss_failures(tmp_context, ret, &gss_code, "edg_wll_gss_read_full");
- edg_wll_UpdateError(tmp_context, LB_PROTO, "get_reply_gss(): error reading message");
+ edg_wll_log_proto_handle_gss_failures(ctx, ret, &gss_code, "edg_wll_gss_read_full");
+ edg_wll_UpdateError(ctx, LB_PROTO, "get_reply_gss(): error reading message");
}
return(ret);
char *msg;
int code;
- tmp_context = context;
- tmp_gss_conn = conn;
- code = read_il_data(&msg, gss_reader);
+ code = read_il_data_thr(&msg, gss_reader,context, conn);
if(code < 0)
goto get_reply_gss_end;
if ((answer = edg_wll_gss_connect(cred,
context->p_destination, context->p_dest_port,
&context->p_tmp_timeout, &con, &gss_stat)) < 0) {
- edg_wll_log_proto_handle_gss_failures(context,answer,&gss_stat,"edg_wll_gss_connect()");
+ answer = edg_wll_log_proto_handle_gss_failures(context,answer,&gss_stat,"edg_wll_gss_connect()");
goto edg_wll_DoLogEvent_end;
}
#endif
if ((answer = edg_wll_gss_connect(cred,host,port,
&context->p_tmp_timeout, &con, &gss_stat)) < 0) {
- edg_wll_log_proto_handle_gss_failures(context,answer,&gss_stat,"edg_wll_gss_connect()");
+ answer = edg_wll_log_proto_handle_gss_failures(context,answer,&gss_stat,"edg_wll_gss_connect()");
goto edg_wll_DoLogEventDirect_end;
}
#Thu May 19 13:15:32 CEST 2005
-module.version=2.0.0
+module.version=2.0.1
module.age=1
#include <unistd.h>
#include <stdlib.h>
+#define IL_PROTOCOL_MAGIC_WORD "michal"
+
int
encode_il_msg(char **buffer, const char *event)
{
int len;
char *p;
+ char *protocol_magic_word = IL_PROTOCOL_MAGIC_WORD;
/* allocate enough room to hold the message */
- len = 17 + len_string((char*)event);
+ len = 17 + len_string(protocol_magic_word) + len_string((char*)event);
if((*buffer = malloc(len)) == NULL) {
return(-1);
}
p += 17;
/* write rest of the message */
+ p = put_string(p, protocol_magic_word);
p = put_string(p, (char*)event);
return(p - *buffer);
decode_il_msg(char **event, const char *buf)
{
char *p;
+ char *protocol_magic_word=NULL;
+ int magic_word_check_failed = 0;
+
+ /* First check that the protocol 'magic' word is there */
+ p = get_string((char*)buf, &protocol_magic_word);
+ if (protocol_magic_word) {
+ if (strcmp (protocol_magic_word, IL_PROTOCOL_MAGIC_WORD) != 0) {
+ magic_word_check_failed = 1;
+ }
+ free(protocol_magic_word);
+ }
+
+ if (magic_word_check_failed != 0) return (-1);
- p = get_string((char*)buf, event);
+ p = get_string(p, event);
if(p == NULL) {
if(*event) { free(*event); *event = NULL; };
return(-1);
}
void testEncodeMsg() {
- CPPUNIT_ASSERT_EQUAL(len_msg, 26);
+ CPPUNIT_ASSERT_EQUAL(len_msg, 35);
CPPUNIT_ASSERT(buffer_msg != NULL);
CPPUNIT_ASSERT(!strncmp(buffer_msg, msg, len_msg));
}
char *s;
l = read_il_data(&s, test_reader);
- CPPUNIT_ASSERT_EQUAL(l, 9);
+ CPPUNIT_ASSERT_EQUAL(l, 18);
CPPUNIT_ASSERT(s != NULL);
- CPPUNIT_ASSERT(!strcmp(s, "6 zprava\n"));
+ CPPUNIT_ASSERT(!strcmp(s, "6 michal\n6 zprava\n"));
free(s);
}
}
};
-const char *IlMsgTest::msg = " 9\n6 zprava\n";
+const char *IlMsgTest::msg = " 18\n6 michal\n6 zprava\n";
const char *IlMsgTest::rep = " 14\n10\n20\n5 chyba\n";
int IlMsgTest::pos;
#Thu May 19 13:16:38 CEST 2005
-module.version=1.1.1
+module.version=1.1.2
module.age=1
YACC=bison -y
CC=gcc
-VPATH=${top_srcdir}/src:${top_srcdir}/test:${top_srcdir}/examples:${top_srcdir}/project
+ifeq ($(gsoap_version),2.7.0)
+ VPATH=${top_srcdir}/src:${top_srcdir}/test:${top_srcdir}/examples:${top_srcdir}/project:${gsoap_prefix}
+else
+ VPATH=${top_srcdir}/src:${top_srcdir}/test:${top_srcdir}/examples:${top_srcdir}/project
+endif
AT3=perl -I${top_srcdir}/project ${top_srcdir}/project/at3
TEST_LIBS:=-L${cppunit}/lib -lcppunit
-I${top_srcdir}/interface \
-I${expat_prefix}/include \
-I${ares_prefix}/include \
- -I${gsoap_prefix}/include \
+ -I${gsoap_prefix}/include -I${gsoap_prefix}/ \
${COVERAGE_FLAGS} \
-I${mysql_prefix}/include -I${mysql_prefix}/include/mysql \
-I${globus_prefix}/include/${nothrflavour} \
-lglobus_common_${nothrflavour} \
-lglobus_gssapi_gsi_${nothrflavour} \
+ifeq ($(shell ls ${gsoap_prefix}/bin/soapcpp2),${gsoap_prefix}/bin/soapcpp2)
+ gsoap_bin_prefix := ${gsoap_prefix}/bin
+else
+ gsoap_bin_prefix := ${gsoap_prefix}
+endif
+
ifneq (${mysql_prefix},/usr)
ifeq ($(shell echo ${mysql_version} | cut -d. -f1,2),4.1)
mysqlib := -L${mysql_prefix}/lib/mysql
lb_xml_parse_V21.o \
lock.o openserver.o query.o userjobs.o db_store.o request.o store.o \
stored_master.o srv_purge.o server_state.o dump.o lb_authz.o load.o \
- notification.o il_notification.o notif_match.o stats.o
+ notification.o il_notification.o notif_match.o stats.o
ifeq ($(GLITE_LB_SERVER_WITH_WS),yes)
- BKSERVER_OBJS:= \
- ${BKSERVER_BASE_OBJS} \
- ${GSOAP_FILES_PREFIX}C.o ${GSOAP_FILES_PREFIX}Server.o \
- ws_query.o ws_fault.o ws_typeref.o
-
- BKSERVER_LIBS= \
- ${SRVBONES_LIB} \
- -lglite_lb_common_${nothrflavour} \
- -L${gsoap_prefix}/lib -lgsoap \
- -lglite_security_gsoap_plugin_${nothrflavour} \
- ${EXT_LIBS}
+ ifeq ($(gsoap_version),2.7.0)
+ BKSERVER_OBJS:= \
+ ${BKSERVER_BASE_OBJS} \
+ ${GSOAP_FILES_PREFIX}C.o ${GSOAP_FILES_PREFIX}Server.o \
+ ws_query.o ws_fault.o ws_typeref.o stdsoap2.o
+
+ BKSERVER_LIBS= \
+ ${SRVBONES_LIB} \
+ -lglite_lb_common_${nothrflavour} \
+ -lglite_security_gsoap_plugin_${nothrflavour} \
+ ${EXT_LIBS}
+ else
+ BKSERVER_OBJS:= \
+ ${BKSERVER_BASE_OBJS} \
+ ${GSOAP_FILES_PREFIX}C.o ${GSOAP_FILES_PREFIX}Server.o \
+ ws_query.o ws_fault.o ws_typeref.o
+
+ BKSERVER_LIBS= \
+ ${SRVBONES_LIB} \
+ -lglite_lb_common_${nothrflavour} \
+ -L${gsoap_prefix}/lib -lgsoap \
+ -lglite_security_gsoap_plugin_${nothrflavour} \
+ ${EXT_LIBS}
+ endif
else
BKSERVER_OBJS:= ${BKSERVER_BASE_OBJS}
chmod -w $@ >/dev/null
${GSOAP_FILES_PREFIX}H.h ${GSOAP_FILES_PREFIX}C.c ${GSOAP_FILES_PREFIX}Server.c ${GSOAP_FILES_PREFIX}Client.c ${GSOAP_FILES_PREFIX}ServerLib.c ${GSOAP_FILES_PREFIX}ClientLib.c LoggingAndBookkeeping.nsmap: LB.xh
- ${gsoap_prefix}/bin/soapcpp2 -w -c -p ${GSOAP_FILES_PREFIX} LB.xh
+ ${gsoap_bin_prefix}/soapcpp2 -w -c -p ${GSOAP_FILES_PREFIX} LB.xh
# try several times -- LB.wsdl downloads BaseFault.xsd from www.ibm.com which may be failing
# not used right now but may be useful one day
LB.xh: ws_typemap.dat ${stagedir}/interface/LB.wsdl
cp ${stagedir}/interface/LBTypes.wsdl .
- ${gsoap_prefix}/bin/wsdl2h -c -t ${top_srcdir}/src/ws_typemap.dat -o $@ ${stagedir}/interface/LB.wsdl
+ ${gsoap_bin_prefix}/wsdl2h -c -t ${top_srcdir}/src/ws_typemap.dat -o $@ ${stagedir}/interface/LB.wsdl
rm -f LBTypes.wsdl
test.xml: test_xml
${COMPILE} -o $@ -c $<
soap_version.h:
- ${gsoap_prefix}/bin/soapcpp2 /dev/null
+ ${gsoap_bin_prefix}/soapcpp2 /dev/null
perl -ne '$$. == 2 && /.*([0-9])\.([0-9])\.([0-9]).*/ && printf "#define GSOAP_VERSION %d%02d%02d\n",$$1,$$2,$$3' soapH.h >$@
-rm soapC.cpp soapH.h soapStub.h soapClient.cpp soapServer.cpp soapClientLib.cpp soapServerLib.cpp
Revision history:
$Log$
+ Revision 1.7 2005/08/03 09:30:28 akrenek
+ Merged the release 1.0 branch
+
Revision 1.6 2005/01/21 11:27:44 jpospi
completely remove gridsite.prefix and voms.prefix
mysql_version=${ext.mysql.version}
cppunit=${with.cppunit.prefix}
gsoap_prefix=${with.gsoap.prefix}
+gsoap_version=${ext.gsoap.version}
</echo>
</target>
</project>
#Thu May 19 13:16:56 CEST 2005
-module.version=1.2.4
+module.version=1.2.5
module.age=1
# System dependencies
###################################################################
-org.glite.version = HEAD
-org.glite.lb.version = HEAD
+
+
+ org.glite.version = glite_R_1_0_5
+ org.glite.lb.version = glite-lb_R_1_1_1
+
+ org.glite.lb.client-interface.version = glite-lb-client-interface_R_2_0_0
+
+ org.glite.lb.ws-interface.version = glite-lb-ws-interface_R_2_0_0
+
+ org.glite.lb.common.version = glite-lb-common_R_2_0_1
+
+ org.glite.lb.client.version = glite-lb-client_R_2_0_1
+
+ org.glite.lb.server-bones.version = glite-lb-server-bones_R_2_0_0
+
+ org.glite.lb.logger.version = glite-lb-logger_R_1_1_2
+
+ org.glite.lb.server.version = glite-lb-server_R_1_2_5
+
+ org.glite.lb.proxy.version = glite-lb-proxy_R_1_1_1
+
-# Component dependencies tag = do not remove this line =
-org.glite.lb.client-interface.version = HEAD
-org.glite.lb.ws-interface.version = HEAD
-org.glite.lb.common.version = HEAD
-org.glite.lb.client.version = HEAD
-org.glite.lb.server.version = HEAD
-org.glite.lb.proxy.version = HEAD
-org.glite.lb.server-bones.version = HEAD
-org.glite.lb.logger.version = HEAD
#Thu May 19 13:17:34 CEST 2005
-module.version=1.1.0
+module.version=1.1.1
module.age=1
nothrflavour=gcc32
thrflavour=gcc32pthr
gsoap_prefix=/opt/gsoap
+gsplugin_version_checking=yes
CC=gcc
-include ../Makefile.inc
GSPLUGIN_DEBUG?=no
-GSPLUGIN_VERSION_CHECKING?=yes
version_info=-version-info `echo ${version} | cut -d. -f1,2 | tr . :`
TEST_LIBS:=-L${cppunit}/lib -lcppunit
TEST_INC:=-I${cppunit}/include
-ifeq ($(GSPLUGIN_DEBUG),yes)
+ifeq ($(gsplugin_version_checking),yes)
DEBUG:=-g -O0 -Wall -DGSPLUGIN_DEBUG
else
DEBUG:=-g -O0 -Wall
EX_LIBS:= ${GLOBUS_LIBS} -L${ares_prefix}/lib -lares
+PATCHED_GSOAP_SRC:=stdsoap2_2.6.2.c
+
HDRS:=glite_gss.h glite_gsplugin.h
GSS_OBJS:=glite_gss.o
cd ${top_srcdir}/interface && ${INSTALL} -m 644 ${HDRS} ${PREFIX}/include/glite/security/
if [ x${DOSTAGE} = xyes ]; then \
install -m 644 ${GSS_STATICLIB} ${GSS_THRSTATICLIB} ${STATICLIB} ${THRSTATICLIB} ${PREFIX}/lib; \
+ install -m 644 ${top_srcdir}/src/${PATCHED_GSOAP_SRC} ${PREFIX}/lib; \
fi
clean:
Load version file
========================================= -->
<property file="${module.version.file}"/>
- <property file="${module.build.file}"/>
+ <property file="${module.build.file}"/>
<!-- ==============================================
Local private targets
-module.build=0
+#Thu Jun 02 03:37:13 CEST 2005
+module.build=21
nothrflavour=${with.globus.nothr.flavor}
cppunit=${with.cppunit.prefix}
gsoap_prefix=${with.gsoap.prefix}
+gsplugin_version_checking=${gsplugin.version.checking}
</echo>
</target>
</project>
-# 1.2 pushed after branching 1.1, no added functionality yet
-module.version=1.2.0
+module.version=1.1.1
module.age=0
fprintf(stderr, "Client connect will work only with gSOAP v2.7.0e and later");
return ENOSYS;
}
+#else
+# warning "gSOAP version checking is switched off!"
#endif
ctx = ((int_plugin_data_t *)soap_lookup_plugin(soap, plugin_id))->ctx;
--- /dev/null
+/*
+
+stdsoap2.c[pp] 2.6.2
+
+Runtime environment.
+
+gSOAP XML Web services tools
+Copyright (C) 2000-2004, Robert van Engelen, Genivia, Inc. All Rights Reserved.
+
+Contributors:
+
+Wind River Systems, Inc., for the following additions (marked WR[...]):
+ - vxWorks compatible
+ - Support for IPv6.
+
+--------------------------------------------------------------------------------
+gSOAP public license.
+
+The contents of this file are subject to the gSOAP Public License Version 1.3
+(the "License"); you may not use this file except in compliance with the
+License. You may obtain a copy of the License at
+http://www.cs.fsu.edu/~engelen/soaplicense.html
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the License.
+
+The Initial Developer of the Original Code is Robert A. van Engelen.
+Copyright (C) 2000-2004 Robert A. van Engelen, Genivia inc. All Rights Reserved.
+--------------------------------------------------------------------------------
+GPL license.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place, Suite 330, Boston, MA 02111-1307 USA
+
+Author contact information:
+engelen@genivia.com / engelen@acm.org
+--------------------------------------------------------------------------------
+
+Installation note:
+
+Win32 build needs winsock.dll (Visual C++ "wsock32.lib")
+To do this in Visual C++ 6.0, go to "Project", "settings", select the "Link"
+tab (the project file needs to be selected in the file view) and add
+"wsock32.lib" to the "Object/library modules" entry
+
+*/
+
+#include "stdsoap2.h"
+
+#ifdef __cplusplus
+SOAP_SOURCE_STAMP("@(#) stdsoap2.cpp ver 2.6.2 2004-06-12 12:00:00 GMT")
+extern "C" {
+#else
+SOAP_SOURCE_STAMP("@(#) stdsoap2.c ver 2.6.2 2004-06-12 12:00:00 GMT")
+#endif
+
+/* 8bit character representing unknown/nonrepresentable character data (not supported by current locale) */
+#ifndef SOAP_UNKNOWN_CHAR
+#define SOAP_UNKNOWN_CHAR (127)
+#endif
+
+/* EOF=-1 */
+#define LT (wchar)(-2) /* XML character '<' */
+#define TT (wchar)(-3) /* XML character '</' */
+#define GT (wchar)(-4) /* XML character '>' */
+#define QT (wchar)(-5) /* XML character '"' */
+#define AP (wchar)(-6) /* XML character ''' */
+
+#define soap_blank(c) ((c) >= 0 && (c) <= 32)
+#define soap_notblank(c) ((c) > 32)
+#define soap_hash_ptr(p) (((unsigned long)(p) >> 3) & (SOAP_PTRHASH - 1))
+
+static int soap_isxdigit(int);
+static wchar soap_char(struct soap*);
+static wchar soap_getchunkchar(struct soap*);
+static void soap_update_ptrs(struct soap*, char*, char*, long);
+static int soap_has_copies(struct soap*, char*, char*);
+static struct soap_ilist *soap_hlookup(struct soap*, const char*);
+static void soap_init_iht(struct soap*);
+static void soap_free_iht(struct soap*);
+static void soap_init_pht(struct soap*);
+static void soap_free_pht(struct soap*);
+static int soap_set_error(struct soap*, const char*, const char*, const char*, int);
+static int soap_copy_fault(struct soap*, const char*, const char*, const char*);
+static int soap_getattrval(struct soap*, char*, size_t, wchar);
+static void soap_set_local_namespaces(struct soap*);
+static size_t soap_begin_dime(struct soap*);
+static int soap_isnumeric(struct soap*, const char*);
+static void *fplugin(struct soap*, const char*);
+
+#ifndef WITH_LEAN
+static time_t soap_timegm(struct tm*);
+static void soap_init_logs(struct soap*);
+static void soap_close_logfile(struct soap*, int);
+static void soap_set_logfile(struct soap*, int, const char*);
+#endif
+
+#ifdef WITH_FAST
+/* Use look-aside buffers */
+static int soap_append_lab(struct soap*, const char*, size_t);
+#endif
+
+#ifndef WITH_LEANER
+static int soap_putdimefield(struct soap*, const char*, size_t);
+static char *soap_getdimefield(struct soap*, size_t);
+#endif
+
+#ifdef WITH_GZIP
+static int soap_getgzipheader(struct soap*);
+#endif
+
+#ifdef WITH_OPENSSL
+static int ssl_auth_init(struct soap*);
+static int ssl_verify_callback(int, X509_STORE_CTX*);
+static int ssl_password(char*, int, int, void *);
+/* This callback is included for future references. It should not be deleted
+static DH *ssl_tmp_dh(SSL*, int, int);
+*/
+#endif
+
+static const char *soap_strerror(struct soap*);
+static const char *tcp_error(struct soap*);
+static const char *http_error(struct soap*, int);
+static int http_post(struct soap*, const char*, const char*, int, const char*, const char*, size_t);
+static int http_get(struct soap*);
+static int http_post_header(struct soap*, const char*, const char*);
+static int http_response(struct soap*, int, size_t);
+static int http_parse(struct soap*);
+static int http_parse_header(struct soap*, const char*, const char*);
+static int tcp_connect(struct soap*, const char*, const char*, int);
+static int tcp_accept(struct soap*, int, struct sockaddr*, int*);
+static int tcp_disconnect(struct soap*);
+static int fsend(struct soap*, const char*, size_t);
+static size_t frecv(struct soap*, char*, size_t);
+
+/* WR[ */
+#ifdef VXWORKS
+static int vx_nonblocking = TRUE; /* ioctl argument */
+#endif
+/* ]WR */
+
+#ifndef PALM_2
+static const char soap_env1[42] = "http://schemas.xmlsoap.org/soap/envelope/";
+static const char soap_enc1[42] = "http://schemas.xmlsoap.org/soap/encoding/";
+static const char soap_env2[40] = "http://www.w3.org/2003/05/soap-envelope";
+static const char soap_enc2[40] = "http://www.w3.org/2003/05/soap-encoding";
+static const char soap_rpc[35] = "http://www.w3.org/2003/05/soap-rpc";
+#endif
+
+#ifndef PALM_1
+const struct soap_double_nan soap_double_nan = {0xFFFFFFFF, 0xFFFFFFFF};
+static const char soap_base64o[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+static const char soap_base64i[81] = "\76XXX\77\64\65\66\67\70\71\72\73\74\75XXXXXXX\00\01\02\03\04\05\06\07\10\11\12\13\14\15\16\17\20\21\22\23\24\25\26\27\30\31XXXXXX\32\33\34\35\36\37\40\41\42\43\44\45\46\47\50\51\52\53\54\55\56\57\60\61\62\63";
+#endif
+
+static const char soap_padding[3] = "\0\0";
+#define SOAP_STR_PADDING (soap_padding)
+#define SOAP_STR_EOS (soap_padding)
+
+#ifndef WITH_LEAN
+static const struct soap_code_map html_entity_codes[] = /* entities for XHTML parsing */
+{ { 160, "nbsp" },
+ { 161, "iexcl" },
+ { 162, "cent" },
+ { 163, "pound" },
+ { 164, "curren" },
+ { 165, "yen" },
+ { 166, "brvbar" },
+ { 167, "sect" },
+ { 168, "uml" },
+ { 169, "copy" },
+ { 170, "ordf" },
+ { 171, "laquo" },
+ { 172, "not" },
+ { 173, "shy" },
+ { 174, "reg" },
+ { 175, "macr" },
+ { 176, "deg" },
+ { 177, "plusmn" },
+ { 178, "sup2" },
+ { 179, "sup3" },
+ { 180, "acute" },
+ { 181, "micro" },
+ { 182, "para" },
+ { 183, "middot" },
+ { 184, "cedil" },
+ { 185, "sup1" },
+ { 186, "ordm" },
+ { 187, "raquo" },
+ { 188, "frac14" },
+ { 189, "frac12" },
+ { 190, "frac34" },
+ { 191, "iquest" },
+ { 192, "Agrave" },
+ { 193, "Aacute" },
+ { 194, "Acirc" },
+ { 195, "Atilde" },
+ { 196, "Auml" },
+ { 197, "Aring" },
+ { 198, "AElig" },
+ { 199, "Ccedil" },
+ { 200, "Egrave" },
+ { 201, "Eacute" },
+ { 202, "Ecirc" },
+ { 203, "Euml" },
+ { 204, "Igrave" },
+ { 205, "Iacute" },
+ { 206, "Icirc" },
+ { 207, "Iuml" },
+ { 208, "ETH" },
+ { 209, "Ntilde" },
+ { 210, "Ograve" },
+ { 211, "Oacute" },
+ { 212, "Ocirc" },
+ { 213, "Otilde" },
+ { 214, "Ouml" },
+ { 215, "times" },
+ { 216, "Oslash" },
+ { 217, "Ugrave" },
+ { 218, "Uacute" },
+ { 219, "Ucirc" },
+ { 220, "Uuml" },
+ { 221, "Yacute" },
+ { 222, "THORN" },
+ { 223, "szlig" },
+ { 224, "agrave" },
+ { 225, "aacute" },
+ { 226, "acirc" },
+ { 227, "atilde" },
+ { 228, "auml" },
+ { 229, "aring" },
+ { 230, "aelig" },
+ { 231, "ccedil" },
+ { 232, "egrave" },
+ { 233, "eacute" },
+ { 234, "ecirc" },
+ { 235, "euml" },
+ { 236, "igrave" },
+ { 237, "iacute" },
+ { 238, "icirc" },
+ { 239, "iuml" },
+ { 240, "eth" },
+ { 241, "ntilde" },
+ { 242, "ograve" },
+ { 243, "oacute" },
+ { 244, "ocirc" },
+ { 245, "otilde" },
+ { 246, "ouml" },
+ { 247, "divide" },
+ { 248, "oslash" },
+ { 249, "ugrave" },
+ { 250, "uacute" },
+ { 251, "ucirc" },
+ { 252, "uuml" },
+ { 253, "yacute" },
+ { 254, "thorn" },
+ { 255, "yuml" },
+ { 0, NULL }
+};
+#endif
+
+#ifndef WITH_LEAN
+static const struct soap_code_map h_error_codes[] =
+{
+#ifdef HOST_NOT_FOUND
+ { HOST_NOT_FOUND, "Host not found" },
+#endif
+#ifdef TRY_AGAIN
+ { TRY_AGAIN, "Try Again" },
+#endif
+#ifdef NO_RECOVERY
+ { NO_RECOVERY, "No Recovery" },
+#endif
+#ifdef NO_DATA
+ { NO_DATA, "No Data" },
+#endif
+#ifdef NO_ADDRESS
+ { NO_ADDRESS, "No Address" },
+#endif
+ { 0, NULL }
+};
+#endif
+
+#ifndef WITH_LEAN
+static const struct soap_code_map h_http_error_codes[] =
+{ { 201, "Created" },
+ { 202, "Accepted" },
+ { 203, "Non-Authoritative Information" },
+ { 204, "No Content" },
+ { 205, "Reset Content" },
+ { 206, "Partial Content" },
+ { 300, "Multiple Choices" },
+ { 301, "Moved Permanently" },
+ { 302, "Found" },
+ { 303, "See Other" },
+ { 304, "Not Modified" },
+ { 305, "Use Proxy" },
+ { 307, "Temporary Redirect" },
+ { 400, "Bad Request" },
+ { 401, "Unauthorized" },
+ { 402, "Payment Required" },
+ { 403, "Forbidden" },
+ { 404, "Not Found" },
+ { 405, "Method Not Allowed" },
+ { 406, "Not Acceptable" },
+ { 407, "Proxy Authentication Required" },
+ { 408, "Request Time-out" },
+ { 409, "Conflict" },
+ { 410, "Gone" },
+ { 411, "Length Required" },
+ { 412, "Precondition Failed" },
+ { 413, "Request Entity Too Large" },
+ { 414, "Request-URI Too Large" },
+ { 415, "Unsupported Media Type" },
+ { 416, "Requested range not satisfiable" },
+ { 417, "Expectation Failed" },
+ { 500, "Internal Server Error" },
+ { 501, "Not Implemented" },
+ { 502, "Bad Gateway" },
+ { 503, "Service Unavailable" },
+ { 504, "Gateway Time-out" },
+ { 505, "HTTP Version not supported" },
+ { 0, NULL }
+};
+#endif
+
+#ifdef WITH_OPENSSL
+static const struct soap_code_map h_ssl_error_codes[] =
+{
+#define _SSL_ERROR(e) { e, #e }
+ _SSL_ERROR(SSL_ERROR_SSL),
+ _SSL_ERROR(SSL_ERROR_ZERO_RETURN),
+ _SSL_ERROR(SSL_ERROR_WANT_READ),
+ _SSL_ERROR(SSL_ERROR_WANT_WRITE),
+ _SSL_ERROR(SSL_ERROR_WANT_CONNECT),
+ _SSL_ERROR(SSL_ERROR_WANT_X509_LOOKUP),
+ _SSL_ERROR(SSL_ERROR_SYSCALL),
+ { 0, NULL }
+};
+#endif
+
+#ifdef WIN32
+static int tcp_done = 0;
+#endif
+
+/******************************************************************************/
+#ifndef MAC_CARBON
+#ifndef PALM_1
+static int
+fsend(struct soap *soap, const char *s, size_t n)
+{ register int nwritten;
+#if defined(__cplusplus) && !defined(UNDER_CE)
+ if (soap->os)
+ { soap->os->write(s, n);
+ if (soap->os->good())
+ return SOAP_OK;
+ return SOAP_EOF;
+ }
+#endif
+ while (n)
+ { if (soap_valid_socket(soap->socket))
+ {
+#ifndef WITH_LEAN
+ if (soap->send_timeout)
+ { struct timeval timeout;
+ fd_set fd;
+ if (soap->send_timeout > 0)
+ { timeout.tv_sec = soap->send_timeout;
+ timeout.tv_usec = 0;
+ }
+ else
+ { timeout.tv_sec = -soap->send_timeout/1000000;
+ timeout.tv_usec = -soap->send_timeout%1000000;
+ }
+ FD_ZERO(&fd);
+ FD_SET((SOAP_SOCKET)soap->socket, &fd);
+ for (;;)
+ { register int r = select((SOAP_SOCKET)(soap->socket + 1), NULL, &fd, &fd, &timeout);
+ if (r > 0)
+ break;
+ if (!r)
+ { soap->errnum = 0;
+ return SOAP_EOF;
+ }
+ if (soap_socket_errno != SOAP_EINTR)
+ { soap->errnum = soap_socket_errno;
+ return SOAP_EOF;
+ }
+ }
+ }
+#endif
+#ifdef WITH_OPENSSL
+ if (soap->ssl)
+ nwritten = SSL_write(soap->ssl, s, n);
+ else
+#endif
+#ifndef PALM
+ nwritten = send((SOAP_SOCKET)soap->socket, s, n, soap->socket_flags);
+#else
+ nwritten = send((SOAP_SOCKET)soap->socket, (void*)s, n, soap->socket_flags);
+#endif
+ if (nwritten <= 0)
+ {
+#ifdef WITH_OPENSSL
+ int err;
+ if (soap->ssl && (err = SSL_get_error(soap->ssl, nwritten)) != SSL_ERROR_NONE && err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE)
+ return SOAP_EOF;
+#endif
+ if (soap_socket_errno != SOAP_EINTR && soap_socket_errno != SOAP_EWOULDBLOCK && soap_socket_errno != SOAP_EAGAIN)
+ { soap->errnum = soap_socket_errno;
+ return SOAP_EOF;
+ }
+ nwritten = 0; /* and call write() again */
+ }
+ }
+ else
+ {
+#ifdef WITH_FASTCGI
+ nwritten = fwrite((void*)s, 1, n, stdout);
+ fflush(stdout);
+#else
+#ifdef UNDER_CE
+ nwritten = fwrite(s, 1, n, soap->sendfd);
+#else
+/* WR[ */
+#ifdef VXWORKS
+#ifdef WMW_RPM_IO
+ if (soap->rpmreqid)
+ {
+ httpBlockPut(soap->rpmreqid, s, n);
+ nwritten = n;
+ }
+ else
+ {
+ nwritten = fwrite(s, sizeof(char), n, fdopen(soap->sendfd, "w"));
+ }
+#else
+ nwritten = fwrite(s, sizeof(char), n, fdopen(soap->sendfd, "w"));
+#endif /* WMW_RPM_IO */
+#else
+/* ]WR */
+ nwritten = write((SOAP_SOCKET)soap->sendfd, s, n);
+/* WR[ */
+#endif
+/* ]WR */
+#endif
+#endif
+ if (nwritten <= 0)
+ { if (soap_errno != SOAP_EINTR && soap_errno != SOAP_EWOULDBLOCK && soap_errno != SOAP_EAGAIN)
+ { soap->errnum = soap_errno;
+ return SOAP_EOF;
+ }
+ nwritten = 0; /* and call write() again */
+ }
+ }
+ n -= nwritten;
+ s += nwritten;
+ }
+ return SOAP_OK;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_flush_raw(struct soap *soap, const char *s, size_t n)
+{
+#ifndef WITH_LEAN
+ if ((soap->mode & SOAP_IO) == SOAP_IO_STORE)
+ { char *t;
+ if (!(t = (char*)soap_push_block(soap, n)))
+ return soap->error = SOAP_EOM;
+ memcpy(t, s, n);
+ return SOAP_OK;
+ }
+ if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
+ { char t[16];
+ sprintf(t, "\r\n%lX\r\n" + (soap->chunksize ? 0 : 2), (unsigned long)n);
+ DBGMSG(SENT, t, strlen(t));
+ if ((soap->error = soap->fsend(soap, t, strlen(t))))
+ return soap->error;
+ soap->chunksize += n;
+ }
+#endif
+ DBGMSG(SENT, s, n);
+ return soap->error = soap->fsend(soap, s, n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_flush(struct soap *soap)
+{ if (soap->bufidx)
+ {
+#ifdef WITH_ZLIB
+ if (soap->mode & SOAP_ENC_ZLIB)
+ { soap->d_stream.next_in = (Byte*)soap->buf;
+ soap->d_stream.avail_in = (unsigned int)soap->bufidx;
+#ifdef WITH_GZIP
+ soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)soap->bufidx);
+#endif
+ do
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflating %u bytes\n", soap->d_stream.avail_in));
+ if (deflate(&soap->d_stream, Z_NO_FLUSH) != Z_OK)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to deflate: %s\n", soap->d_stream.msg?soap->d_stream.msg:""));
+ return soap->error = SOAP_ZLIB_ERROR;
+ }
+ if (!soap->d_stream.avail_out)
+ { if (soap_flush_raw(soap, soap->z_buf, SOAP_BUFLEN))
+ return soap->error;
+ soap->d_stream.next_out = (Byte*)soap->z_buf;
+ soap->d_stream.avail_out = SOAP_BUFLEN;
+ }
+ } while (soap->d_stream.avail_in);
+ }
+ else
+#endif
+ if (soap_flush_raw(soap, soap->buf, soap->bufidx))
+ return soap->error;
+ soap->bufidx = 0;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_send_raw(struct soap *soap, const char *s, size_t n)
+{ if (!n)
+ return SOAP_OK;
+ if (soap->mode & SOAP_IO_LENGTH)
+ { soap->count += n;
+ if (soap->fprepare)
+ return soap->fprepare(soap, s, n);
+ return SOAP_OK;
+ }
+ if (soap->mode & SOAP_IO)
+ { register size_t i = SOAP_BUFLEN - soap->bufidx;
+ while (n >= i)
+ { memcpy(soap->buf + soap->bufidx, s, i);
+ soap->bufidx = SOAP_BUFLEN;
+ if (soap_flush(soap))
+ return soap->error;
+ s += i;
+ n -= i;
+ i = SOAP_BUFLEN;
+ }
+ memcpy(soap->buf + soap->bufidx, s, n);
+ soap->bufidx += n;
+ return SOAP_OK;
+ }
+ return soap_flush_raw(soap, s, n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_send(struct soap *soap, const char *s)
+{ if (s)
+ return soap_send_raw(soap, s, strlen(s));
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef MAC_CARBON
+#ifndef PALM_1
+static size_t
+frecv(struct soap *soap, char *s, size_t n)
+{ register int r;
+ soap->errnum = 0;
+#if defined(__cplusplus) && !defined(UNDER_CE)
+ if (soap->is)
+ { if (soap->is->good())
+ return soap->is->read(s, n).gcount();
+ return 0;
+ }
+#endif
+ if (soap_valid_socket(soap->socket))
+ { for (;;)
+ {
+#ifndef WITH_LEAN
+ struct timeval timeout;
+ fd_set fd;
+ if (soap->recv_timeout)
+ { if (soap->recv_timeout > 0)
+ { timeout.tv_sec = soap->recv_timeout;
+ timeout.tv_usec = 0;
+ }
+ else
+ { timeout.tv_sec = -soap->recv_timeout/1000000;
+ timeout.tv_usec = -soap->recv_timeout%1000000;
+ }
+ FD_ZERO(&fd);
+ FD_SET((SOAP_SOCKET)soap->socket, &fd);
+ for (;;)
+ { r = select((SOAP_SOCKET)(soap->socket + 1), &fd, NULL, &fd, &timeout);
+ if (r > 0)
+ break;
+ if (r == 0)
+ return 0;
+ if (soap_socket_errno != SOAP_EINTR)
+ { soap->errnum = soap_socket_errno;
+ return 0;
+ }
+ }
+ }
+#endif
+#ifdef WITH_OPENSSL
+ if (soap->ssl)
+ { int err;
+ r = SSL_read(soap->ssl, s, n);
+ if ((err = SSL_get_error(soap->ssl, r)) == SSL_ERROR_NONE)
+ return (size_t)r;
+ if (err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE)
+ return 0;
+ }
+ else
+#endif
+ { r = recv((SOAP_SOCKET)soap->socket, s, n, soap->socket_flags);
+ if (r >= 0)
+ return (size_t)r;
+ if (soap_socket_errno != SOAP_EINTR && soap_socket_errno != SOAP_EAGAIN)
+ { soap->errnum = soap_socket_errno;
+ return 0;
+ }
+ }
+#ifndef WITH_LEAN
+ { struct timeval timeout;
+ fd_set fd;
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 10000;
+ FD_ZERO(&fd);
+ FD_SET((SOAP_SOCKET)soap->socket, &fd);
+ r = select((SOAP_SOCKET)(soap->socket + 1), &fd, NULL, &fd, &timeout);
+ if (r < 0 && soap_socket_errno != SOAP_EINTR)
+ { soap->errnum = soap_socket_errno;
+ return 0;
+ }
+ }
+#endif
+ }
+ }
+#ifdef WITH_FASTCGI
+ return fread(s, 1, n, stdin);
+#else
+#ifdef UNDER_CE
+ return fread(s, 1, n, soap->recvfd);
+#else
+/* WR[ */
+#ifdef WMW_RPM_IO
+ if (soap->rpmreqid)
+ {
+ r = httpBlockRead(soap->rpmreqid, s, n);
+ }
+ else
+ {
+ r = read(soap->recvfd, s, n);
+ }
+ if (r >= 0)
+ {
+ return r;
+ }
+ return 0;
+#else
+/* ]WR */
+ r = read((SOAP_SOCKET)soap->recvfd, s, n);
+ if (r >= 0)
+ return (size_t)r;
+ soap->errnum = soap_errno;
+ return 0;
+/* WR[ */
+#endif
+/* ]WR */
+#endif
+#endif
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static wchar
+soap_getchunkchar(struct soap *soap)
+{ if (soap->bufidx < soap->buflen)
+ return soap->buf[soap->bufidx++];
+ soap->bufidx = 0;
+ soap->buflen = soap->chunkbuflen = soap->frecv(soap, soap->buf, SOAP_BUFLEN);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes\n", (unsigned int)soap->buflen));
+ DBGMSG(RECV, soap->buf, soap->buflen);
+ if (soap->buflen)
+ return soap->buf[soap->bufidx++];
+ return EOF;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+soap_isxdigit(int c)
+{ switch (c)
+ { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
+ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+ return 1;
+ }
+ return 0;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_recv_raw(struct soap *soap)
+{ register size_t ret;
+#ifdef WITH_ZLIB
+ if (soap->mode & SOAP_ENC_ZLIB)
+ { if (soap->d_stream.next_out == Z_NULL)
+ return EOF;
+ if (soap->d_stream.avail_in || !soap->d_stream.avail_out)
+ { register int r;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflating\n"));
+ soap->d_stream.next_out = (Byte*)soap->buf;
+ soap->d_stream.avail_out = SOAP_BUFLEN;
+ r = inflate(&soap->d_stream, Z_NO_FLUSH);
+ if (r == Z_OK || r == Z_STREAM_END)
+ { soap->bufidx = 0;
+ soap->buflen = SOAP_BUFLEN - soap->d_stream.avail_out;
+ if (soap->zlib_in == SOAP_ZLIB_GZIP)
+ soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)soap->buflen);
+ if (r == Z_STREAM_END)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated %lu->%lu bytes\n", soap->d_stream.total_in, soap->d_stream.total_out));
+ soap->z_ratio_in = (float)soap->d_stream.total_in / (float)soap->d_stream.total_out;
+ soap->d_stream.next_out = Z_NULL;
+ }
+ if (soap->buflen)
+ { soap->count += soap->buflen;
+ return SOAP_OK;
+ }
+ }
+ else if (r != Z_BUF_ERROR)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate error: %s\n", soap->d_stream.msg?soap->d_stream.msg:""));
+ soap->d_stream.next_out = Z_NULL;
+ return EOF;
+ }
+ }
+zlib_again:
+ if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK && !soap->chunksize)
+ { memcpy(soap->buf, soap->z_buf, SOAP_BUFLEN);
+ soap->buflen = soap->z_buflen;
+ }
+ }
+#endif
+ if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) /* read HTTP chunked transfer */
+ {
+chunk_again:
+ if (soap->chunksize)
+ { soap->buflen = ret = soap->frecv(soap, soap->buf, soap->chunksize > SOAP_BUFLEN ? SOAP_BUFLEN : soap->chunksize);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Getting chunk: read %u bytes\n", (unsigned int)ret));
+ DBGMSG(RECV, soap->buf, ret);
+ soap->bufidx = 0;
+ soap->chunksize -= ret;
+ }
+ else
+ { register wchar c;
+ char tmp[8], *t;
+ t = tmp;
+ if (!soap->chunkbuflen)
+ { soap->chunkbuflen = ret = soap->frecv(soap, soap->buf, SOAP_BUFLEN);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes\n", (unsigned int)ret));
+ DBGMSG(RECV, soap->buf, ret);
+ soap->bufidx = 0;
+ if (!ret)
+ return EOF;
+ }
+ else
+ soap->bufidx = soap->buflen;
+ soap->buflen = soap->chunkbuflen;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Getting chunk size (%u %u)\n", (unsigned int)soap->bufidx, (unsigned int)soap->buflen));
+ while (!soap_isxdigit((int)(c = soap_getchunkchar(soap))))
+ if ((int)c == EOF)
+ return EOF;
+ do
+ *t++ = (char)c;
+ while (soap_isxdigit((int)(c = soap_getchunkchar(soap))) && t - tmp < 7);
+ while ((int)c != EOF && c != '\n')
+ c = soap_getchunkchar(soap);
+ if ((int)c == EOF)
+ return EOF;
+ *t = '\0';
+ soap->chunksize = soap_strtoul(tmp, &t, 16);
+ if (!soap->chunksize)
+ { soap->chunkbuflen = 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of chunked message\n"));
+ while ((int)c != EOF && c != '\n')
+ c = soap_getchunkchar(soap);
+ return EOF;
+ }
+ soap->buflen = soap->bufidx + soap->chunksize;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Moving buf len to %u (%u %s)\n", (unsigned int)soap->buflen, (unsigned int)soap->bufidx, tmp));
+ if (soap->buflen > soap->chunkbuflen)
+ { soap->buflen = soap->chunkbuflen;
+ soap->chunksize -= soap->buflen - soap->bufidx;
+ soap->chunkbuflen = 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Passed end of buffer for chunked HTTP (%lu bytes left)\n", (unsigned long)(soap->buflen - soap->bufidx)));
+ }
+ else if (soap->chunkbuflen)
+ soap->chunksize = 0;
+ ret = soap->buflen - soap->bufidx;
+ if (!ret)
+ goto chunk_again;
+ }
+ }
+ else
+ { soap->bufidx = 0;
+ soap->buflen = ret = soap->frecv(soap, soap->buf, SOAP_BUFLEN);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Read %u bytes\n", (unsigned int)ret));
+ DBGMSG(RECV, soap->buf, ret);
+ }
+#ifdef WITH_ZLIB
+ if (soap->mode & SOAP_ENC_ZLIB)
+ { int r;
+ memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);
+ soap->d_stream.next_in = (Byte*)(soap->z_buf + soap->bufidx);
+ soap->d_stream.avail_in = (unsigned int)ret;
+ soap->d_stream.next_out = (Byte*)soap->buf;
+ soap->d_stream.avail_out = SOAP_BUFLEN;
+ r = inflate(&soap->d_stream, Z_NO_FLUSH);
+ if (r == Z_OK || r == Z_STREAM_END)
+ { soap->bufidx = 0;
+ soap->z_buflen = soap->buflen;
+ soap->buflen = ret = SOAP_BUFLEN - soap->d_stream.avail_out;
+ if (soap->zlib_in == SOAP_ZLIB_GZIP)
+ soap->z_crc = crc32(soap->z_crc, (Byte*)soap->buf, (unsigned int)soap->buflen);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated %u bytes\n", (unsigned int)ret));
+ if (!ret)
+ goto zlib_again;
+ if (r == Z_STREAM_END)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflated %lu->%lu bytes\n", soap->d_stream.total_in, soap->d_stream.total_out));
+ soap->z_ratio_in = (float)soap->d_stream.total_in / (float)soap->d_stream.total_out;
+ soap->d_stream.next_out = Z_NULL;
+ }
+ }
+ else
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to inflate: (%d) %s\n", r, soap->d_stream.msg?soap->d_stream.msg:""));
+ soap->d_stream.next_out = Z_NULL;
+ return EOF;
+ }
+ }
+#endif
+ soap->count += ret;
+ return !ret;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_recv(struct soap *soap)
+{
+#ifndef WITH_LEANER
+ if (soap->mode & SOAP_ENC_DIME)
+ { if (soap->dime_buflen)
+ { char *s;
+ int i;
+ unsigned char tmp[12];
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME hdr for chunked DIME is in buffer\n"));
+ soap->count += soap->dime_buflen - soap->buflen;
+ soap->buflen = soap->dime_buflen;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Skip padding (%ld bytes)\n", -(long)soap->dime_size&3));
+ for (i = -(long)soap->dime_size&3; i > 0; i--)
+ { soap->bufidx++;
+ if (soap->bufidx >= soap->buflen)
+ if (soap_recv_raw(soap))
+ return EOF;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME hdr for next chunk\n"));
+ s = (char*)tmp;
+ for (i = 12; i > 0; i--)
+ { *s++ = soap->buf[soap->bufidx++];
+ if (soap->bufidx >= soap->buflen)
+ if (soap_recv_raw(soap))
+ return EOF;
+ }
+ soap->dime_flags = tmp[0] & 0x7;
+ soap->dime_size = ((size_t)tmp[8] << 24) | ((size_t)tmp[9] << 16) | ((size_t)tmp[10] << 8) | ((size_t)tmp[11]);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME chunk (%u bytes)\n", (unsigned int)soap->dime_size));
+ if (soap->dime_flags & SOAP_DIME_CF)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "More chunking\n"));
+ soap->dime_chunksize = soap->dime_size;
+ if (soap->buflen - soap->bufidx >= soap->dime_size)
+ { soap->dime_buflen = soap->buflen;
+ soap->buflen = soap->bufidx + soap->dime_chunksize;
+ }
+ else
+ soap->dime_chunksize -= soap->buflen - soap->bufidx;
+ }
+ else
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Last chunk\n"));
+ soap->dime_buflen = 0;
+ soap->dime_chunksize = 0;
+ }
+ soap->count = soap->buflen - soap->bufidx;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%u bytes remaining\n", (unsigned int)soap->count));
+ return SOAP_OK;
+ }
+ if (soap->dime_chunksize)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get next DIME hdr for chunked DIME (%u bytes chunk)\n", (unsigned int)soap->dime_chunksize));
+ if (soap_recv_raw(soap))
+ return EOF;
+ if (soap->buflen - soap->bufidx >= soap->dime_chunksize)
+ { soap->dime_buflen = soap->buflen;
+ soap->count -= soap->buflen - soap->bufidx - soap->dime_chunksize;
+ soap->buflen = soap->bufidx + soap->dime_chunksize;
+ }
+ else
+ soap->dime_chunksize -= soap->buflen - soap->bufidx;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "%lu bytes remaining, count=%u\n", (unsigned long)(soap->buflen-soap->bufidx), (unsigned int)soap->count));
+ return SOAP_OK;
+ }
+ }
+#endif
+ return soap_recv_raw(soap);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+wchar
+SOAP_FMAC2
+soap_getchar(struct soap *soap)
+{ register wchar c;
+ if (soap->ahead)
+ { c = soap->ahead;
+ soap->ahead = 0;
+ return c;
+ }
+ return soap_get1(soap);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+const struct soap_code_map*
+SOAP_FMAC2
+soap_code(const struct soap_code_map *map, const char *str)
+{ while (map->string)
+ { if (!strcmp(str, map->string))
+ return map;
+ map++;
+ }
+ return NULL;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+long
+SOAP_FMAC2
+soap_int_code(const struct soap_code_map *map, const char *str, long other)
+{ while (map->string)
+ { if (!strcmp(str, map->string))
+ return map->code;
+ map++;
+ }
+ return other;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_str_code(const struct soap_code_map *map, long code)
+{ while (map->code != code && map->string)
+ map++;
+ return map->string;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static wchar
+soap_char(struct soap *soap)
+{ char tmp[8];
+ register int i;
+ register wchar c;
+ register char *s = tmp;
+ for (i = 0; i < 7; i++)
+ { c = soap_get1(soap);
+ if (c == ';' || (int)c == EOF)
+ break;
+ *s++ = (char)c;
+ }
+ *s = '\0';
+ if (*tmp == '#')
+ { if (tmp[1] == 'x' || tmp[1] == 'X')
+ return soap_strtol(tmp + 2, NULL, 16);
+ return atol(tmp + 1);
+ }
+ if (!strcmp(tmp, "lt"))
+ return '<';
+ if (!strcmp(tmp, "gt"))
+ return '>';
+ if (!strcmp(tmp, "amp"))
+ return '&';
+ if (!strcmp(tmp, "quot"))
+ return '"';
+ if (!strcmp(tmp, "apos"))
+ return '\'';
+#ifndef WITH_LEAN
+ return (wchar)soap_int_code(html_entity_codes, tmp, 127);
+#else
+ return SOAP_UNKNOWN_CHAR; /* use this to represent unknown code */
+#endif
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+wchar
+SOAP_FMAC2
+soap_get(struct soap *soap)
+{ register wchar c;
+ c = soap->ahead;
+ if (c)
+ soap->ahead = 0;
+ else
+ c = soap_get1(soap);
+ for (;;)
+ { if (soap->cdata)
+ { if (c == ']')
+ { c = soap_get1(soap);
+ if (c == ']')
+ { soap->cdata = 0;
+ soap_get1(soap); /* skip > */
+ c = soap_get1(soap);
+ }
+ else
+ { soap_revget1(soap);
+ return ']';
+ }
+ }
+ else
+ return c;
+ }
+ switch (c)
+ { case '<':
+ do c = soap_get1(soap);
+ while (soap_blank(c));
+ if (c == '!' || c == '?' || c == '%')
+ { if (c == '!')
+ { c = soap_get1(soap);
+ if (c == '[')
+ { do c = soap_get1(soap);
+ while ((int)c != EOF && c != '[');
+ if ((int)c == EOF)
+ break;
+ soap->cdata = 1;
+ c = soap_get1(soap);
+ continue;
+ }
+ if (c == '-' && (c = soap_get1(soap)) == '-')
+ { do
+ { c = soap_get1(soap);
+ if (c == '-' && (c = soap_get1(soap)) == '-')
+ break;
+ } while ((int)c != EOF);
+ }
+ }
+ while ((int)c != EOF && c != '>')
+ c = soap_get1(soap);
+ if ((int)c == EOF)
+ break;
+ c = soap_get1(soap);
+ continue;
+ }
+ if (c == '/')
+ return TT;
+ soap_revget1(soap);
+ return LT;
+ case '>':
+ return GT;
+ case '"':
+ return QT;
+ case '\'':
+ return AP;
+ case '&':
+ return soap_char(soap) | 0x80000000;
+ }
+ break;
+ }
+ return c;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+wchar
+SOAP_FMAC2
+soap_advance(struct soap *soap)
+{ register wchar c;
+ while ((int)((c = soap_get(soap)) != EOF) && c != LT && c != TT)
+ ;
+ return c;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+wchar
+SOAP_FMAC2
+soap_skip(struct soap *soap)
+{ register wchar c;
+ do c = soap_get(soap);
+ while (soap_blank(c));
+ return c;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEANER
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_move(struct soap *soap, long n)
+{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Moving %ld bytes forward\n", (long)n));
+ for (; n > 0; n--)
+ if ((int)soap_getchar(soap) == EOF)
+ return SOAP_EOF;
+ return SOAP_OK;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEANER
+#ifndef PALM_1
+SOAP_FMAC1
+size_t
+SOAP_FMAC2
+soap_tell(struct soap *soap)
+{ return soap->count - soap->buflen + soap->bufidx - (soap->ahead != 0);
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_pututf8(struct soap *soap, register unsigned long c)
+{ char tmp[16];
+ if (c > 0 && c < 0x80)
+ { *tmp = (char)c;
+ return soap_send_raw(soap, tmp, 1);
+ }
+#ifndef WITH_LEAN
+ if (soap->mode & SOAP_XML_CANONICAL)
+ { register char *t = tmp;
+ if (c < 0x0800)
+ *t++ = (char)(0xC0 | ((c >> 6) & 0x1F));
+ else
+ { if (c < 0x010000)
+ *t++ = (char)(0xE0 | ((c >> 12) & 0x0F));
+ else
+ { if (c < 0x200000)
+ *t++ = (char)(0xF0 | ((c >> 18) & 0x07));
+ else
+ { if (c < 0x04000000)
+ *t++ = (char)(0xF8 | ((c >> 24) & 0x03));
+ else
+ { *t++ = (char)(0xFC | ((c >> 30) & 0x01));
+ *t++ = (char)(0x80 | ((c >> 24) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 18) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 12) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 6) & 0x3F));
+ }
+ *t++ = (char)(0x80 | (c & 0x3F));
+ *t = '\0';
+ }
+ else
+#endif
+ sprintf(tmp, "&#%lu;", c);
+ return soap_send(soap, tmp);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+wchar
+SOAP_FMAC2
+soap_getutf8(struct soap *soap)
+{ register wchar c, c1, c2, c3, c4;
+ c = soap_get(soap);
+ if (c < 0x80)
+ return c;
+ c1 = soap_get(soap);
+ if (c1 < 0x80)
+ { soap_unget(soap, c1);
+ return c;
+ }
+ c1 &= 0x3F;
+ if (c < 0xE0)
+ return ((wchar)(c & 0x1F) << 6) | c1;
+ c2 = (wchar)soap_get1(soap) & 0x3F;
+ if (c < 0xF0)
+ return ((wchar)(c & 0x0F) << 12) | (c1 << 6) | c2;
+ c3 = (wchar)soap_get1(soap) & 0x3F;
+ if (c < 0xF8)
+ return ((wchar)(c & 0x07) << 18) | (c1 << 12) | (c2 << 6) | c3;
+ c4 = (wchar)soap_get1(soap) & 0x3F;
+ if (c < 0xFC)
+ return ((wchar)(c & 0x03) << 24) | (c1 << 18) | (c2 << 12) | (c3 << 6) | c4;
+ return ((wchar)(c & 0x01) << 30) | (c1 << 24) | (c2 << 18) | (c3 << 12) | (c4 << 6) | (wchar)(soap_get1(soap) & 0x3F);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_puthex(struct soap *soap, const unsigned char *s, int n)
+{ /* TODO: serialize to DOM (as an option) using new soap_s2hex() */
+ char d[2];
+ register int i;
+ for (i = 0; i < n; i++)
+ { register int m = *s++;
+ d[0] = (char)((m >> 4) + (m > 159 ? '7' : '0'));
+ m &= 0x0F;
+ d[1] = (char)(m + (m > 9 ? '7' : '0'));
+ if (soap_send_raw(soap, d, 2))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+unsigned char*
+SOAP_FMAC2
+soap_gethex(struct soap *soap, int *n)
+{
+#ifdef WITH_FAST
+ soap->labidx = 0;
+ for (;;)
+ { register char *s;
+ register int i, k;
+ if (soap_append_lab(soap, NULL, 0))
+ return NULL;
+ s = soap->labbuf + soap->labidx;
+ k = soap->lablen - soap->labidx;
+ soap->labidx = soap->lablen;
+ for (i = 0; i < k; i++)
+ { register char d1, d2;
+ register wchar c;
+ c = soap_get(soap);
+ if (soap_isxdigit(c))
+ { d1 = (char)c;
+ c = soap_get(soap);
+ if (soap_isxdigit(c))
+ d2 = (char)c;
+ else
+ { soap->error = SOAP_TYPE;
+ return NULL;
+ }
+ }
+ else
+ { unsigned char *p;
+ soap_unget(soap, c);
+ if (n)
+ *n = (int)(soap->lablen - k + i);
+ p = (unsigned char*)soap_malloc(soap, soap->lablen - k + i);
+ if (p)
+ memcpy(p, soap->labbuf, soap->lablen - k + i);
+ return p;
+ }
+ *s++ = ((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0');
+ }
+ }
+#else
+ if (soap_new_block(soap))
+ return NULL;
+ for (;;)
+ { register int i;
+ register char *s = (char*)soap_push_block(soap, SOAP_BLKLEN);
+ if (!s)
+ { soap_end_block(soap);
+ return NULL;
+ }
+ for (i = 0; i < SOAP_BLKLEN; i++)
+ { register char d1, d2;
+ register wchar c = soap_get(soap);
+ if (soap_isxdigit(c))
+ { d1 = (char)c;
+ c = soap_get(soap);
+ if (soap_isxdigit(c))
+ d2 = (char)c;
+ else
+ { soap_end_block(soap);
+ soap->error = SOAP_TYPE;
+ return NULL;
+ }
+ }
+ else
+ { unsigned char *p;
+ soap_unget(soap, c);
+ if (n)
+ *n = soap_size_block(soap, i);
+ p = (unsigned char*)soap_save_block(soap, NULL);
+ return p;
+ }
+ *s++ = ((d1 >= 'A' ? (d1 & 0x7) + 9 : d1 - '0') << 4) + (d2 >= 'A' ? (d2 & 0x7) + 9 : d2 - '0');
+ }
+ }
+#endif
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_putbase64(struct soap *soap, const unsigned char *s, int n)
+{ register int i;
+ register unsigned long m;
+ char d[4];
+#ifdef WITH_DOM
+ if ((soap->mode & SOAP_XML_DOM) && soap->dom)
+ { soap->dom->data = (char*)soap_malloc(soap, (n + 2) / 3 * 4 + 1);
+ return soap_s2base64(soap, s, soap->dom->data, n);
+ }
+#endif
+ if (!s)
+ return SOAP_OK;
+ for (; n > 2; n -= 3, s += 3)
+ { m = ((unsigned long)((unsigned char*)s)[0] << 16) | ((unsigned long)((unsigned char*)s)[1] << 8) | (unsigned long)((unsigned char*)s)[2];
+ for (i = 4; i > 0; m >>= 6)
+ d[--i] = soap_base64o[m & 0x3F];
+ if (soap_send_raw(soap, d, 4))
+ return soap->error;
+ }
+ if (n > 0)
+ { m = 0;
+ for (i = 0; i < n; i++)
+ m = (m << 8) | *s++;
+ for (; i < 3; i++)
+ m <<= 8;
+ for (i++; i > 0; m >>= 6)
+ d[--i] = soap_base64o[m & 0x3F];
+ for (i = 3; i > n; i--)
+ d[i] = '=';
+ if (soap_send_raw(soap, d, 4))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+unsigned char*
+SOAP_FMAC2
+soap_getbase64(struct soap *soap, int *n, int malloc_flag)
+{
+#ifdef WITH_FAST
+ soap->labidx = 0;
+ for (;;)
+ { register int i, k;
+ register char *s;
+ if (soap_append_lab(soap, NULL, 2))
+ return NULL;
+ s = soap->labbuf + soap->labidx;
+ k = 3 * ((soap->lablen - soap->labidx) / 3);
+ soap->labidx = 3 * (soap->lablen / 3);
+ if (!s)
+ return NULL;
+ for (i = 0; i < k; i += 3)
+ { register unsigned long m = 0;
+ register int j = 0;
+ do
+ { register wchar c = soap_get(soap);
+ if (c == '=' || c < 0)
+ { unsigned char *p;
+ switch (j)
+ { case 2:
+ *s++ = (char)((m >> 4) & 0xFF);
+ i++;
+ break;
+ case 3:
+ *s++ = (char)((m >> 10) & 0xFF);
+ *s++ = (char)((m >> 2) & 0xFF);
+ i += 2;
+ }
+ if (n)
+ *n = (int)(soap->lablen - k + i);
+ p = (unsigned char*)soap_malloc(soap, soap->lablen - k + i);
+ if (p)
+ memcpy(p, soap->labbuf, soap->lablen - k + i);
+ if (c >= 0)
+ { while ((int)((c = soap_get(soap)) != EOF) && c != LT && c != TT)
+ ;
+ }
+ soap_unget(soap, c);
+ return p;
+ }
+ c -= '+';
+ if (c >= 0 && c <= 79)
+ { m = (m << 6) + soap_base64i[c];
+ j++;
+ }
+ } while (j < 4);
+ *s++ = (char)((m >> 16) & 0xFF);
+ *s++ = (char)((m >> 8) & 0xFF);
+ *s++ = (char)(m & 0xFF);
+ }
+ }
+#else
+ if (soap_new_block(soap))
+ return NULL;
+ for (;;)
+ { register int i;
+ register char *s = (char*)soap_push_block(soap, 3 * SOAP_BLKLEN); /* must be multiple of 3 */
+ if (!s)
+ { soap_end_block(soap);
+ return NULL;
+ }
+ for (i = 0; i < SOAP_BLKLEN; i++)
+ { register unsigned long m = 0;
+ register int j = 0;
+ do
+ { register wchar c = soap_get(soap);
+ if (c == '=' || c < 0)
+ { unsigned char *p;
+ i *= 3;
+ switch (j)
+ { case 2:
+ *s++ = (char)((m >> 4) & 0xFF);
+ i++;
+ break;
+ case 3:
+ *s++ = (char)((m >> 10) & 0xFF);
+ *s++ = (char)((m >> 2) & 0xFF);
+ i += 2;
+ }
+ if (n)
+ *n = (int)soap_size_block(soap, i);
+ p = (unsigned char*)soap_save_block(soap, NULL);
+ if (c >= 0)
+ { while ((int)((c = soap_get(soap)) != EOF) && c != LT && c != TT)
+ ;
+ }
+ soap_unget(soap, c);
+ return p;
+ }
+ c -= '+';
+ if (c >= 0 && c <= 79)
+ { m = (m << 6) + soap_base64i[c];
+ j++;
+ }
+ } while (j < 4);
+ *s++ = (char)((m >> 16) & 0xFF);
+ *s++ = (char)((m >> 8) & 0xFF);
+ *s++ = (char)(m & 0xFF);
+ }
+ }
+#endif
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+char *
+SOAP_FMAC2
+soap_strdup(struct soap *soap, const char *s)
+{ char *t = NULL;
+ if (s && (t = (char*)soap_malloc(soap, strlen(s) + 1)))
+ strcpy(t, s);
+ return t;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_new_block(struct soap *soap)
+{ struct soap_blist *p;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "New block sequence (prev=%p)\n", soap->blist));
+ if (!(p = (struct soap_blist*)SOAP_MALLOC(sizeof(struct soap_blist))))
+ return SOAP_EOM;
+ p->next = soap->blist;
+ p->ptr = NULL;
+ p->size = 0;
+ soap->blist = p;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void*
+SOAP_FMAC2
+soap_push_block(struct soap *soap, size_t n)
+{ char *p;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push block of %u bytes (%u bytes total)\n", (unsigned int)n, (unsigned int)soap->blist->size));
+ if (!(p = (char*)SOAP_MALLOC(n + sizeof(char*) + sizeof(size_t))))
+ { soap->error = SOAP_EOM;
+ return NULL;
+ }
+ *(char**)p = soap->blist->ptr;
+ *(size_t*)(p + sizeof(char*)) = n;
+ soap->blist->ptr = p;
+ soap->blist->size += n;
+ return p + sizeof(char*) + sizeof(size_t);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_pop_block(struct soap *soap)
+{ char *p;
+ if (!soap->blist->ptr)
+ return;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Pop block\n"));
+ p = soap->blist->ptr;
+ soap->blist->size -= *(size_t*)(p + sizeof(char*));
+ soap->blist->ptr = *(char**)p;
+ SOAP_FREE(p);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static void
+soap_update_ptrs(struct soap *soap, char *start, char *end, long offset)
+{ int i;
+ register struct soap_ilist *ip;
+ register void *p, **q;
+ for (i = 0; i < SOAP_IDHASH; i++)
+ for (ip = soap->iht[i]; ip; ip = ip->next)
+ { if (ip->ptr && (char*)ip->ptr >= start && (char*)ip->ptr < end)
+ ip->ptr = (char*)ip->ptr + offset;
+ for (q = &ip->link; q; q = (void**)p)
+ { p = *q;
+ if (p && (char*)p >= start && (char*)p < end)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Link update id='%s' %p\n", ip->id, p));
+ *q = (char*)p + offset;
+ }
+ }
+ for (q = &ip->copy; q; q = (void**)p)
+ { p = *q;
+ if (p && (char*)p >= start && (char*)p < end)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy update id='%s' %p\n", ip->id, p));
+ *q = (char*)p + offset;
+ }
+ }
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+soap_has_copies(struct soap *soap, register char *start, register char *end)
+{ int i;
+ register struct soap_ilist *ip;
+ register char *p;
+ for (i = 0; i < SOAP_IDHASH; i++)
+ for (ip = soap->iht[i]; ip; ip = ip->next)
+ for (p = (char*)ip->copy; p; p = *(char**)p)
+ if (p >= start && p < end)
+ return SOAP_ERR;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_resolve(struct soap *soap)
+{ register int i;
+ register struct soap_ilist *ip;
+ short flag1 = 0, flag2;
+ for (i = 0; i < SOAP_IDHASH; i++)
+ for (ip = soap->iht[i]; ip; ip = ip->next)
+ { if (ip->ptr)
+ soap_resolve_ptr(ip);
+ else if (*ip->id == '#')
+ flag1 = 1;
+ }
+ do
+ { flag2 = 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving forwarded data\n"));
+ for (i = 0; i < SOAP_IDHASH; i++)
+ for (ip = soap->iht[i]; ip; ip = ip->next)
+ if (ip->copy && ip->ptr && ip->size)
+ if (!soap_has_copies(soap, (char*)ip->ptr, (char*)ip->ptr + ip->size))
+ { register void *p, **q = (void**)ip->copy;
+ DBGLOG(TEST, if (q) SOAP_MESSAGE(fdebug, "Traversing copy chain to resolve id='%s'\n", ip->id));
+ ip->copy = NULL;
+ do
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... copy %p -> %p (%u bytes)\n", ip->ptr, q, (unsigned int)ip->size));
+ p = *q;
+ memcpy(q, ip->ptr, ip->size);
+ q = (void**)p;
+ } while (q);
+ flag2 = 1;
+ }
+ } while (flag2);
+ for (i = 0; i < SOAP_IDHASH; i++)
+ for (ip = soap->iht[i]; ip; ip = ip->next)
+ { register struct soap_flist *fp;
+ for (fp = ip->flist; fp; fp = fp->next)
+ if (fp->finsert)
+ { unsigned int k = fp->level;
+ void *p = ip->ptr;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving forwarded container data type=%d location=%p level=%u,%u\n", fp->type, fp->ptr, ip->level, fp->level));
+ while (ip->level < k)
+ { void **q = (void**)soap_malloc(soap, sizeof(void*));
+ if (!q)
+ return SOAP_EOM;
+ *q = p;
+ p = (void*)q;
+ k--;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Descending one level...\n"));
+ }
+ fp->finsert(soap, fp->type, fp->ptr, p);
+ }
+ }
+ if (flag1)
+ return soap->error = SOAP_MISSING_ID;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_resolve_ptr(struct soap_ilist *ip)
+{ register void *p, **q, *r;
+ q = (void**)ip->link;
+ ip->link = NULL;
+ r = ip->ptr;
+ while (q)
+ { p = *q;
+ *q = r;
+ q = (void**)p;
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+size_t
+SOAP_FMAC2
+soap_size_block(struct soap *soap, size_t n)
+{ if (soap->blist->ptr)
+ { soap->blist->size -= *(size_t*)(soap->blist->ptr + sizeof(char*)) - n;
+ *(size_t*)(soap->blist->ptr + sizeof(char*)) = n;
+ }
+ return soap->blist->size;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+char*
+SOAP_FMAC2
+soap_first_block(struct soap *soap)
+{ char *p, *q, *r;
+ p = soap->blist->ptr;
+ if (!p)
+ return NULL;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "First block\n"));
+ r = NULL;
+ do
+ { q = *(char**)p;
+ *(char**)p = r;
+ r = p;
+ p = q;
+ } while (p);
+ soap->blist->ptr = r;
+ return r + sizeof(char*) + sizeof(size_t);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+char*
+SOAP_FMAC2
+soap_next_block(struct soap *soap)
+{ char *p;
+ p = soap->blist->ptr;
+ if (p)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Next block\n"));
+ soap->blist->ptr = *(char**)p;
+ SOAP_FREE(p);
+ if (soap->blist->ptr)
+ return soap->blist->ptr + sizeof(char*) + sizeof(size_t);
+ }
+ return NULL;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+size_t
+SOAP_FMAC2
+soap_block_size(struct soap *soap)
+{ return *(size_t*)(soap->blist->ptr + sizeof(char*));
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_end_block(struct soap *soap)
+{ struct soap_blist *bp;
+ char *p, *q;
+ bp = soap->blist;
+ if (bp)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of block sequence, free all remaining blocks\n"));
+ for (p = bp->ptr; p; p = q)
+ { q = *(char**)p;
+ SOAP_FREE(p);
+ }
+ soap->blist = bp->next;
+ SOAP_FREE(bp);
+ }
+ DBGLOG(TEST, if (soap->blist) SOAP_MESSAGE(fdebug, "Restore previous block sequence\n"));
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+char*
+SOAP_FMAC2
+soap_save_block(struct soap *soap, char *p)
+{ register size_t n;
+ register char *q, *s;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Save all blocks in contiguous memory space of %u bytes (%p->%p)\n", (unsigned int)soap->blist->size, soap->blist->ptr, p));
+ if (soap->blist->size)
+ { if (!p)
+ p = (char*)soap_malloc(soap, soap->blist->size);
+ if (p)
+ for (s = p, q = soap_first_block(soap); q; q = soap_next_block(soap))
+ { n = soap_block_size(soap);
+ soap_update_ptrs(soap, q, q + n, (long)s - (long)q); /* pointers s and q may or may not be related */
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy %u bytes from %p to %p\n", (unsigned int)n, q, s));
+ memcpy(s, q, n);
+ s += n;
+ }
+ else
+ soap->error = SOAP_EOM;
+ }
+ soap_end_block(soap);
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+char*
+SOAP_FMAC2
+soap_store_block(struct soap *soap, char *p)
+{ p = soap_save_block(soap, p);
+ if (!soap->blist)
+ { struct soap_ilist *ip;
+ int i;
+ for (i = 0; i < SOAP_IDHASH; i++)
+ for (ip = soap->iht[i]; ip; ip = ip->next)
+ if (ip->ptr)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolve link chain to point to %p\n", ip->ptr));
+ soap_resolve_ptr(ip);
+ }
+ }
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+char *
+SOAP_FMAC2
+soap_putsize(struct soap *soap, const char *type, int size)
+{ return soap_putsizes(soap, type, &size, 1);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+char *
+SOAP_FMAC2
+soap_putsizes(struct soap *soap, const char *type, const int *size, int dim)
+{ return soap_putsizesoffsets(soap, type, size, NULL, dim);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+char *
+SOAP_FMAC2
+soap_putsizesoffsets(struct soap *soap, const char *type, const int *size, const int *offset, int dim)
+{ int i;
+ if (!type)
+ return NULL;
+ if (soap->version == 2)
+ { sprintf(soap->type, "%s[%d", type, size[0]);
+ for (i = 1; i < dim; i++)
+ sprintf(soap->type + strlen(soap->type), " %d", size[i]);
+ }
+ else
+ { if (offset)
+ { sprintf(soap->type, "%s[%d", type, size[0] + offset[0]);
+ for (i = 1; i < dim; i++)
+ sprintf(soap->type + strlen(soap->type), ",%d", size[i] + offset[i]);
+ }
+ else
+ { sprintf(soap->type, "%s[%d", type, size[0]);
+ for (i = 1; i < dim; i++)
+ sprintf(soap->type + strlen(soap->type), ",%d", size[i]);
+ }
+ strcat(soap->type, "]");
+ }
+ return soap->type;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+char *
+SOAP_FMAC2
+soap_putoffset(struct soap *soap, int offset)
+{ return soap_putoffsets(soap, &offset, 1);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+char *
+SOAP_FMAC2
+soap_putoffsets(struct soap *soap, const int *offset, int dim)
+{ register int i;
+ sprintf(soap->arrayOffset, "[%d", offset[0]);
+ for (i = 1; i < dim; i++)
+ sprintf(soap->arrayOffset + strlen(soap->arrayOffset), ",%d", offset[i]);
+ strcat(soap->arrayOffset, "]");
+ return soap->arrayOffset;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_size(const int *size, int dim)
+{ register int i, n = size[0];
+ for (i = 1; i < dim; i++)
+ n *= size[i];
+ return n;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_getoffsets(const char *attr, const int *size, int *offset, int dim)
+{ register int i, j = 0;
+ if (offset)
+ for (i = 0; i < dim && attr && *attr; i++)
+ { attr++;
+ j *= size[i];
+ j += offset[i] = (int)atol(attr);
+ attr = strchr(attr, ',');
+ }
+ else
+ for (i = 0; i < dim && attr && *attr; i++)
+ { attr++;
+ j *= size[i];
+ j += (int)atol(attr);
+ attr = strchr(attr, ',');
+ }
+ return j;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_getsize(const char *attr1, const char *attr2, int *j)
+{ register int n, k;
+ char *s;
+ *j = 0;
+ if (!*attr1)
+ return -1;
+ n = 1;
+ do
+ { attr1++;
+ k = (int)soap_strtol(attr1, &s, 10);
+ n *= k;
+ if (k < 0 || n > SOAP_MAXARRAYSIZE || s == attr1)
+ return -1;
+ attr1 = strchr(s, ',');
+ if (!attr1)
+ attr1 = strchr(s, ' ');
+ if (attr2 && *attr2)
+ { attr2++;
+ *j *= k;
+ k = (int)soap_strtol(attr2, &s, 10);
+ *j += k;
+ if (k < 0)
+ return -1;
+ attr2 = s;
+ }
+ } while (attr1 && *attr1 != ']');
+ return n - *j;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_getsizes(const char *attr, int *size, int dim)
+{ register int i, k, n;
+ if (!*attr)
+ return -1;
+ i = strlen(attr);
+ n = 1;
+ do
+ { for (i = i-1; i >= 0; i--)
+ if (attr[i] == '[' || attr[i] == ',' || attr[i] == ' ')
+ break;
+ k = (int)atol(attr + i + 1);
+ n *= size[--dim] = k;
+ if (k < 0 || n > SOAP_MAXARRAYSIZE)
+ return -1;
+ } while (i >= 0 && attr[i] != '[');
+ return n;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_getposition(const char *attr, int *pos)
+{ register int i, n;
+ if (!*attr)
+ return -1;
+ n = 0;
+ i = 1;
+ do
+ { pos[n++] = (int)atol(attr + i);
+ while (attr[i] && attr[i] != ',' && attr[i] != ']')
+ i++;
+ if (attr[i] == ',')
+ i++;
+ } while (n < SOAP_MAXDIMS && attr[i] && attr[i] != ']');
+ return n;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_push_namespace(struct soap *soap, const char *id, const char *ns)
+{ register struct soap_nlist *np;
+ register struct Namespace *p;
+ np = (struct soap_nlist*)SOAP_MALLOC(sizeof(struct soap_nlist) + strlen(id));
+ if (!np)
+ return soap->error = SOAP_EOM;
+ np->next = soap->nlist;
+ soap->nlist = np;
+ strcpy(np->id, id);
+ np->level = soap->level;
+ np->index = -1;
+ np->ns = NULL;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push namespace binding (level=%u) '%s' '%s'\n", soap->level, id, ns));
+ p = soap->local_namespaces;
+ if (p)
+ { register short i = 0;
+ if (!strcmp(ns, soap_env1))
+ soap->version = 1; /* make sure we use SOAP 1.1 */
+ else if (!strcmp(ns, soap_env2))
+ soap->version = 2; /* make sure we use SOAP 1.2 */
+ else
+ { for (; p->id; p++, i++)
+ { if (p->ns)
+ if (!strcmp(ns, p->ns))
+ break;
+ if (p->in)
+ if (!soap_tag_cmp(ns, p->in))
+ { if (p->out)
+ SOAP_FREE(p->out);
+ if ((p->out = (char*)SOAP_MALLOC(strlen(ns) + 1)))
+ strcpy(p->out, ns);
+ break;
+ }
+ }
+ }
+ if (i == 0 && (!p->ns || strcmp(ns, p->ns)))
+ { if (p[0].out)
+ SOAP_FREE(p[0].out);
+ if ((p[0].out = (char*)SOAP_MALLOC(strlen(ns) + 1)))
+ strcpy(p[0].out, ns);
+ if (p[1].out)
+ SOAP_FREE(p[1].out);
+ if (soap->version == 1)
+ { if ((p[1].out = (char*)SOAP_MALLOC(sizeof(soap_enc1))))
+ strcpy(p[1].out, soap_enc1);
+ }
+ else if ((p[1].out = (char*)SOAP_MALLOC(sizeof(soap_enc2))))
+ strcpy(p[1].out, soap_enc2);
+ }
+ if (p && p->id)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push OK ('%s' matches '%s' in namespace table)\n", id, p->id));
+ np->index = i;
+ }
+ }
+ if (!p || !p->id)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Push NOT OK: no match found for '%s' in namespace mapping table (added to stack anyway)\n", ns));
+ np->ns = (char*)SOAP_MALLOC(strlen(ns) + 1);
+ if (!np->ns)
+ return soap->error = SOAP_EOM;
+ strcpy(np->ns, ns);
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_push_default_namespace(struct soap *soap, const char *id, int n)
+{ register struct soap_nlist *np = soap->nlist;
+ while (np && np->index >= -1)
+ np = np->next;
+ if (np && (!strncmp(np->id, id, n) && !np->id[n]))
+ return SOAP_OK;
+ np = (struct soap_nlist*)SOAP_MALLOC(sizeof(struct soap_nlist) + n);
+ if (!np)
+ return soap->error = SOAP_EOM;
+ np->next = soap->nlist;
+ soap->nlist = np;
+ strncpy(np->id, id, n);
+ np->id[n] = '\0';
+ np->level = soap->level;
+ np->index = -2;
+ np->ns = NULL;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_pop_namespace(struct soap *soap)
+{ register struct soap_nlist *np;
+ while (soap->nlist && soap->nlist->level >= soap->level)
+ { np = soap->nlist->next;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Popped namespace binding (level=%u) '%s'\n", soap->level, soap->nlist->id));
+ if (soap->nlist->ns)
+ SOAP_FREE(soap->nlist->ns);
+ SOAP_FREE(soap->nlist);
+ soap->nlist = np;
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_match_namespace(struct soap *soap, const char *id1, const char *id2, int n1, int n2)
+{ register struct soap_nlist *np = soap->nlist;
+ while (np && (np->index == -2 || (strncmp(np->id, id1, n1) || np->id[n1])))
+ np = np->next;
+ if (np)
+ { if (np->index < 0 || (np->index >= 0 && soap->local_namespaces[np->index].id && (strncmp(soap->local_namespaces[np->index].id, id2, n2) || soap->local_namespaces[np->index].id[n2])))
+ return SOAP_NAMESPACE;
+ return SOAP_OK;
+ }
+ if (n1 == 3 && n1 == n2 && !strcmp(id1, "xml") && !strcmp(id1, id2))
+ return SOAP_OK;
+ return SOAP_SYNTAX_ERROR;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_default_namespace(struct soap *soap)
+{ register struct soap_nlist *np = soap->nlist;
+ while (np && np->index >= -1)
+ np = np->next;
+ if (np)
+ return np->id;
+ return NULL;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_tag_cmp(register const char *s, register const char *t)
+{ for (; *s && *s != '"'; s++, t++)
+ if (tolower(*s) != tolower(*t))
+ if (*t != '-')
+ { if (*t != '*')
+ return 1;
+ if (*++t)
+ { register int c = tolower(*t);
+ for (; *s && *s != '"'; s++)
+ { if (tolower(*s) == c)
+ if (!soap_tag_cmp(s + 1, t + 1))
+ return 0;
+ }
+ break;
+ }
+ else
+ return 0;
+ }
+ if (*t == '*' && !t[1])
+ return 0;
+ return *t;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_match_tag(struct soap *soap, const char *tag1, const char *tag2)
+{ register const char *s, *t;
+ if (!tag1 || !tag2 || !*tag2)
+ return SOAP_OK;
+ s = strchr(tag1, ':');
+ t = strchr(tag2, ':');
+ if (t)
+ { if (s)
+ { if (SOAP_STRCMP(s + 1, t + 1))
+ return SOAP_TAG_MISMATCH;
+ if (t != tag2 && soap_match_namespace(soap, tag1, tag2, s - tag1, t - tag2))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags '%s' and '%s' match but namespaces differ\n", tag1, tag2));
+ return SOAP_TAG_MISMATCH;
+ }
+ }
+ else if (SOAP_STRCMP(tag1, t + 1))
+ return SOAP_TAG_MISMATCH;
+ else if (t != tag2 && soap_match_namespace(soap, tag1, tag2, 0, t - tag2))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags '%s' and '%s' match but namespaces differ\n", tag1, tag2));
+ return SOAP_TAG_MISMATCH;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags and (default) namespaces match: '%s' '%s'\n", tag1, tag2));
+ return SOAP_OK;
+ }
+ if (s)
+ { if (((soap->mode & SOAP_XML_STRICT) && soap->part != SOAP_IN_HEADER && soap->encodingStyle))
+ return SOAP_TAG_MISMATCH;
+ if (SOAP_STRCMP(s + 1, tag2))
+ return SOAP_TAG_MISMATCH;
+ if (!soap->encodingStyle)
+ { t = soap_default_namespace(soap);
+ if (!t || soap_match_namespace(soap, tag1, t, s - tag1, strlen(t)))
+ return SOAP_TAG_MISMATCH;
+ }
+ }
+ else if (SOAP_STRCMP(tag1, tag2))
+ return SOAP_TAG_MISMATCH;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Tags match: '%s' '%s'\n", tag1, tag2));
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_match_array(struct soap *soap, const char *type)
+{ if (*soap->arrayType)
+ if (soap_match_tag(soap, soap->arrayType, type)
+ && soap_match_tag(soap, soap->arrayType, "xsd:anyType")
+ && soap_match_tag(soap, soap->arrayType, "xsd:ur-type")
+ )
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array type mismatch: '%s' '%s'\n", soap->arrayType, type));
+ return SOAP_TAG_MISMATCH;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+
+#ifdef WITH_OPENSSL
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_ssl_server_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *password, const char *cafile, const char *capath, const char *dhfile, const char *randfile, const char *sid)
+{ int err;
+ soap->keyfile = keyfile;
+ soap->password = password;
+ soap->cafile = cafile;
+ soap->capath = capath;
+ if (dhfile)
+ { soap->dhfile = dhfile;
+ soap->rsa = 0;
+ }
+ else
+ { soap->dhfile = NULL;
+ soap->rsa = 1;
+ }
+ soap->randfile = randfile;
+ soap->require_client_auth = (flags & SOAP_SSL_REQUIRE_CLIENT_AUTHENTICATION);
+ if (!(err = soap->fsslauth(soap)))
+ if (sid)
+ SSL_CTX_set_session_id_context(soap->ctx, (unsigned char*)sid, strlen(sid));
+ return err;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_ssl_client_context(struct soap *soap, unsigned short flags, const char *keyfile, const char *password, const char *cafile, const char *capath, const char *randfile)
+{ soap->keyfile = keyfile;
+ soap->password = password;
+ soap->cafile = cafile;
+ soap->capath = capath;
+ soap->dhfile = NULL;
+ soap->rsa = 0;
+ soap->randfile = randfile;
+ soap->require_server_auth = (flags & SOAP_SSL_REQUIRE_SERVER_AUTHENTICATION);
+ return soap->fsslauth(soap);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static void
+ssl_init()
+{ static int done = 0;
+ if (!done)
+ { done = 1;
+ SSL_library_init();
+#ifndef WITH_LEAN
+ SSL_load_error_strings();
+#endif
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static const char *
+ssl_error(struct soap *soap, int ret)
+{ int err = SSL_get_error(soap->ssl, ret);
+ const char *msg = soap_str_code(h_ssl_error_codes, err);
+ if (msg)
+ strcpy(soap->msgbuf, msg);
+ else
+ return ERR_error_string(err, soap->msgbuf);
+ if (ERR_peek_error())
+ { unsigned long r;
+ strcat(soap->msgbuf, "\n");
+ while ((r = ERR_get_error()))
+ ERR_error_string_n(r, soap->msgbuf + strlen(soap->msgbuf), sizeof(soap->msgbuf) - strlen(soap->msgbuf));
+ }
+ else
+ { switch (ret)
+ { case 0:
+ strcpy(soap->msgbuf, "EOF was observed that violates the protocol. The client probably provided invalid authentication information.");
+ break;
+ case -1:
+ sprintf(soap->msgbuf, "Error observed by underlying BIO: %s", strerror(errno));
+ break;
+ }
+ }
+ return soap->msgbuf;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+ssl_password(char *buf, int num, int rwflag, void *userdata)
+{ if (num < (int)strlen((char*)userdata) + 1)
+ return 0;
+ return strlen(strcpy(buf, (char*)userdata));
+}
+#endif
+
+/******************************************************************************/
+/* This callback is included for future references. It should not be deleted
+#ifndef PALM_1
+static DH *
+ssl_tmp_dh(SSL *ssl, int is_export, int keylength)
+{ static DH *dh512 = NULL;
+ static DH *dh1024 = NULL;
+ DH *dh;
+ switch (keylength)
+ { case 512:
+ if (!dh512)
+ { BIO *bio = BIO_new_file("dh512.pem", "r");
+ if (bio)
+ { dh512 = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
+ BIO_free(bio);
+ return dh512;
+ }
+ }
+ else
+ return dh512;
+ default:
+ if (!dh1024)
+ { BIO *bio = BIO_new_file("dh1024.pem", "r");
+ if (bio)
+ { dh1024 = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
+ BIO_free(bio);
+ }
+ }
+ dh = dh1024;
+ }
+ return dh;
+}
+#endif
+*/
+/******************************************************************************/
+#ifndef PALM_1
+static int
+ssl_auth_init(struct soap *soap)
+{ ssl_init();
+ if (!soap->ctx)
+ if (!(soap->ctx = SSL_CTX_new(SSLv23_method())))
+ return soap_set_receiver_error(soap, "SSL error", "Can't setup context", SOAP_SSL_ERROR);
+ if (soap->randfile)
+ { if (!RAND_load_file(soap->randfile, -1))
+ return soap_set_receiver_error(soap, "SSL error", "Can't load randomness", SOAP_SSL_ERROR);
+ }
+ else if (!RAND_load_file("/dev/urandom", 1024))
+ { int r;
+#ifdef HAVE_RAND_R
+ unsigned int s = (unsigned int)time(NULL);
+#endif
+ RAND_seed(soap->buf, sizeof(soap->buf));
+ while (!RAND_status())
+ {
+#ifdef HAVE_RAND_R
+ r = rand_r(&s);
+#else
+ r = rand();
+#endif
+ RAND_seed(&r, sizeof(int));
+ }
+ }
+ if (soap->cafile || soap->capath)
+ if (!SSL_CTX_load_verify_locations(soap->ctx, soap->cafile, soap->capath))
+ return soap_set_receiver_error(soap, "SSL error", "Can't read CA file and/or directory", SOAP_SSL_ERROR);
+ if (!SSL_CTX_set_default_verify_paths(soap->ctx))
+ return soap_set_receiver_error(soap, "SSL error", "Can't read default CA file and/or directory", SOAP_SSL_ERROR);
+ if (soap->keyfile)
+ { if (!SSL_CTX_use_certificate_chain_file(soap->ctx, soap->keyfile))
+ return soap_set_receiver_error(soap, "SSL error", "Can't read certificate key file", SOAP_SSL_ERROR);
+ if (soap->password)
+ { SSL_CTX_set_default_passwd_cb_userdata(soap->ctx, (void*)soap->password);
+ SSL_CTX_set_default_passwd_cb(soap->ctx, ssl_password);
+ if (!SSL_CTX_use_PrivateKey_file(soap->ctx, soap->keyfile, SSL_FILETYPE_PEM))
+ return soap_set_receiver_error(soap, "SSL error", "Can't read key file", SOAP_SSL_ERROR);
+ }
+ }
+ if (soap->rsa)
+ { RSA *rsa = RSA_generate_key(512, RSA_F4, NULL, NULL);
+ if (!SSL_CTX_set_tmp_rsa(soap->ctx, rsa))
+ { if (rsa)
+ RSA_free(rsa);
+ return soap_set_receiver_error(soap, "SSL error", "Can't set RSA key", SOAP_SSL_ERROR);
+ }
+ RSA_free(rsa);
+ }
+ else if (soap->dhfile)
+ { DH *dh = 0;
+ BIO *bio;
+ bio = BIO_new_file(soap->dhfile, "r");
+ if (!bio)
+ return soap_set_receiver_error(soap, "SSL error", "Can't read DH file", SOAP_SSL_ERROR);
+ dh = PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
+ BIO_free(bio);
+ if (SSL_CTX_set_tmp_dh(soap->ctx, dh) < 0)
+ { if (dh)
+ DH_free(dh);
+ return soap_set_receiver_error(soap, "SSL error", "Can't set DH parameters", SOAP_SSL_ERROR);
+ }
+ DH_free(dh);
+ }
+ SSL_CTX_set_options(soap->ctx, SSL_OP_ALL | SSL_OP_NO_SSLv2);
+ SSL_CTX_set_verify(soap->ctx, soap->require_client_auth ? (SSL_VERIFY_PEER | SSL_VERIFY_FAIL_IF_NO_PEER_CERT) : soap->require_server_auth ? SSL_VERIFY_PEER : SSL_VERIFY_NONE, soap->fsslverify);
+#if (OPENSSL_VERSION_NUMBER < 0x00905100L)
+ SSL_CTX_set_verify_depth(soap->ctx, 1);
+#endif
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+ssl_verify_callback(int ok, X509_STORE_CTX *store)
+{
+#ifdef SOAP_DEBUG
+ if (!ok)
+ { char data[256];
+ X509 *cert = X509_STORE_CTX_get_current_cert(store);
+ fprintf(stderr, "SSL Verify error with certificate at depth %d: %s\n", X509_STORE_CTX_get_error_depth(store), X509_verify_cert_error_string(X509_STORE_CTX_get_error(store)));
+ X509_NAME_oneline(X509_get_issuer_name(cert), data, sizeof(data));
+ fprintf(stderr, "certificate issuer %s\n", data);
+ X509_NAME_oneline(X509_get_subject_name(cert), data, sizeof(data));
+ fprintf(stderr, "certificate subject %s\n", data);
+ }
+#endif
+ return ok;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_ssl_accept(struct soap *soap)
+{ int i, r;
+ if (!soap_valid_socket(soap->socket))
+ return soap_set_receiver_error(soap, "SSL error", "No socket in soap_ssl_accept()", SOAP_SSL_ERROR);
+ if (!soap->ssl)
+ { soap->ssl = SSL_new(soap->ctx);
+ if (!soap->ssl)
+ return soap_set_receiver_error(soap, "SSL error", "SSL_new() failed in soap_ssl_accept()", SOAP_SSL_ERROR);
+ }
+ else
+ SSL_clear(soap->ssl);
+ soap->imode |= SOAP_ENC_SSL;
+ soap->omode |= SOAP_ENC_SSL;
+#ifdef WIN32
+ u_long nonblocking = 1;
+ ioctlsocket((SOAP_SOCKET)soap->socket, FIONBIO, &nonblocking);
+#else
+ fcntl((SOAP_SOCKET)soap->socket, F_SETFL, fcntl((SOAP_SOCKET)soap->socket, F_GETFL)|O_NONBLOCK);
+#endif
+ soap->bio = BIO_new_socket((SOAP_SOCKET)soap->socket, BIO_NOCLOSE);
+ SSL_set_bio(soap->ssl, soap->bio, soap->bio);
+ i = 100;
+ while ((r = SSL_accept(soap->ssl)) <= 0)
+ { int err = SSL_get_error(soap->ssl, r);
+ if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE)
+ { struct timeval timeout;
+ fd_set fd;
+ if (i-- <= 0)
+ break;
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 100000;
+ FD_ZERO(&fd);
+ FD_SET((SOAP_SOCKET)soap->socket, &fd);
+ r = select((SOAP_SOCKET)(soap->socket + 1), &fd, NULL, &fd, &timeout);
+ if (r < 0 && soap_socket_errno != SOAP_EINTR)
+ { soap->errnum = soap_socket_errno;
+ return SOAP_EOF;
+ }
+ }
+ else
+ { soap->errnum = err;
+ break;
+ }
+ }
+#ifdef WIN32
+ { u_long blocking = 0;
+ ioctlsocket((SOAP_SOCKET)soap->socket, FIONBIO, &blocking);
+ }
+#else
+ fcntl((SOAP_SOCKET)soap->socket, F_SETFL, fcntl((SOAP_SOCKET)soap->socket, F_GETFL)&~O_NONBLOCK);
+#endif
+ if (r <= 0)
+ { soap_set_receiver_error(soap, ssl_error(soap, r), "SSL_accept() failed in soap_ssl_accept()", SOAP_SSL_ERROR);
+ soap_closesock(soap);
+ return SOAP_SSL_ERROR;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#endif /* WITH_OPENSSL */
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+tcp_init(struct soap *soap)
+{ soap->errmode = 1;
+#ifdef WIN32
+ if (tcp_done)
+ return 0;
+ else
+ { WSADATA w;
+ if (WSAStartup(MAKEWORD(1, 1), &w))
+ return -1;
+ tcp_done = 1;
+ }
+#endif
+#ifdef PALM
+ errno = 0;
+ h_errno = 0;
+ AppNetRefnum = 0;
+ NetUInit();
+ AppNetTimeout = 10000;
+ NetLibOpen(AppNetRefnum, &h_errno);
+#endif
+ return 0;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_done(struct soap *soap)
+{
+#ifndef WITH_LEAN
+ int i;
+#endif
+ soap_free(soap);
+ while (soap->clist)
+ { struct soap_clist *p = soap->clist->next;
+ SOAP_FREE(soap->clist);
+ soap->clist = p;
+ }
+ soap->keep_alive = 0; /* to force close the socket */
+ soap_closesock(soap);
+#ifdef WITH_COOKIES
+ soap_free_cookies(soap);
+#endif
+ while (soap->plugins)
+ { register struct soap_plugin *p = soap->plugins->next;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Removing plugin '%s'\n", soap->plugins->id));
+ if (soap->plugins->fcopy || !soap->copy)
+ soap->plugins->fdelete(soap, soap->plugins);
+ SOAP_FREE(soap->plugins);
+ soap->plugins = p;
+ }
+ soap->fplugin = fplugin;
+ soap->fpost = http_post;
+ soap->fget = http_get;
+ soap->fposthdr = http_post_header;
+ soap->fresponse = http_response;
+ soap->fparse = http_parse;
+ soap->fparsehdr = http_parse_header;
+#ifndef MAC_CARBON
+ soap->faccept = tcp_accept;
+ soap->fopen = tcp_connect;
+ soap->fclose = tcp_disconnect;
+ soap->fsend = fsend;
+ soap->frecv = frecv;
+#endif
+ soap->fprepare = NULL;
+ soap->fignore = NULL;
+#ifdef WITH_OPENSSL
+ if (soap->session)
+ { SSL_SESSION_free(soap->session);
+ soap->session = NULL;
+ }
+#endif
+ if (!soap->copy)
+ { if (soap_valid_socket(soap->master))
+ { closesocket((SOAP_SOCKET)soap->master);
+ soap->master = SOAP_INVALID_SOCKET;
+ }
+#ifdef WITH_OPENSSL
+ if (soap->ctx)
+ { SSL_CTX_free(soap->ctx);
+ soap->ctx = NULL;
+ }
+#endif
+ }
+#ifndef WITH_LEAN
+ for (i = 0; i < SOAP_MAXLOGS; i++)
+ { soap_close_logfile(soap, i);
+ if (soap->logfile[i])
+ { SOAP_FREE((void*)soap->logfile[i]);
+ soap->logfile[i] = NULL;
+ }
+ }
+#endif
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_cleanup(struct soap *soap)
+{ soap_done(soap);
+#ifdef WIN32
+ if (!tcp_done)
+ return;
+ tcp_done = 0;
+ WSACleanup();
+#endif
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static const char*
+tcp_error(struct soap *soap)
+{ register const char *msg = NULL;
+ switch (soap->errmode)
+ { case 0:
+ msg = soap_strerror(soap);
+ break;
+ case 1:
+ msg = "WSAStartup failed";
+ break;
+ case 2:
+ {
+#ifndef WITH_LEAN
+ msg = soap_str_code(h_error_codes, soap->errnum);
+ if (!msg)
+#endif
+ { sprintf(soap->msgbuf, "TCP error %d", soap->errnum);
+ msg = soap->msgbuf;
+ }
+ }
+ }
+ return msg;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static const char*
+http_error(struct soap *soap, int status)
+{ register const char *msg = NULL;
+#ifndef WITH_LEAN
+ msg = soap_str_code(h_http_error_codes, status);
+ if (!msg)
+#endif
+ { sprintf(soap->msgbuf, "HTTP error %d", status);
+ msg = soap->msgbuf;
+ }
+ return msg;
+}
+#endif
+
+/******************************************************************************/
+/* WR[ */
+#ifndef WITH_IPV6
+/* ]WR */
+#ifndef MAC_CARBON
+#ifndef PALM_1
+static int
+soap_gethost(struct soap *soap, const char *addr, struct in_addr *inaddr)
+{ unsigned long iadd;
+ struct hostent hostent, *host = &hostent;
+/* WR[ */
+#ifdef VXWORKS
+ int hostint;
+ char * addrcopy = (char*)malloc(strlen(addr) + 1); /*copy of addr. */
+ /* inet_addr(), and hostGetByName() expect "char *"; addr is a "const char *". */
+ strncpy(addrcopy, addr, strlen(addr)+1);
+ iadd = inet_addr(addrcopy);
+#else
+/* ]WR */
+#if defined(_AIXVERSION_431) || defined(TRU64)
+ struct hostent_data ht_data;
+#endif
+ iadd = inet_addr(addr);
+/* WR[ */
+#endif
+/* ]WR */
+ if ((int)iadd != -1)
+ { memcpy(inaddr, &iadd, sizeof(iadd));
+/* WR[ */
+#ifdef VXWORKS
+ free(addrcopy);
+#endif
+/* ]WR */
+ return 0;
+ }
+#if defined(__GLIBC__)
+ if (gethostbyname_r(addr, &hostent, soap->buf, SOAP_BUFLEN, &host, &soap->errnum) < 0)
+ host = NULL;
+#elif defined(_AIXVERSION_431) || defined(TRU64)
+ memset(&ht_data, 0, sizeof(ht_data));
+ if (gethostbyname_r(addr, &hostent, &ht_data) < 0)
+ { host = NULL;
+ soap->errnum = h_errno;
+ }
+#elif defined(HAVE_GETHOSTBYNAME_R)
+ host = gethostbyname_r(addr, &hostent, soap->buf, SOAP_BUFLEN, &soap->errnum);
+/* WR[ */
+#elif defined(VXWORKS)
+ /* If the DNS resolver library resolvLib has been configured in the vxWorks
+ * image, a query for the host IP address is sent to the DNS server, if the
+ * name was not found in the local host table. */
+ hostint = hostGetByName(addrcopy);
+ if (hostint == ERROR)
+ {
+ host = NULL;
+ soap->errnum = soap_errno;
+ }
+ free(addrcopy); /*free() is placed after the error checking to assure that
+ * errno captured is that from hostGetByName() */
+/* ]WR */
+#else
+ if (!(host = gethostbyname(addr)))
+ soap->errnum = h_errno;
+#endif
+ if (!host)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Host name not found\n"));
+ return -1;
+ }
+/* WR[ */
+#ifdef VXWORKS
+ inaddr->s_addr = hostint;
+#else
+/* ]WR */
+ memcpy(inaddr, host->h_addr, host->h_length);
+/* WR[ */
+#endif
+/* ]WR */
+ return 0;
+}
+#endif
+#endif
+/* WR[ */
+#endif /* WITH_IPV6 */
+/* ]WR */
+
+/******************************************************************************/
+#ifndef MAC_CARBON
+#ifndef PALM_1
+static int
+tcp_connect(struct soap *soap, const char *endpoint, const char *host, int port)
+{ struct sockaddr_in sockaddr;
+/* WR[ */
+#ifdef WITH_IPV6
+ struct addrinfo *addrinfo;
+ struct addrinfo hints;
+ struct addrinfo resaddr;
+ struct sockaddr_storage addrstorage;
+ int err;
+#endif /* WITH_IPV6 */
+/* ]WR */
+ register int fd;
+#ifndef WITH_LEAN
+ int len = SOAP_BUFLEN;
+ int set = 1;
+#endif
+ if (soap_valid_socket(soap->socket))
+ closesocket((SOAP_SOCKET)soap->socket);
+ soap->socket = SOAP_INVALID_SOCKET;
+ if (tcp_init(soap))
+ { soap_set_sender_error(soap, tcp_error(soap), "TCP initialization failed in tcp_connect()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ soap->errmode = 0;
+/* WR[ */
+#ifdef WITH_IPV6
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ soap->errmode = 2;
+ if (soap->proxy_host)
+ err = getaddrinfo(soap->proxy_host, soap_int2s(soap, soap->proxy_port), &hints, &addrinfo);
+ else
+ err = getaddrinfo(host, soap_int2s(soap, port), &hints, &addrinfo);
+ if (addrinfo)
+ { resaddr = *addrinfo;
+ addrstorage = *((struct sockaddr_storage *) addrinfo->ai_addr);
+ resaddr.ai_addr = (struct sockaddr *) &addrstorage;
+ freeaddrinfo(addrinfo);
+ }
+ if (err)
+ { soap_set_sender_error(soap, gai_strerror(err),
+ "TCP getaddrinfo on proxy host failed in tcp_connect()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ fd = (int)socket(resaddr.ai_family, resaddr.ai_socktype, resaddr.ai_protocol); /* modified to use fd */
+ soap->errmode = 0;
+#else /* WITH_IPV6 */
+/* ]WR */
+ fd = (int)socket(AF_INET, SOCK_STREAM, 0);
+/* WR[ */
+#endif /* WITH_IPV6 */
+/* ]WR */
+ if (fd < 0)
+ { soap->errnum = soap_socket_errno;
+ soap_set_sender_error(soap, tcp_error(soap), "TCP socket failed in tcp_connect()", SOAP_TCP_ERROR);
+ return -1;
+ }
+#ifndef WITH_LEAN
+ if (soap->connect_flags & SO_LINGER)
+ { struct linger linger;
+ memset(&linger, 0, sizeof(struct linger));
+ linger.l_onoff = 1;
+ linger.l_linger = 0;
+ if (setsockopt((SOAP_SOCKET)fd, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_sender_error(soap, tcp_error(soap), "TCP setsockopt SO_LINGER failed in tcp_connect()", SOAP_TCP_ERROR);
+ closesocket((SOAP_SOCKET)fd);
+ return -1;
+ }
+ }
+ if ((soap->connect_flags & ~SO_LINGER) && setsockopt((SOAP_SOCKET)fd, SOL_SOCKET, soap->connect_flags & ~SO_LINGER, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_sender_error(soap, tcp_error(soap), "TCP setsockopt failed in tcp_connect()", SOAP_TCP_ERROR);
+ closesocket((SOAP_SOCKET)fd);
+ return -1;
+ }
+ if (soap->keep_alive && setsockopt((SOAP_SOCKET)fd, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_sender_error(soap, tcp_error(soap), "TCP setsockopt SO_KEEPALIVE failed in tcp_connect()", SOAP_TCP_ERROR);
+ closesocket((SOAP_SOCKET)fd);
+ return -1;
+ }
+ if (setsockopt((SOAP_SOCKET)fd, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_sender_error(soap, tcp_error(soap), "TCP setsockopt SO_SNDBUF failed in tcp_connect()", SOAP_TCP_ERROR);
+ closesocket((SOAP_SOCKET)fd);
+ return -1;
+ }
+ if (setsockopt((SOAP_SOCKET)fd, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_sender_error(soap, tcp_error(soap), "TCP setsockopt SO_RCVBUF failed in tcp_connect()", SOAP_TCP_ERROR);
+ closesocket((SOAP_SOCKET)fd);
+ return -1;
+ }
+#ifdef TCP_NODELAY
+ if (setsockopt((SOAP_SOCKET)fd, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_sender_error(soap, tcp_error(soap), "TCP setsockopt TCP_NODELAY failed in tcp_connect()", SOAP_TCP_ERROR);
+ closesocket((SOAP_SOCKET)fd);
+ return -1;
+ }
+#endif
+#endif
+/* WR[ */
+#ifndef WITH_IPV6
+/* ]WR */
+ memset(&sockaddr, 0, sizeof(sockaddr));
+ sockaddr.sin_family = AF_INET;
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Open socket %d to host='%s'\n", fd, host));
+ soap->errmode = 2;
+ if (soap->proxy_host)
+ { if (soap_gethost(soap, soap->proxy_host, &sockaddr.sin_addr))
+ { soap_set_sender_error(soap, tcp_error(soap), "TCP get proxy host by name failed in tcp_connect()", SOAP_TCP_ERROR);
+ closesocket((SOAP_SOCKET)fd);
+ return -1;
+ }
+ sockaddr.sin_port = htons((short)soap->proxy_port);
+ }
+ else
+ { if (soap_gethost(soap, host, &sockaddr.sin_addr))
+ { soap_set_sender_error(soap, tcp_error(soap), "TCP get host by name failed in tcp_connect()", SOAP_TCP_ERROR);
+ closesocket((SOAP_SOCKET)fd);
+ return -1;
+ }
+ sockaddr.sin_port = htons((short)port);
+ }
+ soap->errmode = 0;
+/* WR[ */
+#endif /* WITH_IPV6 */
+/* ]WR */
+#ifndef WITH_LEAN
+ if (soap->connect_timeout)
+#if defined(WIN32)
+ { u_long nonblocking = 1;
+ ioctlsocket((SOAP_SOCKET)fd, FIONBIO, &nonblocking);
+ }
+/* WR[ */
+#elif defined(VXWORKS)
+ {
+ vx_nonblocking = TRUE;
+ ioctl((SOAP_SOCKET)fd, FIONBIO, (int)(&vx_nonblocking)); /* modified to use fd */
+ }
+/* ]WR */
+#else
+ fcntl((SOAP_SOCKET)fd, F_SETFL, fcntl((SOAP_SOCKET)fd, F_GETFL)|O_NONBLOCK);
+#endif
+ else
+#if defined(WIN32)
+ { u_long blocking = 0;
+ ioctlsocket((SOAP_SOCKET)fd, FIONBIO, &blocking);
+ }
+/* WR[ */
+#elif defined(VXWORKS)
+ {
+ vx_nonblocking = FALSE;
+ ioctl((SOAP_SOCKET)fd, FIONBIO, (int)(&vx_nonblocking)); /* modified to use fd */
+ }
+/* ]WR */
+#else
+ fcntl((SOAP_SOCKET)fd, F_SETFL, fcntl((SOAP_SOCKET)fd, F_GETFL)&~O_NONBLOCK);
+#endif
+#endif
+ for (;;)
+ {
+/* WR[ */
+#ifdef WITH_IPV6
+ if (connect((SOAP_SOCKET)fd, resaddr.ai_addr, resaddr.ai_addrlen)) /* modified to use fd */
+#else /* WITH_IPV6 */
+ if (connect((SOAP_SOCKET)fd, (struct sockaddr*)&sockaddr, sizeof(sockaddr)))
+#endif /* WITH_IPV6 */
+/* ]WR */
+ {
+#ifndef WITH_LEAN
+ if (soap->connect_timeout && (soap_socket_errno == SOAP_EINPROGRESS || soap_socket_errno == SOAP_EWOULDBLOCK))
+ { struct timeval timeout;
+#if defined(SOCKLEN_T)
+ SOCKLEN_T n = sizeof(struct sockaddr_in);
+#elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(CYGWIN)
+ socklen_t n = sizeof(struct sockaddr_in);
+#elif defined(WIN32) || defined(__APPLE__) || defined(HP_UX) || defined(SUN_OS) || defined(OPENSERVER) || defined(TRU64) || defined(VXWORKS)
+ int n = sizeof(struct sockaddr_in);
+#else
+ size_t n = sizeof(struct sockaddr_in);
+#endif
+ fd_set fds;
+ if (soap->connect_timeout > 0)
+ { timeout.tv_sec = soap->connect_timeout;
+ timeout.tv_usec = 0;
+ }
+ else
+ { timeout.tv_sec = -soap->connect_timeout/1000000;
+ timeout.tv_usec = -soap->connect_timeout%1000000;
+ }
+ FD_ZERO(&fds);
+ FD_SET((SOAP_SOCKET)fd, &fds);
+ for (;;)
+ { int r = select((SOAP_SOCKET)(fd + 1), NULL, &fds, NULL, &timeout);
+ if (r > 0)
+ break;
+ if (!r)
+ { soap->errnum = 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connect timeout\n"));
+ soap_set_sender_error(soap, "Timeout", "TCP connect failed in tcp_connect()", SOAP_TCP_ERROR);
+ closesocket((SOAP_SOCKET)fd);
+ return -1;
+ }
+ if (soap_socket_errno != SOAP_EINTR)
+ { soap->errnum = soap_socket_errno;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n"));
+ soap_set_sender_error(soap, tcp_error(soap), "TCP connect failed in tcp_connect()", SOAP_TCP_ERROR);
+ closesocket((SOAP_SOCKET)fd);
+ return -1;
+ }
+ }
+ n = sizeof(soap->errnum);
+ if (!getsockopt((SOAP_SOCKET)fd, SOL_SOCKET, SO_ERROR, (char*)&soap->errnum, &n) && !soap->errnum)
+ break;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n"));
+ soap_set_sender_error(soap, tcp_error(soap), "TCP connect failed in tcp_connect()", SOAP_TCP_ERROR);
+ closesocket((SOAP_SOCKET)fd);
+ return -1;
+ }
+ else
+#endif
+ if (soap_socket_errno != SOAP_EINTR)
+ { soap->errnum = soap_socket_errno;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not connect to host\n"));
+ soap_set_sender_error(soap, tcp_error(soap), "TCP connect failed in tcp_connect()", SOAP_TCP_ERROR);
+ closesocket((SOAP_SOCKET)fd);
+ return -1;
+ }
+ }
+ else
+ break;
+ }
+#ifndef WITH_LEAN
+ if (soap->connect_timeout)
+#if defined(WIN32)
+ { u_long blocking = 0;
+ ioctlsocket((SOAP_SOCKET)fd, FIONBIO, &blocking);
+ }
+/* WR[ */
+#elif defined(VXWORKS)
+ {
+ vx_nonblocking = FALSE;
+ ioctl((SOAP_SOCKET)fd, FIONBIO, (int)(&vx_nonblocking)); /* modified to use fd */
+ }
+/* ]WR */
+#else
+ fcntl((SOAP_SOCKET)fd, F_SETFL, fcntl((SOAP_SOCKET)fd, F_GETFL)&~O_NONBLOCK);
+#endif
+#endif
+ soap->socket = fd;
+#ifdef WITH_OPENSSL
+ soap->imode &= ~SOAP_ENC_SSL;
+ soap->omode &= ~SOAP_ENC_SSL;
+ if (!strncmp(endpoint, "https:", 6))
+ { int r;
+ if (soap->proxy_host)
+ { unsigned int k = soap->omode; /* make sure we only parse HTTP */
+ size_t n = soap->count; /* save the content length */
+ soap->omode &= ~0xFF; /* mask IO and ENC */
+ soap->omode |= SOAP_IO_BUFFER;
+ soap_begin_send(soap);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connecting to proxy server\n"));
+ sprintf(soap->tmpbuf, "CONNECT %s:%d HTTP/%s", host, port, soap->http_version);
+ if ((soap->error = soap->fposthdr(soap, soap->tmpbuf, NULL)))
+ return -1;
+#ifndef WITH_LEAN
+ if (soap->proxy_userid && soap->proxy_passwd && strlen(soap->proxy_userid) + strlen(soap->proxy_passwd) < 761)
+ { sprintf(soap->tmpbuf + 262, "%s:%s", soap->proxy_userid, soap->proxy_passwd);
+ strcpy(soap->tmpbuf, "Basic ");
+ soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, strlen(soap->tmpbuf + 262));
+ if ((soap->error = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf)))
+ return soap->error;
+ }
+#endif
+ if ((soap->error = soap->fposthdr(soap, NULL, NULL))
+ || soap_flush(soap))
+ return -1;
+ soap->omode = k;
+ k = soap->imode;
+ soap->imode &= ~0xFF; /* mask IO and ENC */
+ if (soap_begin_recv(soap))
+ return -1;
+ soap->imode = k;
+ soap->count = n;
+ soap_begin_send(soap);
+ }
+ if (!soap->ctx && (soap->error = soap->fsslauth(soap)))
+ { soap_set_sender_error(soap, "SSL error", "SSL authentication failed in tcp_connect(): check password, key file, and ca file.", SOAP_SSL_ERROR);
+ return -1;
+ }
+ soap->ssl = SSL_new(soap->ctx);
+ if (!soap->ssl)
+ { soap->error = SOAP_SSL_ERROR;
+ return -1;
+ }
+ if (soap->session)
+ { if (!strcmp(soap->session_host, host) && soap->session_port == port)
+ SSL_set_session(soap->ssl, soap->session);
+ SSL_SESSION_free(soap->session);
+ soap->session = NULL;
+ }
+ soap->imode |= SOAP_ENC_SSL;
+ soap->omode |= SOAP_ENC_SSL;
+ soap->bio = BIO_new_socket((SOAP_SOCKET)fd, BIO_NOCLOSE);
+ SSL_set_bio(soap->ssl, soap->bio, soap->bio);
+#ifndef WITH_LEAN
+ if (soap->connect_timeout)
+#ifdef WIN32
+ { u_long nonblocking = 1;
+ ioctlsocket((SOAP_SOCKET)fd, FIONBIO, &nonblocking);
+ }
+#else
+ fcntl((SOAP_SOCKET)fd, F_SETFL, fcntl((SOAP_SOCKET)fd, F_GETFL)|O_NONBLOCK);
+#endif
+#endif
+ for (;;)
+ { if ((r = SSL_connect(soap->ssl)) <= 0)
+ { int err = SSL_get_error(soap->ssl, r);
+ if (err != SSL_ERROR_NONE && err != SSL_ERROR_WANT_READ && err != SSL_ERROR_WANT_WRITE)
+ { soap_set_sender_error(soap, ssl_error(soap, r), "SSL connect failed in tcp_connect()", SOAP_SSL_ERROR);
+ return -1;
+ }
+ if (soap->connect_timeout)
+ { struct timeval timeout;
+ fd_set fds;
+ if (soap->connect_timeout > 0)
+ { timeout.tv_sec = soap->connect_timeout;
+ timeout.tv_usec = 0;
+ }
+ else
+ { timeout.tv_sec = -soap->connect_timeout/1000000;
+ timeout.tv_usec = -soap->connect_timeout%1000000;
+ }
+ FD_ZERO(&fds);
+ FD_SET((SOAP_SOCKET)(soap->socket), &fds);
+ for (;;)
+ { int r = select((SOAP_SOCKET)(soap->socket + 1), &fds, NULL, &fds, &timeout);
+ if (r > 0)
+ break;
+ if (!r)
+ { soap->errnum = 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Connect timeout\n"));
+ soap_set_sender_error(soap, "Timeout", "TCP connect failed in tcp_connect()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ }
+ continue;
+ }
+ }
+ break;
+ }
+#ifndef WITH_LEAN
+ if (soap->connect_timeout)
+#ifdef WIN32
+ { u_long blocking = 0;
+ ioctlsocket((SOAP_SOCKET)fd, FIONBIO, &blocking);
+ }
+#else
+ fcntl((SOAP_SOCKET)fd, F_SETFL, fcntl((SOAP_SOCKET)fd, F_GETFL)&~O_NONBLOCK);
+#endif
+#endif
+ if (soap->require_server_auth)
+ { X509 *peer;
+ int err;
+ if ((err = SSL_get_verify_result(soap->ssl)) != X509_V_OK)
+ { soap_set_sender_error(soap, X509_verify_cert_error_string(err), "SSL certificate cannot be verified in tcp_connect()", SOAP_SSL_ERROR);
+ return -1;
+ }
+ peer = SSL_get_peer_certificate(soap->ssl);
+ if (!peer)
+ { soap_set_sender_error(soap, "SSL error", "No SSL certificate was presented by the peer in tcp_connect()", SOAP_SSL_ERROR);
+ return -1;
+ }
+ X509_NAME_get_text_by_NID(X509_get_subject_name(peer), NID_commonName, soap->msgbuf, sizeof(soap->msgbuf));
+ X509_free(peer);
+ if (soap_tag_cmp(soap->msgbuf, host))
+ { soap_set_sender_error(soap, "SSL error", "SSL certificate host name mismatch in tcp_connect()", SOAP_SSL_ERROR);
+ return -1;
+ }
+ }
+ }
+#endif
+ return fd;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef MAC_CARBON
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_bind(struct soap *soap, const char *host, int port, int backlog)
+{ struct sockaddr_in sockaddr;
+/* WR[ */
+#ifdef WITH_IPV6
+ struct addrinfo *addrinfo;
+ struct addrinfo hints;
+ struct addrinfo resaddr;
+ struct sockaddr_storage addrstorage;
+ int err;
+#endif /* WITH_IPV6 */
+/* ]WR */
+#ifndef WITH_LEAN
+ int len = SOAP_BUFLEN;
+ int set = 1;
+#endif
+ if (soap_valid_socket(soap->master))
+ { closesocket((SOAP_SOCKET)soap->master);
+ soap->master = SOAP_INVALID_SOCKET;
+ }
+ soap->socket = SOAP_INVALID_SOCKET;
+ soap->errmode = 1;
+ if (tcp_init(soap))
+ { soap_set_receiver_error(soap, tcp_error(soap), "TCP init failed in soap_bind()", SOAP_TCP_ERROR);
+ return -1;
+ }
+/* WR[ */
+#ifdef WITH_IPV6
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = PF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_PASSIVE;
+ soap->errmode = 2;
+ if (host)
+ err = getaddrinfo(host, soap_int2s(soap, port), &hints, &addrinfo);
+ else
+ err = getaddrinfo(NULL, soap_int2s(soap, port), &hints, &addrinfo);
+ if (NULL != addrinfo)
+ {
+ resaddr = *addrinfo;
+ addrstorage = *((struct sockaddr_storage *) addrinfo->ai_addr);
+ resaddr.ai_addr = (struct sockaddr *) &addrstorage;
+ freeaddrinfo(addrinfo);
+ }
+ if (err)
+ { soap_set_receiver_error(soap, gai_strerror(err), "TCP getaddrinfo failed in soap_bind()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ soap->errmode = 0;
+ if ((soap->master = socket(resaddr.ai_family, resaddr.ai_socktype, resaddr.ai_protocol)) < 0)
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP socket failed in soap_bind()", SOAP_TCP_ERROR);
+ return -1;
+ }
+#else /* WITH_IPV6 */
+/* ]WR */
+ soap->errmode = 0;
+ if ((soap->master = (int)socket(AF_INET, SOCK_STREAM, 0)) < 0)
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP socket failed in soap_bind()", SOAP_TCP_ERROR);
+ return -1;
+ }
+/* WR[ */
+#endif /* WITH_IPV6 */
+/* ]WR */
+#ifndef WITH_LEAN
+ if (soap->bind_flags && setsockopt((SOAP_SOCKET)soap->master, SOL_SOCKET, soap->bind_flags, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt failed in soap_bind()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ if (soap->keep_alive && setsockopt((SOAP_SOCKET)soap->master, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt SO_KEEPALIVE failed in soap_bind()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ if (setsockopt((SOAP_SOCKET)soap->master, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt SO_SNDBUF failed in soap_bind()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ if (setsockopt((SOAP_SOCKET)soap->master, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt SO_RCVBUF failed in soap_bind()", SOAP_TCP_ERROR);
+ return -1;
+ }
+#ifdef TCP_NODELAY
+ if (setsockopt((SOAP_SOCKET)soap->master, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt TCP_NODELAY failed in soap_bind()", SOAP_TCP_ERROR);
+ return -1;
+ }
+#endif
+#endif
+/* WR[ */
+#ifdef WITH_IPV6
+ soap->errmode = 0;
+ if (bind(soap->master, resaddr.ai_addr, resaddr.ai_addrlen) || listen(soap->master, backlog))
+ {
+ soap->errnum = soap_socket_errno;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host\n"));
+ soap_closesock(soap);
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP bind failed in soap_bind()", SOAP_TCP_ERROR);
+ return -1;
+ }
+#else /* WITH_IPV6 */
+/* ]WR */
+ memset(&sockaddr, 0, sizeof(sockaddr));
+ sockaddr.sin_family = AF_INET;
+ soap->errmode = 2;
+ if (host)
+ { if (soap_gethost(soap, host, &sockaddr.sin_addr))
+ { soap_set_receiver_error(soap, tcp_error(soap), "TCP get host by name failed in soap_bind()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ }
+ else
+ sockaddr.sin_addr.s_addr = htonl(INADDR_ANY);
+ sockaddr.sin_port = htons((short)port);
+ soap->errmode = 0;
+ if (bind((SOAP_SOCKET)soap->master, (struct sockaddr*)&sockaddr, sizeof(sockaddr)) || listen((SOAP_SOCKET)soap->master, backlog))
+ { soap->errnum = soap_socket_errno;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not bind to host\n"));
+ soap_closesock(soap);
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP bind failed in soap_bind()", SOAP_TCP_ERROR);
+ return -1;
+ }
+/* WR[ */
+#endif /* WITH_IPV6 */
+/* ]WR */
+#ifdef WITH_OPENSSL
+ if (!soap->ctx && (soap->error = soap->fsslauth(soap)))
+ return -1;
+#endif
+ return soap->master;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef MAC_CARBON
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_poll(struct soap *soap)
+{
+#ifndef WITH_LEAN
+ struct timeval timeout;
+ fd_set sfd,rfd;
+ int r;
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 0;
+ FD_ZERO(&rfd);
+ FD_ZERO(&sfd);
+ if (soap->socket >= 0)
+ { FD_SET(soap->socket, &rfd);
+ FD_SET(soap->socket, &sfd);
+ r = select(soap->socket + 1, &rfd, &sfd, NULL, &timeout);
+ }
+ else if (soap->master >= 0)
+ { FD_SET(soap->master, &rfd);
+ r = select(soap->master + 1, &rfd, &sfd, NULL, &timeout);
+ }
+ else
+ { FD_SET(soap->sendfd, &sfd);
+ FD_SET(soap->recvfd, &rfd);
+ r = select((soap->sendfd > soap->recvfd ? soap->sendfd : soap->recvfd) + 1, &rfd, &sfd, NULL, &timeout);
+ }
+ if (r > 0)
+ {
+#ifdef WITH_OPENSSL
+ if (soap->ssl)
+ { if ((soap->socket >= 0) && FD_ISSET(soap->socket, &rfd))
+ { char buf = '\0';
+ if (SSL_peek(soap->ssl, &buf, 1) <= 0)
+ return SOAP_EOF;
+ }
+ }
+#endif
+ return SOAP_OK;
+ }
+ if (r < 0 && (soap_valid_socket(soap->master) || soap_valid_socket(soap->socket)) && soap_socket_errno != SOAP_EINTR)
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "select failed in soap_poll()", SOAP_TCP_ERROR);
+ return soap->error = SOAP_TCP_ERROR;
+ }
+ else
+ soap->errnum = soap_errno;
+ return SOAP_EOF;
+#else
+ return SOAP_OK;
+#endif
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef MAC_CARBON
+#ifndef PALM_1
+static int
+tcp_accept(struct soap *soap, int s, struct sockaddr *a, int *n)
+{
+#if defined(SOCKLEN_T)
+ return (int)accept((SOAP_SOCKET)s, a, (SOCKLEN_T*)n);
+#elif defined(__socklen_t_defined) || defined(_SOCKLEN_T) || defined(CYGWIN)
+ return (int)accept((SOAP_SOCKET)s, a, (socklen_t*)n);
+#elif defined(WIN32) || defined(__APPLE__) || defined(HP_UX) || defined(SUN_OS) || defined(OPENSERVER) || defined(TRU64) || defined(VXWORKS)
+ return (int)accept((SOAP_SOCKET)s, a, n);
+#else
+ return (int)accept((SOAP_SOCKET)s, a, (size_t*)n);
+#endif
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef MAC_CARBON
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_accept(struct soap *soap)
+{
+/* WR[ */
+#ifdef WITH_IPV6
+ struct sockaddr_storage sockaddr;
+#else /* WITH_IPV6 */
+/* ]WR */
+ struct sockaddr_in sockaddr;
+/* WR[ */
+#endif
+/* ]WR */
+ int n = (int)sizeof(struct sockaddr);
+#ifndef WITH_LEAN
+ int len = SOAP_BUFLEN;
+ int set = 1;
+#endif
+ memset(&sockaddr, 0, sizeof(sockaddr));
+ soap->socket = SOAP_INVALID_SOCKET;
+ soap->errmode = 0;
+ if (soap_valid_socket(soap->master))
+ { for (;;)
+ {
+#ifndef WITH_LEAN
+ if (soap->accept_timeout)
+ { struct timeval timeout;
+ fd_set fd;
+ if (soap->accept_timeout > 0)
+ { timeout.tv_sec = soap->accept_timeout;
+ timeout.tv_usec = 0;
+ }
+ else
+ { timeout.tv_sec = -soap->accept_timeout/1000000;
+ timeout.tv_usec = -soap->accept_timeout%1000000;
+ }
+ FD_ZERO(&fd);
+ FD_SET((SOAP_SOCKET)soap->master, &fd);
+ for (;;)
+ { int r = select((SOAP_SOCKET)(soap->master + 1), &fd, &fd, NULL, &timeout);
+ if (r > 0)
+ break;
+ if (!r)
+ { soap->errnum = 0;
+ soap_set_receiver_error(soap, "Timeout", "TCP accept failed in soap_accept()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ if (soap_socket_errno != SOAP_EINTR)
+ { soap->errnum = soap_socket_errno;
+ soap_closesock(soap);
+ soap_set_sender_error(soap, tcp_error(soap), "TCP accept failed in soap_accept()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ }
+#if defined(WIN32)
+ { u_long nonblocking = 1;
+ ioctlsocket((SOAP_SOCKET)soap->master, FIONBIO, &nonblocking);
+ }
+#elif defined(VXWORKS)
+ { vx_nonblocking = TRUE;
+ ioctl((SOAP_SOCKET)soap->master, FIONBIO, (int)(&vx_nonblocking));
+ }
+#else
+ fcntl((SOAP_SOCKET)soap->master, F_SETFL, fcntl((SOAP_SOCKET)soap->master, F_GETFL)|O_NONBLOCK);
+#endif
+ }
+ else
+#if defined(WIN32)
+ { u_long blocking = 0;
+ ioctlsocket((SOAP_SOCKET)soap->master, FIONBIO, &blocking);
+ }
+/* WR[ */
+#elif defined(VXWORKS)
+ {
+ vx_nonblocking = FALSE;
+ ioctl((SOAP_SOCKET)soap->master, FIONBIO, (int)(&vx_nonblocking));
+ }
+/* ]WR */
+#else
+ fcntl((SOAP_SOCKET)soap->master, F_SETFL, fcntl((SOAP_SOCKET)soap->master, F_GETFL)&~O_NONBLOCK);
+#endif
+#endif
+ if ((soap->socket = soap->faccept(soap, soap->master, (struct sockaddr*)&sockaddr, &n)) >= 0)
+ {
+/* WR[ */
+#ifdef WITH_IPV6
+/* Use soap->host to store the numeric form of the remote host */
+ getnameinfo((struct sockaddr*)&sockaddr, n, soap->host, sizeof(soap->host), NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV);
+ soap->ip = 0; /* info stored in soap->host */
+ soap->port = 0; /* info stored in soap->host */
+#else /* WITH_IPV6 */
+/* ]WR */
+ soap->ip = ntohl(sockaddr.sin_addr.s_addr);
+ soap->port = (int)ntohs(sockaddr.sin_port);
+/* WR[ */
+#endif /* WITH_IPV6 */
+/* ]WR */
+ soap->keep_alive = ((soap->imode & SOAP_IO_KEEPALIVE) != 0);
+#ifndef WITH_LEAN
+ if (soap->accept_flags & SO_LINGER)
+ { struct linger linger;
+ memset(&linger, 0, sizeof(struct linger));
+ linger.l_onoff = 1;
+ linger.l_linger = 0;
+ if (setsockopt((SOAP_SOCKET)soap->socket, SOL_SOCKET, SO_LINGER, (char*)&linger, sizeof(struct linger)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt SO_LINGER failed in soap_accept()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ }
+ if ((soap->accept_flags & ~SO_LINGER) && setsockopt((SOAP_SOCKET)soap->socket, SOL_SOCKET, soap->accept_flags & ~SO_LINGER, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt failed in soap_accept()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ if (soap->keep_alive && setsockopt((SOAP_SOCKET)soap->socket, SOL_SOCKET, SO_KEEPALIVE, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt SO_KEEPALIVE failed in soap_accept()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ if (setsockopt((SOAP_SOCKET)soap->socket, SOL_SOCKET, SO_SNDBUF, (char*)&len, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt SO_SNDBUF failed in soap_accept()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ if (setsockopt((SOAP_SOCKET)soap->socket, SOL_SOCKET, SO_RCVBUF, (char*)&len, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt SO_RCVBUF failed in soap_accept()", SOAP_TCP_ERROR);
+ return -1;
+ }
+#ifdef TCP_NODELAY
+ if (setsockopt((SOAP_SOCKET)soap->socket, IPPROTO_TCP, TCP_NODELAY, (char*)&set, sizeof(int)))
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP setsockopt TCP_NODELAY failed in soap_accept()", SOAP_TCP_ERROR);
+ return -1;
+ }
+#endif
+#endif
+ if (soap->accept_timeout)
+ {
+#if defined(WIN32)
+ u_long blocking = 0;
+ ioctlsocket((SOAP_SOCKET)soap->master, FIONBIO, &blocking);
+ ioctlsocket((SOAP_SOCKET)soap->socket, FIONBIO, &blocking);
+/* WR[ */
+#elif defined(VXWORKS)
+ vx_nonblocking = FALSE;
+ ioctl((SOAP_SOCKET)soap->master, FIONBIO, (int)(&vx_nonblocking));
+ ioctl((SOAP_SOCKET)soap->socket, FIONBIO, (int)(&vx_nonblocking));
+/* ]WR */
+#else
+ fcntl((SOAP_SOCKET)soap->master, F_SETFL, fcntl((SOAP_SOCKET)soap->master, F_GETFL)&~O_NONBLOCK);
+ fcntl((SOAP_SOCKET)soap->socket, F_SETFL, fcntl((SOAP_SOCKET)soap->socket, F_GETFL)&~O_NONBLOCK);
+#endif
+ }
+ return soap->socket;
+ }
+ if (soap_socket_errno != SOAP_EINTR && soap_socket_errno != SOAP_EAGAIN)
+ { soap->errnum = soap_socket_errno;
+ soap_set_receiver_error(soap, tcp_error(soap), "TCP accept failed in soap_accept()", SOAP_TCP_ERROR);
+ return -1;
+ }
+ }
+ }
+ else
+ { soap_set_receiver_error(soap, tcp_error(soap), "TCP no master socket in soap_accept()", SOAP_TCP_ERROR);
+ return -1;
+ }
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef MAC_CARBON
+#ifndef PALM_1
+static int
+tcp_disconnect(struct soap *soap)
+{
+#ifdef WITH_OPENSSL
+ if (soap->ssl)
+ { int r, s = 0;
+ if (soap->session)
+ SSL_SESSION_free(soap->session);
+ if (*soap->host)
+ { soap->session = SSL_get1_session(soap->ssl);
+ if (soap->session)
+ { strcpy(soap->session_host, soap->host);
+ soap->session_port = soap->port;
+ }
+ }
+ r = SSL_shutdown(soap->ssl);
+ if (r != 1)
+ { s = ERR_get_error();
+ if (s)
+ { if (soap_valid_socket(soap->socket))
+ { shutdown((SOAP_SOCKET)soap->socket, 1);
+ soap->socket = SOAP_INVALID_SOCKET;
+ }
+ r = SSL_shutdown(soap->ssl);
+ }
+ }
+ DBGLOG(TEST, if (s) SOAP_MESSAGE(fdebug, "Shutdown failed: %d\n", SSL_get_error(soap->ssl, r)));
+ SSL_free(soap->ssl);
+ soap->ssl = NULL;
+ if (s)
+ return SOAP_SSL_ERROR;
+ ERR_remove_state(0);
+ }
+#endif
+ if (soap_valid_socket(soap->socket))
+ { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Closing socket %d\n", soap->socket));
+ shutdown((SOAP_SOCKET)soap->socket, 2);
+ closesocket((SOAP_SOCKET)soap->socket);
+ soap->socket = SOAP_INVALID_SOCKET;
+ }
+ return SOAP_OK;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_closesock(struct soap *soap)
+{ register int status = soap->error;
+#ifndef MAC_CARBON
+ if (status == SOAP_EOF || !soap->keep_alive)
+ { if ((soap->error = soap->fclose(soap)))
+ return soap->error;
+ soap->socket = SOAP_INVALID_SOCKET;
+ }
+#endif
+#ifdef WITH_ZLIB
+ if (soap->zlib_state == SOAP_ZLIB_DEFLATE)
+ deflateEnd(&soap->d_stream);
+ else if (soap->zlib_state == SOAP_ZLIB_INFLATE)
+ inflateEnd(&soap->d_stream);
+ soap->zlib_state = SOAP_ZLIB_NONE;
+#endif
+ return soap->error = status;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_hash(register const char *s)
+{ register int h = 0;
+ while (*s)
+ h += *s++ & 0x1F;
+ return h % SOAP_IDHASH;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static void
+soap_init_pht(struct soap *soap)
+{ register int i;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing pointer hashtable\n"));
+ for (i = 0; i < SOAP_PTRHASH; i++)
+ soap->pht[i] = NULL;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+struct soap*
+SOAP_FMAC2
+soap_new()
+{ struct soap *soap = (struct soap*)SOAP_MALLOC(sizeof(struct soap));
+ if (soap)
+ soap_init(soap);
+ return soap;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+struct soap*
+SOAP_FMAC2
+soap_new1(int mode)
+{ return soap_new2(mode, mode);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+struct soap*
+SOAP_FMAC2
+soap_new2(int imode, int omode)
+{ struct soap *soap = (struct soap*)SOAP_MALLOC(sizeof(struct soap));
+ if (soap)
+ soap_init2(soap, imode, omode);
+ return soap;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+static void
+soap_free_pht(struct soap *soap)
+{ register struct soap_plist *pp, *next;
+ register int i;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free pointer hashtable\n"));
+ for (i = 0; i < SOAP_PTRHASH; i++)
+ { for (pp = soap->pht[i]; pp; pp = next)
+ { next = pp->next;
+ SOAP_FREE(pp);
+ }
+ soap->pht[i] = NULL;
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_embed_element(struct soap *soap, const void *p, const char *tag, int type)
+{ register int i;
+ struct soap_plist *pp;
+ if (soap->version != 1)
+ soap->encoding = 1;
+ if ((i = soap_pointer_lookup(soap, p, type, &pp)))
+ { if (soap_is_embedded(soap, pp) || soap_is_single(soap, pp))
+ return 0;
+ soap_set_embedded(soap, pp);
+ }
+ return i;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_embed_array(struct soap *soap, const void *p, const struct soap_array *a, int n, const char *tag, int type)
+{ register int i;
+ struct soap_plist *pp;
+ if (soap->version != 1)
+ soap->encoding = 1;
+ if ((i = soap_array_pointer_lookup(soap, p, a, n, type, &pp)))
+ { if (soap_is_embedded(soap, pp) || soap_is_single(soap, pp))
+ return 0;
+ soap_set_embedded(soap, pp);
+ }
+ return i;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_pointer_lookup(struct soap *soap, const void *p, int type, struct soap_plist **ppp)
+{ register struct soap_plist *pp;
+ *ppp = NULL;
+ if (p)
+ for (pp = soap->pht[soap_hash_ptr(p)]; pp; pp = pp->next)
+ if (pp->ptr == p && pp->type == type)
+ { *ppp = pp;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup location=%p type=%d id=%d\n", p, type, pp->id));
+ return pp->id;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup location=%p type=%d: not found\n", p, type));
+ return 0;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_array_pointer_lookup(struct soap *soap, const void *p, const struct soap_array *a, int n, int type, struct soap_plist **ppp)
+{ struct soap_plist *pp;
+ *ppp = NULL;
+ if (!p || !a->__ptr)
+ return 0;
+ for (pp = soap->pht[soap_hash_ptr(a->__ptr)]; pp; pp = pp->next)
+ if (pp->type == type && pp->array && pp->array->__ptr == a->__ptr && pp->array->__size == n)
+ { *ppp = pp;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d id=%d\n", a->__ptr, type, pp->id));
+ return pp->id;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array lookup location=%p type=%d: not found\n", a->__ptr, type));
+ return 0;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_pointer_enter(struct soap *soap, const void *p, int type, struct soap_plist **ppp)
+{ register struct soap_plist *pp;
+ if (!p)
+ { *ppp = NULL;
+ return 0;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enter location=%p type=%d id=%lu\n", p, type, soap->idnum+1));
+ *ppp = pp = (struct soap_plist*)SOAP_MALLOC(sizeof(struct soap_plist));
+ if (pp)
+ { register int h = soap_hash_ptr(p);
+ pp->next = soap->pht[h];
+ pp->type = type;
+ if ((soap->mode & SOAP_XML_TREE) || soap->part == SOAP_IN_HEADER)
+ { pp->mark1 = 0;
+ pp->mark2 = 0;
+ }
+ else
+ { pp->mark1 = 1;
+ pp->mark2 = 1;
+ }
+ pp->ptr = p;
+ pp->array = NULL;
+ soap->pht[h] = pp;
+ return pp->id = ++soap->idnum;
+ }
+ return 0;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_array_pointer_enter(struct soap *soap, const void *p, const struct soap_array *a, int type, struct soap_plist **ppp)
+{ struct soap_plist *pp;
+ *ppp = NULL;
+ if (!p || !a->__ptr)
+ return 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array enter location=%p size=%d type=%d id=%lu\n", a->__ptr, a->__size, type, soap->idnum+1));
+ *ppp = pp = (struct soap_plist*)SOAP_MALLOC(sizeof(struct soap_plist));
+ if (pp)
+ { register int h = soap_hash_ptr(a->__ptr);
+ pp->next = soap->pht[h];
+ pp->type = type;
+ if ((soap->mode & SOAP_XML_TREE) || soap->part == SOAP_IN_HEADER)
+ { pp->mark1 = 0;
+ pp->mark2 = 0;
+ }
+ else
+ { pp->mark1 = 1;
+ pp->mark2 = 1;
+ }
+ pp->ptr = p;
+ pp->array = a;
+ soap->pht[h] = pp;
+ return pp->id = ++soap->idnum;
+ }
+ return 0;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_begin_count(struct soap *soap)
+{ soap_clr_attr(soap);
+ soap_set_local_namespaces(soap);
+ if (soap->mode & SOAP_ENC_DIME)
+ soap->mode = soap->omode | SOAP_IO_LENGTH | SOAP_ENC_DIME;
+ else
+ { soap->mode = soap->omode;
+ if (((soap->mode & (SOAP_IO_STORE | SOAP_IO_CHUNK)) || (soap->mode & SOAP_ENC_XML)) && !soap->fprepare)
+ soap->mode &= ~SOAP_IO_LENGTH;
+ else
+ soap->mode |= SOAP_IO_LENGTH;
+ }
+ if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH)
+ { if (!(soap->mode & SOAP_ENC_DIME))
+ soap->mode &= ~SOAP_IO_LENGTH;
+ if (soap->mode & SOAP_ENC_XML)
+ soap->mode |= SOAP_IO_BUFFER;
+ else
+ soap->mode |= SOAP_IO_STORE;
+ }
+ soap->count = 0;
+ soap->ns = 0;
+ soap->null = 0;
+ soap->position = 0;
+ soap->mustUnderstand = 0;
+ soap->encoding = 0;
+ soap->part = SOAP_BEGIN;
+ soap->idnum = 0;
+ soap->dime_count = 0; /* count # of attachments */
+ soap->dime_size = 0; /* accumulate total size of attachments */
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin count phase (socket=%d mode=%hd count=%lu)\n", soap->socket, soap->mode, (unsigned long)soap->count));
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_begin_send(struct soap *soap)
+{ soap_clr_attr(soap);
+ soap_set_local_namespaces(soap);
+ soap->mode = (soap->omode & ~SOAP_IO_LENGTH) | (soap->mode & SOAP_ENC_DIME);
+ if ((soap->mode & SOAP_ENC_ZLIB) && (soap->mode & SOAP_IO) == SOAP_IO_FLUSH)
+ { if (soap->mode & SOAP_ENC_XML)
+ soap->mode |= SOAP_IO_BUFFER;
+ else
+ soap->mode |= SOAP_IO_STORE;
+ }
+ if ((soap->mode & SOAP_IO) == SOAP_IO_FLUSH && soap_valid_socket(soap->socket))
+ { if (soap->count || (soap->mode & SOAP_ENC_XML))
+ soap->mode |= SOAP_IO_BUFFER;
+ else
+ soap->mode |= SOAP_IO_STORE;
+ }
+ if ((soap->mode & SOAP_IO) == SOAP_IO_STORE)
+ soap_new_block(soap);
+ if (!(soap->mode & SOAP_IO_KEEPALIVE))
+ soap->keep_alive = 0;
+#ifdef WIN32
+#ifndef UNDER_CE
+#ifndef WITH_FASTCGI
+ if (!soap_valid_socket(soap->socket)) /* Set win32 stdout or soap->sendfd to BINARY, e.g. to support DIME */
+#ifdef __BORLANDC__
+ setmode((SOAP_SOCKET)soap->sendfd, O_BINARY);
+#else
+ _setmode((SOAP_SOCKET)soap->sendfd, _O_BINARY);
+#endif
+#endif
+#endif
+#endif
+ if (soap->mode & SOAP_IO)
+ { soap->bufidx = 0;
+ soap->buflen = 0;
+ }
+ soap->chunksize = 0;
+ soap->ns = 0;
+ soap->null = 0;
+ soap->position = 0;
+ soap->mustUnderstand = 0;
+ soap->encoding = 0;
+ soap->part = SOAP_BEGIN;
+ soap->idnum = 0;
+ soap->level = 0;
+#ifdef WITH_ZLIB
+ soap->z_ratio_out = 1.0;
+ if ((soap->mode & SOAP_ENC_ZLIB) && soap->zlib_state != SOAP_ZLIB_DEFLATE)
+ {
+#ifdef WITH_GZIP
+ memcpy(soap->z_buf, "\37\213\10\0\0\0\0\0\0\377", 10);
+ soap->d_stream.next_out = (Byte*)soap->z_buf + 10;
+ soap->d_stream.avail_out = SOAP_BUFLEN - 10;
+ soap->z_crc = crc32(0L, NULL, 0);
+ if (deflateInit2(&soap->d_stream, soap->z_level, Z_DEFLATED, -MAX_WBITS, 8, Z_DEFAULT_STRATEGY) != Z_OK)
+#else
+ soap->d_stream.next_out = (Byte*)soap->z_buf;
+ soap->d_stream.avail_out = SOAP_BUFLEN;
+ if (deflateInit(&soap->d_stream, soap->z_level) != Z_OK)
+#endif
+ return soap->error = SOAP_ZLIB_ERROR;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflate initialized\n"));
+ soap->zlib_state = SOAP_ZLIB_DEFLATE;
+ }
+#endif
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin send phase (socket=%d mode=%hd count=%lu)\n", soap->socket, soap->mode, (unsigned long)soap->count));
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_embedded(struct soap *soap, const void *p, int t)
+{ struct soap_plist *pp;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded %p type=%d\n", p, t));
+ if (soap_pointer_lookup(soap, p, t, &pp))
+ { pp->mark1 = 1;
+ pp->mark2 = 1;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded %p type=%d set to %d\n", p, t, (int)pp->mark1));
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_reference(struct soap *soap, const void *p, int t)
+{ register int i;
+ struct soap_plist *pp;
+ if (!p)
+ return 1;
+ i = soap_pointer_lookup(soap, p, t, &pp);
+ if (i)
+ { if (pp->mark1 == 0)
+ { pp->mark1 = 2;
+ pp->mark2 = 2;
+ }
+ }
+ else
+ { soap_pointer_enter(soap, p, t, &pp);
+ pp->mark1 = 0;
+ pp->mark2 = 0;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reference %p type = %d (%d %d)\n", p, t, (int)pp->mark1, (int)pp->mark2));
+ return pp->mark1;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_array_reference(struct soap *soap, const void *p, const struct soap_array *a, int n, int t)
+{ register int i;
+ struct soap_plist *pp;
+ if (!p)
+ return 1;
+ i = soap_array_pointer_lookup(soap, p, a, n, t, &pp);
+ if (i)
+ { if (pp->mark1 == 0)
+ { pp->mark1 = 2;
+ pp->mark2 = 2;
+ }
+ }
+ else if (!soap_array_pointer_enter(soap, p, a, t, &pp))
+ return 1;
+ pp->mark1 = 0;
+ pp->mark2 = 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Array reference %p ptr=%p size=%d type = %d (%d %d)\n", p, a->__ptr, n, t, (int)pp->mark1, (int)pp->mark2));
+ return pp->mark1;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_embedded_id(struct soap *soap, int id, const void *p, int t)
+{ struct soap_plist *pp;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id %p type=%d id=%d\n", p, t, id));
+ if (soap->version == 1 && soap->encodingStyle && !(soap->mode & (SOAP_XML_TREE | SOAP_XML_GRAPH)) && soap->part != SOAP_IN_HEADER)
+ { if (id < 0)
+ { id = soap_pointer_lookup(soap, p, t, &pp);
+ if (id > 0 && pp)
+ { if (soap->mode & SOAP_IO_LENGTH)
+ pp->mark1 = 2;
+ else
+ pp->mark2 = 2;
+ }
+ return -1;
+ }
+ return id;
+ }
+ if (id < 0)
+ id = soap_pointer_lookup(soap, p, t, &pp);
+ else
+ soap_pointer_lookup(soap, p, t, &pp);
+ if (id > 0 && pp)
+ { if (soap->mode & SOAP_IO_LENGTH)
+ pp->mark1 = 1;
+ else
+ pp->mark2 = 1;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Embedded_id id=%d %p type=%d = (%d %d)\n", id, p, t, (int)pp->mark1, (int)pp->mark2));
+ }
+ return id;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_is_embedded(struct soap *soap, struct soap_plist *pp)
+{ if (!pp)
+ return 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Is embedded? %d %d\n", (int)pp->mark1, (int)pp->mark2));
+ if (soap->version == 1 && soap->encodingStyle && !(soap->mode & (SOAP_XML_TREE | SOAP_XML_GRAPH)) && soap->part != SOAP_IN_HEADER)
+ { if (soap->mode & SOAP_IO_LENGTH)
+ return pp->mark1 != 0;
+ return pp->mark2 != 0;
+ }
+ if (soap->mode & SOAP_IO_LENGTH)
+ return pp->mark1 == 1;
+ return pp->mark2 == 1;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_is_single(struct soap *soap, struct soap_plist *pp)
+{ if ((soap->mode & SOAP_XML_TREE) || soap->part == SOAP_IN_HEADER)
+ return 1;
+ if (!pp)
+ return 0;
+ if (soap->mode & SOAP_IO_LENGTH)
+ return pp->mark1 == 0;
+ return pp->mark2 == 0;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_is_multi(struct soap *soap, struct soap_plist *pp)
+{ if (soap->mode & SOAP_IO_LENGTH)
+ return pp->mark1 == 2;
+ return pp->mark2 == 2;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_set_embedded(struct soap *soap, struct soap_plist *pp)
+{ if (!pp)
+ return;
+ if (soap->mode & SOAP_IO_LENGTH)
+ pp->mark1 = 1;
+ else
+ pp->mark2 = 1;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEANER
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_set_attached(struct soap *soap, struct soap_plist *pp, const char *id, const char *type, const char *options, size_t size)
+{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set attached id='%s' type='%s'\n", id?id:"", type?type:""));
+ if (soap->mode & SOAP_IO_LENGTH)
+ { if (pp->mark1 != 3)
+ { pp->mark1 = 3;
+ soap->dime_count++; /* one more attachment found */
+ soap->dime_size += 12; /* increase total size (DIME fields) */
+ if (id)
+ soap->dime_size += (strlen(id)+3)&(~3);
+ if (type)
+ soap->dime_size += (strlen(type)+3)&(~3);
+ if (options)
+ soap->dime_size += 4 + (((((unsigned char)options[2] << 8 | (unsigned char)options[3]))+3)&(~3));
+ soap->dime_size += (size+3)&(~3);
+ }
+ }
+ else if (pp->mark2 != 3)
+ pp->mark2 = 3;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static void
+soap_init_iht(struct soap *soap)
+{ register int i;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing ID hashtable\n"));
+ for (i = 0; i < SOAP_IDHASH; i++)
+ soap->iht[i] = NULL;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+static void
+soap_free_iht(struct soap *soap)
+{ register int i;
+ register struct soap_ilist *ip, *p;
+ register struct soap_flist *fp, *q;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free ID hashtable\n"));
+ for (i = 0; i < SOAP_IDHASH; i++)
+ { for (ip = soap->iht[i]; ip; ip = p)
+ { for (fp = ip->flist; fp; fp = q)
+ { q = fp->next;
+ SOAP_FREE(fp);
+ }
+ p = ip->next;
+ SOAP_FREE(ip);
+ }
+ soap->iht[i] = NULL;
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+static struct soap_ilist *
+soap_hlookup(struct soap *soap, const char *id)
+{ register struct soap_ilist *ip;
+ for (ip = soap->iht[soap_hash(id)]; ip; ip = ip->next)
+ if (!strcmp(ip->id, id))
+ return ip;
+ return NULL;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+struct soap_ilist *
+SOAP_FMAC2
+soap_lookup(struct soap *soap, const char *id)
+{ register struct soap_ilist *ip;
+ ip = soap_hlookup(soap, id);
+#ifndef WITH_LEANER
+ if (!ip && *id != '#' && !strchr(id, ':')) /* try content id "cid:" with DIME attachments */
+ { char cid[SOAP_TAGLEN];
+ strcpy(cid, "cid:");
+ strncat(cid + 4, id, sizeof(cid) - 5);
+ cid[sizeof(cid) - 1] = '\0';
+ ip = soap_hlookup(soap, cid);
+ }
+#endif
+ return ip;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+struct soap_ilist *
+SOAP_FMAC2
+soap_enter(struct soap *soap, const char *id)
+{ register int h;
+ register struct soap_ilist *ip;
+ ip = (struct soap_ilist*)SOAP_MALLOC(sizeof(struct soap_ilist) + strlen(id));
+ if (ip)
+ { h = soap_hash(id);
+ strcpy(ip->id, id);
+ ip->next = soap->iht[h];
+ soap->iht[h] = ip;
+ return ip;
+ }
+ return NULL;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void*
+SOAP_FMAC2
+soap_malloc(struct soap *soap, size_t n)
+{ register char *p;
+ if (!n)
+ return NULL;
+ if (!soap)
+ return SOAP_MALLOC(n);
+ n += (-(long)n) & 7;
+ if (!(p = (char*)SOAP_MALLOC(n + sizeof(void*) + sizeof(size_t))))
+ { soap->error = SOAP_EOM;
+ return NULL;
+ }
+ /* keep chain of alloced cells for later destruction */
+ soap->alloced = 1;
+ *(void**)(p + n) = soap->alist;
+ *(size_t*)(p + n + sizeof(void*)) = n;
+ soap->alist = p + n;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Malloc %u bytes at location %p\n", (unsigned int)n, p));
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_dealloc(struct soap *soap, void *p)
+{ if (!soap)
+ return;
+ if (p)
+ { register char **q;
+ for (q = (char**)&soap->alist; *q; q = *(char***)q)
+ { if (p == (void*)(*q - *(size_t*)(*q + sizeof(void*))))
+ { *q = **(char***)q;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Freed data at %p\n", p));
+ SOAP_FREE(p);
+ return;
+ }
+ }
+ soap_delete(soap, p);
+ }
+ else
+ { register char *q;
+ while (soap->alist)
+ { q = (char*)soap->alist;
+ soap->alist = *(void**)q;
+ q -= *(size_t*)(q + sizeof(void*));
+ if (q == (char*)soap->fault)
+ soap->fault = NULL; /* this was deallocated */
+ else if (q == (char*)soap->header)
+ soap->header = NULL; /* this was deallocated */
+ SOAP_FREE(q);
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Dealloc all data done\n"));
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_delete(struct soap *soap, void *p)
+{ register struct soap_clist **cp = &soap->clist;
+ if (p)
+ { while (*cp)
+ { if (p == (*cp)->ptr)
+ { register struct soap_clist *q = *cp;
+ *cp = q->next;
+ q->fdelete(q);
+ SOAP_FREE(q);
+ return;
+ }
+ cp = &(*cp)->next;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not dealloc data %p: address not in list\n", p));
+ }
+ else
+ { while (*cp)
+ { register struct soap_clist *q = *cp;
+ *cp = q->next;
+ if (q->ptr == (void*)soap->fault)
+ soap->fault = NULL; /* this was deallocated */
+ else if (q->ptr == (void*)soap->header)
+ soap->header = NULL; /* this was deallocated */
+ q->fdelete(q);
+ SOAP_FREE(q);
+ }
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+struct soap_clist *
+SOAP_FMAC2
+soap_link(struct soap *soap, void *p, int t, int n, void (*fdelete)(struct soap_clist*))
+{ register struct soap_clist *cp;
+ if ((cp = (struct soap_clist*)SOAP_MALLOC(sizeof(struct soap_clist))))
+ { cp->next = soap->clist;
+ cp->type = t;
+ cp->size = n;
+ cp->ptr = p;
+ cp->fdelete = fdelete;
+ soap->clist = cp;
+ }
+ return cp;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_unlink(struct soap *soap, const void *p)
+{ register char **q;
+ register struct soap_clist **cp;
+ if (!soap || !p)
+ return;
+ for (q = (char**)&soap->alist; *q; q = *(char***)q)
+ { if (p == (void*)(*q - *(size_t*)(*q + sizeof(void*))))
+ { *q = **(char***)q;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked data %p\n", p));
+ return;
+ }
+ }
+ for (cp = &soap->clist; *cp; cp = &(*cp)->next)
+ { if (p == (*cp)->ptr)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unlinked class instance %p\n", p));
+ q = (char**)*cp;
+ *cp = (*cp)->next;
+ SOAP_FREE(q);
+ return;
+ }
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_lookup_type(struct soap *soap, const char *id)
+{ register struct soap_ilist *ip;
+ if (*id)
+ { ip = soap_lookup(soap, id);
+ if (ip)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Lookup id='%s' type=%d\n", id, ip->type));
+ return ip->type;
+ }
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "lookup type id='%s' NOT FOUND! Need to get it from xsi:type\n", id));
+ return 0;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void*
+SOAP_FMAC2
+soap_id_lookup(struct soap *soap, const char *id, void **p, int t, size_t n, unsigned int k)
+{ struct soap_ilist *ip;
+ void **q;
+ if (*id == '\0')
+ return p;
+ soap->alloced = 0;
+ if (!p)
+ p = (void**)soap_malloc(soap, sizeof(void*));
+ ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */
+ if (!ip)
+ { ip = soap_enter(soap, id); /* new hash table entry for string id */
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding first href='%s' %p (%u bytes)\n", id, p, (unsigned int)n));
+ ip->type = t;
+ ip->size = n;
+ ip->link = p;
+ ip->copy = NULL;
+ ip->flist = NULL;
+ ip->ptr = NULL;
+ ip->level = k;
+ *p = NULL;
+ }
+ else if (!soap->blist && ip->ptr)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolved href='%s' type='%d' (%u bytes)\n", id, t, (unsigned int)n));
+ if (ip->type != t)
+ { soap->error = SOAP_HREF;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Object mismatch: id's type='%d' href's type='%d'\n", ip->type, t));
+ return NULL;
+ }
+ while (ip->level < k)
+ { q = (void**)soap_malloc(soap, sizeof(void*));
+ if (!q)
+ return NULL;
+ *p = (void*)q;
+ p = q;
+ k--;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Descending one level...\n"));
+ }
+ *p = ip->ptr;
+ }
+ else if (ip->level > k)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolving level %u pointers to href='%s'\n", ip->level, id));
+ while (ip->level > k)
+ { void *s, **r = &ip->link;
+ q = (void**)ip->link;
+ while (q)
+ { *r = (void*)soap_malloc(soap, sizeof(void*));
+ s = *q;
+ *q = *r;
+ r = *(void***)q;
+ q = (void**)s;
+ }
+ *r = NULL;
+ ip->size = n;
+ ip->copy = NULL;
+ ip->level = ip->level - 1;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Descending one level...\n"));
+ }
+ q = (void**)ip->link;
+ ip->link = p;
+ *p = (void*)q;
+ }
+ else
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarded href='%s' (%u bytes)\n", id, (unsigned int)n));
+ while (ip->level < k)
+ { q = (void**)soap_malloc(soap, sizeof(void*));
+ *p = q;
+ p = q;
+ k--;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Descending one level...\n"));
+ }
+ q = (void**)ip->link;
+ ip->link = p;
+ *p = (void*)q;
+ }
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void*
+SOAP_FMAC2
+soap_id_forward(struct soap *soap, const char *href, void *p, int t, size_t n)
+{ struct soap_ilist *ip;
+ if (!p || !*href)
+ return p;
+ ip = soap_lookup(soap, soap->href); /* lookup pointer to hash table entry for string id */
+ if (!ip)
+ { if (n >= sizeof(void*))
+ { ip = soap_enter(soap, href); /* new hash table entry for string id */
+ ip->type = t;
+ ip->size = n;
+ ip->link = NULL;
+ ip->copy = p;
+ ip->flist = NULL;
+ *(void**)p = NULL;
+ ip->ptr = NULL;
+ ip->level = 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding first copying address %p for type %d href='%s'\n", p, t, href));
+ return p;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding problem: copying location %p too small (%u) for href='%s'\n", p, (unsigned int)n, href));
+ soap->error = SOAP_HREF;
+ return NULL;
+ }
+ else if (ip->ptr)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying value from location %p to location %p to resolve href='%s'\n", ip->ptr, p, href));
+ memcpy(p, ip->ptr, n);
+ }
+ else if (n >= sizeof(void*))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding copying address %p for type %d href='%s' (prev in chain = %p)\n", p, t, href, ip->copy));
+ *(void**)p = ip->copy;
+ ip->copy = p;
+ return p;
+ }
+ else
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Forwarding problem: copying location %p too small (%u) for href='%s'\n", p, (unsigned int)n, href));
+ soap->error = SOAP_HREF; /* href to object too small to hold pointer */
+ return NULL;
+ }
+ return ip->ptr;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void*
+SOAP_FMAC2
+soap_id_enter(struct soap *soap, const char *id, void *p, int t, size_t n, int k)
+{ struct soap_ilist *ip;
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Enter id='%s' type=%d loc=%p size=%d level=%d\n", id, t, p, (int)n, k));
+ soap->alloced = 0;
+ if (*id == '\0')
+ { if (!p)
+ return soap_malloc(soap, n);
+ else
+ return p;
+ }
+ ip = soap_lookup(soap, id); /* lookup pointer to hash table entry for string id */
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Lookup entry id='%s'\n", id));
+ if (!ip)
+ { ip = soap_enter(soap, id); /* new hash table entry for string id */
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "New entry id='%s' type=%d size=%u\n", id, t, (unsigned int)n));
+ ip->type = t;
+ ip->size = n;
+ ip->link = NULL;
+ ip->copy = NULL;
+ ip->flist = NULL;
+ if (!p)
+ p = soap_malloc(soap, n);
+ ip->ptr = p;
+ ip->level = k;
+ }
+ else if (ip->ptr) /* storage address was forwarded */
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Multiply defined id='%s'\n", id));
+ if (p)
+ { soap->error = SOAP_MULTI_ID;
+ return NULL;
+ }
+ }
+ else
+ { if (!p)
+ p = soap_malloc(soap, n);
+ ip->ptr = p;
+ if (!soap->blist)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Resolve link chain to point to %p\n", ip->ptr));
+ soap_resolve_ptr(ip);
+ }
+ }
+ return ip->ptr;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_end_send(struct soap *soap)
+{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End send\n"));
+ if (soap->mode & SOAP_IO) /* need to flush the remaining data in buffer */
+ { if (soap_flush(soap))
+#ifdef WITH_ZLIB
+ { if (soap->mode & SOAP_ENC_ZLIB && soap->zlib_state == SOAP_ZLIB_DEFLATE)
+ { soap->zlib_state = SOAP_ZLIB_NONE;
+ deflateEnd(&soap->d_stream);
+ }
+ return soap->error;
+ }
+#else
+ return soap->error;
+#endif
+#ifdef WITH_ZLIB
+ if (soap->mode & SOAP_ENC_ZLIB)
+ { int r;
+ soap->d_stream.avail_in = 0;
+ do
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflating remainder\n"));
+ r = deflate(&soap->d_stream, Z_FINISH);
+ if (soap->d_stream.avail_out != SOAP_BUFLEN)
+ { if (soap_flush_raw(soap, soap->z_buf, SOAP_BUFLEN - soap->d_stream.avail_out))
+ { soap->zlib_state = SOAP_ZLIB_NONE;
+ deflateEnd(&soap->d_stream);
+ return soap->error;
+ }
+ soap->d_stream.next_out = (Byte*)soap->z_buf;
+ soap->d_stream.avail_out = SOAP_BUFLEN;
+ }
+ } while (r == Z_OK);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Deflated %lu->%lu bytes\n", soap->d_stream.total_in, soap->d_stream.total_out));
+ soap->z_ratio_out = (float)soap->d_stream.total_out / (float)soap->d_stream.total_in;
+ soap->mode &= ~SOAP_ENC_ZLIB;
+ soap->zlib_state = SOAP_ZLIB_NONE;
+ if (deflateEnd(&soap->d_stream) != Z_OK || r != Z_STREAM_END)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Unable to end deflate: %s\n", soap->d_stream.msg?soap->d_stream.msg:""));
+ return soap->error = SOAP_ZLIB_ERROR;
+ }
+#ifdef WITH_GZIP
+ soap->z_buf[0] = soap->z_crc & 0xFF;
+ soap->z_buf[1] = (soap->z_crc >> 8) & 0xFF;
+ soap->z_buf[2] = (soap->z_crc >> 16) & 0xFF;
+ soap->z_buf[3] = (soap->z_crc >> 24) & 0xFF;
+ soap->z_buf[4] = soap->d_stream.total_in & 0xFF;
+ soap->z_buf[5] = (soap->d_stream.total_in >> 8) & 0xFF;
+ soap->z_buf[6] = (soap->d_stream.total_in >> 16) & 0xFF;
+ soap->z_buf[7] = (soap->d_stream.total_in >> 24) & 0xFF;
+ if (soap_flush_raw(soap, soap->z_buf, 8))
+ return soap->error;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip crc32=%lu\n", soap->z_crc));
+#endif
+ }
+#endif
+#ifndef WITH_LEAN
+ if ((soap->mode & SOAP_IO) == SOAP_IO_STORE)
+ { char *p;
+ if (!(soap->mode & SOAP_ENC_XML))
+ { soap->mode--;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Sending buffered message of length %u\n", (unsigned int)soap->blist->size));
+ if (soap->status >= SOAP_POST)
+ soap->error = soap->fpost(soap, soap->endpoint, soap->host, soap->port, soap->path, soap->action, soap->blist->size);
+ else if (soap->status != SOAP_STOP)
+ soap->error = soap->fresponse(soap, soap->status, soap->blist->size);
+ if (soap->error || soap_flush(soap))
+ return soap->error;
+ soap->mode++;
+ }
+ for (p = soap_first_block(soap); p; p = soap_next_block(soap))
+ { DBGMSG(SENT, p, soap_block_size(soap));
+ if ((soap->error = soap->fsend(soap, p, soap_block_size(soap))))
+ { soap_end_block(soap);
+ return soap->error;
+ }
+ }
+ soap_end_block(soap);
+ }
+ else if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
+ { DBGMSG(SENT, "\r\n0\r\n\r\n", 7);
+ if ((soap->error = soap->fsend(soap, "\r\n0\r\n\r\n", 7)))
+ return soap->error;
+ }
+#endif
+ }
+#ifdef WITH_OPENSSL
+ if (!soap->ssl && soap_valid_socket(soap->socket) && !soap->keep_alive)
+ shutdown((SOAP_SOCKET)soap->socket, 1); /* Send TCP FIN */
+#else
+ if (soap_valid_socket(soap->socket) && !soap->keep_alive)
+ shutdown((SOAP_SOCKET)soap->socket, 1); /* Send TCP FIN */
+#endif
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End of send message ok\n"));
+ soap->part = SOAP_END;
+ soap->count = 0;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_end_recv(struct soap *soap)
+{ soap->part = SOAP_END;
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "End of receive message ok\n"));
+#ifdef WITH_ZLIB
+ if (soap->mode & SOAP_ENC_ZLIB)
+ { soap->mode &= ~SOAP_ENC_ZLIB;
+ memcpy(soap->buf, soap->z_buf, SOAP_BUFLEN);
+ soap->bufidx = (char*)soap->d_stream.next_in - soap->z_buf;
+ soap->buflen = soap->z_buflen;
+ soap->zlib_state = SOAP_ZLIB_NONE;
+ if (inflateEnd(&soap->d_stream) != Z_OK)
+ return soap->error = SOAP_ZLIB_ERROR;
+#ifdef WITH_GZIP
+ if (soap->zlib_in == SOAP_ZLIB_GZIP)
+ { wchar c;
+ short i;
+ for (i = 0; i < 8; i++)
+ { if ((int)(c = soap_getchar(soap)) == EOF)
+ return soap->error = SOAP_EOF;
+ soap->z_buf[i] = (char)c;
+ }
+ if (soap->z_crc != ((unsigned char)soap->z_buf[0] | (unsigned long)((unsigned char)soap->z_buf[1] << 8) | (unsigned long)((unsigned char)soap->z_buf[2] << 16) | (unsigned long)((unsigned char)soap->z_buf[3] << 24)))
+ { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Gzip error: crc check failed, message corrupted? (crc32=%lu)\n", soap->z_crc));
+ return soap->error = SOAP_ZLIB_ERROR;
+ }
+ if (soap->d_stream.total_out != ((unsigned char)soap->z_buf[4] | (unsigned long)((unsigned char)soap->z_buf[5] << 8) | (unsigned long)((unsigned char)soap->z_buf[6] << 16) | (unsigned long)((unsigned char)soap->z_buf[7] << 24)))
+ { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Gzip error: incorrect message length\n"));
+ return soap->error = SOAP_ZLIB_ERROR;
+ }
+ }
+#endif
+ }
+#endif
+ if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
+ while ((int)soap_getchar(soap) != EOF) /* advance to last chunk */
+ ;
+ if (soap->fdisconnect)
+ if ((soap->error = soap->fdisconnect(soap)))
+ return soap->error;
+ return soap_resolve(soap);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_free(struct soap *soap)
+{ register struct soap_nlist *np;
+ register struct soap_attribute *tp;
+ register struct Namespace *ns;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free namespace stack\n"));
+ while (soap->nlist)
+ { np = soap->nlist->next;
+ if (soap->nlist->ns)
+ SOAP_FREE(soap->nlist->ns);
+ SOAP_FREE(soap->nlist);
+ soap->nlist = np;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free any remaining temp blocks\n"));
+ while (soap->blist)
+ soap_end_block(soap);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free attributes\n"));
+ while (soap->attributes)
+ { tp = soap->attributes->next;
+ if (soap->attributes->value)
+ SOAP_FREE(soap->attributes->value);
+ SOAP_FREE(soap->attributes);
+ soap->attributes = tp;
+ }
+ if (soap->labbuf)
+ SOAP_FREE(soap->labbuf);
+ soap->labbuf = NULL;
+ soap->lablen = 0;
+ soap->labidx = 0;
+ soap_free_pht(soap);
+ soap_free_iht(soap);
+ ns = soap->local_namespaces;
+ if (ns)
+ { for (; ns->id; ns++)
+ { if (ns->out)
+ { SOAP_FREE(ns->out);
+ if (soap->encodingStyle == ns->out)
+ soap->encodingStyle = SOAP_STR_EOS;
+ ns->out = NULL;
+ }
+ if (soap->encodingStyle == ns->ns)
+ soap->encodingStyle = SOAP_STR_EOS;
+ }
+ SOAP_FREE(soap->local_namespaces);
+ soap->local_namespaces = NULL;
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+static void
+soap_init_logs(struct soap *soap)
+{ int i;
+ for (i = 0; i < SOAP_MAXLOGS; i++)
+ { soap->logfile[i] = NULL;
+ soap->fdebug[i] = NULL;
+ }
+#ifdef SOAP_DEBUG
+ soap_set_recv_logfile(soap, "RECV.log");
+ soap_set_sent_logfile(soap, "SENT.log");
+ soap_set_test_logfile(soap, "TEST.log");
+#endif
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_open_logfile(struct soap *soap, int i)
+{ if (soap->logfile[i])
+ soap->fdebug[i] = fopen(soap->logfile[i], i < 2 ? "ab" : "a");
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+static void
+soap_close_logfile(struct soap *soap, int i)
+{ if (soap->fdebug[i])
+ { fclose(soap->fdebug[i]);
+ soap->fdebug[i] = NULL;
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_close_logfiles(struct soap *soap)
+{ int i;
+ for (i = 0; i < SOAP_MAXLOGS; i++)
+ soap_close_logfile(soap, i);
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+static void
+soap_set_logfile(struct soap *soap, int i, const char *logfile)
+{ char *s = NULL;
+ soap_close_logfile(soap, i);
+ if (soap->logfile[i])
+ SOAP_FREE((void*)soap->logfile[i]);
+ if (logfile)
+ if ((s = (char*)SOAP_MALLOC(strlen(logfile) + 1)))
+ strcpy(s, logfile);
+ soap->logfile[i] = s;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_set_recv_logfile(struct soap *soap, const char *logfile)
+{ soap_set_logfile(soap, SOAP_INDEX_RECV, logfile);
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_set_sent_logfile(struct soap *soap, const char *logfile)
+{ soap_set_logfile(soap, SOAP_INDEX_SENT, logfile);
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_set_test_logfile(struct soap *soap, const char *logfile)
+{ soap_set_logfile(soap, SOAP_INDEX_TEST, logfile);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+struct soap*
+SOAP_FMAC2
+soap_copy(struct soap *soap)
+{ return soap_copy_context((struct soap*)SOAP_MALLOC(sizeof(struct soap)), soap);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+struct soap*
+SOAP_FMAC2
+soap_copy_context(struct soap *copy, struct soap *soap)
+{ if (copy)
+ { register struct soap_plugin *p;
+ memcpy(copy, soap, sizeof(struct soap));
+ copy->copy = 1;
+ copy->user = NULL;
+ copy->userid = NULL;
+ copy->passwd = NULL;
+ copy->nlist = NULL;
+ copy->blist = NULL;
+ copy->clist = NULL;
+ copy->alist = NULL;
+ copy->attributes = NULL;
+ copy->local_namespaces = NULL;
+ soap_set_local_namespaces(copy);
+ soap_init_iht(copy);
+ soap_init_pht(copy);
+ copy->header = NULL;
+ copy->fault = NULL;
+ copy->action = NULL;
+ *copy->host = '\0';
+#ifndef WITH_LEAN
+#ifdef WITH_COOKIES
+ copy->cookies = soap_copy_cookies(soap);
+#else
+ copy->cookies = NULL;
+#endif
+ soap_init_logs(copy);
+#endif
+ copy->plugins = NULL;
+ for (p = soap->plugins; p; p = p->next)
+ { register struct soap_plugin *q = (struct soap_plugin*)SOAP_MALLOC(sizeof(struct soap_plugin));
+ if (!q)
+ return NULL;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copying plugin '%s'\n", p->id));
+ *q = *p;
+ if (p->fcopy && (soap->error = p->fcopy(soap, q, p)))
+ { SOAP_FREE(q);
+ return NULL;
+ }
+ q->next = copy->plugins;
+ copy->plugins = q;
+ }
+ }
+ else
+ soap->error = SOAP_EOM;
+ return copy;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_init(struct soap *soap)
+{ soap->version = 1; /* default SOAP 1.1 */
+ soap_imode(soap, SOAP_IO_DEFAULT);
+ soap_omode(soap, SOAP_IO_DEFAULT);
+ soap->copy = 0;
+ soap->plugins = NULL;
+ soap->user = NULL;
+ soap->userid = NULL;
+ soap->passwd = NULL;
+ soap->fpost = http_post;
+ soap->fget = http_get;
+ soap->fposthdr = http_post_header;
+ soap->fresponse = http_response;
+ soap->fparse = http_parse;
+ soap->fparsehdr = http_parse_header;
+ soap->fconnect = NULL;
+ soap->fdisconnect = NULL;
+#ifndef MAC_CARBON
+ soap->faccept = tcp_accept;
+ soap->fopen = tcp_connect;
+ soap->fclose = tcp_disconnect;
+ soap->fsend = fsend;
+ soap->frecv = frecv;
+#endif
+ soap->fprepare = NULL;
+ soap->fignore = NULL;
+ soap->fplugin = fplugin;
+ soap->fdimereadopen = NULL;
+ soap->fdimewriteopen = NULL;
+ soap->fdimereadclose = NULL;
+ soap->fdimewriteclose = NULL;
+ soap->fdimeread = NULL;
+ soap->fdimewrite = NULL;
+ soap->float_format = "%.8g"; /* .8 preserves single FP precision as much as possible, but might not be very efficient */
+ soap->double_format = "%.17lg"; /* .17 preserves double FP precision as much as possible, but might not be very efficient */
+ soap->dime_id_format = "cid:id%d"; /* default DIME id format */
+ soap->http_version = "1.1";
+ soap->encodingStyle = SOAP_STR_EOS;
+ soap->actor = NULL;
+ soap->max_keep_alive = SOAP_MAXKEEPALIVE;
+ soap->keep_alive = 0;
+ soap->recv_timeout = 0;
+ soap->send_timeout = 0;
+ soap->connect_timeout = 0;
+ soap->accept_timeout = 0;
+ soap->socket_flags = 0;
+ soap->connect_flags = 0;
+ soap->bind_flags = 0;
+ soap->accept_flags = 0;
+ soap->ip = 0;
+ soap->labbuf = NULL;
+ soap->lablen = 0;
+ soap->labidx = 0;
+#ifndef WITH_NONAMESPACES
+ soap->namespaces = namespaces;
+#else
+ soap->namespaces = NULL;
+#endif
+ soap->local_namespaces = NULL;
+ soap->nlist = NULL;
+ soap->blist = NULL;
+ soap->clist = NULL;
+ soap->alist = NULL;
+ soap->attributes = NULL;
+ soap->header = NULL;
+ soap->fault = NULL;
+ soap->master = SOAP_INVALID_SOCKET;
+ soap->socket = SOAP_INVALID_SOCKET;
+ soap->os = NULL;
+ soap->is = NULL;
+ soap->dom = NULL;
+#ifndef UNDER_CE
+ soap->recvfd = 0;
+ soap->sendfd = 1;
+#else
+ soap->recvfd = stdin;
+ soap->sendfd = stdout;
+#endif
+ soap->host[0] = '\0';
+ soap->port = 0;
+ soap->action = NULL;
+ soap->proxy_host = NULL;
+ soap->proxy_port = 8080;
+ soap->proxy_userid = NULL;
+ soap->proxy_passwd = NULL;
+#ifdef WITH_OPENSSL
+ soap->fsslauth = ssl_auth_init;
+ soap->fsslverify = ssl_verify_callback;
+ soap->bio = NULL;
+ soap->ssl = NULL;
+ soap->ctx = NULL;
+ soap->require_server_auth = 0;
+ soap->require_client_auth = 0;
+ soap->rsa = 0;
+ soap->keyfile = NULL;
+ soap->password = NULL;
+ soap->dhfile = NULL;
+ soap->cafile = NULL;
+ soap->capath = NULL;
+ soap->randfile = NULL;
+ soap->session = NULL;
+#endif
+#ifdef WITH_ZLIB
+ soap->zlib_state = SOAP_ZLIB_NONE;
+ soap->zlib_in = SOAP_ZLIB_NONE;
+ soap->zlib_out = SOAP_ZLIB_NONE;
+ soap->d_stream.zalloc = NULL;
+ soap->d_stream.zfree = NULL;
+ soap->d_stream.opaque = NULL;
+ soap->z_level = 6;
+#endif
+#ifndef WITH_LEAN
+ soap->cookies = NULL;
+ soap->cookie_domain = NULL;
+ soap->cookie_path = NULL;
+ soap->cookie_max = 32;
+ soap_init_logs(soap);
+#endif
+/* WR[ */
+#ifdef WMW_RPM_IO
+ soap->rpmreqid = NULL;
+#endif /* WMW_RPM_IO */
+/* ]WR */
+ soap_init_iht(soap);
+ soap_init_pht(soap);
+ soap_begin(soap);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_init1(struct soap *soap, int mode)
+{ soap_init2(soap, mode, mode);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_init2(struct soap *soap, int imode, int omode)
+{ soap_init(soap);
+ soap_imode(soap, imode);
+ soap_omode(soap, omode);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_begin(struct soap *soap)
+{ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Initializing\n"));
+ if (!soap->keep_alive)
+ { soap->buflen = 0;
+ soap->bufidx = 0;
+ }
+ soap->keep_alive = (((soap->imode | soap->omode) & SOAP_IO_KEEPALIVE) != 0);
+ soap->null = 0;
+ soap->position = 0;
+ soap->encoding = 0;
+ soap->mustUnderstand = 0;
+ soap->mode = 0;
+ soap->ns = 0;
+ soap->part = SOAP_BEGIN;
+ soap->alloced = 0;
+ soap->count = 0;
+ soap->length = 0;
+ soap->cdata = 0;
+ soap->error = SOAP_OK;
+ soap->peeked = 0;
+ soap->ahead = 0;
+ soap->idnum = 0;
+ soap->level = 0;
+ soap->endpoint[0] = '\0';
+ soap->dime_chunksize = 0;
+ soap->dime_buflen = 0;
+ soap->dot_net_bug = 0;
+ soap_free(soap);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_end(struct soap *soap)
+{ register struct soap_clist *cp;
+ soap_free(soap);
+ soap_dealloc(soap, NULL);
+ while (soap->clist)
+ { cp = soap->clist->next;
+ SOAP_FREE(soap->clist);
+ soap->clist = cp;
+ }
+ soap_closesock(soap);
+#ifndef WITH_LEAN
+ soap_close_logfiles(soap);
+#endif
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_set_namespaces(struct soap *soap, struct Namespace *p)
+{ struct Namespace *ns = soap->local_namespaces;
+ struct soap_nlist *np, *nq, *nr;
+ unsigned int level = soap->level;
+ soap->namespaces = p;
+ soap->local_namespaces = NULL;
+ soap_set_local_namespaces(soap);
+ /* reverse the list */
+ np = soap->nlist;
+ soap->nlist = NULL;
+ if (np)
+ { nq = np->next;
+ np->next = NULL;
+ while (nq)
+ { nr = nq->next;
+ nq->next = np;
+ np = nq;
+ nq = nr;
+ }
+ }
+ while (np)
+ { soap->level = np->level; /* preserve element nesting level */
+ if (np->ns)
+ { if (soap_push_namespace(soap, np->id, np->ns))
+ return soap->error;
+ }
+ else if (np->index >= 0 && ns)
+ { if (ns[np->index].out)
+ { if (soap_push_namespace(soap, np->id, ns[np->index].out))
+ return soap->error;
+ }
+ else if (soap_push_namespace(soap, np->id, ns[np->index].ns))
+ return soap->error;
+ }
+ if (np->ns)
+ SOAP_FREE(np->ns);
+ nq = np;
+ np = np->next;
+ SOAP_FREE(nq);
+ }
+ if (ns)
+ { int i;
+ for (i = 0; ns[i].id; i++)
+ { if (ns[i].out)
+ { SOAP_FREE(ns[i].out);
+ ns[i].out = NULL;
+ }
+ }
+ SOAP_FREE(ns);
+ }
+ soap->level = level; /* restore level */
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+static void
+soap_set_local_namespaces(struct soap *soap)
+{ if (soap->namespaces && !soap->local_namespaces)
+ { register struct Namespace *ns;
+ register size_t n = 1;
+ for (ns = soap->namespaces; ns->id; ns++)
+ n++;
+ if (n > 3)
+ { n *= sizeof(struct Namespace);
+ ns = (struct Namespace*)SOAP_MALLOC(n);
+ if (ns)
+ { memcpy(ns, soap->namespaces, n);
+ ns[0].id = "SOAP-ENV";
+ ns[1].id = "SOAP-ENC";
+ ns[2].id = "xsi";
+ if (ns[0].ns)
+ { if (!strcmp(ns[0].ns, soap_env1))
+ soap->version = 1;
+ else
+ soap->version = 2;
+ }
+ soap->local_namespaces = ns;
+ }
+ }
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_element(struct soap *soap, const char *tag, int id, const char *type)
+{ struct Namespace *ns = soap->local_namespaces;
+ register const char *s;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element begin tag='%s' id='%d' type='%s'\n", tag, id, type?type:""));
+/**/
+#ifdef WITH_DOM
+ if (soap->mode & SOAP_XML_DOM)
+ { register struct soap_dom_element *p, *e = (struct soap_dom_element*)soap_malloc(soap, sizeof(struct soap_dom_element));
+ e->next = NULL;
+ e->prnt = soap->dom;
+ e->nstr = NULL;
+ e->name = soap_strdup(soap, tag); /* check EOM? */
+ e->data = NULL;
+ e->type = 0;
+ e->node = NULL;
+ e->elts = NULL;
+ e->atts = NULL;
+ if (soap->dom)
+ { p = soap->dom->elts;
+ if (p)
+ { while (p->next)
+ p = p->next;
+ p->next = e;
+ }
+ else
+ soap->dom->elts = e;
+ }
+ soap->dom = e;
+ }
+ else
+#endif
+{
+ soap->level++;
+ if (!soap->ns && !(soap->mode & SOAP_XML_CANONICAL))
+ if (soap_send(soap, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"))
+ return soap->error;
+ if (soap_send_raw(soap, "<", 1))
+ return soap->error;
+ s = tag;
+ if (ns && soap->part != SOAP_IN_ENVELOPE && (soap->part == SOAP_IN_HEADER || !soap->encodingStyle))
+ { register const char *t = strchr(s, ':');
+ if (t)
+ { s = t + 1;
+ for (ns++; ns->id; ns++)
+ { if ((ns->out || ns->ns) && !strncmp(ns->id, tag, t - tag) && !ns->id[t - tag])
+ { if (soap_send(soap, s) || soap_attribute(soap, "xmlns", ns->out ? ns->out : ns->ns))
+ return soap->error;
+ s = NULL;
+ break;
+ }
+ }
+ }
+ }
+ if (s)
+ if (soap_send(soap, tag))
+ return soap->error;
+}
+/**/
+ if (!soap->ns)
+ { for (ns = soap->local_namespaces; ns && ns->id; ns++)
+ { if (*ns->id && (ns->out || ns->ns))
+ { sprintf(soap->tmpbuf, "xmlns:%s", ns->id);
+ if (soap_attribute(soap, soap->tmpbuf, ns->out ? ns->out : ns->ns))
+ return soap->error;
+ }
+ }
+ soap->ns = 1;
+ }
+ if (id > 0)
+ { sprintf(soap->tmpbuf, "_%d", id);
+ if (soap_attribute(soap, "id", soap->tmpbuf))
+ return soap->error;
+ }
+ if (type && *type)
+ { if (soap_attribute(soap, "xsi:type", type))
+ return soap->error;
+ }
+ if (soap->null && soap->position > 0)
+ { int i;
+ sprintf(soap->tmpbuf, "[%d", soap->positions[0]);
+ for (i = 1; i < soap->position; i++)
+ sprintf(soap->tmpbuf + strlen(soap->tmpbuf), ",%d", soap->positions[i]);
+ strcat(soap->tmpbuf, "]");
+ if (soap_attribute(soap, "SOAP-ENC:position", soap->tmpbuf))
+ return soap->error;
+ }
+ if (soap->mustUnderstand)
+ { if (soap->actor && *soap->actor)
+ { if (soap_attribute(soap, soap->version == 2 ? "SOAP-ENV:role" : "SOAP-ENV:actor", soap->actor))
+ return soap->error;
+ }
+ if (soap_attribute(soap, "SOAP-ENV:mustUnderstand", soap->version == 2 ? "true" : "1"))
+ return soap->error;
+ soap->mustUnderstand = 0;
+ }
+ if (soap->encoding)
+ { if (soap->encodingStyle)
+ { if (!*soap->encodingStyle && soap->local_namespaces)
+ { if (soap->local_namespaces[1].out)
+ soap->encodingStyle = soap->local_namespaces[1].out;
+ else
+ soap->encodingStyle = soap->local_namespaces[1].ns;
+ }
+ if (soap_attribute(soap, "SOAP-ENV:encodingStyle", soap->encodingStyle))
+ return soap->error;
+ }
+ soap->encoding = 0;
+ }
+ soap->null = 0;
+ soap->position = 0;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_element_begin_out(struct soap *soap, const char *tag, int id, const char *type)
+{ if (*tag == '-')
+ return SOAP_OK;
+ if (soap_element(soap, tag, id, type))
+ return soap->error;
+ return soap_element_start_end_out(soap, NULL);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+#ifndef HAVE_STRRCHR
+SOAP_FMAC1
+char*
+SOAP_FMAC2
+soap_strrchr(const char *s, int t)
+{ register char *r = NULL;
+ while (*s)
+ if (*s++ == t)
+ r = (char*)s - 1;
+ return r;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+#ifndef HAVE_STRTOL
+SOAP_FMAC1
+long
+SOAP_FMAC2
+soap_strtol(const char *s, char **t, int b)
+{ register long n = 0;
+ register int c;
+ while (*s > 0 && *s <= 32)
+ s++;
+ if (b == 10)
+ { short neg = 0;
+ if (*s == '-')
+ { s++;
+ neg = 1;
+ }
+ else if (*s == '+')
+ s++;
+ while ((c = *s) && c >= '0' && c <= '9')
+ { if (n > 214748364)
+ break;
+ n *= 10;
+ n += c - '0';
+ s++;
+ }
+ if (neg)
+ n = -n;
+ }
+ else /* b == 16 and value is always positive */
+ { while ((c = *s))
+ { if (c >= '0' && c <= '9')
+ c -= '0';
+ else if (c >= 'A' && c <= 'F')
+ c -= 'A' - 10;
+ else if (c >= 'a' && c <= 'f')
+ c -= 'a' - 10;
+ if (n > 0x07FFFFFF)
+ break;
+ n <<= 4;
+ n += c;
+ s++;
+ }
+ }
+ if (t)
+ *t = (char*)s;
+ return n;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+#ifndef HAVE_STRTOUL
+SOAP_FMAC1
+unsigned long
+SOAP_FMAC2
+soap_strtoul(const char *s, char **t, int b)
+{ unsigned long n = 0;
+ register int c;
+ while (*s > 0 && *s <= 32)
+ s++;
+ if (b == 10)
+ { if (*s == '+')
+ s++;
+ while ((c = *s) && c >= '0' && c <= '9')
+ { if (n > 429496729)
+ break;
+ n *= 10;
+ n += c - '0';
+ s++;
+ }
+ }
+ else /* b == 16 */
+ { while ((c = *s))
+ { if (c >= '0' && c <= '9')
+ c -= '0';
+ else if (c >= 'A' && c <= 'F')
+ c -= 'A' - 10;
+ else if (c >= 'a' && c <= 'f')
+ c -= 'a' - 10;
+ if (n > 0x0FFFFFFF)
+ break;
+ n <<= 4;
+ n += c;
+ s++;
+ }
+ }
+ if (t)
+ *t = (char*)s;
+ return n;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_array_begin_out(struct soap *soap, const char *tag, int id, const char *type, const char *offset)
+{ if (soap_element(soap, tag, id, "SOAP-ENC:Array"))
+ return soap->error;
+ if (soap->version == 2)
+ { const char *s;
+ s = soap_strrchr(type, '[');
+ if ((size_t)(s - type) < sizeof(soap->tmpbuf))
+ { strncpy(soap->tmpbuf, type, s - type);
+ soap->tmpbuf[s - type] = '\0';
+ if (type && *type && (soap_attribute(soap, "SOAP-ENC:itemType", soap->tmpbuf)))
+ return soap->error;
+ if (s && (soap_attribute(soap, "SOAP-ENC:arraySize", s + 1)))
+ return soap->error;
+ }
+ }
+ else
+ { if (offset && (soap_attribute(soap, "SOAP-ENC:offset", offset)))
+ return soap->error;
+ if (type && *type && (soap_attribute(soap, "SOAP-ENC:arrayType", type)))
+ return soap->error;
+ }
+ return soap_element_start_end_out(soap, NULL);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_element_start_end_out(struct soap *soap, const char *tag)
+{ register struct soap_attribute *tp;
+/**/
+#ifdef WITH_DOM
+ if ((soap->mode & SOAP_XML_DOM) && soap->dom)
+ { for (tp = soap->attributes; tp; tp = tp->next)
+ { if (tp->visible)
+ { register struct soap_dom_attribute *a = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute));
+ a->next = soap->dom->atts;
+ a->nstr = NULL;
+ a->name = soap_strdup(soap, tp->name); /* check EOM */
+ a->data = soap_strdup(soap, tp->value); /* check EOM */
+ a->wide = NULL;
+ soap->dom->atts = a;
+ tp->visible = 0;
+ }
+ }
+ return SOAP_OK;
+ }
+#endif
+/**/
+ for (tp = soap->attributes; tp; tp = tp->next)
+ { if (tp->visible)
+ { if (soap_send_raw(soap, " ", 1)
+ || soap_send(soap, tp->name))
+ return soap->error;
+ if (tp->visible == 2 && tp->value)
+ if (soap_send_raw(soap, "=\"", 2)
+ || soap_string_out(soap, tp->value, 1)
+ || soap_send_raw(soap, "\"", 1))
+ return soap->error;
+ tp->visible = 0;
+ }
+ }
+ if (tag)
+ { soap->level--;
+#ifndef WITH_LEAN
+ if (soap->mode & SOAP_XML_CANONICAL)
+ { if (soap_send_raw(soap, ">", 1)
+ || soap_element_end_out(soap, tag))
+ return soap->error;
+ return SOAP_OK;
+ }
+#endif
+ return soap_send_raw(soap, "/>", 2);
+ }
+ return soap_send_raw(soap, ">", 1);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_element_end_out(struct soap *soap, const char *tag)
+{ if (*tag == '-')
+ return SOAP_OK;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Element ending tag='%s'\n", tag));
+/**/
+#ifdef WITH_DOM
+ if ((soap->mode & SOAP_XML_DOM) && soap->dom)
+ { if (soap->dom->prnt)
+ soap->dom = soap->dom->prnt;
+ return SOAP_OK;
+ }
+#endif
+/**/
+ if (soap->part != SOAP_IN_ENVELOPE && (soap->part == SOAP_IN_HEADER || !soap->encodingStyle) && soap->local_namespaces)
+ { const char *s = strchr(tag, ':');
+ if (s && strncmp(tag, "SOAP-ENV", s - tag))
+ tag = s + 1;
+ }
+ soap->level--;
+ if (soap_send_raw(soap, "</", 2)
+ || soap_send(soap, tag)
+ || soap_send_raw(soap, ">", 1))
+ return soap->error;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_element_ref(struct soap *soap, const char *tag, int id, int href)
+{ int n = 0;
+ if (soap_element(soap, tag, id, NULL))
+ return soap->error;
+ if (soap->version == 2)
+ n = 1;
+ sprintf(soap->tmpbuf, "#_%d", href);
+ if (soap_attribute(soap, "href" + n, soap->tmpbuf + n)
+ || soap_element_start_end_out(soap, tag))
+ return soap->error;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_element_href(struct soap *soap, const char *tag, int id, const char *href)
+{ if (soap_element(soap, tag, id, NULL)
+ || soap_attribute(soap, "href", href)
+ || soap_element_start_end_out(soap, tag))
+ return soap->error;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_element_null(struct soap *soap, const char *tag, int id, const char *type)
+{ struct soap_attribute *tp;
+ for (tp = soap->attributes; tp; tp = tp->next)
+ if (tp->visible)
+ break;
+ if (tp || (soap->version == 2 && soap->position > 0) || id > 0 || (soap->mode & SOAP_XML_NIL))
+ { if (soap_element(soap, tag, id, type))
+ return soap->error;
+ if (soap->part != SOAP_IN_HEADER && soap->encodingStyle)
+ if (soap_attribute(soap, "xsi:nil", "true"))
+ return soap->error;
+ return soap_element_start_end_out(soap, tag);
+ }
+ soap->null = 1;
+ soap->position = 0;
+ soap->mustUnderstand = 0;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_element_result(struct soap *soap, const char *tag)
+{ if (soap->version == 2 && soap->encodingStyle)
+ if (soap_element(soap, "SOAP-RPC:result", 0, NULL)
+ || soap_attribute(soap, "xmlns:SOAP-RPC", soap_rpc)
+ || soap_element_start_end_out(soap, NULL)
+ || soap_string_out(soap, tag, 0)
+ || soap_element_end_out(soap, "SOAP-RPC:result"))
+ return soap->error;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_attribute(struct soap *soap, const char *name, const char *value)
+{
+/**/
+#ifdef WITH_DOM
+ if ((soap->mode & SOAP_XML_DOM) && soap->dom)
+ { register struct soap_dom_attribute *a = (struct soap_dom_attribute*)soap_malloc(soap, sizeof(struct soap_dom_attribute));
+ a->next = soap->dom->atts;
+ a->nstr = NULL;
+ a->name = soap_strdup(soap, name); /* check EOM */
+ a->data = soap_strdup(soap, value); /* check EOM */
+ a->wide = NULL;
+ soap->dom->atts = a;
+ return SOAP_OK;
+ }
+#endif
+/**/
+#ifndef WITH_LEAN
+ if (soap->mode & SOAP_XML_CANONICAL)
+ { if (soap_set_attr(soap, name, value))
+ return soap->error;
+ }
+ else
+#endif
+ { if (soap_send_raw(soap, " ", 1)
+ || soap_send(soap, name))
+ return soap->error;
+ if (value)
+ if (soap_send_raw(soap, "=\"", 2)
+ || soap_string_out(soap, value, 1)
+ || soap_send_raw(soap, "\"", 1))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_element_begin_in(struct soap *soap, const char *tag)
+{ if (tag && *tag == '-')
+ return SOAP_OK;
+ if (!soap_peek_element(soap))
+ { if (soap->other)
+ return soap->error = SOAP_TAG_MISMATCH;
+ if (!(soap->error = soap_match_tag(soap, soap->tag, tag)))
+ { if (tag && !soap->encodingStyle)
+ { const char *s = strchr(tag, ':');
+ if (s)
+ soap_push_default_namespace(soap, tag, s - tag);
+ }
+ soap->peeked = 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Begin element found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag?tag:"" ));
+ if (soap->body)
+ soap->level++;
+ }
+ }
+ return soap->error;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_element_end_in(struct soap *soap, const char *tag)
+{ register wchar c;
+ register char *s;
+ register const char *t;
+ if (tag && *tag == '-')
+ return SOAP_OK;
+ soap->level--;
+ soap_pop_namespace(soap);
+ if (soap->peeked)
+ { if (*soap->tag == '\0')
+ { soap->peeked = 0;
+ soap->error = SOAP_OK;
+ }
+ else
+ return soap->error = SOAP_SYNTAX_ERROR;
+ }
+ else
+ { while (((c = soap_get(soap)) != TT))
+ { if ((int)c == EOF)
+ return soap->error = SOAP_EOF;
+ if (c == LT)
+ return soap->error = SOAP_SYNTAX_ERROR;
+ }
+ }
+ s = soap->tag;
+ do c = soap_get(soap);
+ while (soap_blank(c));
+ do
+ { *s++ = (char)c;
+ c = soap_get(soap);
+ } while (soap_notblank(c));
+ *s = '\0';
+ if ((int)c == EOF)
+ return soap->error = SOAP_EOF;
+ while (soap_blank(c))
+ c = soap_get(soap);
+ if (c != GT)
+ return soap->error = SOAP_SYNTAX_ERROR;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element found (level=%u) '%s'='%s'\n", soap->level, soap->tag, tag?tag:""));
+ if (!tag)
+ return SOAP_OK;
+ if ((s = strchr(soap->tag, ':')))
+ s++;
+ else
+ s = soap->tag;
+ if ((t = strchr(tag, ':')))
+ t++;
+ else
+ t = tag;
+ if (!SOAP_STRCMP(s, t))
+ return SOAP_OK;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "End element does not match\n"));
+ return soap->error = SOAP_SYNTAX_ERROR;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+struct soap_attribute *
+SOAP_FMAC2
+soap_attr(struct soap *soap, const char *name)
+{ register struct soap_attribute *tp;
+ for (tp = soap->attributes; tp; tp = tp->next)
+ if (!soap_match_tag(soap, tp->name, name))
+ return tp;
+ return NULL;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+const char *
+SOAP_FMAC2
+soap_attr_value(struct soap *soap, const char *name)
+{ register struct soap_attribute *tp = soap_attr(soap, name);
+ if (tp && tp->visible == 2)
+ return tp->value;
+ return NULL;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_set_attr(struct soap *soap, const char *name, const char *value)
+{ register struct soap_attribute *tp;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set attribute %s='%s'\n", name, value?value:""));
+ for (tp = soap->attributes; tp; tp = tp->next)
+ if (!strcmp(tp->name, name))
+ break;
+ if (!tp)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute %s\n", name));
+ if (!(tp = (struct soap_attribute*)SOAP_MALLOC(sizeof(struct soap_attribute) + strlen(name))))
+ return soap->error = SOAP_EOM;
+ tp->ns = NULL;
+#ifndef WITH_LEAN
+ if (soap->mode & SOAP_XML_CANONICAL)
+ { struct soap_attribute **tpp = &soap->attributes;
+ const char *s = strchr(name, ':');
+ if (!strncmp(name, "xmlns", 5))
+ { for (; *tpp; tpp = &(*tpp)->next)
+ if (strncmp((*tpp)->name, "xmlns", 5) || strcmp((*tpp)->name + 5, name + 5) > 0)
+ break;
+ }
+ else if (!s)
+ { for (; *tpp; tpp = &(*tpp)->next)
+ if (strncmp((*tpp)->name, "xmlns", 5) && ((*tpp)->ns || strcmp((*tpp)->name, name) > 0))
+ break;
+ }
+ else
+ { int k;
+ for (; *tpp; tpp = &(*tpp)->next)
+ { if (!strncmp((*tpp)->name, "xmlns:", 6) && !strncmp((*tpp)->name + 6, name, s - name) && !(*tpp)->name[6 + s - name])
+ { if (!tp->ns)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Canonicalization: prefix %s=%p(%s)\n", name, (*tpp)->ns, (*tpp)->ns));
+ tp->ns = (*tpp)->ns;
+ }
+ }
+ else if (strncmp((*tpp)->name, "xmlns", 5) && (*tpp)->ns && tp->ns && ((k = strcmp((*tpp)->ns, tp->ns)) > 0 || (!k && strcmp((*tpp)->name, name) > 0)))
+ break;
+ }
+ }
+ tp->next = *tpp;
+ *tpp = tp;
+ }
+ else
+#endif
+ { tp->next = soap->attributes;
+ soap->attributes = tp;
+ }
+ strcpy(tp->name, name);
+ tp->value = NULL;
+ }
+ else if (value && tp->value && tp->size <= strlen(value))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Free attribute value of %s (free %p)\n", name, tp->value));
+ SOAP_FREE(tp->value);
+ tp->value = NULL;
+ tp->ns = NULL;
+ }
+ if (value)
+ { if (!tp->value)
+ { tp->size = strlen(value) + 1;
+ if (!(tp->value = (char*)SOAP_MALLOC(tp->size)))
+ return soap->error = SOAP_EOM;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Allocate attribute value of %s (%p)\n", tp->name, tp->value));
+ }
+ strcpy(tp->value, value);
+ if (!strncmp(tp->name, "xmlns:", 6))
+ tp->ns = tp->value;
+ tp->visible = 2;
+ }
+ else
+ tp->visible = 1;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_clr_attr(struct soap *soap)
+{ register struct soap_attribute *tp;
+#ifndef WITH_LEAN
+ if (soap->mode & SOAP_XML_CANONICAL)
+ { while (soap->attributes)
+ { tp = soap->attributes->next;
+ SOAP_FREE(soap->attributes->value);
+ SOAP_FREE(soap->attributes);
+ soap->attributes = tp;
+ }
+ }
+ else
+#endif
+ { for (tp = soap->attributes; tp; tp = tp->next)
+ tp->visible = 0;
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+static int
+soap_getattrval(struct soap *soap, char *s, size_t n, wchar d)
+{ size_t i;
+ wchar c;
+ for (i = 0; i < n; i++)
+ { c = soap_getutf8(soap);
+ switch (c)
+ {
+ case TT:
+ *s++ = '<';
+ soap_unget(soap, '/');
+ break;
+ case LT:
+ *s++ = '<';
+ break;
+ case GT:
+ if (d == ' ')
+ { soap_unget(soap, c);
+ *s = '\0';
+ return SOAP_OK;
+ }
+ *s++ = '>';
+ break;
+ case QT:
+ if (c == d)
+ { *s = '\0';
+ return SOAP_OK;
+ }
+ *s++ = '"';
+ break;
+ case AP:
+ if (c == d)
+ { *s = '\0';
+ return SOAP_OK;
+ }
+ *s++ = '\'';
+ break;
+ case '\t':
+ case '\n':
+ case '\r':
+ case ' ':
+ case '/':
+ if (d == ' ')
+ { soap_unget(soap, c);
+ *s = '\0';
+ return SOAP_OK;
+ }
+ default:
+ if ((int)c == EOF)
+ return soap->error = SOAP_EOF;
+ *s++ = (char)c;
+ }
+ }
+ return soap->error = SOAP_EOM;
+}
+#endif
+
+/******************************************************************************/
+#ifdef WITH_FAST
+#ifndef PALM_2
+static int
+soap_append_lab(struct soap *soap, const char *s, size_t n)
+{ if (soap->labidx + n >= soap->lablen)
+ { register char *t = soap->labbuf;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Enlarging look-aside buffer to append data, old size=%lu", (unsigned long)soap->lablen));
+ if (soap->lablen == 0)
+ soap->lablen = SOAP_LABLEN;
+ while (soap->labidx + n >= soap->lablen)
+ soap->lablen <<= 1;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, ", new size=%lu\n", (unsigned long)soap->lablen));
+ soap->labbuf = (char*)SOAP_MALLOC(soap->lablen);
+ if (!soap->labbuf)
+ { if (t)
+ free(t);
+ return soap->error = SOAP_EOM;
+ }
+ if (t && soap->labidx)
+ { memcpy(soap->labbuf, t, soap->labidx);
+ free(t);
+ }
+ }
+ if (s)
+ { memcpy(soap->labbuf + soap->labidx, s, n);
+ soap->labidx += n;
+ }
+ return SOAP_OK;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_peek_element(struct soap *soap)
+{ struct soap_attribute *tp;
+ const char *t;
+ register char *s;
+ register wchar c;
+ register int i;
+ if (soap->peeked)
+ { if (*soap->tag == '\0')
+ return soap->error = SOAP_NO_TAG;
+ return SOAP_OK;
+ }
+ soap->peeked = 1;
+ for (;;)
+ { while (((c = soap_get(soap)) != LT) && c != TT)
+ { if ((int)c == EOF)
+ return soap->error = SOAP_EOF;
+ }
+ if (c == TT)
+ { *soap->tag = '\0';
+ return soap->error = SOAP_NO_TAG; /* ending tag found */
+ }
+ s = soap->tag;
+ do c = soap_get(soap);
+ while (soap_blank(c));
+ i = sizeof(soap->tag);
+ while (c != '/' && soap_notblank(c))
+ { if (--i > 0)
+ *s++ = (char)c;
+ c = soap_get(soap);
+ }
+ while (soap_blank(c))
+ c = soap_get(soap);
+ *s = '\0';
+ if (*soap->tag != '?')
+ break;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "XML PI <%s?>\n", soap->tag));
+ while ((int)c != EOF && c != GT && c != '?')
+ { s = soap->tmpbuf;
+ i = sizeof(soap->tmpbuf) - 2;
+ while (c != '=' && c != GT && c != '?' && soap_notblank(c))
+ { if (--i > 0)
+ *s++ = (char)c;
+ c = soap_get(soap);
+ }
+ while (soap_blank(c))
+ c = soap_get(soap);
+ if (c == '=')
+ { *s++ = '=';
+ do c = soap_get(soap);
+ while (soap_blank(c));
+ if (c != QT && c != AP)
+ { soap_unget(soap, c);
+ c = ' '; /* blank delimiter */
+ }
+ if (soap_getattrval(soap, s, i, c) == SOAP_EOM)
+ while (soap_getattrval(soap, soap->tmpbuf, sizeof(soap->tmpbuf), c) == SOAP_EOM)
+ ;
+ else if (!strcmp(soap->tag, "?xml") && (!soap_tag_cmp(soap->tmpbuf, "encoding=iso-8859-1") || !soap_tag_cmp(soap->tmpbuf, "encoding=latin1")))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "XML latin1 encoding\n"));
+ soap->mode |= SOAP_C_LATIN;
+ }
+ }
+ do c = soap_get(soap);
+ while (soap_blank(c));
+ }
+ }
+ soap->id[0] = '\0';
+ soap->href[0] = '\0';
+ soap->type[0] = '\0';
+ soap->arrayType[0] = '\0';
+ soap->arraySize[0] = '\0';
+ soap->arrayOffset[0] = '\0';
+ soap->other = 0;
+ soap->root = -1;
+ soap->position = 0;
+ soap->null = 0;
+ soap->mustUnderstand = 0;
+ soap_clr_attr(soap);
+ soap_pop_namespace(soap);
+ while ((int)c != EOF && c != GT && c != '/')
+ { s = soap->tmpbuf;
+ i = sizeof(soap->tmpbuf);
+ while (c != '=' && c != '/' && soap_notblank(c))
+ { if (--i > 0)
+ *s++ = (char)c;
+ c = soap_get(soap);
+ }
+ *s = '\0';
+ if (i == sizeof(soap->tmpbuf))
+ return soap->error = SOAP_SYNTAX_ERROR;
+ if (!strncmp(soap->tmpbuf, "xmlns:", 6))
+ { soap->tmpbuf[5] = '\0';
+ t = soap->tmpbuf + 6;
+ }
+ else if (!strcmp(soap->tmpbuf, "xmlns"))
+ t = SOAP_STR_EOS;
+ else
+ t = NULL;
+ tp = soap_attr(soap, soap->tmpbuf);
+ if (!tp)
+ { tp = (struct soap_attribute*)SOAP_MALLOC(sizeof(struct soap_attribute) + strlen(soap->tmpbuf));
+ if (!tp)
+ return soap->error = SOAP_EOM;
+ strcpy(tp->name, soap->tmpbuf);
+ tp->value = NULL;
+ tp->size = 0;
+ tp->next = soap->attributes;
+ soap->attributes = tp;
+ }
+ while (soap_blank(c))
+ c = soap_get(soap);
+ if (c == '=')
+ { do c = soap_get(soap);
+ while (soap_blank(c));
+ if (c != QT && c != AP)
+ { soap_unget(soap, c);
+ c = ' '; /* blank delimiter */
+ }
+ if (soap_getattrval(soap, tp->value, tp->size, c))
+ {
+#ifdef WITH_FAST
+ if (soap->error != SOAP_EOM)
+ return soap->error;
+ soap->error = SOAP_OK;
+ soap->labidx = 0;
+ if (soap_append_lab(soap, tp->value, tp->size))
+ return soap->error;
+ SOAP_FREE(tp->value);
+ for (;;)
+ { if (soap_getattrval(soap, soap->labbuf + soap->labidx, soap->lablen - soap->labidx, c))
+ { if (soap->error != SOAP_EOM)
+ return soap->error;
+ soap->error = SOAP_OK;
+ soap->labidx = soap->lablen;
+ if (soap_append_lab(soap, NULL, 0))
+ return soap->error;
+ }
+ else
+ break;
+ }
+ tp->size = soap->lablen;
+ if (!(tp->value = (char*)SOAP_MALLOC(tp->size)))
+ return soap->error = SOAP_EOM;
+ memcpy(tp->value, soap->labbuf, soap->lablen);
+#else
+ size_t n;
+ if (soap->error != SOAP_EOM)
+ return soap->error;
+ soap->error = SOAP_OK;
+ if (soap_new_block(soap))
+ return soap->error;
+ for (;;)
+ { if (!(s = (char*)soap_push_block(soap, SOAP_BLKLEN)))
+ return soap->error;
+ if (soap_getattrval(soap, s, SOAP_BLKLEN, c))
+ { if (soap->error != SOAP_EOM)
+ return soap->error;
+ soap->error = SOAP_OK;
+ }
+ else
+ break;
+ }
+ n = tp->size + soap->blist->size;
+ if (!(s = (char*)SOAP_MALLOC(n)))
+ return soap->error = SOAP_EOM;
+ if (tp->value)
+ { memcpy(s, tp->value, tp->size);
+ SOAP_FREE(tp->value);
+ }
+ soap_save_block(soap, s + tp->size);
+ tp->value = s;
+ tp->size = n;
+#endif
+ }
+ do c = soap_get(soap);
+ while (soap_blank(c));
+ tp->visible = 2; /* seen this attribute w/ value */
+ }
+ else
+ tp->visible = 1; /* seen this attribute w/o value */
+ if (t && tp->value)
+ { if (soap_push_namespace(soap, t, tp->value))
+ return soap->error;
+ tp->visible = 0;
+ }
+ }
+ if ((int)c == EOF)
+ return soap->error = SOAP_EOF;
+ for (tp = soap->attributes; tp; tp = tp->next)
+ { if (tp->visible && tp->value)
+ { if (!strcmp(tp->name, "id"))
+ { if (soap->part != SOAP_IN_HEADER || !soap->dot_net_bug)
+ { *soap->id = '#';
+ strncpy(soap->id + 1, tp->value, sizeof(soap->id) - 2);
+ }
+ }
+ else if (soap->version == 1 && !strcmp(tp->name, "href"))
+ strncpy(soap->href, tp->value, sizeof(soap->href) - 1);
+ else if (soap->version == 2 && !strcmp(tp->name, "ref"))
+ { *soap->href = '#';
+ strncpy(soap->href + 1, tp->value, sizeof(soap->href) - 2);
+ }
+ else if (!soap_match_tag(soap, tp->name, "xsi:type"))
+ strncpy(soap->type, tp->value, sizeof(soap->type) - 1);
+ else if (soap->version == 1 && !soap_match_tag(soap, tp->name, "SOAP-ENC:arrayType"))
+ { s = soap_strrchr(tp->value, '[');
+ if (s && (size_t)(s - tp->value) < sizeof(soap->arrayType))
+ { strncpy(soap->arrayType, tp->value, s - tp->value);
+ soap->arrayType[s - tp->value] = '\0';
+ strncpy(soap->arraySize, s, sizeof(soap->arraySize) - 1);
+ }
+ else
+ strncpy(soap->arrayType, tp->value, sizeof(soap->arrayType) - 1);
+ }
+ else if (soap->version == 2 && !soap_match_tag(soap, tp->name, "SOAP-ENC:itemType"))
+ strncpy(soap->arrayType, tp->value, sizeof(soap->arrayType) - 1);
+ else if (soap->version == 2 && !soap_match_tag(soap, tp->name, "SOAP-ENC:arraySize"))
+ strncpy(soap->arraySize, tp->value, sizeof(soap->arraySize) - 1);
+ else if (soap->version == 1 && !soap_match_tag(soap, tp->name, "SOAP-ENC:offset"))
+ strncpy(soap->arrayOffset, tp->value, sizeof(soap->arrayOffset));
+ else if (soap->version == 1 && !soap_match_tag(soap, tp->name, "SOAP-ENC:position"))
+ soap->position = soap_getposition(tp->value, soap->positions);
+ else if (soap->version == 1 && !soap_match_tag(soap, tp->name, "SOAP-ENC:root"))
+ soap->root = ((!strcmp(tp->value, "1") || !strcmp(tp->value, "true")));
+ else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:actor")
+ || !soap_match_tag(soap, tp->name, "SOAP-ENV:role"))
+ { if ((!soap->actor || strcmp(soap->actor, tp->value))
+ && strcmp(tp->value, "http://schemas.xmlsoap.org/soap/actor/next")
+ && strcmp(tp->value, "http://www.w3.org/2003/05/soap-envelope/role/next"))
+ soap->other = 1;
+ }
+ else if (!soap_match_tag(soap, tp->name, "SOAP-ENV:mustUnderstand")
+ && (!strcmp(tp->value, "1") || !strcmp(tp->value, "true")))
+ soap->mustUnderstand = 1;
+ else if ((!soap_match_tag(soap, tp->name, "xsi:null")
+ || !soap_match_tag(soap, tp->name, "xsi:nil"))
+ && (!strcmp(tp->value, "1")
+ || !strcmp(tp->value, "true")))
+ soap->null = 1;
+ }
+ }
+ if (!(soap->body = (c != '/')))
+ do c = soap_get(soap);
+ while (soap_blank(c));
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_retry(struct soap *soap)
+{ soap->peeked = 1;
+ soap->error = SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_revert(struct soap *soap)
+{ soap->peeked = 1;
+ if (soap->body)
+ soap->level--;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Reverting last element (level=%u)\n", soap->level));
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_string_out(struct soap *soap, const char *s, int flag)
+{ register const char *t;
+ register wchar c;
+ register wchar mask = 0x80000000;
+#ifdef WITH_DOM
+ if ((soap->mode & SOAP_XML_DOM) && soap->dom)
+ { soap->dom->data = soap_strdup(soap, s); /* check EOM */
+ return SOAP_OK;
+ }
+#endif
+ if (soap->mode & SOAP_C_UTFSTRING)
+ mask = 0;
+ t = s;
+ while ((c = *t++))
+ { switch (c)
+ {
+ case 9:
+ if (flag)
+ { if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "	", 5))
+ return soap->error;
+ s = t;
+ }
+ break;
+ case 10:
+ if (flag || !(soap->mode & SOAP_XML_CANONICAL))
+ { if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "
", 5))
+ return soap->error;
+ s = t;
+ }
+ break;
+ case 13:
+ if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "
", 5))
+ return soap->error;
+ s = t;
+ break;
+ case '&':
+ if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "&", 5))
+ return soap->error;
+ s = t;
+ break;
+ case '<':
+ if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, "<", 4))
+ return soap->error;
+ s = t;
+ break;
+ case '>':
+ if (!flag)
+ { if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, ">", 4))
+ return soap->error;
+ s = t;
+ }
+ break;
+ case '"':
+ if (flag)
+ { if (soap_send_raw(soap, s, t - s - 1) || soap_send_raw(soap, """, 6))
+ return soap->error;
+ s = t;
+ }
+ break;
+ default:
+#ifdef HAVE_MBTOWC
+ if (soap->mode & SOAP_C_MBSTRING)
+ { wchar_t wc;
+ register int m = mbtowc(&wc, t - 1, MB_CUR_MAX);
+ if (m > 0 && wc != c)
+ { if (soap_send_raw(soap, s, t - s - 1) || soap_pututf8(soap, wc))
+ return soap->error;
+ s = t + m - 1;
+ continue;
+ }
+ }
+#endif
+ if (c & mask)
+ { if (soap_send_raw(soap, s, t - s - 1) || soap_pututf8(soap, (unsigned char)c))
+ return soap->error;
+ s = t;
+ }
+ }
+ }
+ return soap_send_raw(soap, s, t - s - 1);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+char *
+SOAP_FMAC2
+soap_string_in(struct soap *soap, int flag)
+{ register char *s;
+ char *t = NULL;
+ register size_t i;
+ register int n = 0;
+ register int m = 0;
+ register wchar c;
+#ifdef HAVE_WCTOMB
+ char buf[MB_LEN_MAX > 8 ? MB_LEN_MAX : 8];
+#else
+ char buf[8];
+#endif
+#ifdef WITH_CDATA
+ if (!flag)
+ { register int state = 0;
+#ifdef WITH_FAST
+ soap->labidx = 0; /* use look-aside buffer */
+#else
+ if (soap_new_block(soap))
+ return NULL;
+#endif
+ for (;;)
+ {
+#ifdef WITH_FAST
+ register size_t k;
+ if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */
+ return NULL;
+ s = soap->labbuf + soap->labidx; /* space to populate */
+ k = soap->lablen - soap->labidx; /* number of bytes available */
+ soap->labidx = soap->lablen; /* claim this space */
+#else
+ register size_t k = SOAP_BLKLEN;
+ if (!(s = (char*)soap_push_block(soap, k)))
+ return NULL;
+#endif
+ for (i = 0; i < k; i++)
+ { if (m > 0)
+ { *s++ = *t++; /* copy multibyte characters */
+ m--;
+ continue;
+ }
+ c = soap_getchar(soap);
+ if ((int)c == EOF)
+ goto end;
+ if (c >= 0x80 && !(soap->mode & SOAP_C_LATIN))
+ { soap_unget(soap, c);
+ c = soap_getutf8(soap);
+ if (soap->mode & SOAP_C_UTFSTRING)
+ { if ((c & 0x80000000) && c >= -0x7FFFFF80 && c < AP)
+ { c &= 0x7FFFFFFF;
+ t = buf;
+ if (c < 0x0800)
+ *t++ = (char)(0xC0 | ((c >> 6) & 0x1F));
+ else
+ { if (c < 0x010000)
+ *t++ = (char)(0xE0 | ((c >> 12) & 0x0F));
+ else
+ { if (c < 0x200000)
+ *t++ = (char)(0xF0 | ((c >> 18) & 0x07));
+ else
+ { if (c < 0x04000000)
+ *t++ = (char)(0xF8 | ((c >> 24) & 0x03));
+ else
+ { *t++ = (char)(0xFC | ((c >> 30) & 0x01));
+ *t++ = (char)(0x80 | ((c >> 24) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 18) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 12) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 6) & 0x3F));
+ }
+ *t++ = (char)(0x80 | (c & 0x3F));
+ m = (int)(t - buf) - 1;
+ t = buf;
+ *s++ = *t++;
+ continue;
+ }
+ }
+ }
+ switch (state)
+ { case 1:
+ if (c == ']')
+ state = 4;
+ *s++ = c;
+ continue;
+ case 2:
+ if (c == '-')
+ state = 6;
+ *s++ = c;
+ continue;
+ case 3:
+ if (c == '?')
+ state = 8;
+ *s++ = c;
+ continue;
+ /* CDATA */
+ case 4:
+ if (c == ']')
+ state = 5;
+ else
+ state = 1;
+ *s++ = c;
+ continue;
+ case 5:
+ if (c == '>')
+ state = 0;
+ else
+ state = 1;
+ *s++ = c;
+ continue;
+ /* comment */
+ case 6:
+ if (c == '-')
+ state = 7;
+ else
+ state = 2;
+ *s++ = c;
+ continue;
+ case 7:
+ if (c == '>')
+ state = 0;
+ else
+ state = 2;
+ *s++ = c;
+ continue;
+ /* PI */
+ case 8:
+ if (c == '>')
+ state = 0;
+ else
+ state = 3;
+ *s++ = c;
+ continue;
+ }
+ switch (c)
+ {
+ case '/':
+ if (n > 0)
+ { c = soap_get1(soap);
+ if (c == '>')
+ n--;
+ soap_unget(soap, c);
+ }
+ *s++ = '/';
+ break;
+ case '<':
+ c = soap_get1(soap);
+ if (c == '/')
+ { if (n == 0)
+ { c = TT;
+ goto end;
+ }
+ n--;
+ }
+ else if (c == '!')
+ { c = soap_get1(soap);
+ if (c == '[')
+ { do c = soap_get1(soap);
+ while ((int)c != EOF && c != '[');
+ if ((int)c == EOF)
+ goto end;
+ t = (char*)"![CDATA[";
+ state = 1;
+ }
+ else if (c == '-')
+ { if ((c = soap_get1(soap)) == '-')
+ state = 2;
+ t = (char*)"!-";
+ soap_unget(soap, c);
+ }
+ else
+ { t = (char*)"!";
+ soap_unget(soap, c);
+ }
+ *s++ = '<';
+ break;
+ }
+ else if (c == '?')
+ state = 3;
+ else
+ n++;
+ soap_unget(soap, c);
+ *s++ = '<';
+ break;
+ case '>':
+ *s++ = '>';
+ break;
+ case '"':
+ *s++ = '"';
+ break;
+ default:
+#ifdef HAVE_WCTOMB
+ if (soap->mode & SOAP_C_MBSTRING)
+ { m = wctomb(buf, c & 0x7FFFFFFF);
+ if (m >= 1)
+ { t = buf;
+ *s++ = *t++;
+ m--;
+ }
+ else
+ *s++ = SOAP_UNKNOWN_CHAR;
+ }
+ else
+#endif
+ *s++ = (char)(c & 0xFF);
+ }
+ }
+ }
+ }
+#endif
+#ifdef WITH_FAST
+ soap->labidx = 0; /* use look-aside buffer */
+#else
+ if (soap_new_block(soap))
+ return NULL;
+#endif
+ for (;;)
+ {
+#ifdef WITH_FAST
+ register size_t k;
+ if (soap_append_lab(soap, NULL, 0)) /* allocate more space in look-aside buffer if necessary */
+ return NULL;
+ s = soap->labbuf + soap->labidx; /* space to populate */
+ k = soap->lablen - soap->labidx; /* number of bytes available */
+ soap->labidx = soap->lablen; /* claim this space */
+#else
+ register size_t k = SOAP_BLKLEN;
+ if (!(s = (char*)soap_push_block(soap, k)))
+ return NULL;
+#endif
+ for (i = 0; i < k; i++)
+ { if (m > 0)
+ { *s++ = *t++; /* copy multibyte characters */
+ m--;
+ continue;
+ }
+ if (soap->mode & SOAP_C_UTFSTRING)
+ { if (((c = soap_get(soap)) & 0x80000000) && c >= -0x7FFFFF80 && c < AP)
+ { c &= 0x7FFFFFFF;
+ t = buf;
+ if (c < 0x0800)
+ *t++ = (char)(0xC0 | ((c >> 6) & 0x1F));
+ else
+ { if (c < 0x010000)
+ *t++ = (char)(0xE0 | ((c >> 12) & 0x0F));
+ else
+ { if (c < 0x200000)
+ *t++ = (char)(0xF0 | ((c >> 18) & 0x07));
+ else
+ { if (c < 0x04000000)
+ *t++ = (char)(0xF8 | ((c >> 24) & 0x03));
+ else
+ { *t++ = (char)(0xFC | ((c >> 30) & 0x01));
+ *t++ = (char)(0x80 | ((c >> 24) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 18) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 12) & 0x3F));
+ }
+ *t++ = (char)(0x80 | ((c >> 6) & 0x3F));
+ }
+ *t++ = (char)(0x80 | (c & 0x3F));
+ m = (int)(t - buf) - 1;
+ t = buf;
+ *s++ = *t++;
+ continue;
+ }
+ }
+ else if (soap->mode & SOAP_C_LATIN)
+ c = soap_get(soap);
+ else
+ c = soap_getutf8(soap);
+ switch (c)
+ {
+ case TT:
+ if (n == 0)
+ goto end;
+ n--;
+ *s++ = '<';
+ soap_unget(soap, '/');
+ break;
+ case LT:
+ n++;
+ *s++ = '<';
+ break;
+ case GT:
+ *s++ = '>';
+ break;
+ case QT:
+ *s++ = '"';
+ break;
+ case AP:
+ *s++ = '\'';
+ break;
+ case '/':
+ if (n > 0)
+ { c = soap_get(soap);
+ if (c == GT)
+ n--;
+ soap_unget(soap, c);
+ }
+ *s++ = '/';
+ break;
+ case '<':
+ if (flag)
+ *s++ = '<';
+ else
+ { *s++ = '&';
+ t = (char*)"lt;";
+ }
+ break;
+ case '>':
+ if (flag)
+ *s++ = '>';
+ else
+ { *s++ = '&';
+ t = (char*)"gt;";
+ }
+ break;
+ case '"':
+ if (flag)
+ *s++ = '"';
+ else
+ { *s++ = '&';
+ t = (char*)"quot;";
+ }
+ break;
+ default:
+ if ((int)c == EOF)
+ goto end;
+#ifdef HAVE_WCTOMB
+ if (soap->mode & SOAP_C_MBSTRING)
+ { m = wctomb(buf, c & 0x7FFFFFFF);
+ if (m >= 1)
+ { t = buf;
+ *s++ = *t++;
+ m--;
+ }
+ else
+ *s++ = SOAP_UNKNOWN_CHAR;
+ }
+ else
+#endif
+ *s++ = (char)(c & 0xFF);
+ }
+ }
+ }
+end:
+ soap_unget(soap, c);
+ *s = '\0';
+#ifdef WITH_FAST
+ t = soap_strdup(soap, soap->labbuf);
+#else
+ soap_size_block(soap, i+1);
+ t = soap_save_block(soap, NULL);
+#endif
+ if (flag == 2)
+ if (soap_s2QName(soap, t, &t))
+ return NULL;
+ return t;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_wstring_out(struct soap *soap, const wchar_t *s, int flag)
+{ const char *t;
+ char tmp;
+ register wchar c;
+#ifdef WITH_DOM
+ if ((soap->mode & SOAP_XML_DOM) && soap->dom)
+ { soap->dom->wide = NULL; /* soap_malloc() ??? */
+ return SOAP_OK;
+ }
+#endif
+ while ((c = *s++))
+ { switch (c)
+ {
+ case 9:
+ if (flag)
+ t = "	";
+ else
+ t = "\t";
+ break;
+ case 10:
+ if (flag || !(soap->mode & SOAP_XML_CANONICAL))
+ t = "
";
+ else
+ t = "\n";
+ break;
+ case 13:
+ t = "
";
+ break;
+ case '&':
+ t = "&";
+ break;
+ case '<':
+ t = "<";
+ break;
+ case '>':
+ if (flag)
+ t = ">";
+ else
+ t = ">";
+ break;
+ case '"':
+ if (flag)
+ t = """;
+ else
+ t = "\"";
+ break;
+ default:
+ if (c > 0 && c < 0x80)
+ { tmp = (char)c;
+ if (soap_send_raw(soap, &tmp, 1))
+ return soap->error;
+ }
+ else if (soap_pututf8(soap, (unsigned long)c))
+ return soap->error;
+ continue;
+ }
+ if (soap_send(soap, t))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+wchar_t *
+SOAP_FMAC2
+soap_wstring_in(struct soap *soap, int flag)
+{ wchar_t *s;
+ register int i, n = 0;
+ register wchar c;
+ const char *t = NULL;
+ if (soap_new_block(soap))
+ return NULL;
+ for (;;)
+ { if (!(s = (wchar_t*)soap_push_block(soap, sizeof(wchar_t)*SOAP_BLKLEN)))
+ return NULL;
+ for (i = 0; i < SOAP_BLKLEN; i++)
+ { if (t)
+ { *s++ = (wchar_t)*t++;
+ if (!*t)
+ t = NULL;
+ continue;
+ }
+ if (soap->mode & SOAP_C_LATIN)
+ c = soap_get(soap);
+ else
+ c = soap_getutf8(soap);
+ switch (c)
+ {
+ case TT:
+ if (n == 0)
+ goto end;
+ n--;
+ *s++ = '<';
+ soap_unget(soap, '/');
+ break;
+ case LT:
+ n++;
+ *s++ = '<';
+ break;
+ case GT:
+ *s++ = '>';
+ break;
+ case QT:
+ *s++ = '"';
+ break;
+ case AP:
+ *s++ = '\'';
+ break;
+ case '/':
+ if (n > 0)
+ { c = soap_getutf8(soap);
+ if (c == GT)
+ n--;
+ soap_unget(soap, c);
+ }
+ *s++ = '/';
+ break;
+ case '<':
+ if (flag)
+ *s++ = (wchar)'<';
+ else
+ { *s++ = (wchar)'&';
+ t = "lt;";
+ }
+ break;
+ case '>':
+ if (flag)
+ *s++ = (wchar)'>';
+ else
+ { *s++ = (wchar)'&';
+ t = "gt;";
+ }
+ break;
+ case '"':
+ if (flag)
+ *s++ = (wchar)'"';
+ else
+ { *s++ = (wchar)'&';
+ t = "quot;";
+ }
+ break;
+ default:
+ if ((int)c == EOF)
+ goto end;
+ *s++ = (wchar_t)c & 0x7FFFFFFF;
+ }
+ }
+ }
+end:
+ soap_unget(soap, c);
+ *s = '\0';
+ soap_size_block(soap, sizeof(wchar_t) * (i + 1));
+ return (wchar_t*)soap_save_block(soap, NULL);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_int2s(struct soap *soap, int n)
+{ return soap_long2s(soap, (long)n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outint(struct soap *soap, const char *tag, int id, const int *p, const char *type, int n)
+{ long m = (long)*p;
+ return soap_outlong(soap, tag, id, &m, type, n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2int(struct soap *soap, const char *s, int *p)
+{ if (s)
+ { char *r;
+ *p = (int)soap_strtol(s, &r, 10);
+ if (*r)
+ return soap->error = SOAP_TYPE;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int *
+SOAP_FMAC2
+soap_inint(struct soap *soap, const char *tag, int *p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type
+ && soap_match_tag(soap, soap->type, type)
+ && soap_match_tag(soap, soap->type, ":int")
+ && soap_match_tag(soap, soap->type, ":short")
+ && soap_match_tag(soap, soap->type, ":byte"))
+ { soap->error = SOAP_TYPE;
+ soap_revert(soap);
+ return NULL;
+ }
+ p = (int*)soap_id_enter(soap, soap->id, p, t, sizeof(int), 0);
+ if (p && soap->body && !*soap->href)
+ soap_s2int(soap, soap_value(soap), p);
+ else
+ p = (int*)soap_id_forward(soap, soap->href, p, t, sizeof(int));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_long2s(struct soap *soap, long n)
+{ sprintf(soap->tmpbuf, "%ld", n);
+ return soap->tmpbuf;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outlong(struct soap *soap, const char *tag, int id, const long *p, const char *type, int n)
+{ if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
+ || soap_string_out(soap, soap_long2s(soap, *p), 0))
+ return soap->error;
+ return soap_element_end_out(soap, tag);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2long(struct soap *soap, const char *s, long *p)
+{ if (s)
+ { char *r;
+ *p = soap_strtol(s, &r, 10);
+ if (*r)
+ return soap->error = SOAP_TYPE;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+long *
+SOAP_FMAC2
+soap_inlong(struct soap *soap, const char *tag, long *p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type
+ && soap_match_tag(soap, soap->type, type)
+ && soap_match_tag(soap, soap->type, ":int")
+ && soap_match_tag(soap, soap->type, ":short")
+ && soap_match_tag(soap, soap->type, ":byte"))
+ { soap->error = SOAP_TYPE;
+ soap_revert(soap);
+ return NULL;
+ }
+ p = (long*)soap_id_enter(soap, soap->id, p, t, sizeof(long), 0);
+ if (p && soap->body && !*soap->href)
+ soap_s2long(soap, soap_value(soap), p);
+ else
+ p = (long*)soap_id_forward(soap, soap->href, p, t, sizeof(long));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_LONG642s(struct soap *soap, LONG64 n)
+{ sprintf(soap->tmpbuf, SOAP_LONG_FORMAT, n);
+ return soap->tmpbuf;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outLONG64(struct soap *soap, const char *tag, int id, const LONG64 *p, const char *type, int n)
+{ if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
+ || soap_string_out(soap, soap_LONG642s(soap, *p), 0))
+ return soap->error;
+ return soap_element_end_out(soap, tag);
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2LONG64(struct soap *soap, const char *s, LONG64 *p)
+{ if (s && sscanf(s, SOAP_LONG_FORMAT, p) != 1)
+ return soap->error = SOAP_TYPE;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+LONG64 *
+SOAP_FMAC2
+soap_inLONG64(struct soap *soap, const char *tag, LONG64 *p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type
+ && soap_match_tag(soap, soap->type, type)
+ && soap_match_tag(soap, soap->type, ":integer")
+ && soap_match_tag(soap, soap->type, ":positiveInteger")
+ && soap_match_tag(soap, soap->type, ":negativeInteger")
+ && soap_match_tag(soap, soap->type, ":nonPositiveInteger")
+ && soap_match_tag(soap, soap->type, ":nonNegativeInteger")
+ && soap_match_tag(soap, soap->type, ":long")
+ && soap_match_tag(soap, soap->type, ":int")
+ && soap_match_tag(soap, soap->type, ":short")
+ && soap_match_tag(soap, soap->type, ":byte"))
+ { soap->error = SOAP_TYPE;
+ soap_revert(soap);
+ return NULL;
+ }
+ p = (LONG64*)soap_id_enter(soap, soap->id, p, t, sizeof(LONG64), 0);
+ if (soap->body && !*soap->href)
+ soap_s2LONG64(soap, soap_value(soap), p);
+ else
+ p = (LONG64*)soap_id_forward(soap, soap->href, p, t, sizeof(LONG64));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_byte2s(struct soap *soap, char n)
+{ return soap_long2s(soap, (long)n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outbyte(struct soap *soap, const char *tag, int id, const char *p, const char *type, int n)
+{ long m = (long)*p;
+ return soap_outlong(soap, tag, id, &m, type, n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2byte(struct soap *soap, const char *s, char *p)
+{ if (s)
+ { long n;
+ char *r;
+ n = soap_strtol(s, &r, 10);
+ if (*r || n < -128 || n > 127)
+ return soap->error = SOAP_TYPE;
+ *p = (char)n;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+char *
+SOAP_FMAC2
+soap_inbyte(struct soap *soap, const char *tag, char *p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type
+ && soap_match_tag(soap, soap->type, type)
+ && soap_match_tag(soap, soap->type, ":byte"))
+ { soap->error = SOAP_TYPE;
+ soap_revert(soap);
+ return NULL;
+ }
+ p = (char*)soap_id_enter(soap, soap->id, p, t, sizeof(char), 0);
+ if (soap->body && !*soap->href)
+ soap_s2byte(soap, soap_value(soap), p);
+ else
+ p = (char*)soap_id_forward(soap, soap->href, p, t, sizeof(char));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_short2s(struct soap *soap, short n)
+{ return soap_long2s(soap, (long)n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outshort(struct soap *soap, const char *tag, int id, const short *p, const char *type, int n)
+{ long m = (long)*p;
+ return soap_outlong(soap, tag, id, &m, type, n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2short(struct soap *soap, const char *s, short *p)
+{ if (s)
+ { long n;
+ char *r;
+ n = soap_strtol(s, &r, 10);
+ if (*r || n < -32768 || n > 32767)
+ return soap->error = SOAP_TYPE;
+ *p = (char)n;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+short *
+SOAP_FMAC2
+soap_inshort(struct soap *soap, const char *tag, short *p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type
+ && soap_match_tag(soap, soap->type, type)
+ && soap_match_tag(soap, soap->type, ":short")
+ && soap_match_tag(soap, soap->type, ":byte"))
+ { soap->error = SOAP_TYPE;
+ soap_revert(soap);
+ return NULL;
+ }
+ p = (short*)soap_id_enter(soap, soap->id, p, t, sizeof(short), 0);
+ if (soap->body && !*soap->href)
+ soap_s2short(soap, soap_value(soap), p);
+ else
+ p = (short*)soap_id_forward(soap, soap->href, p, t, sizeof(short));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_float2s(struct soap *soap, float n)
+{ const char *s;
+ if (isnan(n))
+ s = "NaN";
+ else if (n >= FLT_PINFTY)
+ s = "INF";
+ else if (n <= FLT_NINFTY)
+ s = "-INF";
+ else
+ { sprintf(soap->tmpbuf, soap->float_format, n);
+ s = soap->tmpbuf;
+ }
+ return s;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outfloat(struct soap *soap, const char *tag, int id, const float *p, const char *type, int n)
+{ if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
+ || soap_string_out(soap, soap_float2s(soap, *p), 0))
+ return soap->error;
+ return soap_element_end_out(soap, tag);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2float(struct soap *soap, const char *s, float *p)
+{ if (s)
+ { if (!soap_tag_cmp(s, "INF"))
+ *p = FLT_PINFTY;
+ else if (!soap_tag_cmp(s, "+INF"))
+ *p = FLT_PINFTY;
+ else if (!soap_tag_cmp(s, "-INF"))
+ *p = FLT_NINFTY;
+ else if (!soap_tag_cmp(s, "NaN"))
+ *p = FLT_NAN;
+ else
+ {
+#ifdef HAVE_STRTOD
+ char *r;
+ *p = (float)strtod(s, &r);
+ if (*r)
+#endif
+ if (sscanf(s, soap->float_format, p) != 1)
+ return soap->error = SOAP_TYPE;
+ }
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+static int soap_isnumeric(struct soap *soap, const char *type)
+{ if (soap_match_tag(soap, soap->type, type)
+ && soap_match_tag(soap, soap->type, ":float")
+ && soap_match_tag(soap, soap->type, ":double")
+ && soap_match_tag(soap, soap->type, ":decimal")
+ && soap_match_tag(soap, soap->type, ":integer")
+ && soap_match_tag(soap, soap->type, ":positiveInteger")
+ && soap_match_tag(soap, soap->type, ":negativeInteger")
+ && soap_match_tag(soap, soap->type, ":nonPositiveInteger")
+ && soap_match_tag(soap, soap->type, ":nonNegativeInteger")
+ && soap_match_tag(soap, soap->type, ":long")
+ && soap_match_tag(soap, soap->type, ":int")
+ && soap_match_tag(soap, soap->type, ":short")
+ && soap_match_tag(soap, soap->type, ":byte")
+ && soap_match_tag(soap, soap->type, ":unsignedLong")
+ && soap_match_tag(soap, soap->type, ":unsignedInt")
+ && soap_match_tag(soap, soap->type, ":unsignedShort")
+ && soap_match_tag(soap, soap->type, ":unsignedByte"))
+ { soap->error = SOAP_TYPE;
+ soap_revert(soap);
+ return SOAP_ERR;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+float *
+SOAP_FMAC2
+soap_infloat(struct soap *soap, const char *tag, float *p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type != '\0' && soap_isnumeric(soap, type))
+ return NULL;
+ p = (float*)soap_id_enter(soap, soap->id, p, t, sizeof(float), 0);
+ if (soap->body && !*soap->href)
+ soap_s2float(soap, soap_value(soap), p);
+ else
+ p = (float*)soap_id_forward(soap, soap->href, p, t, sizeof(float));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_double2s(struct soap *soap, double n)
+{ const char *s;
+ if (isnan(n))
+ s = "NaN";
+ else if (n >= DBL_PINFTY)
+ s = "INF";
+ else if (n <= DBL_NINFTY)
+ s = "-INF";
+ else
+ { sprintf(soap->tmpbuf, soap->double_format, n);
+ s = soap->tmpbuf;
+ }
+ return s;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outdouble(struct soap *soap, const char *tag, int id, const double *p, const char *type, int n)
+{ if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
+ || soap_string_out(soap, soap_double2s(soap, *p), 0))
+ return soap->error;
+ return soap_element_end_out(soap, tag);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2double(struct soap *soap, const char *s, double *p)
+{ if (s)
+ { if (!soap_tag_cmp(s, "INF"))
+ *p = DBL_PINFTY;
+ else if (!soap_tag_cmp(s, "+INF"))
+ *p = DBL_PINFTY;
+ else if (!soap_tag_cmp(s, "-INF"))
+ *p = DBL_NINFTY;
+ else if (!soap_tag_cmp(s, "NaN"))
+ *p = DBL_NAN;
+ else
+ {
+#ifdef HAVE_STRTOD
+ char *r;
+ *p = strtod(s, &r);
+ if (*r)
+#endif
+ if (sscanf(s, soap->double_format, p) != 1)
+ return soap->error = SOAP_TYPE;
+ }
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+double *
+SOAP_FMAC2
+soap_indouble(struct soap *soap, const char *tag, double *p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type != '\0' && soap_isnumeric(soap, type))
+ return NULL;
+ p = (double*)soap_id_enter(soap, soap->id, p, t, sizeof(double), 0);
+ if (soap->body && !*soap->href)
+ soap_s2double(soap, soap_value(soap), p);
+ else
+ p = (double*)soap_id_forward(soap, soap->href, p, t, sizeof(double));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_unsignedByte2s(struct soap *soap, unsigned char n)
+{ return soap_unsignedLong2s(soap, (unsigned long)n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outunsignedByte(struct soap *soap, const char *tag, int id, const unsigned char *p, const char *type, int n)
+{ unsigned long m = (unsigned long)*p;
+ return soap_outunsignedLong(soap, tag, id, &m, type, n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2unsignedByte(struct soap *soap, const char *s, unsigned char *p)
+{ if (s)
+ { unsigned long n;
+ char *r;
+ n = soap_strtoul(s, &r, 10);
+ if (*r || n > 255)
+ return soap->error = SOAP_TYPE;
+ *p = (unsigned char)n;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+unsigned char *
+SOAP_FMAC2
+soap_inunsignedByte(struct soap *soap, const char *tag, unsigned char *p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type
+ && soap_match_tag(soap, soap->type, type)
+ && soap_match_tag(soap, soap->type, ":unsignedByte"))
+ { soap->error = SOAP_TYPE;
+ soap_revert(soap);
+ return NULL;
+ }
+ p = (unsigned char*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned char), 0);
+ if (soap->body && !*soap->href)
+ soap_s2unsignedByte(soap, soap_value(soap), p);
+ else
+ p = (unsigned char*)soap_id_forward(soap, soap->href, p, t, sizeof(unsigned char));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_unsignedShort2s(struct soap *soap, unsigned short n)
+{ return soap_unsignedLong2s(soap, (unsigned long)n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outunsignedShort(struct soap *soap, const char *tag, int id, const unsigned short *p, const char *type, int n)
+{ unsigned long m = (unsigned long)*p;
+ return soap_outunsignedLong(soap, tag, id, &m, type, n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2unsignedShort(struct soap *soap, const char *s, unsigned short *p)
+{ if (s)
+ { unsigned long n;
+ char *r;
+ n = soap_strtoul(s, &r, 10);
+ if (*r || n > 65535)
+ return soap->error = SOAP_TYPE;
+ *p = (unsigned short)n;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+unsigned short *
+SOAP_FMAC2
+soap_inunsignedShort(struct soap *soap, const char *tag, unsigned short *p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type
+ && soap_match_tag(soap, soap->type, type)
+ && soap_match_tag(soap, soap->type, ":unsignedShort")
+ && soap_match_tag(soap, soap->type, ":unsignedByte"))
+ { soap->error = SOAP_TYPE;
+ soap_revert(soap);
+ return NULL;
+ }
+ p = (unsigned short*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned short), 0);
+ if (soap->body && !*soap->href)
+ soap_s2unsignedShort(soap, soap_value(soap), p);
+ else
+ p = (unsigned short*)soap_id_forward(soap, soap->href, p, t, sizeof(unsigned short));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_unsignedInt2s(struct soap *soap, unsigned int n)
+{ return soap_unsignedLong2s(soap, (unsigned long)n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outunsignedInt(struct soap *soap, const char *tag, int id, const unsigned int *p, const char *type, int n)
+{ unsigned long m = (unsigned long)*p;
+ return soap_outunsignedLong(soap, tag, id, &m, type, n);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2unsignedInt(struct soap *soap, const char *s, unsigned int *p)
+{ if (s)
+ { char *r;
+ *p = (unsigned int)soap_strtoul(s, &r, 10);
+ if (*r)
+ return soap->error = SOAP_TYPE;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+unsigned int *
+SOAP_FMAC2
+soap_inunsignedInt(struct soap *soap, const char *tag, unsigned int *p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type
+ && soap_match_tag(soap, soap->type, type)
+ && soap_match_tag(soap, soap->type, ":unsignedInt")
+ && soap_match_tag(soap, soap->type, ":unsignedShort")
+ && soap_match_tag(soap, soap->type, ":unsignedByte"))
+ { soap->error = SOAP_TYPE;
+ soap_revert(soap);
+ return NULL;
+ }
+ p = (unsigned int*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned int), 0);
+ if (soap->body && !*soap->href)
+ soap_s2unsignedInt(soap, soap_value(soap), p);
+ else
+ p = (unsigned int*)soap_id_forward(soap, soap->href, p, t, sizeof(unsigned int));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_unsignedLong2s(struct soap *soap, unsigned long n)
+{ sprintf(soap->tmpbuf, "%lu", n);
+ return soap->tmpbuf;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outunsignedLong(struct soap *soap, const char *tag, int id, const unsigned long *p, const char *type, int n)
+{ if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
+ || soap_string_out(soap, soap_unsignedLong2s(soap, *p), 0))
+ return soap->error;
+ return soap_element_end_out(soap, tag);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2unsignedLong(struct soap *soap, const char *s, unsigned long *p)
+{ if (s)
+ { char *r;
+ *p = soap_strtoul(s, &r, 10);
+ if (*r)
+ return soap->error = SOAP_TYPE;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+unsigned long *
+SOAP_FMAC2
+soap_inunsignedLong(struct soap *soap, const char *tag, unsigned long *p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type
+ && soap_match_tag(soap, soap->type, type)
+ && soap_match_tag(soap, soap->type, ":unsignedInt")
+ && soap_match_tag(soap, soap->type, ":unsignedShort")
+ && soap_match_tag(soap, soap->type, ":unsignedByte"))
+ { soap->error = SOAP_TYPE;
+ soap_revert(soap);
+ return NULL;
+ }
+ p = (unsigned long*)soap_id_enter(soap, soap->id, p, t, sizeof(unsigned long), 0);
+ if (soap->body && !*soap->href)
+ soap_s2unsignedLong(soap, soap_value(soap), p);
+ else
+ p = (unsigned long*)soap_id_forward(soap, soap->href, p, t, sizeof(unsigned long));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_ULONG642s(struct soap *soap, ULONG64 n)
+{ sprintf(soap->tmpbuf, SOAP_ULONG_FORMAT, n);
+ return soap->tmpbuf;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outULONG64(struct soap *soap, const char *tag, int id, const ULONG64 *p, const char *type, int n)
+{ if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
+ || soap_string_out(soap, soap_ULONG642s(soap, *p), 0))
+ return soap->error;
+ return soap_element_end_out(soap, tag);
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2ULONG64(struct soap *soap, const char *s, ULONG64 *p)
+{ if (s && sscanf(s, SOAP_ULONG_FORMAT, p) != 1)
+ return soap->error = SOAP_TYPE;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+ULONG64 *
+SOAP_FMAC2
+soap_inULONG64(struct soap *soap, const char *tag, ULONG64 *p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type
+ && soap_match_tag(soap, soap->type, type)
+ && soap_match_tag(soap, soap->type, ":positiveInteger")
+ && soap_match_tag(soap, soap->type, ":nonNegativeInteger")
+ && soap_match_tag(soap, soap->type, ":unsignedLong")
+ && soap_match_tag(soap, soap->type, ":unsignedInt")
+ && soap_match_tag(soap, soap->type, ":unsignedShort")
+ && soap_match_tag(soap, soap->type, ":unsignedByte"))
+ { soap->error = SOAP_TYPE;
+ soap_revert(soap);
+ return NULL;
+ }
+ p = (ULONG64*)soap_id_enter(soap, soap->id, p, t, sizeof(ULONG64), 0);
+ if (soap->body && !*soap->href)
+ soap_s2ULONG64(soap, soap_value(soap), p);
+ else
+ p = (ULONG64*)soap_id_forward(soap, soap->href, p, t, sizeof(ULONG64));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2string(struct soap *soap, const char *s, char **t)
+{ *t = NULL;
+ if (s && !(*t = soap_strdup(soap, s)))
+ return soap->error = SOAP_EOM;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2QName(struct soap *soap, const char *s, char **t)
+{ if (s)
+ { struct soap_nlist *np = soap->nlist;
+ const char *p = strchr(s, ':');
+ if (p)
+ { int n = p - s;
+ while (np && (np->index == -2 || strncmp(np->id, s, n) || np->id[n]))
+ np = np->next;
+ p++;
+ }
+ else
+ { while (np && *np->id)
+ np = np->next;
+ p = s;
+ }
+ if (np)
+ { if (np->index >= 0 && soap->local_namespaces)
+ { const char *q = soap->local_namespaces[np->index].id;
+ if (q)
+ { if ((*t = (char*)soap_malloc(soap, strlen(p) + strlen(q) + 2)))
+ sprintf(*t, "%s:%s", q, p);
+ return SOAP_OK;
+ }
+ }
+ if (np->ns)
+ { if ((*t = (char*)soap_malloc(soap, strlen(p) + strlen(np->ns) + 4)))
+ sprintf(*t, "\"%s\":%s", np->ns, p);
+ return SOAP_OK;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Namespace prefix of '%s' not defined (index=%d, URI=%s)\n", s, np->index, np->ns?np->ns:""));
+ return soap->error = SOAP_NAMESPACE;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Namespace prefix of '%s' not defined, assuming empty namespace\n", s));
+ if ((*t = (char*)soap_malloc(soap, strlen(p) + 4)))
+ sprintf(*t, "\"\":%s", p);
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_QName2s(struct soap *soap, const char *s)
+{ struct Namespace *p;
+ char *t;
+ int n;
+ if (!s || *s != '"')
+ return s;
+ s++;
+ if ((p = soap->local_namespaces))
+ { for (; p->id; p++)
+ { if (p->ns)
+ if (!soap_tag_cmp(s, p->ns))
+ break;
+ if (p->in)
+ if (!soap_tag_cmp(s, p->in))
+ break;
+ }
+ if (p && p->id)
+ { s = strchr(s, '"');
+ if (s)
+ { t = (char*)soap_malloc(soap, strlen(p->id) + strlen(s));
+ strcpy(t, p->id);
+ strcat(t, s + 1);
+ return t;
+ }
+ }
+ }
+ t = (char*)strchr(s, '"');
+ if (t)
+ n = t - s;
+ else
+ n = 0;
+ t = soap_strdup(soap, s);
+ t[n] = '\0';
+ sprintf(soap->tmpbuf, "xmlns:_%lu", soap->idnum++);
+ soap_set_attr(soap, soap->tmpbuf, t);
+ s = strchr(s, '"');
+ if (s)
+ { t = (char*)soap_malloc(soap, strlen(soap->tmpbuf) + strlen(s) - 6);
+ strcpy(t, soap->tmpbuf + 6);
+ strcat(t, s + 1);
+ }
+ return t;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outstring(struct soap *soap, const char *tag, int id, char *const*p, const char *type, int n)
+{ if (!*p)
+ { if (soap_element_null(soap, tag, id, type))
+ return soap->error;
+ }
+ else
+ { struct soap_plist *pp;
+ int i = soap_pointer_lookup(soap, *p, n, &pp);
+ if (id > 0)
+ { if (i)
+ { if (soap_element_begin_out(soap, tag, id, type) || soap_string_out(soap, *p, 0) || soap_element_end_out(soap, tag))
+ return soap->error;
+ soap_set_embedded(soap, pp);
+ }
+ else
+ { i = soap_pointer_enter(soap, *p, n, &pp);
+ if (soap_element_begin_out(soap, tag, id, type) || soap_string_out(soap, *p, 0) || soap_element_end_out(soap, tag))
+ return soap->error;
+ if (soap->mode & SOAP_IO_LENGTH)
+ pp->mark1 = 0;
+ else
+ pp->mark2 = 0;
+ }
+ }
+ else if (i)
+ { if (soap_is_embedded(soap, pp))
+ { if (soap_element_ref(soap, tag, 0, i))
+ return soap->error;
+ }
+ else if (soap_is_single(soap, pp))
+ { if (soap_element_begin_out(soap, tag, 0, type) || soap_string_out(soap, *p, 0) || soap_element_end_out(soap, tag))
+ return soap->error;
+ }
+ else
+ { if (soap_element_begin_out(soap, tag, i, type) || soap_string_out(soap, *p, 0) || soap_element_end_out(soap, tag))
+ return soap->error;
+ soap_set_embedded(soap, pp);
+ }
+ }
+ else
+ { soap_pointer_enter(soap, *p, n, &pp);
+ if (soap_element_begin_out(soap, tag, id, type) || soap_string_out(soap, *p, 0) || soap_element_end_out(soap, tag))
+ return soap->error;
+ if (soap->mode & SOAP_IO_LENGTH)
+ pp->mark1 = 0;
+ else
+ pp->mark2 = 0;
+ }
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+char **
+SOAP_FMAC2
+soap_instring(struct soap *soap, const char *tag, char **p, const char *type, int t, int flag)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { p = (char**)soap_id_enter(soap, soap->id, p, t, sizeof(char**), 0);
+ if (p)
+ *p = NULL;
+ }
+ else if (soap->body && !*soap->href)
+ { if (soap_match_tag(soap, soap->type, "PointerTostring") == 0)
+ { p = (char**)soap_id_enter(soap, soap->id, p, t, sizeof(char**), 0);
+ p = (char**)soap_instring(soap, "string", p, type, t, flag);
+ }
+ else
+ { if (!p)
+ if ((p = (char**)soap_id_enter(soap, SOAP_STR_EOS, p, t, sizeof(char**), 0)) == NULL)
+ return NULL;
+ *p = (char*)soap_id_enter(soap, soap->id, soap_string_in(soap, flag), t, 0, 0);
+ }
+ }
+ else
+ p = (char**)soap_id_lookup(soap, soap->href, (void**)p, t, sizeof(char*), 0);
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outwstring(struct soap *soap, const char *tag, int id, wchar_t *const*p, const char *type, int n)
+{ if (!*p)
+ { if (soap_element_null(soap, tag, id, type))
+ return soap->error;
+ }
+ else
+ { struct soap_plist *pp;
+ int i = soap_pointer_lookup(soap, *p, n, &pp);
+ if (id > 0)
+ { if (i)
+ { if (soap_element_begin_out(soap, tag, id, type) || soap_wstring_out(soap, *p, 0) || soap_element_end_out(soap, tag))
+ return soap->error;
+ soap_set_embedded(soap, pp);
+ }
+ else
+ { i = soap_pointer_enter(soap, *p, n, &pp);
+ if (soap_element_begin_out(soap, tag, id, type) || soap_wstring_out(soap, *p, 0) || soap_element_end_out(soap, tag))
+ return soap->error;
+ if (soap->mode & SOAP_IO_LENGTH)
+ pp->mark1 = 0;
+ else
+ pp->mark2 = 0;
+ }
+ }
+ else if (i)
+ { if (soap_is_embedded(soap, pp))
+ { if (soap_element_ref(soap, tag, 0, i))
+ return soap->error;
+ }
+ else if (soap_is_single(soap, pp))
+ { if (soap_element_begin_out(soap, tag, 0, type) || soap_wstring_out(soap, *p, 0) || soap_element_end_out(soap, tag))
+ return soap->error;
+ }
+ else
+ { if (soap_element_begin_out(soap, tag, i, type) || soap_wstring_out(soap, *p, 0) || soap_element_end_out(soap, tag))
+ return soap->error;
+ soap_set_embedded(soap, pp);
+ }
+ }
+ else
+ { if (soap_element_begin_out(soap, tag, id, type) || soap_wstring_out(soap, *p, 0) || soap_element_end_out(soap, tag))
+ return soap->error;
+ if (soap->mode & SOAP_IO_LENGTH)
+ pp->mark1 = 0;
+ else
+ pp->mark2 = 0;
+ }
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+wchar_t **
+SOAP_FMAC2
+soap_inwstring(struct soap *soap, const char *tag, wchar_t **p, const char *type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { p = (wchar_t**)soap_id_enter(soap, soap->id, p, t, sizeof(wchar_t**), 0);
+ if (p)
+ *p = NULL;
+ }
+ else if (soap->body && !*soap->href)
+ { if (soap_match_tag(soap, soap->type, "PointerTostring") == 0)
+ p = (wchar_t**)soap_inwstring(soap, "string", (wchar_t**)soap_id_enter(soap, soap->id, p, t, sizeof(wchar_t**), 0), type, t);
+ else
+ { if (!p)
+ if (!(p = (wchar_t**)soap_id_enter(soap, SOAP_STR_EOS, p, t, sizeof(wchar_t**), 0)))
+ return NULL;
+ *p = (wchar_t*)soap_id_enter(soap, soap->id, soap_wstring_in(soap, 1), t, 0, 0);
+ }
+ }
+ else
+ p = (wchar_t**)soap_id_lookup(soap, soap->href, (void**)p, t, sizeof(wchar_t*), 0);
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+static time_t
+soap_timegm(struct tm *T)
+{
+#if defined(HAVE_TIMEGM)
+ return timegm(T);
+#elif defined(HAVE_GETTIMEOFDAY)
+ struct timezone t;
+ struct timeval tv;
+ gettimeofday(&tv, &t); /* doesn't work properly on Solaris */
+ T->tm_min -= t.tz_minuteswest;
+ T->tm_isdst = (t.tz_dsttime != 0);
+ return mktime(T);
+/* WR[ */
+ /* The following define was added for VxWorks*/
+#elif defined(HAVE_MKTIME)
+ /* FOR VXWORKS:
+ vxWorks does not seem to have any variable representation of time zones, but
+ timezone information can be set in INSTALL_DIR/target/h/private/timeP.h header
+ file, by setting the ZONEBUFFER define. The ZONEBUFFER define follows this
+ format:
+
+ name_of_zone:<(unused)>:time_in_minutes_from_UTC:daylight_start:daylight_end
+
+ To calculate local time, the value of time_in_minutes_from_UTC is subtracted
+ from UTC; time_in_minutes_from_UTC must be positive. Daylight information is
+ expressed as mmddhh (month-day-hour), for example:
+
+ UTC::0:040102:100102
+
+ */
+ return mktime(T);
+/* ]WR */
+#elif defined(HAVE_FTIME)
+ struct timeb t;
+ t.timezone = 0;
+ t.dstflag = -1;
+ ftime(&t);
+ T->tm_min -= t.timezone;
+ T->tm_isdst = t.dstflag; /* doesn't work properly on Solaris */
+ return mktime(T);
+#else
+#warning "time_t (de)serialization is not MT safe on this platform"
+ time_t t;
+ char *tz = getenv("TZ");
+ putenv("TZ=UTC");
+ tzset();
+ t = mktime(T);
+ if (tz)
+ { char tmp[16];
+ strcpy(tmp, "TZ=");
+ strncat(tmp, tz, 12);
+ tmp[15] = '\0';
+ putenv(tmp);
+ }
+ else
+ putenv("TZ=");
+ tzset();
+ return t;
+#endif
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_dateTime2s(struct soap *soap, time_t n)
+{ struct tm T;
+ struct tm *pT = &T;
+#if defined(HAVE_GMTIME_R)
+ if (gmtime_r(&n, pT))
+ strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT);
+/* WR[ */
+ /* The following defines were added for VxWorks*/
+#elif defined(HAVE_PGMTIME_R)
+ if (gmtime_r(&n, pT))
+ strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT);
+#elif defined(HAVE_PGMTIME)
+ if (gmtime(&n, pT))
+ strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT);
+/* ]WR */
+#elif defined(HAVE_GMTIME)
+ if ((pT = gmtime(&n)))
+ strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%SZ", pT);
+#elif defined(HAVE_GETTIMEOFDAY)
+ struct timezone t;
+#if defined(HAVE_LOCALTIME_R)
+ if (localtime_r(&n, pT))
+ { struct timeval tv;
+ gettimeofday(&tv, &t);
+ strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+ sprintf(soap->tmpbuf + strlen(soap->tmpbuf), "%+03d:%02d", -t.tz_minuteswest/60-(t.tz_dsttime!=0), abs(t.tz_minuteswest)%60);
+ }
+#else
+ if ((pT = localtime(&n)))
+ { struct timeval tv;
+ gettimeofday(&tv, &t);
+ strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+ sprintf(soap->tmpbuf + strlen(soap->tmpbuf), "%+03d:%02d", -t.tz_minuteswest/60-(t.tz_dsttime!=0), abs(t.tz_minuteswest)%60);
+ }
+#endif
+#elif defined(HAVE_FTIME)
+ struct timeb t;
+#if defined(HAVE_LOCALTIME_R)
+ if (localtime_r(&n, pT))
+ { ftime(&t);
+ strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+ sprintf(soap->tmpbuf + strlen(soap->tmpbuf), "%+03d:%02d", -t.timezone/60-(t.dstflag!=0), abs(t.timezone)%60);
+ }
+/* WR[ */
+ /* The following defines were added for VxWorks*/
+#elif defined(HAVE_PLOCALTIME_R)
+ if (localtime_r(&n, pT))
+ { strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+ sprintf(soap->tmpbuf+strlen(soap->tmpbuf), "%+03d:%02d", t.timezone/60, abs(t.timezone)%60);
+ }
+/* ]WR */
+#else
+ if ((pT = localtime(&n)))
+ { ftime(&t);
+ strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+ sprintf(soap->tmpbuf + strlen(soap->tmpbuf), "%+03d:%02d", -t.timezone/60-(t.dstflag!=0), abs(t.timezone)%60);
+ }
+#endif
+#elif defined(HAVE_LOCALTIME_R)
+ if (localtime_r(&n, pT))
+ strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+/* WR[ */
+ /* The following defines were added for VxWorks*/
+#elif defined(HAVE_PLOCALTIME_R)
+ if (localtime_r(&n, pT))
+ strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+/* ]WR */
+#else
+ if ((pT = localtime(&n)))
+ strftime(soap->tmpbuf, sizeof(soap->tmpbuf), "%Y-%m-%dT%H:%M:%S", pT);
+#endif
+ else
+ strcpy(soap->tmpbuf, "1969-12-31T23:59:59Z");
+ return soap->tmpbuf;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outdateTime(struct soap *soap, const char *tag, int id, const time_t *p, const char *type, int n)
+{ if (soap_element_begin_out(soap, tag, soap_embedded_id(soap, id, p, n), type)
+ || soap_string_out(soap, soap_dateTime2s(soap, *p), 0))
+ return soap->error;
+ return soap_element_end_out(soap, tag);
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2dateTime(struct soap *soap, const char *s, time_t *p)
+{ if (s)
+ { struct tm T;
+ char zone[16];
+ memset(&T, 0, sizeof(struct tm));
+ zone[sizeof(zone)-1] = '\0';
+ sscanf(s, "%d-%d-%dT%d:%d:%d%15s", &T.tm_year, &T.tm_mon, &T.tm_mday, &T.tm_hour, &T.tm_min, &T.tm_sec, zone);
+ if (T.tm_year == 1)
+ T.tm_year = 70;
+ else
+ T.tm_year -= 1900;
+ T.tm_mon--;
+ if (*zone)
+ { if (*zone == '.')
+ { for (s = zone + 1; *s; s++)
+ if (*s < '0' || *s > '9')
+ break;
+ }
+ else
+ s = zone;
+ if (*s != 'Z')
+ { int h = 0, m = 0;
+ sscanf(s, "%d:%d", &h, &m);
+ T.tm_hour -= h;
+ if (h >= 0)
+ T.tm_min -= m;
+ else
+ T.tm_min += m;
+ }
+ *p = soap_timegm(&T);
+ }
+ else
+ *p = mktime(&T); /* no time zone: suppose it is localtime? */
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+time_t *
+SOAP_FMAC2
+soap_indateTime(struct soap *soap, const char *tag, time_t *p, const char * type, int t)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (soap->null)
+ { if (soap->mode & SOAP_XML_NIL)
+ { soap->error = SOAP_NULL;
+ return NULL;
+ }
+ return p;
+ }
+ if (*soap->type
+ && soap_match_tag(soap, soap->type, type)
+ && soap_match_tag(soap, soap->type, ":dateTime"))
+ { soap->error = SOAP_TYPE;
+ soap_revert(soap);
+ return NULL;
+ }
+ p = (time_t*)soap_id_enter(soap, soap->id, p, t, sizeof(time_t), 0);
+ if (soap->body && !*soap->href)
+ soap_s2dateTime(soap, soap_value(soap), p);
+ else
+ p = (time_t*)soap_id_forward(soap, soap->href, p, t, sizeof(time_t));
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outliteral(struct soap *soap, const char *tag, char *const*p)
+{ int i;
+ const char *t = NULL;
+ if (tag && *tag != '-')
+ { if ((t = strchr(tag, ':')))
+ { strncpy(soap->tmpbuf, tag, t-tag);
+ soap->tmpbuf[t-tag] = '\0';
+ for (i = 0; soap->local_namespaces[i].id; i++)
+ if (!strcmp(soap->tmpbuf, soap->local_namespaces[i].id))
+ break;
+ t++;
+ sprintf(soap->tmpbuf, "<%s xmlns=\"%s\">", t, soap->local_namespaces[i].ns ? soap->local_namespaces[i].ns : SOAP_STR_EOS);
+ }
+ else
+ { t = tag;
+ sprintf(soap->tmpbuf, "<%s>", tag);
+ }
+ if (soap_send(soap, soap->tmpbuf))
+ return soap->error;
+ }
+ if (p && *p)
+ { if (soap_send(soap, *p))
+ return soap->error;
+ }
+ if (t)
+ { sprintf(soap->tmpbuf, "</%s>", t);
+ return soap_send(soap, soap->tmpbuf);
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+char **
+SOAP_FMAC2
+soap_inliteral(struct soap *soap, const char *tag, char **p)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (!p)
+ if (!(p = (char**)soap_malloc(soap, sizeof(char*))))
+ return NULL;
+ if (soap->null)
+ *p = NULL;
+ else if (soap->body)
+ *p = soap_string_in(soap, 0);
+ else
+ *p = NULL;
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_outwliteral(struct soap *soap, const char *tag, wchar_t *const*p)
+{ int i;
+ const char *t = NULL;
+ wchar_t c;
+ const wchar_t *s;
+ if (tag && *tag != '-')
+ { if (tag && (t = strchr(tag, ':')))
+ { strncpy(soap->tmpbuf, tag, t-tag);
+ soap->tmpbuf[t-tag] = '\0';
+ for (i = 0; soap->local_namespaces[i].id; i++)
+ if (!strcmp(soap->tmpbuf, soap->local_namespaces[i].id))
+ break;
+ t++;
+ sprintf(soap->tmpbuf, "<%s xmlns=\"%s\">", t, soap->local_namespaces[i].ns ? soap->local_namespaces[i].ns : SOAP_STR_EOS);
+ }
+ else
+ { t = tag;
+ sprintf(soap->tmpbuf, "<%s>", tag);
+ }
+ if (soap_send(soap, soap->tmpbuf))
+ return soap->error;
+ }
+ if (p)
+ { s = *p;
+ while ((c = *s++))
+ if (soap_pututf8(soap, (unsigned char)c))
+ return soap->error;
+ }
+ if (t)
+ { sprintf(soap->tmpbuf, "</%s>", t);
+ return soap_send(soap, soap->tmpbuf);
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+wchar_t **
+SOAP_FMAC2
+soap_inwliteral(struct soap *soap, const char *tag, wchar_t **p)
+{ if (soap_element_begin_in(soap, tag))
+ return NULL;
+ if (!p)
+ if (!(p = (wchar_t**)soap_malloc(soap, sizeof(wchar_t*))))
+ return NULL;
+ if (soap->null)
+ *p = NULL;
+ else if (soap->body)
+ *p = soap_wstring_in(soap, 0);
+ else
+ *p = NULL;
+ if (soap->body && soap_element_end_in(soap, tag))
+ return NULL;
+ return p;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+char *
+SOAP_FMAC2
+soap_value(struct soap *soap)
+{ size_t i;
+ wchar c = 0;
+ char *s;
+ s = soap->tmpbuf;
+ for (i = 0; i < sizeof(soap->tmpbuf) - 1; i++)
+ { c = soap_get(soap);
+ if (c == TT || (int)c == EOF || soap_blank(c))
+ break;
+ *s++ = (char)c;
+ }
+ if ((int)c == EOF || c == TT)
+ soap_unget(soap, c);
+ *s = '\0';
+ return soap->tmpbuf; /* return non-null pointer */
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_getline(struct soap *soap, char *s, int len)
+{ int i = len;
+ wchar c = 0;
+ for (;;)
+ { while (--i > 0)
+ { c = soap_getchar(soap);
+ if (c == '\r' || c == '\n' || (int)c == EOF)
+ break;
+ *s++ = (char)c;
+ }
+ *s = '\0';
+ while (c != '\n' && (int)c != EOF)
+ c = soap_getchar(soap);
+ if ((int)c == EOF)
+ return SOAP_EOF;
+ if (i+1 == len) /* empty line: end of HTTP header */
+ break;
+ c = soap_unget(soap, soap_getchar(soap));
+ if (c != ' ' && c != '\t') /* HTTP line continuation? */
+ break;
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static size_t
+soap_begin_dime(struct soap *soap)
+{
+#ifndef WITH_LEANER
+ if (soap->mode & SOAP_ENC_DIME)
+ { size_t count;
+ sprintf(soap->id, soap->dime_id_format, 0);
+ soap->dime_id = soap->id;
+ if (soap->local_namespaces)
+ { if (soap->local_namespaces[0].out)
+ soap->dime_type = (char*)soap->local_namespaces[0].out;
+ else
+ soap->dime_type = (char*)soap->local_namespaces[0].ns;
+ }
+ soap->dime_options = NULL;
+ count = soap->dime_size + 12 + ((soap->count+3)&(~3)) + ((strlen(soap->dime_id)+3)&(~3)) + ((strlen(soap->dime_type)+3)&(~3));
+ soap->dime_size = soap->count;
+ if (soap->dime_count)
+ soap->dime_flags = SOAP_DIME_MB | SOAP_DIME_ABSURI;
+ else
+ soap->dime_flags = SOAP_DIME_MB | SOAP_DIME_ME | SOAP_DIME_ABSURI;
+ return count;
+ }
+#endif
+ return soap->count;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEANER
+#ifndef PALM_1
+static int
+soap_putdimefield(struct soap *soap, const char *s, size_t n)
+{ if (soap_send_raw(soap, s, n))
+ return soap->error;
+ return soap_send_raw(soap, SOAP_STR_PADDING, -(long)n&3);
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEANER
+#ifndef PALM_1
+SOAP_FMAC1
+char *
+SOAP_FMAC2
+soap_dime_option(struct soap *soap, unsigned short type, const char *option)
+{ size_t n;
+ char *s = NULL;
+ if (option)
+ { n = strlen(option);
+ s = (char*)soap_malloc(soap, n + 5);
+ if (s)
+ { s[0] = type >> 8;
+ s[1] = type & 0xFF;
+ s[2] = n >> 8;
+ s[3] = n & 0xFF;
+ strcpy(s + 4, option);
+ }
+ }
+ return s;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEANER
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_putdimehdr(struct soap *soap)
+{ unsigned char tmp[12];
+ size_t optlen = 0, idlen = 0, typelen = 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Put DIME header id='%s'\n", soap->dime_id?soap->dime_id:""));
+ if (soap->dime_options)
+ optlen = (((unsigned char)soap->dime_options[2] << 8) | ((unsigned char)soap->dime_options[3])) + 4;
+ if (soap->dime_id)
+ idlen = strlen(soap->dime_id);
+ if (soap->dime_type)
+ typelen = strlen(soap->dime_type);
+ tmp[0] = SOAP_DIME_VERSION | (soap->dime_flags & 0x7);
+ tmp[1] = soap->dime_flags & 0xF0;
+ tmp[2] = optlen >> 8;
+ tmp[3] = optlen & 0xFF;
+ tmp[4] = idlen >> 8;
+ tmp[5] = idlen & 0xFF;
+ tmp[6] = typelen >> 8;
+ tmp[7] = typelen & 0xFF;
+ tmp[8] = soap->dime_size >> 24;
+ tmp[9] = (soap->dime_size >> 16) & 0xFF;
+ tmp[10] = (soap->dime_size >> 8) & 0xFF;
+ tmp[11] = soap->dime_size & 0xFF;
+ if (soap_send_raw(soap, (char*)tmp, 12)
+ || soap_putdimefield(soap, soap->dime_options, optlen)
+ || soap_putdimefield(soap, soap->dime_id, idlen)
+ || soap_putdimefield(soap, soap->dime_type, typelen))
+ return soap->error;
+ return SOAP_OK;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEANER
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_putdime(struct soap *soap, int i, char *id, char *type, char *options, void *ptr, size_t size)
+{ void *h;
+ if (id)
+ soap->dime_id = id;
+ else
+ { sprintf(soap->id, soap->dime_id_format, i);
+ soap->dime_id = soap->id;
+ }
+ soap->dime_type = type;
+ soap->dime_options = options;
+ soap->dime_size = size;
+ soap->dime_flags = SOAP_DIME_VERSION | SOAP_DIME_MEDIA;
+ if (soap->fdimereadopen && ((h = soap->fdimereadopen(soap, (void*)ptr, soap->dime_id, type, options)) || soap->error))
+ { size_t n;
+ if (!h)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadopen failed\n"));
+ return soap->error;
+ }
+ if (!size && ((soap->mode & SOAP_ENC_XML) || (soap->mode & SOAP_IO) == SOAP_IO_CHUNK || (soap->mode & SOAP_IO) == SOAP_IO_STORE))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked streaming DIME\n"));
+ n = sizeof(soap->tmpbuf);
+ do
+ { size = soap->fdimeread(soap, h, soap->tmpbuf, n);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimeread returned %lu bytes\n", (unsigned long)size));
+ if (size == n)
+ soap->dime_flags |= SOAP_DIME_CF;
+ else
+ { soap->dime_flags &= ~SOAP_DIME_CF;
+ if (--soap->dime_count == 0)
+ soap->dime_flags |= SOAP_DIME_ME;
+ }
+ soap->dime_size = size;
+ if (soap_putdimehdr(soap)
+ || soap_send_raw(soap, soap->tmpbuf, size)
+ || soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->dime_size&3))
+ break;
+ if (soap->dime_id)
+ { soap->dime_flags &= ~(SOAP_DIME_MB | SOAP_DIME_MEDIA);
+ soap->dime_id = NULL;
+ soap->dime_type = NULL;
+ soap->dime_options = NULL;
+ }
+ } while (size >= n);
+ }
+ else
+ { if (--soap->dime_count == 0)
+ soap->dime_flags |= SOAP_DIME_ME;
+ if (soap_putdimehdr(soap))
+ return soap->error;
+ do
+ { if (size < sizeof(soap->tmpbuf))
+ n = size;
+ else
+ n = sizeof(soap->tmpbuf);
+ if (!(n = soap->fdimeread(soap, h, soap->tmpbuf, n)))
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimeread failed: insufficient data (%lu bytes remaining from %lu bytes)\n", (unsigned long)size, (unsigned long)soap->dime_size));
+ soap->error = SOAP_EOF;
+ break;
+ }
+ if (soap_send_raw(soap, soap->tmpbuf, n))
+ break;
+ size -= n;
+ } while (size);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadclose\n"));
+ soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->dime_size&3);
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "fdimereadclose\n"));
+ if (soap->fdimereadclose)
+ soap->fdimereadclose(soap, h);
+ return soap->error;
+ }
+ if (--soap->dime_count == 0)
+ soap->dime_flags |= SOAP_DIME_ME;
+ if (soap_putdimehdr(soap))
+ return soap->error;
+ return soap_putdimefield(soap, (char*)ptr, size);
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEANER
+#ifndef PALM_1
+static char *
+soap_getdimefield(struct soap *soap, size_t n)
+{ register wchar c;
+ register int i;
+ register char *s;
+ char *p = NULL;
+ if (n)
+ { p = (char*)soap_malloc(soap, n + 1);
+ if (p)
+ { s = p;
+ for (i = n; i > 0; i--)
+ { if ((int)(c = soap_get1(soap)) == EOF)
+ { soap->error = SOAP_EOF;
+ return NULL;
+ }
+ *s++ = (char)c;
+ }
+ *s = '\0';
+ if ((soap->error = soap_move(soap, -(long)n&3)))
+ return NULL;
+ }
+ else
+ soap->error = SOAP_EOM;
+ }
+ return p;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEANER
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_getdimehdr(struct soap *soap)
+{ register wchar c;
+ register char *s;
+ register int i;
+ unsigned char tmp[12];
+ size_t optlen, idlen, typelen;
+ if (!(soap->mode & SOAP_ENC_DIME))
+ return soap->error = SOAP_EOD;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get DIME header\n"));
+ if (soap->dime_buflen || soap->dime_chunksize)
+ { if (soap_move(soap, (long)(soap->dime_size - soap_tell(soap))))
+ return soap->error = SOAP_EOF;
+ soap_unget(soap, soap_getchar(soap)); /* skip padding and get hdr */
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "... From chunked\n"));
+ return SOAP_OK;
+ }
+ s = (char*)tmp;
+ for (i = 12; i > 0; i--)
+ { if ((int)(c = soap_getchar(soap)) == EOF)
+ return soap->error = SOAP_EOF;
+ *s++ = (char)c;
+ }
+ if ((tmp[0] & 0xF8) != SOAP_DIME_VERSION)
+ return soap->error = SOAP_DIME_MISMATCH;
+ soap->dime_flags = (tmp[0] & 0x7) | (tmp[1] & 0xF0);
+ optlen = (tmp[2] << 8) | tmp[3];
+ idlen = (tmp[4] << 8) | tmp[5];
+ typelen = (tmp[6] << 8) | tmp[7];
+ soap->dime_size = (tmp[8] << 24) | (tmp[9] << 16) | (tmp[10] << 8) | tmp[11];
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME size=%u flags=0x%X\n", (unsigned int)soap->dime_size, soap->dime_flags));
+ if (!(soap->dime_options = soap_getdimefield(soap, optlen)) && soap->error)
+ return soap->error;
+ if (!(soap->dime_id = soap_getdimefield(soap, idlen)) && soap->error)
+ return soap->error;
+ if (!(soap->dime_type = soap_getdimefield(soap, typelen)) && soap->error)
+ return soap->error;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "DIME id=%s, type=%s, options=%s\n", soap->dime_id?soap->dime_id:"", soap->dime_type?soap->dime_type:"", soap->dime_options?soap->dime_options+4:""));
+ if (soap->dime_flags & SOAP_DIME_ME)
+ soap->mode &= ~SOAP_ENC_DIME;
+ return SOAP_OK;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEANER
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_getdime(struct soap *soap)
+{ if (soap_getdimehdr(soap))
+ return soap->error;
+ if (soap->fdimewriteopen && ((soap->dime_ptr = (char*)soap->fdimewriteopen(soap, soap->dime_id, soap->dime_type, soap->dime_options)) || soap->error))
+ { char *id, *type, *options;
+ size_t size, n;
+ if (!soap->dime_ptr)
+ return soap->error;
+ id = soap->dime_id;
+ type = soap->dime_type;
+ options = soap->dime_options;
+ for (;;)
+ { size = soap->dime_size;
+ for (;;)
+ { n = soap->buflen - soap->bufidx;
+ if (size < n)
+ n = size;
+ if ((soap->error = soap->fdimewrite(soap, (void*)soap->dime_ptr, soap->buf + soap->bufidx, n)))
+ break;
+ size -= n;
+ if (!size)
+ { soap->bufidx += n;
+ break;
+ }
+ if (soap_recv(soap))
+ { soap->error = SOAP_EOF;
+ goto end;
+ }
+ }
+ if (soap_move(soap, -(long)soap->dime_size&3))
+ { soap->error = SOAP_EOF;
+ break;
+ }
+ if (!(soap->dime_flags & SOAP_DIME_CF))
+ break;
+ if (soap_getdimehdr(soap))
+ break;
+ }
+end:
+ if (soap->fdimewriteclose)
+ soap->fdimewriteclose(soap, (void*)soap->dime_ptr);
+ soap->dime_size = 0;
+ soap->dime_id = id;
+ soap->dime_type = type;
+ soap->dime_options = options;
+ }
+ else if (soap->dime_flags & SOAP_DIME_CF)
+ { char *id, *type, *options;
+ register wchar c;
+ register char *s;
+ register int i;
+ id = soap->dime_id;
+ type = soap->dime_type;
+ options = soap->dime_options;
+ if (soap_new_block(soap))
+ return SOAP_EOM;
+ for (;;)
+ { s = (char*)soap_push_block(soap, soap->dime_size);
+ if (!s)
+ return soap->error = SOAP_EOM;
+ for (i = soap->dime_size; i > 0; i--)
+ { if ((int)(c = soap_get1(soap)) == EOF)
+ return soap->error = SOAP_EOF;
+ *s++ = (char)c;
+ }
+ if (soap_move(soap, -(long)soap->dime_size&3))
+ return soap->error = SOAP_EOF;
+ if (!(soap->dime_flags & SOAP_DIME_CF))
+ break;
+ if (soap_getdimehdr(soap))
+ return soap->error;
+ }
+ soap->dime_size = soap->blist->size++; /* allocate one more for '\0' */
+ if (!(soap->dime_ptr = soap_save_block(soap, NULL)))
+ return soap->error;
+ soap->dime_ptr[soap->dime_size] = '\0'; /* make 0-terminated to enable string-based attachments */
+ soap->dime_id = id;
+ soap->dime_type = type;
+ soap->dime_options = options;
+ }
+ else
+ soap->dime_ptr = soap_getdimefield(soap, soap->dime_size);
+ return soap->error;
+}
+#endif
+#endif
+
+/******************************************************************************/
+
+#ifdef WITH_COOKIES
+/******************************************************************************/
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_encode_cookie(const char *s, char *t, int len)
+{ register int c;
+ register int n = len;
+ while ((c = *s++) && --n > 0)
+ { if (c > ' ' && c < 128 && c != ';' && c != ',')
+ *t++ = c;
+ else if (n > 2)
+ { *t++ = '%';
+ *t++ = (c >> 4) + (c > 159 ? '7' : '0');
+ c &= 0xF;
+ *t++ = c + (c > 9 ? '7' : '0');
+ n -= 2;
+ }
+ else
+ break;
+ }
+ *t = '\0';
+ return len - n;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_decode_cookie(char *buf, int len, const char *val)
+{ const char *s;
+ char *t;
+ for (s = val; *s; s++)
+ if (*s != ' ' && *s != '=')
+ break;
+ if (*s == '"')
+ { t = buf;
+ s++;
+ while (*s && *s != '"' && --len)
+ *t++ = *s++;
+ *t = '\0';
+ do s++;
+ while (*s && *s != ';' && *s != '=');
+ }
+ else
+ { t = buf;
+ while (*s && *s != ';' && *s != '=' && --len)
+ switch (*s)
+ { case ' ':
+ s++;
+ break;
+ case '%':
+ *t++ = ((s[1] >= 'A' ? (s[1] & 0x7) + 9 : s[1] - '0') << 4)
+ + (s[2] >= 'A' ? (s[2] & 0x7) + 9 : s[2] - '0');
+ s += 3;
+ break;
+ default:
+ *t++ = *s++;
+ }
+ *t = '\0';
+ }
+ return s;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+struct soap_cookie*
+SOAP_FMAC2
+soap_cookie(struct soap *soap, const char *name, const char *domain, const char *path)
+{ struct soap_cookie *p;
+ size_t n;
+ if (!domain)
+ domain = soap->cookie_domain;
+ if (!path)
+ path = soap->cookie_path;
+ if (*path == '/')
+ path++;
+ n = strlen(path);
+ for (p = soap->cookies; p; p = p->next)
+ if (!strcmp(p->name, name)
+ && domain
+ && p->domain
+ && !strcmp(p->domain, domain)
+ && !strncmp(p->path, path, n))
+ break;
+ return p;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+struct soap_cookie*
+SOAP_FMAC2
+soap_set_cookie(struct soap *soap, const char *name, const char *value, const char *domain, const char *path)
+{ struct soap_cookie **p, *q;
+ int n;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set cookie: %s=%s domain=%s path=%s\n", name, value?value:"", domain?domain:"", path?path:""));
+ if (!domain)
+ domain = soap->cookie_domain;
+ if (!path)
+ path = soap->cookie_path;
+ if (!path)
+ { soap_set_receiver_error(soap, "Cookie path not set", NULL, SOAP_HTTP_ERROR);
+ return NULL;
+ }
+ if (*path == '/')
+ path++;
+ q = soap_cookie(soap, name, domain, path);
+ if (!q)
+ { if ((q = (struct soap_cookie*)SOAP_MALLOC(sizeof(struct soap_cookie))))
+ { if ((q->name = (char*)SOAP_MALLOC(strlen(name)+1)))
+ strcpy(q->name, name);
+ q->value = NULL;
+ q->domain = NULL;
+ q->path = NULL;
+ q->expire = -1;
+ q->version = 0;
+ q->secure = 0;
+ q->env = 0;
+ q->modified = 0;
+ for (p = &soap->cookies, n = soap->cookie_max; *p && n; p = &(*p)->next, n--)
+ if (!strcmp((*p)->name, name) && (*p)->path && strcmp((*p)->path, path) < 0)
+ break;
+ if (n)
+ { q->next = *p;
+ *p = q;
+ }
+ else
+ { SOAP_FREE(q->name);
+ SOAP_FREE(q);
+ q = NULL;
+ }
+ }
+ }
+ else
+ q->modified = 1;
+ if (q)
+ { if (q->value)
+ { SOAP_FREE(q->value);
+ q->value = NULL;
+ }
+ if (q->domain)
+ { SOAP_FREE(q->domain);
+ q->domain = NULL;
+ }
+ if (q->path)
+ { SOAP_FREE(q->path);
+ q->path = NULL;
+ }
+ if (value && *value && (q->value = (char*)SOAP_MALLOC(strlen(value)+1)))
+ strcpy(q->value, value);
+ if (domain && *domain && (q->domain = (char*)SOAP_MALLOC(strlen(domain)+1)))
+ strcpy(q->domain, domain);
+ if (path && *path && (q->path = (char*)SOAP_MALLOC(strlen(path)+1)))
+ strcpy(q->path, path);
+ q->session = 1;
+ }
+ return q;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_clr_cookie(struct soap *soap, const char *name, const char *domain, const char *path)
+{ struct soap_cookie **p, *q;
+ if (!domain)
+ domain = soap->cookie_domain;
+ if (!domain)
+ { soap_set_receiver_error(soap, "Cookie domain not set", SOAP_STR_EOS, SOAP_HTTP_ERROR);
+ return;
+ }
+ if (!path)
+ path = soap->cookie_path;
+ if (!path)
+ { soap_set_receiver_error(soap, "Cookie path not set", SOAP_STR_EOS, SOAP_HTTP_ERROR);
+ return;
+ }
+ if (*path == '/')
+ path++;
+ for (p = &soap->cookies, q = *p; q; q = *p)
+ if (!strcmp(q->name, name) && !strcmp(q->domain, domain) && !strncmp(q->path, path, strlen(q->path)))
+ { if (q->value)
+ SOAP_FREE(q->value);
+ if (q->domain)
+ SOAP_FREE(q->domain);
+ if (q->path)
+ SOAP_FREE(q->path);
+ *p = q->next;
+ SOAP_FREE(q);
+ }
+ else
+ p = &q->next;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+char *
+SOAP_FMAC2
+soap_cookie_value(struct soap *soap, const char *name, const char *domain, const char *path)
+{ struct soap_cookie *p;
+ if ((p = soap_cookie(soap, name, domain, path)))
+ return p->value;
+ return NULL;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+long
+SOAP_FMAC2
+soap_cookie_expire(struct soap *soap, const char *name, const char *domain, const char *path)
+{ struct soap_cookie *p;
+ if ((p = soap_cookie(soap, name, domain, path)))
+ return p->expire;
+ return -1;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_set_cookie_expire(struct soap *soap, const char *name, long expire, const char *domain, const char *path)
+{ struct soap_cookie *p;
+ if ((p = soap_cookie(soap, name, domain, path)))
+ { p->expire = expire;
+ p->modified = 1;
+ return SOAP_OK;
+ }
+ return SOAP_ERR;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_set_cookie_session(struct soap *soap, const char *name, const char *domain, const char *path)
+{ struct soap_cookie *p;
+ if ((p = soap_cookie(soap, name, domain, path)))
+ { p->session = 1;
+ p->modified = 1;
+ return SOAP_OK;
+ }
+ return SOAP_ERR;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_clr_cookie_session(struct soap *soap, const char *name, const char *domain, const char *path)
+{ struct soap_cookie *p;
+ if ((p = soap_cookie(soap, name, domain, path)))
+ { p->session = 0;
+ p->modified = 1;
+ return SOAP_OK;
+ }
+ return SOAP_ERR;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_putsetcookies(struct soap *soap)
+{ struct soap_cookie *p;
+ char *s, tmp[4096];
+ const char *t;
+ for (p = soap->cookies; p; p = p->next)
+ if (p->modified || !p->env)
+ { s = tmp;
+ if (p->name)
+ s += soap_encode_cookie(p->name, s, tmp-s+4064);
+ if (p->value)
+ { *s++ = '=';
+ s += soap_encode_cookie(p->value, s, tmp-s+4064);
+ }
+ if (p->domain && (int)strlen(p->domain) < tmp-s+4064)
+ sprintf(s, ";Domain=%s", p->domain);
+ else if (soap->cookie_domain && (int)strlen(soap->cookie_domain) < tmp-s+4064)
+ sprintf(s, ";Domain=%s", soap->cookie_domain);
+ strcpy(s, ";Path=/");
+ if (p->path)
+ t = p->path;
+ else
+ t = soap->cookie_path;
+ if (t)
+ { if (*t == '/')
+ t++;
+ if ((int)strlen(t) < tmp-s+4064)
+ strcat(s, t);
+ }
+ s += strlen(s);
+ if (p->version > 0)
+ { sprintf(s, ";Version=%u", p->version);
+ s += strlen(s);
+ }
+ if (p->expire >= 0)
+ { sprintf(s, ";Max-Age=%ld", p->expire);
+ s += strlen(s);
+ }
+ if (p->secure)
+ strcpy(s, ";Secure");
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Set-Cookie: %s\n", tmp));
+ if (soap->fposthdr(soap, "Set-Cookie", tmp))
+ return soap->error;
+ }
+ return SOAP_OK;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_putcookies(struct soap *soap, const char *domain, const char *path, int secure)
+{ struct soap_cookie **p, *q;
+ unsigned int version = 0;
+ time_t now = time(NULL);
+ char *s, tmp[4096];
+ p = &soap->cookies;
+ while ((q = *p))
+ { if (q->expire && now > q->expire)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie %s expired\n", q->name));
+ SOAP_FREE(q->name);
+ if (q->value)
+ SOAP_FREE(q->value);
+ if (q->domain)
+ SOAP_FREE(q->domain);
+ if (q->path)
+ SOAP_FREE(q->path);
+ *p = q->next;
+ SOAP_FREE(q);
+ }
+ else if ((!q->domain || !strcmp(q->domain, domain))
+ && (!q->path || !strncmp(q->path, path, strlen(q->path)))
+ && (!q->secure || secure))
+ { s = tmp;
+ if (q->version != version)
+ { sprintf(s, "$Version=%u;", q->version);
+ version = q->version;
+ }
+ if (q->name)
+ s += soap_encode_cookie(q->name, s, tmp-s+4080);
+ if (q->value)
+ { *s++ = '=';
+ s += soap_encode_cookie(q->value, s, tmp-s+4080);
+ }
+ if (q->path && (int)strlen(q->path) < tmp-s+4080)
+ { sprintf(s, ";$Path=/%s", q->path);
+ s += strlen(s);
+ }
+ if (q->domain && (int)strlen(q->domain) < tmp-s+4080)
+ sprintf(s, ";$Domain=%s", q->domain);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Cookie: %s\n", tmp));
+ if (soap->fposthdr(soap, "Cookie", tmp))
+ return soap->error;
+ p = &q->next;
+ }
+ else
+ p = &q->next;
+ }
+ return SOAP_OK;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_getcookies(struct soap *soap, const char *val)
+{ struct soap_cookie *p = NULL, *q;
+ const char *s;
+ char *t, tmp[4096]; /* cookie size is up to 4096 bytes [RFC2109] */
+ char *domain = NULL;
+ char *path = NULL;
+ unsigned int version = 0;
+ time_t now = time(NULL);
+ if (!val)
+ return;
+ s = val;
+ while (*s)
+ { s = soap_decode_cookie(tmp, sizeof(tmp), s);
+ if (!soap_tag_cmp(tmp, "$Version"))
+ { if ((s = soap_decode_cookie(tmp, sizeof(tmp), s)))
+ { if (p)
+ p->version = (int)atol(tmp);
+ else
+ version = (int)atol(tmp);
+ }
+ }
+ else if (!soap_tag_cmp(tmp, "$Path"))
+ { s = soap_decode_cookie(tmp, sizeof(tmp), s);
+ if (*tmp)
+ { if ((t = (char*)SOAP_MALLOC(strlen(tmp)+1)))
+ strcpy(t, tmp);
+ }
+ else
+ t = NULL;
+ if (p)
+ { if (p->path)
+ SOAP_FREE(p->path);
+ p->path = t;
+ }
+ else
+ { if (path)
+ SOAP_FREE(path);
+ path = t;
+ }
+ }
+ else if (!soap_tag_cmp(tmp, "$Domain"))
+ { s = soap_decode_cookie(tmp, sizeof(tmp), s);
+ if (*tmp)
+ { if ((t = (char*)SOAP_MALLOC(strlen(tmp)+1)))
+ strcpy(t, tmp);
+ }
+ else
+ t = NULL;
+ if (p)
+ { if (p->domain)
+ SOAP_FREE(p->domain);
+ p->domain = t;
+ }
+ else
+ { if (domain)
+ SOAP_FREE(domain);
+ domain = t;
+ }
+ }
+ else if (p && !soap_tag_cmp(tmp, "Path"))
+ { s = soap_decode_cookie(tmp, sizeof(tmp), s);
+ if (p->path)
+ SOAP_FREE(p->path);
+ if (*tmp)
+ { if ((p->path = (char*)SOAP_MALLOC(strlen(tmp)+1)))
+ strcpy(p->path, tmp);
+ }
+ else
+ p->path = NULL;
+ }
+ else if (p && !soap_tag_cmp(tmp, "Domain"))
+ { s = soap_decode_cookie(tmp, sizeof(tmp), s);
+ if (p->domain)
+ SOAP_FREE(p->domain);
+ if (*tmp)
+ { if ((p->domain = (char*)SOAP_MALLOC(strlen(tmp)+1)))
+ strcpy(p->domain, tmp);
+ }
+ else
+ p->domain = NULL;
+ }
+ else if (p && !soap_tag_cmp(tmp, "Version"))
+ { s = soap_decode_cookie(tmp, sizeof(tmp), s);
+ p->version = (unsigned int)atol(tmp);
+ }
+ else if (p && !soap_tag_cmp(tmp, "Max-Age"))
+ { s = soap_decode_cookie(tmp, sizeof(tmp), s);
+ p->expire = now + atol(tmp);
+ }
+ else if (p && !soap_tag_cmp(tmp, "Expires"))
+ { struct tm T;
+ char a[3];
+ static const char mns[] = "anebarprayunulugepctovec";
+ s = soap_decode_cookie(tmp, sizeof(tmp), s);
+ memset(&T, 0, sizeof(struct tm));
+ a[0] = tmp[4];
+ a[1] = tmp[5];
+ a[2] = '\0';
+ T.tm_mday = (int)atol(a);
+ a[0] = tmp[8];
+ a[1] = tmp[9];
+ T.tm_mon = (strstr(mns, a) - mns) / 2;
+ a[0] = tmp[11];
+ a[1] = tmp[12];
+ T.tm_year = 100 + (int)atol(a);
+ a[0] = tmp[13];
+ a[1] = tmp[14];
+ T.tm_hour = (int)atol(a);
+ a[0] = tmp[16];
+ a[1] = tmp[17];
+ T.tm_min = (int)atol(a);
+ a[0] = tmp[19];
+ a[1] = tmp[20];
+ T.tm_sec = (int)atol(a);
+ p->expire = soap_timegm(&T);
+ }
+ else if (p && !soap_tag_cmp(tmp, "Secure"))
+ p->secure = 1;
+ else
+ { if (p)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Got environment cookie %s=%s domain=%s path=%s expire=%ld secure=%d\n", p->name, p->value?p->value:"", p->domain?p->domain:"", p->path?p->path:"", p->expire, p->secure));
+ if ((q = soap_set_cookie(soap, p->name, p->value, p->domain, p->path)))
+ { q->version = p->version;
+ q->expire = p->expire;
+ q->secure = p->secure;
+ q->env = 1;
+ }
+ if (p->name)
+ SOAP_FREE(p->name);
+ if (p->value)
+ SOAP_FREE(p->value);
+ if (p->domain)
+ SOAP_FREE(p->domain);
+ if (p->path)
+ SOAP_FREE(p->path);
+ SOAP_FREE(p);
+ }
+ if ((p = (struct soap_cookie*)SOAP_MALLOC(sizeof(struct soap_cookie))))
+ { p->name = (char*)SOAP_MALLOC(strlen(tmp)+1);
+ strcpy(p->name, tmp);
+ s = soap_decode_cookie(tmp, sizeof(tmp), s);
+ if (*tmp)
+ { p->value = (char*)SOAP_MALLOC(strlen(tmp)+1);
+ strcpy(p->value, tmp);
+ }
+ else
+ p->value = NULL;
+ p->domain = domain;
+ p->path = path;
+ p->expire = 0;
+ p->secure = 0;
+ p->version = version;
+ }
+ }
+ if (*s == ';')
+ s++;
+ }
+ if (p)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Got cookie %s=%s domain=%s path=%s expire=%ld secure=%d\n", p->name, p->value?p->value:"", p->domain?p->domain:"", p->path?p->path:"", p->expire, p->secure));
+ if ((q = soap_set_cookie(soap, p->name, p->value, p->domain, p->path)))
+ { q->version = p->version;
+ q->expire = p->expire;
+ q->secure = p->secure;
+ }
+ if (p->name)
+ SOAP_FREE(p->name);
+ if (p->value)
+ SOAP_FREE(p->value);
+ if (p->domain)
+ SOAP_FREE(p->domain);
+ if (p->path)
+ SOAP_FREE(p->path);
+ SOAP_FREE(p);
+ }
+ if (domain)
+ SOAP_FREE(domain);
+ if (path)
+ SOAP_FREE(path);
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_getenv_cookies(struct soap *soap)
+{ struct soap_cookie *p;
+ const char *s;
+ char key[4096], val[4096]; /* cookie size is up to 4096 bytes [RFC2109] */
+ if (!(s = getenv("HTTP_COOKIE")))
+ return SOAP_ERR;
+ do
+ { s = soap_decode_cookie(key, sizeof(key), s);
+ s = soap_decode_cookie(val, sizeof(val), s);
+ p = soap_set_cookie(soap, key, val, NULL, NULL);
+ if (p)
+ p->env = 1;
+ if (*s == ';')
+ s++;
+ } while (*s);
+ return SOAP_OK;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+struct soap_cookie*
+SOAP_FMAC2
+soap_copy_cookies(struct soap *soap)
+{ struct soap_cookie *p, **q, *r;
+ q = &r;
+ for (p = soap->cookies; p; p = p->next)
+ { if (!(*q = (struct soap_cookie*)SOAP_MALLOC(sizeof(struct soap_cookie))))
+ return r;
+ **q = *p;
+ if (p->name)
+ { if (((*q)->name = (char*)SOAP_MALLOC(strlen(p->name)+1)))
+ strcpy((*q)->name, p->name);
+ }
+ if (p->value)
+ { if (((*q)->value = (char*)SOAP_MALLOC(strlen(p->value)+1)))
+ strcpy((*q)->value, p->value);
+ }
+ if (p->domain)
+ { if (((*q)->domain = (char*)SOAP_MALLOC(strlen(p->domain)+1)))
+ strcpy((*q)->domain, p->domain);
+ }
+ if (p->path)
+ { if (((*q)->path = (char*)SOAP_MALLOC(strlen(p->path)+1)))
+ strcpy((*q)->path, p->path);
+ }
+ q = &(*q)->next;
+ }
+ *q = NULL;
+ return r;
+}
+
+/******************************************************************************/
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_free_cookies(struct soap *soap)
+{ struct soap_cookie *p;
+ for (p = soap->cookies; p; p = soap->cookies)
+ { soap->cookies = p->next;
+ SOAP_FREE(p->name);
+ if (p->value)
+ SOAP_FREE(p->value);
+ if (p->domain)
+ SOAP_FREE(p->domain);
+ if (p->path)
+ SOAP_FREE(p->path);
+ SOAP_FREE(p);
+ }
+}
+
+/******************************************************************************/
+#endif /* WITH_COOKIES */
+
+/******************************************************************************/
+#ifdef WITH_GZIP
+#ifndef PALM_2
+static int
+soap_getgzipheader(struct soap *soap)
+{ int i;
+ wchar c, f = 0;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Get gzip header\n"));
+ for (i = 0; i < 9; i++)
+ { if ((int)(c = soap_get1(soap) == EOF))
+ return soap->error = SOAP_EOF;
+ if (i == 2)
+ f = c;
+ }
+ if (f & 0x04) /* FEXTRA */
+ { for (i = soap_get1(soap) | (soap_get1(soap) << 8); i; i--)
+ if ((int)soap_get1(soap) == EOF)
+ return soap->error = SOAP_EOF;
+ }
+ if (f & 0x08) /* FNAME */
+ do
+ c = soap_get1(soap);
+ while (c && (int)c != EOF);
+ if ((int)c != EOF && (f & 0x10)) /* FCOMMENT */
+ do
+ c = soap_get1(soap);
+ while (c && (int)f != EOF);
+ if ((int)c != EOF && (f & 0x01)) /* FHCRC */
+ { if ((int)(c = soap_get1(soap)) != EOF)
+ c = soap_get1(soap);
+ }
+ if ((int)c == EOF)
+ return soap->error = SOAP_EOF;
+ return SOAP_OK;
+}
+#endif
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_begin_recv(struct soap *soap)
+{ wchar c;
+ soap_set_local_namespaces(soap);
+ soap->version = 0; /* don't assume we're parsing SOAP content by default */
+ soap_free_iht(soap);
+ if ((soap->imode & SOAP_IO) == SOAP_IO_CHUNK)
+ soap->omode |= SOAP_IO_CHUNK;
+ soap->imode &= ~SOAP_IO;
+ soap->mode = soap->imode;
+ if (!soap->keep_alive)
+ { soap->buflen = 0;
+ soap->bufidx = 0;
+ }
+ if (!(soap->mode & SOAP_IO_KEEPALIVE))
+ soap->keep_alive = 0;
+ soap->ahead = 0;
+ soap->peeked = 0;
+ soap->level = 0;
+ soap->part = SOAP_BEGIN;
+ soap->alloced = 0;
+ soap->count = 0;
+ soap->length = 0;
+ soap->cdata = 0;
+ *soap->endpoint = '\0';
+ soap->userid = NULL;
+ soap->passwd = NULL;
+ soap->action = NULL;
+ soap->dime_chunksize = 0;
+ soap->dime_buflen = 0;
+#ifdef WIN32
+#ifndef UNDER_CE
+#ifndef WITH_FASTCGI
+ if (!soap_valid_socket(soap->socket))
+#ifdef __BORLANDC__
+ setmode((SOAP_SOCKET)soap->recvfd, O_BINARY);
+#else
+ _setmode((SOAP_SOCKET)soap->recvfd, _O_BINARY);
+#endif
+#endif
+#endif
+#endif
+#ifdef WITH_ZLIB
+ soap->mode &= ~SOAP_ENC_ZLIB;
+ soap->zlib_in = SOAP_ZLIB_NONE;
+ soap->zlib_out = SOAP_ZLIB_NONE;
+ soap->d_stream.next_in = Z_NULL;
+ soap->d_stream.avail_in = 0;
+ soap->d_stream.next_out = (Byte*)soap->buf;
+ soap->d_stream.avail_out = SOAP_BUFLEN;
+ soap->z_ratio_in = 1.0;
+#endif
+ c = soap_getchar(soap);
+ if ((c & 0xFFFC) == (SOAP_DIME_VERSION | SOAP_DIME_MB) && (soap_get0(soap) & 0xFFF0) == 0x20)
+ soap->mode |= SOAP_ENC_DIME;
+#ifdef WITH_GZIP
+ else if (c == 0x1F)
+ { if (soap_getgzipheader(soap))
+ return soap->error;
+ if (inflateInit2(&soap->d_stream, -MAX_WBITS) != Z_OK)
+ return soap->error = SOAP_ZLIB_ERROR;
+ soap->zlib_state = SOAP_ZLIB_INFLATE;
+ soap->mode |= SOAP_ENC_ZLIB;
+ soap->zlib_in = SOAP_ZLIB_GZIP;
+ soap->z_crc = crc32(0L, NULL, 0);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n"));
+ memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);
+ /* should not chunk over plain transport, so why bother to check? */
+ /* if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK) */
+ /* soap->z_buflen = soap->bufidx; */
+ /* else */
+ soap->d_stream.next_in = (Byte*)(soap->z_buf + soap->bufidx);
+ soap->d_stream.avail_in = soap->buflen - soap->bufidx;
+ soap->z_buflen = soap->buflen;
+ soap->buflen = soap->bufidx;
+ }
+#endif
+ else
+ { if (c == 0xEF && !(soap->mode & SOAP_C_LATIN))
+ { soap_unget(soap, c);
+ c = soap_getutf8(soap);
+ if (c == 0xFEFF)
+ c = soap_getchar(soap);
+ }
+ while (soap_blank(c))
+ c = soap_getchar(soap);
+ }
+ if ((int)c == EOF)
+ return soap->error = SOAP_EOF;
+ soap_unget(soap, c);
+ if (c != '<' && !(soap->mode & (SOAP_ENC_DIME | SOAP_ENC_ZLIB)))
+ { soap->mode &= ~SOAP_IO;
+ if ((soap->error = soap->fparse(soap)))
+ { if (soap->error == 307) /* HTTP redirect */
+ { soap_getline(soap, soap->endpoint, sizeof(soap->endpoint));
+ soap->keep_alive = 0; /* force close when soap_closesock() */
+ }
+ return soap->error;
+ }
+ if ((soap->mode & SOAP_IO) == SOAP_IO_CHUNK)
+ { soap->chunkbuflen = soap->buflen;
+ soap->buflen = soap->bufidx;
+ soap->chunksize = 0;
+ }
+#ifdef WITH_ZLIB
+ if (soap->zlib_in)
+ { /* fparse should not use soap_unget */
+#ifdef WITH_GZIP
+ c = soap_get1(soap);
+ if (c == 0x1F)
+ { if (soap_getgzipheader(soap))
+ return soap->error;
+ if (inflateInit2(&soap->d_stream, -MAX_WBITS) != Z_OK)
+ return soap->error = SOAP_ZLIB_ERROR;
+ soap->zlib_state = SOAP_ZLIB_INFLATE;
+ soap->z_crc = crc32(0L, NULL, 0);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "gzip initialized\n"));
+ }
+ else
+ { soap_revget1(soap);
+#else
+ {
+#endif
+ if (inflateInit(&soap->d_stream) != Z_OK)
+ return soap->error = SOAP_ZLIB_ERROR;
+ soap->zlib_state = SOAP_ZLIB_INFLATE;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Inflate initialized\n"));
+ }
+ soap->mode |= SOAP_ENC_ZLIB;
+ memcpy(soap->z_buf, soap->buf, SOAP_BUFLEN);
+ soap->d_stream.next_in = (Byte*)(soap->z_buf + soap->bufidx);
+ soap->d_stream.avail_in = soap->buflen - soap->bufidx;
+ soap->z_buflen = soap->buflen;
+ soap->buflen = soap->bufidx;
+ }
+#endif
+ }
+#ifndef WITH_LEANER
+ if (soap->mode & SOAP_ENC_DIME)
+ { if (soap_getdimehdr(soap))
+ return soap->error;
+ if (soap->dime_flags & SOAP_DIME_CF)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Chunked DIME SOAP message\n"));
+ soap->dime_chunksize = soap->dime_size;
+ if (soap->buflen - soap->bufidx >= soap->dime_chunksize)
+ { soap->dime_buflen = soap->buflen;
+ soap->buflen = soap->bufidx + soap->dime_chunksize;
+ }
+ else
+ soap->dime_chunksize -= soap->buflen - soap->bufidx;
+ }
+ soap->count = soap->buflen - soap->bufidx;
+ }
+#endif
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+http_parse(struct soap *soap)
+{ char header[SOAP_HDRLEN], *s;
+ unsigned short g = 0, k;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Waiting for response...\n"));
+ *soap->endpoint = '\0';
+ soap->length = 0;
+ do
+ { if (soap_getline(soap, soap->msgbuf, sizeof(soap->msgbuf)))
+ return SOAP_EOF;
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "HTTP status: %s\n", soap->msgbuf));
+ for (;;)
+ { if (soap_getline(soap, header, SOAP_HDRLEN))
+ return SOAP_EOF;
+ if (!*header)
+ break;
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "HTTP header: %s\n", header));
+ s = strchr(header, ':');
+ if (s)
+ { *s = '\0';
+ do s++;
+ while (*s && *s <= 32);
+ if ((soap->error = soap->fparsehdr(soap, header, s)))
+ return soap->error;
+ }
+ }
+ if ((s = strchr(soap->msgbuf, ' ')))
+ k = (unsigned short)soap_strtoul(s, NULL, 10);
+ else
+ k = 0;
+ } while (k == 100);
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Finished HTTP header parsing\n"));
+ s = strstr(soap->msgbuf, "HTTP/");
+ if (s && s[7] != '1')
+ { if (soap->keep_alive == 1)
+ soap->keep_alive = 0;
+ if (k == 0 && (soap->omode & SOAP_IO) == SOAP_IO_CHUNK) /* k == 0 for HTTP request */
+ { soap->imode |= SOAP_IO_CHUNK;
+ soap->omode = (soap->omode & ~SOAP_IO) | SOAP_IO_STORE;
+ }
+ }
+ if (soap->keep_alive < 0)
+ soap->keep_alive = 1;
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Keep alive connection = %d\n", soap->keep_alive));
+ if (s && (((g = !strncmp(soap->msgbuf, "GET ", 4))) || !strncmp(soap->msgbuf, "POST ", 5)))
+ { size_t m = strlen(soap->endpoint);
+ size_t n = m + (s - soap->msgbuf) - 5 - (!g);
+ if (n >= sizeof(soap->endpoint))
+ n = sizeof(soap->endpoint) - 1;
+ strncpy(soap->path, soap->msgbuf + 4 + (!g), n - m);
+ soap->path[n - m] = '\0';
+ strcat(soap->endpoint, soap->path);
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Target endpoint='%s'\n", soap->endpoint));
+ if (g)
+ { soap->error = soap->fget(soap);
+ if (soap->error == SOAP_OK)
+ soap->error = SOAP_STOP; /* prevents further processing */
+ return soap->error;
+ }
+ return SOAP_OK;
+ }
+ if (k == 0 || (k >= 200 && k <= 299) || k == 400 || k == 500)
+ return SOAP_OK;
+ return soap_set_receiver_error(soap, "HTTP error", soap->msgbuf, k);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+http_parse_header(struct soap *soap, const char *key, const char *val)
+{ if (!soap_tag_cmp(key, "Host"))
+ {
+#ifdef WITH_OPENSSL
+ if (soap->imode & SOAP_ENC_SSL)
+ strcpy(soap->endpoint, "https://");
+ else
+#endif
+ strcpy(soap->endpoint, "http://");
+ strncat(soap->endpoint, val, sizeof(soap->endpoint) - 8);
+ soap->endpoint[sizeof(soap->endpoint) - 1] = '\0';
+ }
+ else if (!soap_tag_cmp(key, "Content-Type"))
+ { if (!soap_tag_cmp(val, "*application/dime*"))
+ soap->mode |= SOAP_ENC_DIME;
+ }
+ else if (!soap_tag_cmp(key, "Content-Length"))
+ soap->length = soap_strtoul(val, NULL, 10);
+ else if (!soap_tag_cmp(key, "Content-Encoding"))
+ { if (!soap_tag_cmp(val, "deflate*"))
+#ifdef WITH_ZLIB
+ soap->zlib_in = SOAP_ZLIB_DEFLATE;
+#else
+ return SOAP_ZLIB_ERROR;
+#endif
+ else if (!soap_tag_cmp(val, "gzip*"))
+#ifdef WITH_GZIP
+ soap->zlib_in = SOAP_ZLIB_GZIP;
+#else
+ return SOAP_ZLIB_ERROR;
+#endif
+ }
+#ifdef WITH_ZLIB
+ else if (!soap_tag_cmp(key, "Accept-Encoding"))
+ {
+#ifdef WITH_GZIP
+ if (strchr(val, '*') || !soap_tag_cmp(val, "*gzip*"))
+ soap->zlib_out = SOAP_ZLIB_GZIP;
+ else
+#endif
+ if (strchr(val, '*') || !soap_tag_cmp(val, "*deflate*"))
+ soap->zlib_out = SOAP_ZLIB_DEFLATE;
+ else
+ soap->zlib_out = SOAP_ZLIB_NONE;
+ }
+#endif
+ else if (!soap_tag_cmp(key, "Transfer-Encoding"))
+ { soap->mode &= ~SOAP_IO;
+ if (!soap_tag_cmp(val, "chunked*"))
+ soap->mode |= SOAP_IO_CHUNK;
+ }
+ else if (!soap_tag_cmp(key, "Connection"))
+ { if (!soap_tag_cmp(val, "keep-alive*"))
+ soap->keep_alive = -soap->keep_alive;
+ else if (!soap_tag_cmp(val, "close*"))
+ soap->keep_alive = 0;
+ }
+#ifndef WITH_LEAN
+ else if (!soap_tag_cmp(key, "Authorization"))
+ { if (!soap_tag_cmp(val, "basic *"))
+ { size_t n;
+ char *s;
+ soap_base642s(soap, val + 6, soap->tmpbuf, sizeof(soap->tmpbuf) - 1, &n);
+ soap->tmpbuf[n] = '\0';
+ if ((s = strchr(soap->tmpbuf, ':')))
+ { *s = '\0';
+ soap->userid = soap_strdup(soap, soap->tmpbuf);
+ soap->passwd = soap_strdup(soap, s + 1);
+ }
+ }
+ }
+#endif
+ else if (!soap_tag_cmp(key, "SOAPAction"))
+ { if (val[0] && val[1])
+ { soap->action = soap_strdup(soap, val + 1);
+ soap->action[strlen(soap->action) - 1] = '\0';
+ }
+ }
+/* [ Deal with .NET bug (invalid XML id-ref) */
+ else if (!soap_tag_cmp(key, "Server"))
+ { if (!soap_tag_cmp(val, "Microsoft-IIS*"))
+ soap->dot_net_bug = 1;
+ }
+ else if (!soap_tag_cmp(key, "User-Agent"))
+ { if (!soap_tag_cmp(val, "*.NET CLR*") || !soap_tag_cmp(val, "*MS Web Services Client Protocol*"))
+ soap->dot_net_bug = 1;
+ }
+/* ] */
+#ifdef WITH_COOKIES
+ else if (!soap_tag_cmp(key, "Cookie") || !soap_tag_cmp(key, "Set-Cookie"))
+ soap_getcookies(soap, val);
+#endif
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_envelope_begin_out(struct soap *soap)
+{ soap->part = SOAP_IN_ENVELOPE;
+ return soap_element_begin_out(soap, "SOAP-ENV:Envelope", 0, NULL);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_envelope_end_out(struct soap *soap)
+{ if (soap_element_end_out(soap, "SOAP-ENV:Envelope"))
+ return soap->error;
+ soap->part = SOAP_END_ENVELOPE;
+#ifndef WITH_LEANER
+ if (!(soap->mode & SOAP_IO_LENGTH) && (soap->mode & SOAP_ENC_DIME))
+ return soap_send_raw(soap, SOAP_STR_PADDING, -(long)soap->count&3);
+#endif
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_envelope_begin_in(struct soap *soap)
+{ soap->part = SOAP_IN_ENVELOPE;
+ if (soap_element_begin_in(soap, "SOAP-ENV:Envelope"))
+ return soap->error = SOAP_VERSIONMISMATCH;
+ return soap->error;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_envelope_end_in(struct soap *soap)
+{ if (soap_element_end_in(soap, "SOAP-ENV:Envelope"))
+ return soap->error;
+ soap->part = SOAP_END_ENVELOPE;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_body_begin_out(struct soap *soap)
+{ soap->part = SOAP_IN_BODY;
+ if (soap->version == 1)
+ soap->encoding = 1;
+ if (soap_element(soap, "SOAP-ENV:Body", 0, NULL))
+ return soap->error;
+ if (soap_attribute(soap, "id", "_0"))
+ return soap->error;
+ return soap_element_start_end_out(soap, NULL);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_body_end_out(struct soap *soap)
+{ if (soap_element_end_out(soap, "SOAP-ENV:Body"))
+ return soap->error;
+ soap->part = SOAP_IN_BODY;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_body_begin_in(struct soap *soap)
+{ soap->part = SOAP_IN_BODY;
+ return soap_element_begin_in(soap, "SOAP-ENV:Body");
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_body_end_in(struct soap *soap)
+{ if (soap_element_end_in(soap, "SOAP-ENV:Body"))
+ return soap->error;
+ soap->part = SOAP_END_BODY;
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_2
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_recv_header(struct soap *soap)
+{ if (soap_getheader(soap) && soap->error == SOAP_TAG_MISMATCH)
+ soap->error = SOAP_OK;
+ return soap->error;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_set_endpoint(struct soap *soap, const char *endpoint)
+{ register const char *s;
+ register size_t i, n;
+ *soap->endpoint = '\0';
+ *soap->host = '\0';
+ *soap->path = '\0';
+ soap->port = 80;
+ if (!endpoint || !*endpoint)
+ return;
+#ifdef WITH_OPENSSL
+ if (!strncmp(endpoint, "https:", 6))
+ soap->port = 443;
+#endif
+ strncpy(soap->endpoint, endpoint, sizeof(soap->endpoint) - 1);
+ s = strchr(endpoint, ':');
+ if (s && s[1] == '/' && s[2] == '/')
+ s += 3;
+ else
+ s = endpoint;
+ n = strlen(s);
+ if (n >= sizeof(soap->host))
+ n = sizeof(soap->host) - 1;
+/* WR[ */
+#ifdef WITH_IPV6
+ if ('[' == s[0])
+ {
+ s++;
+ for (i = 0; i < n; i++)
+ { soap->host[i] = s[i];
+ if (']' == s[i])
+ {
+ s++;
+ break;
+ }
+ }
+ }
+ else
+ {
+ for (i = 0; i < n; i++)
+ { soap->host[i] = s[i];
+ if (s[i] == '/' || s[i] == ':')
+ break;
+ }
+ }
+#else /* WITH_IPV6 */
+/* ]WR */
+ for (i = 0; i < n; i++)
+ { soap->host[i] = s[i];
+ if (s[i] == '/' || s[i] == ':')
+ break;
+ }
+/* WR[ */
+#endif /* WITH_IPV6 */
+/* ]WR */
+ soap->host[i] = '\0';
+ if (s[i] == ':')
+ { soap->port = (int)atol(s + i + 1);
+ for (i++; i < n; i++)
+ if (s[i] == '/')
+ break;
+ }
+ if (s[i])
+ { strncpy(soap->path, s + i + 1, sizeof(soap->path));
+ soap->path[sizeof(soap->path) - 1] = '\0';
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_connect(struct soap *soap, const char *endpoint, const char *action)
+{ return soap_connect_command(soap, SOAP_POST, endpoint, action);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_connect_command(struct soap *soap, int http_command, const char *endpoint, const char *action)
+{ char host[sizeof(soap->host)];
+ int port;
+ size_t count;
+ strcpy(host, soap->host); /* save to compare */
+ port = soap->port; /* save to compare */
+ soap_set_endpoint(soap, endpoint);
+ if (action)
+ soap->action = soap_strdup(soap, action);
+ if (soap->fconnect)
+ {
+ if ((soap->error = soap->fconnect(soap, endpoint, soap->host, soap->port)))
+ return soap->error;
+ }
+ else if (*soap->host)
+ { soap->status = http_command;
+ if (!soap_valid_socket(soap->socket) || strcmp(soap->host, host) || soap->port != port)
+ { soap->keep_alive = 0; /* force close */
+ soap_closesock(soap);
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Connect to host='%s' path='%s' port=%d\n", soap->host, soap->path, soap->port));
+ soap->socket = soap->fopen(soap, endpoint, soap->host, soap->port);
+ if (soap->error)
+ return soap->error;
+ soap->keep_alive = ((soap->omode & SOAP_IO_KEEPALIVE) != 0);
+ }
+ else if (!soap->keep_alive || soap_poll(soap))
+ { soap->keep_alive = 0; /* force close */
+ soap_closesock(soap);
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Reconnect to host='%s' path='%s' port=%d\n", soap->host, soap->path, soap->port));
+ soap->socket = soap->fopen(soap, endpoint, soap->host, soap->port);
+ if (soap->error)
+ return soap->error;
+ }
+ }
+ count = soap_begin_dime(soap);
+ if (soap_begin_send(soap))
+ return soap->error;
+ if ((soap->mode & SOAP_IO) != SOAP_IO_STORE && !(soap->mode & SOAP_ENC_XML) && endpoint)
+ { unsigned int k = soap->mode;
+ soap->mode &= ~(SOAP_IO | SOAP_ENC_ZLIB);
+ if ((k & SOAP_IO) != SOAP_IO_FLUSH)
+ soap->mode |= SOAP_IO_BUFFER;
+ if ((soap->error = soap->fpost(soap, endpoint, soap->host, soap->port, soap->path, action, count)))
+ return soap->error;
+ if ((k & SOAP_IO) == SOAP_IO_CHUNK)
+ { if (soap_flush(soap))
+ return soap->error;
+ }
+ soap->mode = k;
+ }
+ if (http_command != SOAP_POST)
+ return soap_end_send(soap);
+#ifndef WITH_LEANER
+ if (soap->mode & SOAP_ENC_DIME)
+ return soap_putdimehdr(soap);
+#endif
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_s2base64(struct soap *soap, const unsigned char *s, char *t, size_t n)
+{ register size_t i;
+ register unsigned long m;
+ if (!t)
+ return SOAP_EOM;
+ t[0] = '\0';
+ if (!s)
+ return SOAP_OK;
+ for (; n > 2; n -= 3, s += 3)
+ { m = ((unsigned long)((unsigned char*)s)[0] << 16) | ((unsigned long)((unsigned char*)s)[1] << 8) | (unsigned long)((unsigned char*)s)[2];
+ for (i = 4; i > 0; m >>= 6)
+ t[--i] = soap_base64o[m & 0x3F];
+ t += 4;
+ }
+ t[0] = '\0';
+ if (n > 0)
+ { m = 0;
+ for (i = 0; i < n; i++)
+ m = (m << 8) | *s++;
+ for (; i < 3; i++)
+ m <<= 8;
+ for (i++; i > 0; m >>= 6)
+ t[--i] = soap_base64o[m & 0x3F];
+ for (i = 3; i > n; i--)
+ t[i] = '=';
+ t[4] = '\0';
+ }
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef WITH_LEAN
+SOAP_FMAC1
+const char*
+SOAP_FMAC2
+soap_base642s(struct soap *soap, const char *s, char *t, size_t l, size_t *n)
+{ register int i, j, c;
+ register unsigned long m;
+ char *p = t;
+ if (n)
+ *n = 0;
+ for (;;)
+ { for (i = 0; i < SOAP_BLKLEN; i++)
+ { m = 0;
+ j = 0;
+ while (j < 4)
+ { c = *s++;
+ if (c == '=' || !c)
+ { i *= 3;
+ switch (j)
+ { case 2:
+ *t++ = (char)((m >> 4) & 0xFF);
+ i++;
+ break;
+ case 3:
+ *t++ = (char)((m >> 10) & 0xFF);
+ *t++ = (char)((m >> 2) & 0xFF);
+ i += 2;
+ }
+ if (n)
+ *n += i;
+ return p;
+ }
+ c -= '+';
+ if (c >= 0 && c <= 79)
+ { m = (m << 6) + soap_base64i[c];
+ j++;
+ }
+ }
+ *t++ = (char)((m >> 16) & 0xFF);
+ *t++ = (char)((m >> 8) & 0xFF);
+ *t++ = (char)(m & 0xFF);
+ if (l < 3)
+ { if (n)
+ *n += i;
+ return p;
+ }
+ l -= 3;
+ }
+ if (n)
+ *n += 3 * SOAP_BLKLEN;
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_puthttphdr(struct soap *soap, int status, size_t count)
+{ const char *s;
+ if (status == SOAP_FILE)
+ s = soap->http_content;
+ else if (status == SOAP_HTML)
+ s = "text/html; charset=utf-8";
+ else if (soap->mode & SOAP_ENC_DIME)
+ s = "application/dime";
+ else if (soap->version == 2)
+ s = "application/soap+xml; charset=utf-8";
+ else
+ s = "text/xml; charset=utf-8";
+ soap->error = soap->fposthdr(soap, "Content-Type", s);
+ if (soap->error)
+ return soap->error;
+#ifdef WITH_ZLIB
+ if (soap->omode & SOAP_ENC_ZLIB)
+#ifdef WITH_GZIP
+ soap->error = soap->fposthdr(soap, "Content-Encoding", "gzip");
+#else
+ soap->error = soap->fposthdr(soap, "Content-Encoding", "deflate");
+#endif
+#endif
+ if ((soap->omode & SOAP_IO) == SOAP_IO_CHUNK)
+ soap->error = soap->fposthdr(soap, "Transfer-Encoding", "chunked");
+ else if (count > 0)
+ { sprintf(soap->tmpbuf, "%lu", (unsigned long)count);
+ soap->error = soap->fposthdr(soap, "Content-Length", soap->tmpbuf);
+ }
+ if (soap->error)
+ return soap->error;
+ return soap->error = soap->fposthdr(soap, "Connection", soap->keep_alive ? "keep-alive" : "close");
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+http_get(struct soap *soap)
+{ return SOAP_GET_METHOD;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+http_post(struct soap *soap, const char *endpoint, const char *host, int port, const char *path, const char *action, size_t count)
+{ const char *s;
+ if (soap->status == SOAP_GET)
+ { s = "GET";
+ count = 0;
+ }
+ else
+ s = "POST";
+#ifndef PALM
+ if (!endpoint || (strncmp(endpoint, "http:", 5) && strncmp(endpoint, "https:", 6) && strncmp(endpoint, "httpg:", 6)))
+#else
+ if (!endpoint || (strncmp(endpoint, "http:", 5) && strncmp(endpoint, "https:", 6) && strncmp(endpoint, "httpg:", 6)) && strncmp(endpoint, "_beam:", 6) && strncmp(endpoint, "_local:", 7) && strncmp(endpoint, "_btobex:", 8))
+#endif
+ return SOAP_OK;
+ if (soap->proxy_host)
+ sprintf(soap->tmpbuf, "%s %s HTTP/%s", s, endpoint, soap->http_version);
+ else
+ sprintf(soap->tmpbuf, "%s /%s HTTP/%s", s, path, soap->http_version);
+ if ((soap->error = soap->fposthdr(soap, soap->tmpbuf, NULL)))
+ return soap->error;
+ if (port != 80)
+ sprintf(soap->tmpbuf, "%s:%d", host, port);
+ else
+ strcpy(soap->tmpbuf, host);
+ if ((soap->error = soap->fposthdr(soap, "Host", soap->tmpbuf))
+ || (soap->error = soap->fposthdr(soap, "User-Agent", "gSOAP/2.6"))
+ || (soap->error = soap_puthttphdr(soap, SOAP_OK, count)))
+ return soap->error;
+#ifdef WITH_ZLIB
+#ifdef WITH_GZIP
+ if ((soap->error = soap->fposthdr(soap, "Accept-Encoding", "gzip, deflate")))
+#else
+ if ((soap->error = soap->fposthdr(soap, "Accept-Encoding", "deflate")))
+#endif
+ return soap->error;
+#endif
+#ifndef WITH_LEAN
+ if (soap->userid && soap->passwd && strlen(soap->userid) + strlen(soap->passwd) < 761)
+ { sprintf(soap->tmpbuf + 262, "%s:%s", soap->userid, soap->passwd);
+ strcpy(soap->tmpbuf, "Basic ");
+ soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, strlen(soap->tmpbuf + 262));
+ if ((soap->error = soap->fposthdr(soap, "Authorization", soap->tmpbuf)))
+ return soap->error;
+ }
+ if (soap->proxy_userid && soap->proxy_passwd && strlen(soap->proxy_userid) + strlen(soap->proxy_passwd) < 761)
+ { sprintf(soap->tmpbuf + 262, "%s:%s", soap->proxy_userid, soap->proxy_passwd);
+ strcpy(soap->tmpbuf, "Basic ");
+ soap_s2base64(soap, (const unsigned char*)(soap->tmpbuf + 262), soap->tmpbuf + 6, strlen(soap->tmpbuf + 262));
+ if ((soap->error = soap->fposthdr(soap, "Proxy-Authorization", soap->tmpbuf)))
+ return soap->error;
+ }
+#endif
+#ifdef WITH_COOKIES
+#ifdef WITH_OPENSSL
+ if (soap_putcookies(soap, host, path, soap->ssl != NULL))
+ return soap->error;
+#else
+ if (soap_putcookies(soap, host, path, 0))
+ return soap->error;
+#endif
+#endif
+ if (action)
+ { sprintf(soap->tmpbuf, "\"%s\"", action);
+ if ((soap->error = soap->fposthdr(soap, "SOAPAction", soap->tmpbuf)))
+ return soap->error;
+ }
+ return soap->error = soap->fposthdr(soap, NULL, NULL);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+http_post_header(struct soap *soap, const char *key, const char *val)
+{ if (key)
+ { if (soap_send(soap, key))
+ return soap->error;
+ if (val && (soap_send(soap, ": ") || soap_send(soap, val)))
+ return soap->error;
+ }
+ return soap_send(soap, "\r\n");
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+http_response(struct soap *soap, int status, size_t count)
+{
+/* WR[ */
+#ifdef WMW_RPM_IO
+ if (soap->rpmreqid)
+ {
+ httpOutputEnable(soap->rpmreqid);
+ }
+#endif /* WMW_RPM_IO */
+/* ]WR */
+ if (!status || status == SOAP_HTML || status == SOAP_FILE)
+ { DBGLOG(TEST, SOAP_MESSAGE(fdebug, "OK 200\n"));
+/* WR[ */
+#ifdef WMW_RPM_IO
+ if (soap->rpmreqid || soap_valid_socket(soap->master) || soap_valid_socket(soap->socket)) /* RPM behaves as if standalone */
+#else
+/* ]WR */
+ if (soap_valid_socket(soap->master) || soap_valid_socket(soap->socket)) /* standalone application */
+/* WR[ */
+#endif /* WMW_RPM_IO */
+/* ]WR */
+ { sprintf(soap->tmpbuf, "HTTP/%s 200 OK", soap->http_version);
+ if ((soap->error = soap->fposthdr(soap, soap->tmpbuf, NULL)))
+ return soap->error;
+ }
+ else if ((soap->error = soap->fposthdr(soap, "Status", "200 OK")))
+ return soap->error;
+ }
+ else if (status > 200 && status < 600)
+ { sprintf(soap->tmpbuf, "HTTP/%s %d %s", soap->http_version, status, http_error(soap, status));
+ if ((soap->error = soap->fposthdr(soap, soap->tmpbuf, NULL)))
+ return soap->error;
+ if (status == 401)
+ if ((soap->error = soap->fposthdr(soap, "WWW-Authenticate", "Basic realm=\"gSOAP Service\"")))
+ return soap->error;
+ }
+ else
+ { const char *s = *soap_faultcode(soap);
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Error\n"));
+ if (soap->version == 2 && !strcmp(s, "SOAP-ENV:Sender"))
+ s = "400 Bad Request";
+ else
+ s = "500 Internal Server Error";
+/* WR[ */
+#ifdef WMW_RPM_IO
+ if (soap->rpmreqid || soap_valid_socket(soap->master) || soap_valid_socket(soap->socket)) /* RPM behaves as if standalone */
+#else
+/* ]WR */
+ if (soap_valid_socket(soap->master) || soap_valid_socket(soap->socket)) /* standalone application */
+/* WR[ */
+#endif /* WMW_RPM_IO */
+/* ]WR */
+ { sprintf(soap->tmpbuf, "HTTP/%s %s", soap->http_version, s);
+ if ((soap->error = soap->fposthdr(soap, soap->tmpbuf, NULL)))
+ return soap->error;
+ }
+ else if ((soap->error = soap->fposthdr(soap, "Status", s)))
+ return soap->error;
+ }
+ if ((soap->error = soap->fposthdr(soap, "Server", "gSOAP/2.6"))
+ || (soap->error = soap_puthttphdr(soap, status, count)))
+ return soap->error;
+#ifdef WITH_COOKIES
+ if (soap_putsetcookies(soap))
+ return soap->error;
+#endif
+ return soap->error = soap->fposthdr(soap, NULL, NULL);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_response(struct soap *soap, int status)
+{ register size_t count;
+ if (!(soap->omode & (SOAP_ENC_XML | SOAP_IO_STORE /* this tests for chunking too */))
+ && (status == SOAP_HTML || status == SOAP_FILE))
+ { soap->omode &= ~SOAP_IO;
+ soap->omode |= SOAP_IO_STORE;
+ }
+ soap->status = status;
+ count = soap_begin_dime(soap);
+ if (soap_begin_send(soap))
+ return soap->error;
+ if ((soap->mode & SOAP_IO) != SOAP_IO_STORE && !(soap->mode & SOAP_ENC_XML))
+ { register int n = soap->mode;
+ soap->mode &= ~(SOAP_IO | SOAP_ENC_ZLIB);
+ if ((n & SOAP_IO) != SOAP_IO_FLUSH)
+ soap->mode |= SOAP_IO_BUFFER;
+ if ((soap->error = soap->fresponse(soap, status, count)))
+ return soap->error;
+ if ((n & SOAP_IO) == SOAP_IO_CHUNK)
+ { if (soap_flush(soap))
+ return soap->error;
+ }
+ soap->mode = n;
+ }
+#ifndef WITH_LEANER
+ if (soap->mode & SOAP_ENC_DIME)
+ return soap_putdimehdr(soap);
+#endif
+ return SOAP_OK;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_set_fault(struct soap *soap)
+{ const char **c = soap_faultcode(soap);
+ const char **s = soap_faultstring(soap);
+ if (!*c)
+ { if (soap->version == 2)
+ *c = "SOAP-ENV:Sender";
+ else
+ *c = "SOAP-ENV:Client";
+ }
+ if (*s)
+ return;
+ switch (soap->error)
+ { case SOAP_CLI_FAULT:
+ *s = "Client fault";
+ break;
+ case SOAP_SVR_FAULT:
+ *s = "Server fault";
+ break;
+ case SOAP_TAG_MISMATCH:
+ sprintf(soap->msgbuf, "Tag mismatch: element '%s' does not correspond to expected element", soap->tag);
+ *s = soap->msgbuf;
+ break;
+ case SOAP_TYPE:
+ sprintf(soap->msgbuf, "Data type '%s' mismatch in element '%s'", soap->type, soap->tag);
+ *s = soap->msgbuf;
+ break;
+ case SOAP_SYNTAX_ERROR:
+ *s = "XML syntax error";
+ break;
+ case SOAP_NO_TAG:
+ *s = "No XML element tag found";
+ break;
+ case SOAP_MUSTUNDERSTAND:
+ *c = "SOAP-ENV:MustUnderstand";
+ sprintf(soap->msgbuf, "The data in element '%s' must be understood but cannot be handled", soap->tag);
+ *s = soap->msgbuf;
+ break;
+ case SOAP_VERSIONMISMATCH:
+ *c = "SOAP-ENV:VersionMismatch";
+ *s = "SOAP version mismatch or invalid SOAP message";
+ break;
+ case SOAP_DATAENCODINGUNKNOWN:
+ *c = "SOAP-ENV:DataEncodingUnknown";
+ *s = "Unsupported SOAP data encoding";
+ break;
+ case SOAP_DIME_MISMATCH:
+ *s = "DIME version mismatch";
+ break;
+ case SOAP_NAMESPACE:
+ sprintf(soap->msgbuf, "Namespace URI mismatch in element '%s'", soap->tag);
+ *s = soap->msgbuf;
+ break;
+ case SOAP_OBJ_MISMATCH:
+ *s = "Object mismatch";
+ break;
+ case SOAP_FATAL_ERROR:
+ *s = "Fatal error";
+ break;
+ case SOAP_NO_METHOD:
+ sprintf(soap->msgbuf, "Method '%s' not implemented", soap->tag);
+ *s = soap->msgbuf;
+ break;
+ case SOAP_GET_METHOD:
+ *s = "HTTP GET method not implemented";
+ break;
+ case SOAP_EOM:
+ *s = "Out of memory";
+ break;
+ case SOAP_IOB:
+ *s = "Array index out of bounds";
+ break;
+ case SOAP_NULL:
+ sprintf(soap->msgbuf, "Cannot create nilable object for type '%s' in element '%s'", soap->type, soap->tag);
+ *s = soap->msgbuf;
+ break;
+ case SOAP_MULTI_ID:
+ *s = "Non-unique id attribute";
+ break;
+ case SOAP_MISSING_ID:
+ *s = "Missing id: referenced data is missing or had to be ignored";
+ break;
+ case SOAP_HREF:
+ *s = "Invalid XML: object reference with href attribute is incompatible with actual object referred to";
+ break;
+ case SOAP_FAULT:
+ break;
+ case SOAP_TCP_ERROR:
+ *s = tcp_error(soap);
+ break;
+ case SOAP_HTTP_ERROR:
+ *s = "HTTP error";
+ break;
+ case SOAP_SSL_ERROR:
+ *s = "SSL error";
+ break;
+ case SOAP_PLUGIN_ERROR:
+ *s = "Plugin registry error";
+ break;
+ case SOAP_DIME_ERROR:
+ *s = "DIME error";
+ break;
+ case SOAP_ZLIB_ERROR:
+#ifdef WITH_ZLIB
+ sprintf(soap->msgbuf, "Zlib/gzip error: '%s'", soap->d_stream.msg?soap->d_stream.msg:"");
+ *s = soap->msgbuf;
+#else
+ *s = "Zlib not installed for required message (de)compression";
+#endif
+ break;
+ case SOAP_EOD:
+ *s = "End of DIME error";
+ break;
+ case SOAP_REQUIRED:
+ *s = "Validation failure: XML attribute required";
+ break;
+ case SOAP_OCCURS:
+ *s = "Validation failure: XML element occurs count";
+ break;
+ case SOAP_EOF:
+ sprintf(soap->msgbuf, "End of file or no input: '%s'", soap_strerror(soap));
+ *s = soap->msgbuf;
+ break;
+ default:
+ if (soap->error > 200 && soap->error < 600)
+ { sprintf(soap->msgbuf, "HTTP Error: '%s'", http_error(soap, soap->error));
+ *s = soap->msgbuf;
+ }
+ else
+ *s = "Unknown error code";
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_send_fault(struct soap *soap)
+{ register int status = soap->error;
+ if (status == SOAP_STOP)
+ return status;
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Sending back fault struct for error code %d\n", soap->error));
+ soap->keep_alive = 0; /* to terminate connection */
+ soap_set_fault(soap);
+ if ((status != SOAP_EOF || (!soap->recv_timeout && !soap->send_timeout)) && soap_poll(soap) == SOAP_OK)
+ { soap->error = SOAP_OK;
+ soap_serializeheader(soap);
+ soap_serializefault(soap);
+ soap_begin_count(soap);
+ if (soap->mode & SOAP_IO_LENGTH)
+ { soap_envelope_begin_out(soap);
+ soap_putheader(soap);
+ soap_body_begin_out(soap);
+ soap_putfault(soap);
+ soap_body_end_out(soap);
+ soap_envelope_end_out(soap);
+ }
+ if (soap_response(soap, status)
+ || soap_envelope_begin_out(soap)
+ || soap_putheader(soap)
+ || soap_body_begin_out(soap)
+ || soap_putfault(soap)
+ || soap_body_end_out(soap)
+ || soap_envelope_end_out(soap))
+ return soap_closesock(soap);
+ soap_end_send(soap);
+ }
+ soap_closesock(soap);
+ return soap->error = status;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_recv_fault(struct soap *soap)
+{ register int status = soap->error;
+ DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Receiving SOAP Fault\n"));
+ soap->error = SOAP_OK;
+ if (soap_getfault(soap))
+ { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Error: soap_get_soapfault() failed. Is this a SOAP message at all?\n"));
+ *soap_faultcode(soap) = (soap->version == 2 ? "SOAP-ENV:Sender" : "SOAP-ENV:Client");
+ soap->error = status;
+ soap_set_fault(soap);
+ }
+ else
+ { register const char *s = *soap_faultcode(soap);
+ if (!soap_match_tag(soap, s, "SOAP-ENV:Server") || !soap_match_tag(soap, s, "SOAP-ENV:Receiver"))
+ status = SOAP_SVR_FAULT;
+ else if (!soap_match_tag(soap, s, "SOAP-ENV:Client") || !soap_match_tag(soap, s, "SOAP-ENV:Sender"))
+ status = SOAP_CLI_FAULT;
+ else if (!soap_match_tag(soap, s, "SOAP-ENV:MustUnderstand"))
+ status = SOAP_MUSTUNDERSTAND;
+ else if (!soap_match_tag(soap, s, "SOAP-ENV:VersionMismatch"))
+ status = SOAP_VERSIONMISMATCH;
+ else
+ { DBGLOG(TEST,SOAP_MESSAGE(fdebug, "Fault code %s\n", s));
+ status = SOAP_FAULT;
+ }
+ if (soap_body_end_in(soap)
+ || soap_envelope_end_in(soap)
+ || soap_end_recv(soap))
+ return soap_closesock(soap);
+ soap->error = status;
+ }
+ return soap_closesock(soap);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static const char*
+soap_strerror(struct soap *soap)
+{ int err = soap->errnum;
+ if (!err)
+ err = soap_errno;
+ if (err)
+ {
+#ifndef UNDER_CE
+ return strerror(err);
+#else
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, (LPTSTR)&soap->werrorstr, 256, NULL);
+ wcstombs(soap->errorstr, soap->werrorstr, 256);
+ return soap->errorstr;
+#endif
+ }
+ return "Operation interrupted or timed out";
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+soap_set_error(struct soap *soap, const char *faultcode, const char *faultstring, const char *faultdetail, int soaperror)
+{ *soap_faultcode(soap) = faultcode;
+ *soap_faultstring(soap) = faultstring;
+ if (faultdetail && *faultdetail)
+ { register const char **s = soap_faultdetail(soap);
+ if (s)
+ *s = faultdetail;
+ }
+ return soap->error = soaperror;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_set_sender_error(struct soap *soap, const char *faultstring, const char *faultdetail, int soaperror)
+{ return soap_set_error(soap, soap->version == 2 ? "SOAP-ENV:Sender" : "SOAP-ENV:Client", faultstring, faultdetail, soaperror);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_set_receiver_error(struct soap *soap, const char *faultstring, const char *faultdetail, int soaperror)
+{ return soap_set_error(soap, soap->version == 2 ? "SOAP-ENV:Receiver" : "SOAP-ENV:Server", faultstring, faultdetail, soaperror);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static int
+soap_copy_fault(struct soap *soap, const char *faultcode, const char *faultstring, const char *faultdetail)
+{ char *s = NULL, *t = NULL;
+ if (faultstring)
+ s = soap_strdup(soap, faultstring);
+ if (faultdetail)
+ t = soap_strdup(soap, faultdetail);
+ return soap_set_error(soap, faultcode, s, t, SOAP_FAULT);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_sender_fault(struct soap *soap, const char *faultstring, const char *faultdetail)
+{ return soap_copy_fault(soap, soap->version == 2 ? "SOAP-ENV:Sender" : "SOAP-ENV:Client", faultstring, faultdetail);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_receiver_fault(struct soap *soap, const char *faultstring, const char *faultdetail)
+{ return soap_copy_fault(soap, soap->version == 2 ? "SOAP-ENV:Receiver" : "SOAP-ENV:Server", faultstring, faultdetail);
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_print_fault(struct soap *soap, FILE *fd)
+{ if (soap->error)
+ { const char **s;
+ if (!*soap_faultcode(soap))
+ soap_set_fault(soap);
+ fprintf(fd, "SOAP FAULT: %s\n\"%s\"\n", *soap_faultcode(soap), *soap_faultstring(soap));
+ s = soap_faultdetail(soap);
+ if (s && *s)
+ fprintf(fd, "Detail: %s\n", *s);
+ }
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void
+SOAP_FMAC2
+soap_print_fault_location(struct soap *soap, FILE *fd)
+{
+#ifndef WITH_LEAN
+ int c;
+ if (soap->error && soap->buflen > 0)
+ { if (soap->bufidx == 0)
+ soap->bufidx = 1;
+ c = soap->buf[soap->bufidx - 1];
+ soap->buf[soap->bufidx - 1] = '\0';
+ soap->buf[soap->buflen - 1] = '\0';
+ if (soap->bufidx < soap->buflen)
+ fprintf(fd, "%s%c\n** HERE **\n%s\n", soap->buf, c, soap->buf + soap->bufidx);
+ else
+ fprintf(fd, "%s%c\n** HERE **\n", soap->buf, c);
+ }
+#endif
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+int
+SOAP_FMAC2
+soap_register_plugin_arg(struct soap *soap, int (*fcreate)(struct soap*, struct soap_plugin*, void*), void *arg)
+{ register struct soap_plugin *p;
+ register int r;
+ if (!(p = (struct soap_plugin*)SOAP_MALLOC(sizeof(struct soap_plugin))))
+ return soap->error = SOAP_EOM;
+ p->id = NULL;
+ p->data = NULL;
+ p->fcopy = NULL;
+ p->fdelete = NULL;
+ r = fcreate(soap, p, arg);
+ if (!r && p->fdelete)
+ { p->next = soap->plugins;
+ soap->plugins = p;
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Registered '%s' plugin\n", p->id));
+ return SOAP_OK;
+ }
+ DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Could not register plugin '%s': plugin returned error %d (or fdelete callback not set)\n", p->id?p->id:"?", r));
+ SOAP_FREE(p);
+ return r;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+static void *
+fplugin(struct soap *soap, const char *id)
+{ register struct soap_plugin *p;
+ for (p = soap->plugins; p; p = p->next)
+ if (p->id == id || !strcmp(p->id, id))
+ return p->data;
+ return NULL;
+}
+#endif
+
+/******************************************************************************/
+#ifndef PALM_1
+SOAP_FMAC1
+void *
+SOAP_FMAC2
+soap_lookup_plugin(struct soap *soap, const char *id)
+{ return soap->fplugin(soap, id);
+}
+#endif
+
+/******************************************************************************/
+#ifdef __cplusplus
+}
+#endif
+
#include <iostream>
-#include <fstream>
#include <sys/types.h>
#include <unistd.h>
-#include <assert.h>
+
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/XmlOutputter.h>
-#include <cppunit/TestRunner.h>
-#include <cppunit/TestResult.h>
-#include <cppunit/TestResultCollector.h>
+#include <cppunit/ui/text/TestRunner.h>
+
#include "glite_gss.h"
{
CPPUNIT_TEST_SUITE(GSSTest);
CPPUNIT_TEST(echo);
- CPPUNIT_TEST(echo);
- CPPUNIT_TEST(bigecho);
CPPUNIT_TEST(errorTest);
CPPUNIT_TEST_SUITE_END();
public:
void echo();
- void bigecho();
void errorTest();
void setUp();
struct timeval timeout;
void replier();
+
};
struct sockaddr_in a;
socklen_t alen = sizeof(a);
int s, len;
- char buf[8*BUFSIZ];
-
- std::cerr << "replier " << getpid() << std::endl;
+ char buf[100];
+
if ( (s = accept(sock, (struct sockaddr *) &a, &alen)) < 0 ) exit(1);
if ( edg_wll_gss_accept(my_cred, s, &timeout, &conn, &stat) ) exit(1);
socklen_t alen = sizeof(a);
char * cred_file = NULL;
char * key_file = NULL;
- char * to = getenv("GSS_TEST_TIMEOUT");
- timeout.tv_sec = to ? atoi(to) : 10 ;
+ timeout.tv_sec = 10;
timeout.tv_usec = 0;
key_file = cred_file = getenv("X509_USER_PROXY");
char buf[] = "f843fejwfanczn nc4*&686%$$&^(*)*#$@WSH";
char buf2[100];
- std::cerr << "echo " << getpid() << std::endl;
err = edg_wll_gss_connect(my_cred, "localhost", port, &timeout, &conn, &stat);
CPPUNIT_ASSERT_MESSAGE("edg_wll_gss_connect()", !err);
}
-void GSSTest::bigecho()
-{
- edg_wll_GssConnection conn;
- edg_wll_GssStatus stat;
- size_t total;
- int err;
- char buf[7*BUFSIZ];
- char buf2[7*BUFSIZ];
-
- std::cerr << "bigecho " << getpid() << std::endl;
-
- err = edg_wll_gss_connect(my_cred, "localhost", port, &timeout, &conn, &stat);
- CPPUNIT_ASSERT_MESSAGE("edg_wll_gss_connect()", !err);
-
- err = edg_wll_gss_write(&conn, buf, sizeof buf, &timeout, &stat);
- CPPUNIT_ASSERT_MESSAGE("edg_wll_gss_write()", !err);
-
- err = edg_wll_gss_read_full(&conn, buf2, sizeof buf2, &timeout, &total, &stat);
- CPPUNIT_ASSERT_MESSAGE("edg_wll_gss_read_full()", !err);
-
- CPPUNIT_ASSERT(sizeof buf == total && !memcmp(buf,buf2,sizeof buf) );
-
- edg_wll_gss_close(&conn, &timeout);
-
-}
-
void GSSTest::errorTest()
{
int main (int ac,const char *av[])
{
- assert(ac == 2);
- std::ofstream xml(av[1]);
-
CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
- CppUnit::TestRunner runner;
-
- CppUnit::TestResult controller;
- CppUnit::TestResultCollector result;
- controller.addListener( &result );
-
+ CppUnit::TextUi::TestRunner runner;
+
runner.addTest(suite);
- runner.run(controller);
-
-
- CppUnit::XmlOutputter xout( &result, xml );
- CppUnit::CompilerOutputter tout( &result, std::cout);
- xout.write();
- tout.write();
-
- return result.wasSuccessful() ? 0 : 1 ;
+ return runner.run() ? 0 : 1;
}
Load version file
========================================= -->
<property file="${module.version.file}"/>
- <property file="${module.build.file}"/>
+ <property file="${module.build.file}"/>
+ <property file="${module.build.file}" />
<!-- ==============================================
Local private targets
-module.build=137
+#Wed Aug 10 03:45:05 CEST 2005
+module.build=333
Revision history:
$Log$
- Revision 1.3 2005/03/08 12:51:23 dkouril
- - Removed unused code
- - enabled (and partly rewritten) support for renewal of VOMS attributes
- - internal VOMS headers added - they are necessary to work with ASN.1 encoded
- VOMS attribures (hopefully new version of the VOMS API will provide better
- support)
-
- Revision 1.2 2004/07/12 16:18:37 dimeglio
- Modified to use myproxy from the repository if available
-
-->
<!-- ======================================================
thrflavour=${with.globus.thr.flavor}
nothrflavour=${with.globus.nothr.flavor}
myproxy_prefix=${with.myproxy.prefix}
+voms_prefix=${with.glite.location}
</echo>
</target>
</project>
-module.version=1.2.2
-module.age=1
+
+module.version = 1.0.14
+module.age = 1
+
+++ /dev/null
-/*********************************************************************
- *
- * Authors: Vincenzo Ciaschini - Vincenzo.Ciaschini@cnaf.infn.it
- *
- * Copyright (c) 2002, 2003 INFN-CNAF on behalf of the EU DataGrid.
- * For license conditions see LICENSE file or
- * http://www.edg.org/license.html
- *
- * Parts of this code may be based upon or even include verbatim pieces,
- * originally written by other people, in which case the original header
- * follows.
- *
- *********************************************************************/
-#ifndef _ACSTACK_H
-#define _ACSTACK_H
-
-#include <openssl/asn1.h>
-#include <openssl/stack.h>
-#include <openssl/safestack.h>
-
-#define IMPL_STACK(type) \
- DECLARE_STACK_OF(type) \
- STACK_OF(type) *sk_##type##_new (int (*cmp)(const type * const *, const type * const *)) \
- { return sk_new ( (int (*)(const char * const *, const char * const *))cmp);} \
- STACK_OF(type) *sk_##type##_new_null () { return sk_new_null(); } \
- void sk_##type##_free (STACK_OF(type) *st) { sk_free(st); } \
- int sk_##type##_num (const STACK_OF(type) *st) { return sk_num(st); } \
- type *sk_##type##_value (const STACK_OF(type) *st, int i) { return (type *)sk_value(st, i); } \
- type *sk_##type##_set (STACK_OF(type) *st, int i, type *val) { return ((type *)sk_set(st, i, (char *)val)); } \
- void sk_##type##_zero (STACK_OF(type) *st) { sk_zero(st);} \
- int sk_##type##_push (STACK_OF(type) *st, type *val) { return sk_push(st, (char *)val); } \
- int sk_##type##_unshift (STACK_OF(type) *st, type *val) { return sk_unshift(st, (char *)val); } \
- int sk_##type##_find (STACK_OF(type) *st, type *val) { return sk_find(st, (char *)val); } \
- type *sk_##type##_delete (STACK_OF(type) *st, int i) { return (type *)sk_delete(st, i); } \
- type *sk_##type##_delete_ptr (STACK_OF(type) *st, type *ptr) { return (type *)sk_delete_ptr(st, (char *)ptr); } \
- int sk_##type##_insert (STACK_OF(type) *st, type *val, int i) { return sk_insert(st, (char *)val, i); } \
- int (*sk_##type##_set_cmp_func (STACK_OF(type) *st, int (*cmp)(const type * const *, const type * const *)))(const type * const *, const type * const *) \
- { return (int ((*)(const type * const *, const type * const *)))sk_set_cmp_func (st, (int (*)(const char * const *, const char * const *))cmp); } \
- STACK_OF(type) *sk_##type##_dup (STACK_OF(type) *st) { return sk_dup(st); } \
- void sk_##type##_pop_free (STACK_OF(type) *st, void (*func)(type *)) { sk_pop_free(st, (void (*)(void *))func); } \
- type *sk_##type##_shift (STACK_OF(type) *st) { return (type *)sk_shift(st); } \
- type *sk_##type##_pop (STACK_OF(type) *st) { return (type *)sk_pop(st); } \
- void sk_##type##_sort (STACK_OF(type) *st) { sk_sort(st); } \
- STACK_OF(type) *d2i_ASN1_SET_OF_##type (STACK_OF(type) **st, unsigned char **pp, long length, type *(*d2ifunc)(), void (*freefunc)(type *), int ex_tag, int ex_class) \
- { return d2i_ASN1_SET(st, pp, length, (char *(*)())d2ifunc, (void (*)(void *))freefunc, ex_tag, ex_class); } \
- int i2d_ASN1_SET_OF_##type (STACK_OF(type) *st, unsigned char **pp, int (*i2dfunc)(), int ex_tag, int ex_class, int is_set) \
- { return i2d_ASN1_SET(st, pp, i2dfunc, ex_tag, ex_class, is_set); } \
- unsigned char *ASN1_seq_pack_##type (STACK_OF(type) *st, int (*i2d)(), unsigned char **buf, int *len) { return ASN1_seq_pack(st, i2d, buf, len); } \
- STACK_OF(type) *ASN1_seq_unpack_##type (unsigned char *buf, int len, type *(*d2i)(), void (*freefunc)(type *)) \
- { return ASN1_seq_unpack(buf, len, (char *(*)())d2i, (void (*)(void *))freefunc); }
-
-
-#define DECL_STACK(type) \
- DECLARE_STACK_OF(type) \
- extern STACK_OF(type) *sk_##type##_new (int (*)(const type * const *, const type * const *)); \
- extern STACK_OF(type) *sk_##type##_new_null (); \
- extern void sk_##type##_free (STACK_OF(type) *); \
- extern int sk_##type##_num (const STACK_OF(type) *); \
- extern type *sk_##type##_value (const STACK_OF(type) *, int); \
- extern type *sk_##type##_set (STACK_OF(type) *, int, type *); \
- extern void sk_##type##_zero (STACK_OF(type) *); \
- extern int sk_##type##_push (STACK_OF(type) *, type *); \
- extern int sk_##type##_unshift (STACK_OF(type) *, type *); \
- extern int sk_##type##_find (STACK_OF(type) *, type *); \
- extern type *sk_##type##_delete (STACK_OF(type) *, int); \
- extern type *sk_##type##_delete_ptr (STACK_OF(type) *, type *); \
- extern int sk_##type##_insert (STACK_OF(type) *, type *, int); \
- extern int (*sk_##type##_set_cmp_func (STACK_OF(type) *, int (*)(const type * const *, const type * const *)))(const type * const *, const type * const *); \
- extern STACK_OF(type) *sk_##type##_dup (STACK_OF(type) *); \
- extern void sk_##type##_pop_free (STACK_OF(type) *, void (*)(type *)); \
- extern type *sk_##type##_shift (STACK_OF(type) *); \
- extern type *sk_##type##_pop (STACK_OF(type) *); \
- extern void sk_##type##_sort (STACK_OF(type) *); \
- extern STACK_OF(type) *d2i_ASN1_SET_OF_##type (STACK_OF(type) **, unsigned char **, long, type *(*)(), void (*)(type *), int, int); \
- extern int i2d_ASN1_SET_OF_##type (STACK_OF(type) *, unsigned char **, int (*)(), int, int, int); \
- extern unsigned char *ASN1_seq_pack_##type (STACK_OF(type) *, int (*)(), unsigned char **, int *); \
- extern STACK_OF(type) *ASN1_seq_unpack_##type (unsigned char *, int, type *(*)(), void (*)(type *)) ;
-
-#endif
+++ /dev/null
-/*********************************************************************
- *
- * Authors: Vincenzo Ciaschini - Vincenzo.Ciaschini@cnaf.infn.it
- *
- * Copyright (c) 2002, 2003 INFN-CNAF on behalf of the EU DataGrid.
- * For license conditions see LICENSE file or
- * http://www.edg.org/license.html
- *
- * Parts of this code may be based upon or even include verbatim pieces,
- * originally written by other people, in which case the original header
- * follows.
- *
- *********************************************************************/
-#ifndef _NEW_FORMAT_H
-#define _NEW_FORMAT_H
-#include <openssl/evp.h>
-#include <openssl/asn1.h>
-#include <openssl/asn1_mac.h>
-#include <openssl/x509.h>
-#include <openssl/x509v3.h>
-#include <openssl/stack.h>
-#include <openssl/safestack.h>
-
-#include "acstack.h"
-#if 0
-static STACK_OF(CRYPT_EX_DATA_FUNS) *AC_meth = NULL;
-
-static AC_METHOD meth = {
- (int (*)()) i2d_AC,
- (char *(*)())d2i_AC,
- (char *(*)())AC_new,
- (void (*)()) AC_free};
-a
-ASN1_METHOD *AC_asn1_meth(void)
-{
- return &meth;
-}
-#endif
-
-typedef struct ACDIGEST {
- ASN1_ENUMERATED *type;
- ASN1_OBJECT *oid;
- X509_ALGOR *algor;
- ASN1_BIT_STRING *digest;
-} AC_DIGEST;
-
-typedef struct ACIS {
- STACK_OF(GENERAL_NAME) *issuer;
- ASN1_INTEGER *serial;
- ASN1_BIT_STRING *uid;
-} AC_IS;
-
-typedef struct ACFORM {
- STACK_OF(GENERAL_NAME) *names;
- AC_IS *is;
- AC_DIGEST *digest;
-} AC_FORM;
-
-typedef struct ACACI {
- STACK_OF(GENERAL_NAME) *names;
- AC_FORM *form;
-} AC_ACI;
-
-typedef struct ACHOLDER {
- AC_IS *baseid;
- STACK_OF(GENERAL_NAMES) *name;
- AC_DIGEST *digest;
-} AC_HOLDER;
-
-typedef struct ACVAL {
- ASN1_GENERALIZEDTIME *notBefore;
- ASN1_GENERALIZEDTIME *notAfter;
-} AC_VAL;
-
-typedef struct asn1_string_st AC_IETFATTRVAL;
-
-typedef struct ACIETFATTR {
- STACK_OF(GENERAL_NAMES) *names;
- STACK_OF(AC_IETFATTRVAL) *values;
-} AC_IETFATTR;
-
-typedef struct ACTARGET {
- GENERAL_NAME *name;
- GENERAL_NAME *group;
- AC_IS *cert;
-} AC_TARGET;
-
-typedef struct ACTARGETS {
- STACK_OF(AC_TARGET) *targets;
-} AC_TARGETS;
-
-typedef struct ACATTR {
- ASN1_OBJECT *type;
- STACK_OF(AC_IETFATTR) *ietfattr;
-} AC_ATTR;
-
-typedef struct ACINFO {
- ASN1_INTEGER *version;
- AC_HOLDER *holder;
- AC_FORM *form;
- X509_ALGOR *alg;
- ASN1_INTEGER *serial;
- AC_VAL *validity;
- STACK_OF(AC_ATTR) *attrib;
- ASN1_BIT_STRING *id;
- STACK_OF(X509_EXTENSION) *exts;
-} AC_INFO;
-
-typedef struct ACC {
- AC_INFO *acinfo;
- X509_ALGOR *sig_alg;
- ASN1_BIT_STRING *signature;
-} AC;
-
-typedef struct ACSEQ {
- STACK_OF(AC) *acs;
-} AC_SEQ;
-
-DECL_STACK(AC_TARGET)
-DECL_STACK(AC_TARGETS)
-DECL_STACK(AC_IETFATTR)
-DECL_STACK(AC_IETFATTRVAL)
-DECL_STACK(AC_ATTR)
-DECL_STACK(AC);
-DECL_STACK(AC_INFO);
-DECL_STACK(AC_VAL);
-DECL_STACK(AC_HOLDER);
-DECL_STACK(AC_ACI);
-DECL_STACK(AC_FORM);
-DECL_STACK(AC_IS);
-DECL_STACK(AC_DIGEST);
-
-extern int i2d_AC_ATTR(AC_ATTR *a, unsigned char **pp);
-extern AC_ATTR *d2i_AC_ATTR(AC_ATTR **a, unsigned char **p, long length);
-extern AC_ATTR *AC_ATTR_new();
-extern void AC_ATTR_free(AC_ATTR *a);
-extern int i2d_AC_IETFATTR(AC_IETFATTR *a, unsigned char **pp);
-extern AC_IETFATTR *d2i_AC_IETFATTR(AC_IETFATTR **a, unsigned char **p, long length);
-extern AC_IETFATTR *AC_IETFATTR_new();
-extern void AC_IETFATTR_free (AC_IETFATTR *a);
-extern int i2d_AC_IETFATTRVAL(AC_IETFATTRVAL *a, unsigned char **pp);
-extern AC_IETFATTRVAL *d2i_AC_IETFATTRVAL(AC_IETFATTRVAL **a, unsigned char **pp, long length);
-extern AC_IETFATTRVAL *AC_IETFATTRVAL_new();
-extern void AC_IETFATTRVAL_free(AC_IETFATTRVAL *a);
-extern int i2d_AC_DIGEST(AC_DIGEST *a, unsigned char **pp);
-extern AC_DIGEST *d2i_AC_DIGEST(AC_DIGEST **a, unsigned char **pp, long length);;
-extern AC_DIGEST *AC_DIGEST_new(void);
-extern void AC_DIGEST_free(AC_DIGEST *a);
-extern int i2d_AC_IS(AC_IS *a, unsigned char **pp);
-extern AC_IS *d2i_AC_IS(AC_IS **a, unsigned char **pp, long length);
-extern AC_IS *AC_IS_new(void);
-extern void AC_IS_free(AC_IS *a);
-extern int i2d_AC_FORM(AC_FORM *a, unsigned char **pp);
-extern AC_FORM *d2i_AC_FORM(AC_FORM **a, unsigned char **pp, long length);
-extern AC_FORM *AC_FORM_new(void);
-extern void AC_FORM_free(AC_FORM *a);
-extern int i2d_AC_ACI(AC_ACI *a, unsigned char **pp);
-extern AC_ACI *d2i_AC_ACI(AC_ACI **a, unsigned char **pp, long length);
-extern AC_ACI *AC_ACI_new(void);
-extern void AC_ACI_free(AC_ACI *a);
-
-extern int i2d_AC_HOLDER(AC_HOLDER *a, unsigned char **pp);
-extern AC_HOLDER *d2i_AC_HOLDER(AC_HOLDER **a, unsigned char **pp, long length);
-extern AC_HOLDER *AC_HOLDER_new(void);
-extern void AC_HOLDER_free(AC_HOLDER *a);
-
-/* new AC_VAL functions by Valerio */
-extern int i2d_AC_VAL(AC_VAL *a, unsigned char **pp);
-extern AC_VAL *d2i_AC_VAL(AC_VAL **a, unsigned char **pp, long length);
-extern AC_VAL *AC_VAL_new(void);
-extern void AC_VAL_free(AC_VAL *a);
-/* end*/
-
-extern int i2d_AC_INFO(AC_INFO *a, unsigned char **pp);
-extern AC_INFO *d2i_AC_INFO(AC_INFO **a, unsigned char **p, long length);
-extern AC_INFO *AC_INFO_new(void);
-extern void AC_INFO_free(AC_INFO *a);
-extern int i2d_AC(AC *a, unsigned char **pp) ;
-extern AC *d2i_AC(AC **a, unsigned char **pp, long length);
-extern AC *AC_new(void);
-extern void AC_free(AC *a);
-extern int i2d_AC_TARGETS(AC_TARGETS *a, unsigned char **pp) ;
-extern AC_TARGETS *d2i_AC_TARGETS(AC_TARGETS **a, unsigned char **pp, long length);
-extern AC_TARGETS *AC_TARGETS_new(void);
-extern void AC_TARGETS_free(AC_TARGETS *a);
-extern int i2d_AC_TARGET(AC_TARGET *a, unsigned char **pp) ;
-extern AC_TARGET *d2i_AC_TARGET(AC_TARGET **a, unsigned char **pp, long length);
-extern AC_TARGET *AC_TARGET_new(void);
-extern void AC_TARGET_free(AC_TARGET *a);
-extern int i2d_AC_SEQ(AC_SEQ *a, unsigned char **pp) ;
-extern AC_SEQ *d2i_AC_SEQ(AC_SEQ **a, unsigned char **pp, long length);
-extern AC_SEQ *AC_SEQ_new(void);
-extern void AC_SEQ_free(AC_SEQ *a);
-
-#endif
#include "glite/security/voms/voms_apic.h"
-#include "newformat.h"
+#include "glite/security/voms/newformat.h"
char * Decode(const char *, int, int *);
char **listadd(char **, char *, int);
Load version file
========================================= -->
<property file="${module.version.file}"/>
- <property file="${module.build.file}"/>
+ <property file="${module.build.file}"/>
+ <property file="${module.build.file}" />
<!-- ==============================================
Local private targets
#
# Revision history:
# $Log$
+# Revision 1.10.2.1 2005/04/04 00:48:20 dimeglio
+# Increased revision number
+#
+# Revision 1.10 2004/12/10 07:31:35 eronchie
+# Increased version
+#
# Revision 1.9 2004/11/16 15:31:13 eronchie
# Increased version
#
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
-AC_INIT([GLite WMS Utils Exception], [1.0.0])
+AC_INIT([GLite WMS Utils Exception], [1.0.2])
AC_CONFIG_AUX_DIR([./project])
AM_INIT_AUTOMAKE([1.6.3 subdir-objects])
AC_CONFIG_SRCDIR([src/Exception.cpp])
-module.build=138
+#Thu Jul 28 02:10:14 CEST 2005
+module.build=319
-module.version=1.0.0
-module.age=1
+
+module.version = 1.0.2
+module.age = 1
+
namespace exception {
using namespace std ;
pthread_mutex_t METHOD_MUTEX ; // This mutex is used in order to lock the file for writing log infornation
-
/* *********************************
* Exception Class Implementation
************************************/
//Constructor/Destructor
+
Exception::Exception () {
line = 0;
-};
+} ;
Exception::~Exception() throw(){ }
line = line_number;
method_name = method;
error_message = "";
+ exception_name = "";
}
Exception::Exception( const std::string& file, int line_number, const std::string& method, int code, const std::string& name)
const char* Exception::what() const throw(){
if (!ancestor.empty()) return ancestor.c_str();
- return error_message.c_str();
+
+ return error_message.c_str();
};
string Exception::getExceptionName(){
string Exception::dbgMessage(){
string result ;
- result = "";
- // Exception name should be displayed only once
- if (stack_strings.size()==0){result +=exception_name;};
+ //Adding exception Name
+ result = exception_name;
+
//Adding error msg
if (error_message!="") result +=": " + string(what());
+
if (result != "") result+="\n";
+
//Adding Source
result +="\tat " + method_name +"[" +source_file;
+
//Adding line number
if (line!=0){
char buffer [1024] ;
+++ /dev/null
-## *********************************************************************
-## *
-## * Copyright (c) 2002 CERN and INFN on behalf of the EU DataGrid.
-## * For license conditions see LICENSE file or
-## * http://www.edg.org/license.html
-## *
-## *********************************************************************
-
-EXCEPTION_LIBS = $(top_builddir)/src/libglite_wmsutils_exception.la
-
-TESTS = glite-wmsutils-exception
-
-check_PROGRAMS = $(TESTS)
-
-glite_wmsutils_exception_SOURCES = exception_cu_suite.cpp \
- exception_cu_suite.h \
- exception_cu_main.cpp
-
-glite_wmsutils_exception_LDADD = \
- $(GLITE_WMSUTILS_EXCEPTION_LIBS) \
- $(GLOBUS_GSS_THR_LIBS) \
- $(EXCEPTION_LIBS) \
- $(CPPUNIT_LIBS)
-
-AM_CPPFLAGS = \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/test \
- $(GLITE_CFLAGS) \
- $(GLOBUS_THR_CFLAGS) \
- $(CPPUNIT_CFLAGS)
-
-MAINTAINERCLEANFILES = Makefile.in *~
-
+++ /dev/null
-#include <iostream>
-#include <fstream>
-
-#include "exception_cu_suite.h"
-
-#include <cppunit/TestResult.h>
-#include <cppunit/TestRunner.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TextOutputter.h>
-#include <cppunit/XmlOutputter.h>
-
-using namespace CppUnit;
-using namespace std;
-
-int main (int argc , char** argv)
-{
- std::ofstream xml("./cppUnit_output.xml",ios::app);
-
- CppUnit::TestResult controller;
- CppUnit::TestResultCollector result;
- controller.addListener( &result );
-
- TestRunner runner;
- runner.addTest(Exception_test::suite());
- runner.run(controller);
-
- CppUnit::XmlOutputter outputter( &result, xml );
- CppUnit::TextOutputter outputter2( &result, std::cerr );
- outputter.write();
- outputter2.write();
-
- return result.wasSuccessful() ? 0 : 1 ;
-}
+++ /dev/null
-#include "exception_cu_suite.h"
-#include "glite/wmsutils/exception/Exception.h"
-#include <string>
-#include <vector>
-
-using namespace CppUnit;
-using namespace std;
-using namespace glite::wmsutils::exception;
-
-void Exception_test::setUp()
-{}
-
-void Exception_test::tearDown()
-{}
-
-
-void Exception_test::constructor_case()
-{
-
- //constructor class name, line number, method name, code, exception name
- glite::wmsutils::exception::Exception exc_5("TEST_Class", 3, "test_method", 1, "exception_test");
-
- //constructor class name, method name, code, exception name
- glite::wmsutils::exception::Exception exc_4("TEST_Class", "test_method", 1, "exception_test");
-
- CPPUNIT_ASSERT(exc_5.getExceptionName() == "exception_test");
- CPPUNIT_ASSERT(exc_5.getCode() == 1);
-}
-
-void Exception_test::tostring_case()
-{
- cout<<"TEST TO STRING METHODS"<<endl;
- glite::wmsutils::exception::Exception exc_5("TEST_Class", 3, "test_method", 1, "exception_test");
- cout << exc_5.dbgMessage() << endl;
- cout << exc_5.printStackTrace() << endl;
- exc_5.log("exception_file");
-
- cout<<"END TEST TO STRING"<<endl;
-}
-
-void Exception_test::stackTrace_case()
-{
- glite::wmsutils::exception::Exception exc_5("TEST_Class", 3, "test_method", 1, "exception_test");
-
- exc_5.push_back("Second_Class", 5, "second_method");
-
- vector<string> msgvec = exc_5.getStackTrace();
-
- for (int i=0; i<msgvec.size(); i++)
- {
- cout << msgvec[i] << endl;
- }
-
-}
-
-
+++ /dev/null
-#include<iostream>
-#include<string>
-#include<pthread.h>
-
-#include <cppunit/extensions/HelperMacros.h>
-
-
-class Exception_test : public CppUnit::TestFixture {
-
- CPPUNIT_TEST_SUITE(Exception_test);
- CPPUNIT_TEST(constructor_case);
- CPPUNIT_TEST(tostring_case);
- CPPUNIT_TEST(stackTrace_case);
- CPPUNIT_TEST_SUITE_END();
-
-
-public:
-
- void setUp();
- void tearDown();
-
- void constructor_case();
- void tostring_case();
- void stackTrace_case();
-
-};
-
-
-
Load version file
========================================= -->
<property file="${module.version.file}"/>
- <property file="${module.build.file}"/>
+ <property file="${module.build.file}"/>
+ <property file="${module.build.file}" />
<!-- ==============================================
Local private targets
typedef struct _edg_wlc_jobid_s* edg_wlc_jobid_t;
namespace glite {
-namespace wmsutils {
+namespace wmsutils {
namespace jobid {
/**
JobId() ;
/**
* Instantiates a JobId object from the passed dg_jobId in string format.
- * @param jobid a string representig a classAd expression
+ * @param job_id_string a string representig a classAd expression
* @throws WrongIdException When a string is passed in a wrong format
*/
- JobId(const std::string& jobid ) ;
- /**
- * Instantiates a JobId object from the passed JobId instance
- * @param jobid a JobId instance to copy from
- * @throws WrongIdException When a string is passed in a wrong format
- */
- JobId(const JobId& jobid );
- /**
- * Instantiates a JobId object from the passed JobId internal reference
- * @param jobid the JobId internal reference
- * @throws WrongIdException When a string is passed in a wrong format
- */
- JobId(const edg_wlc_JobId& jobid);
+ JobId(const std::string& job_id_string ) ;
+ JobId(const JobId&);
+ JobId(const edg_wlc_JobId&);
/**
* Destructor
* Destroy the Job Id instance
/** Converts the jobId into a string
@return the string representation of a JobId*/
std::string toString() const;
- /** casting operator */
operator const edg_wlc_JobId() const { return m_JobId; }
- /** Operator "=" create a deep copy of the JobId instance*/
JobId & operator=(JobId const &);
- /** Operator "=" create a deep copy of the JobId instance*/
JobId & operator=(const edg_wlc_JobId &);
- /** Retrieve the internal id reference
- *@return the JobId internal reference used by some LB methods */
edg_wlc_JobId getId() const ;
private:
// This Variable stores the Job unique identification String
mutable char* m_pStr;
mutable char* m_pBkserver;
mutable char* m_pUnique;
- /** Operator "<"*/
+
friend bool operator<(JobId const& lhs, JobId const& rhs);
- /** Operator "=="*/
friend bool operator==(JobId const& lhs, JobId const& rhs);
};
-module.build=137
+#Sun Apr 03 03:12:33 CEST 2005
+module.build=213
-module.version=1.0.0
-module.age=1
+
+module.version = 1.0.0
+module.age = 1
+
\ No newline at end of file
+++ /dev/null
-## *********************************************************************
-## *
-## * Copyright (c) 2002 CERN and INFN on behalf of the EU DataGrid.
-## * For license conditions see LICENSE file or
-## * http://www.edg.org/license.html
-## *
-## *********************************************************************
-
-JOBID_LIBS = $(top_builddir)/src/jobid/libglite_wmsutils_jobid.la
-CJOBID_LIBS = $(top_builddir)/src/jobid/libglite_wmsutils_cjobid.la
-
-TESTS = glite-wmsutils-jobid \
- glite-wmsutils-manipulation
-
-check_PROGRAMS = $(TESTS)
-
-glite_wmsutils_jobid_SOURCES = jobid_cu_suite.cpp \
- jobid_cu_suite.h \
- jobid_cu_main.cpp
-
-glite_wmsutils_jobid_LDADD = \
- $(GLITE_WMSUTILS_EXCEPTION_LIBS) \
- $(GLOBUS_GSS_THR_LIBS) \
- $(CPPUNIT_LIBS) \
- $(JOBID_LIBS) \
- $(CJOBID_LIBS)
-
-glite_wmsutils_manipulation_SOURCES = manipulation_cu_suite.cpp \
- manipulation_cu_suite.h \
- manipulation_cu_main.cpp
-
-glite_wmsutils_manipulation_LDADD = \
- $(GLITE_WMSUTILS_EXCEPTION_LIBS) \
- $(GLOBUS_GSS_THR_LIBS) \
- $(CPPUNIT_LIBS) \
- $(JOBID_LIBS) \
- $(CJOBID_LIBS)
-
-
-AM_CPPFLAGS = -I$(top_srcdir)/interface \
- -I$(top_srcdir)/src \
- -I$(top_srcdir)/test \
- $(GLITE_CFLAGS) \
- $(GLOBUS_THR_CFLAGS) \
- $(CPPUNIT_CFLAGS)
-
-MAINTAINERCLEANFILES = Makefile.in *~
-
+++ /dev/null
-#include <iostream>
-#include <fstream>
-
-#include "jobid_cu_suite.h"
-
-#include <cppunit/TestResult.h>
-#include <cppunit/TestRunner.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TextOutputter.h>
-#include <cppunit/XmlOutputter.h>
-
-using namespace CppUnit;
-using namespace std;
-
-int main (int argc , char** argv)
-{
- std::ofstream xml("./cppUnit_output.xml",ios::app);
-
- CppUnit::TestResult controller;
- CppUnit::TestResultCollector result;
- controller.addListener( &result );
-
- TestRunner runner;
- runner.addTest(Jobid_test::suite());
- runner.run(controller);
-
- CppUnit::XmlOutputter outputter( &result, xml );
- CppUnit::TextOutputter outputter2( &result, std::cerr );
- outputter.write();
- outputter2.write();
-
- return result.wasSuccessful() ? 0 : 1 ;
-}
+++ /dev/null
-#include "jobid_cu_suite.h"
-
-
-using namespace CppUnit;
-using namespace std;
-using namespace glite::wmsutils::jobid;
-
-
-void Jobid_test::setUp()
-{}
-
-void Jobid_test::tearDown()
-{}
-
-void Jobid_test::Constructor_case()
-{
- //EMPTY CONSTRUCTOR
- JobId empty;
-
- CPPUNIT_ASSERT(empty.isSet()==false);
-
- //create a string with cjobid
- string bkserver="grid012g.cnaf.infn.it";
- edg_wlc_JobId jobid;
- int bkport=6000;
- int ok=edg_wlc_JobIdCreate(bkserver.c_str(), bkport, &jobid);
- CPPUNIT_ASSERT(ok == 0);
- if (ok==0)
- {
- string jobstring=edg_wlc_JobIdUnparse(jobid);
-
- //STRING CONSTRUCTOR
- JobId stringCons(jobstring);
-
- //EDG_WLC CONSTRUCTOR
- JobId edg_wlc_Cons(jobid);
-
- //test copy constructor
- JobId copycon(stringCons);
-
- CPPUNIT_ASSERT(stringCons.isSet());
- CPPUNIT_ASSERT(edg_wlc_Cons.isSet());
- CPPUNIT_ASSERT(copycon.isSet());
-
- //test =
- JobId testequal;
- testequal=stringCons;
- CPPUNIT_ASSERT(testequal.isSet());
-
- JobId testoperator;
- testoperator=jobid;
- CPPUNIT_ASSERT(testoperator.isSet());
-
- edg_wlc_JobId testget = edg_wlc_Cons.getId();
- char *server;
- unsigned int port;
- edg_wlc_JobIdGetServerParts(testget, &server, &port);
- string serverstring = server;
- CPPUNIT_ASSERT(port==bkport);
- CPPUNIT_ASSERT(serverstring==bkserver);
- }
-
- CPPUNIT_ASSERT_THROW( JobId stringwrong("grid012"), WrongIdException);
-}
-
-void Jobid_test::Clear_case()
-{
- JobId *element;
- string jobstring="https://grid012g.cnaf.infn.it:6000/qaKyEoV3G144rmoyXeW6QA";
- CPPUNIT_ASSERT_NO_THROW(element= new JobId(jobstring));
-
- CPPUNIT_ASSERT(element->isSet());
- element->clear();
- CPPUNIT_ASSERT(element->isSet()==false);
- delete element;
-}
-
-void Jobid_test::SetandGet_case()
-{
- JobId element;
- string lbserver="grid012g.cnaf.infn.it";
- int port=6000;
- string unique ="qaKyEoV3G144rmoyXeW6QA";
- element.setJobId(lbserver, port, unique);
-
- string server=element.getServer();
- lbserver=lbserver+":6000";
-
- CPPUNIT_ASSERT(server==lbserver);
- string lonely=element.getUnique();
- CPPUNIT_ASSERT(lonely==unique);
-
- string descr=element.toString();
- cout << "!!! BEGIN TEST toString() METHOD!!!"<< endl;
- cout << descr <<endl;
- cout << "!!! END TEST toString() METHOD!!!"<< endl;
-
- JobId wrongelement;
- CPPUNIT_ASSERT_THROW(string server=wrongelement.getServer(), EmptyIdException);
- CPPUNIT_ASSERT_THROW(string server=wrongelement.getUnique(), EmptyIdException);
-
-}
+++ /dev/null
-#include<iostream>
-#include<string>
-#include<pthread.h>
-
-#include <cppunit/extensions/HelperMacros.h>
-
-#include "glite/wmsutils/jobid/JobId.h"
-#include "glite/wmsutils/jobid/cjobid.h"
-#include "glite/wmsutils/jobid/JobIdExceptions.h"
-
-class Jobid_test : public CppUnit::TestFixture {
-
- CPPUNIT_TEST_SUITE(Jobid_test);
-
- CPPUNIT_TEST(Constructor_case);
- CPPUNIT_TEST(Clear_case);
- CPPUNIT_TEST(SetandGet_case);
-
- CPPUNIT_TEST_SUITE_END();
-
-
-public:
-
- void setUp();
- void tearDown();
-
- void Constructor_case();
- void Clear_case();
- void SetandGet_case();
-
-};
-
-
-
+++ /dev/null
-#include <iostream>
-#include <fstream>
-
-#include "manipulation_cu_suite.h"
-
-#include <cppunit/TestResult.h>
-#include <cppunit/TestRunner.h>
-#include <cppunit/TestResultCollector.h>
-#include <cppunit/TextOutputter.h>
-#include <cppunit/XmlOutputter.h>
-
-using namespace CppUnit;
-using namespace std;
-
-int main (int argc , char** argv)
-{
- std::ofstream xml("./cppUnit_output.xml",ios::app);
-
- CppUnit::TestResult controller;
- CppUnit::TestResultCollector result;
- controller.addListener( &result );
-
- TestRunner runner;
- runner.addTest(Manipulation_test::suite());
- runner.run(controller);
-
- CppUnit::XmlOutputter outputter( &result, xml );
- CppUnit::TextOutputter outputter2( &result, std::cerr );
- outputter.write();
- outputter2.write();
-
- return result.wasSuccessful() ? 0 : 1 ;
-}
+++ /dev/null
-#include "manipulation_cu_suite.h"
-
-
-using namespace CppUnit;
-using namespace std;
-using namespace glite::wmsutils::jobid;
-
-
-void Manipulation_test::setUp()
-{}
-
-void Manipulation_test::tearDown()
-{}
-
-void Manipulation_test::to_fromfile_case()
-{
- JobId element;
-
- string lbserver="grid012g.cnaf.infn.it";
- int port=6000;
- string unique ="qaKyEoV3G144rmoyXeW6QA";
- element.setJobId(lbserver, port, unique);
-
- string filename=to_filename(element);
-
- JobId newelement = from_filename(filename);
-
- string reduced = get_reduced_part(element, 7);
-
- string newreduced = get_reduced_part(newelement, 7);
-
- CPPUNIT_ASSERT(reduced==newreduced);
-}
-
+++ /dev/null
-#include<iostream>
-#include<string>
-#include<pthread.h>
-
-#include <cppunit/extensions/HelperMacros.h>
-
-#include "glite/wmsutils/jobid/JobId.h"
-#include "glite/wmsutils/jobid/manipulation.h"
-
-class Manipulation_test : public CppUnit::TestFixture {
-
- CPPUNIT_TEST_SUITE(Manipulation_test);
-
- CPPUNIT_TEST(to_fromfile_case);
-
- CPPUNIT_TEST_SUITE_END();
-
-
-public:
-
- void setUp();
- void tearDown();
-
- void to_fromfile_case();
-
-};
-
-
-
+* Wed Oct 12 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Fix for older OpenSSL to grst_x509.c from
+ Zoltan.Farkas <Zoltan.Farkas@cern.ch>
+* Wed Oct 12 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- ==== GridSite version 1.1.14 ====
+* Tue Oct 11 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Modify VOMS AC parsing to handle multiple ACs inside
+ the same X.509 AC extension.
+* Mon Oct 10 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- ==== GridSite version 1.1.13 ====
+* Mon Oct 10 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Add target_gname patch to gsexec from
+ Gerben Venekamp <venekamp@nikhef.nl>
+* Thu Oct 6 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Fix session reuse with Shared-Memory SSL Session
+ Cache bug #8856 in mod_gridsite.
+- Add SiteCast support to file copying in htcp.
+* Tue Oct 4 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Move User, Config, Admin and Install guides from
+ doc directory into GridSite Wiki.
+- Create/update man pages for htcp, mod_gridsite and
+ gsexec to be distributed with source/binaries.
+* Mon Oct 3 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Fix to gsexec GRST_CRED_0/SSL_CLIENT_S_DN bug found
+ by Ian Stokes-Rees <i.stokes-rees1@PHYSICS.OX.AC.UK>
+* Fri Sep 30 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Add SiteCast ping (NOP) support to htcp
+* Thu Sep 29 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Add SiteCast support to mod_gridsite (file location
+ discovery via UDP multicast of HTCP messages.)
+* Wed Sep 21 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Add ports 777 and 488 to example httpd.conf files in
+ docs. See http://www.gridsite.org/wiki/IP_Ports
+* Tue Sep 13 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- ==== GridSite version 1.1.12 ====
+* Tue Sep 13 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Fix bug #10031 submitted by Fabrizio Pacini
+ <fabrizio.pacini@cern.ch> (invalid free in
+ GRSTgaclAclLoadFile if ACL format not valid.)
+* Mon Sep 12 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Accept GRIDHTTP_ONETIME when passed in HTTP query
+ (still overridden by a GRIDHTTP_ONETIME in a cookie.)
+* Sat Sep 10 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Fix problem with attempted upgrades to GridHTTP when
+ already on the HTTP virtual server.
+* Fri Sep 9 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- GRST_DESTINATION_TRANSLATED and GRST_DESTINATION_PERM
+ environment variables, for use with CGI-based COPY.
+- Rework GridHTTP (ex-Downgrade) code to store method
+ and URI with permission, rather than credentials.
+- Restrict use of GridSiteOnetimesDir to main server.
+* Fri Aug 26 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
+- Fix for HTTP PUT lack-of-truncation bug found by
+ Mike Jones, and support for HTTP/WebDAV MOVE.
+- Add MOVE support to htcp and update htcp manpage.
+- Unset CURLOPT_SSL_VERIFYPEER in htcp etc when using
+ --noverify option.
* Fri Jun 10 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
- ==== GridSite version 1.1.11 ====
* Fri Jun 10 2005 Andrew McNab <Andrew.McNab@man.ac.uk>
BUILDING/INSTALLING GRIDSITE
============================
-For more detailed instructions, see the install.html file, either
-in the ./doc subdirectory in the sources, in the directory
-gridsite-VERSION/html of the docs directory when GridSite is
-installed, or http://www.gridsite.org/1.1.x/install.html
+For more detailed instructions, see the Installation and Build
+pages in the GridSite Wiki http://www.gridsite.org/wiki/
GridSite is currently only supported on Linux, but should be
trivially portable to other Unix platforms where the GNU build
-See INSTALL for build and installation instructions, and
-the Documentation section of http://www.gridsite.org/
-for configuration and usage guides.
+See INSTALL for build and installation instructions, and the
+man pages for reference information.
+
+The GridSite Wiki at http://www.gridsite.org/wiki/ has guides
+( http://www.gridsite.org/wiki/Category:Guides ) and cookbook
+examples ( http://www.gridsite.org/wiki/Category:Cookbooks )
MAJOR_VERSION=1
MINOR_VERSION=1.1
-PATCH_VERSION=1.1.11
+PATCH_VERSION=1.1.14
VERSION=$(PATCH_VERSION)
+++ /dev/null
-<title>GridSite Admin Guide</title>
-<body>
-<h1 align=center>GridSite Admin Guide</h1>
-
-<p>
-This Guide is intended for people administrating areas of GridSite
-websites or fileservers, or managing GridSite's DN List groups - that is,
-how to use GridSite to manage other people's access to parts of the site -
-for example, people's write access to areas devoted to specific subprojects.
-
-<p>
- There is a separate
-<a href="user.html">User Guide</a>
- which explains how to authenticate to the server with X.509 certificates,
-and how to manage files via a standard web browser or with command-line
-HTTPS clients. You should be familiar with the User Guide to fully
-understand this Admin Guide.
-
-<p>
- You may also find the
-<a href="config.html">Config Guide</a>
- useful to understand how the Apache webserver is configured with GridSite
-extensions. If you are also the Apache webmaster for your site, you will
-definitely need to read the Config Guide to create the httpd.conf file.
-However, if you only need to manage webpages and files, then this Admin
-Guide and the User Guide should be sufficient.
-
-<h2>Groups and DN Lists</h2>
-
-<p>
-GridSite defines groups of people using plain text DN Lists - that is, lists
-of people's certificate DNs. Each DN List has a URL which uniquely
-identifies the list (and may also allow other sites to obtain the list and
-use it themselves.) For example, the list of all GridPP members is
-https://www.gridpp.ac.uk/dn-lists/gridpp (note that it's https:// not
-http:// - this means that other sites that download the list can check the
-certificate of www.gridpp.ac.uk and know they're talking to the
-authoritative source of the lists.)
-
-<p>
-The system can also have a number of other DN Lists which are associated with
-specific groups of people and perhaps with specific areas of responsibility
-of the website. If the DN List directory URI is /dn-lists/ then
-there is a full list of the DN Lists exported by the server at that URI
-(for example, https://www.gridpp.ac.uk/dn-lists/ )
-
-<p>
-If you have permission to modify a DN List, you can start changing it by
-going to /dn-lists/ (via HTTPS), using the "Manage directory"
-button and finding the URL of your DN List in the listings. You may
-need to go down into a subdirectory to find your list. For
-example, https://www.gridpp.ac.uk/dn-lists/atlas is in the atlas
-subdirectory of /dn-lists/ (You may wish to bookmark the listing of such
-a directory if you frequently work with one.)
-
-<p>
-DN List directories are managed by the ACLs described in the next section,
-and if you have write permission, you can edit the lists already there, and
-add new lists with the same prefix (this means you can readily create your
-own subgroups.)
-
-<h2>Access Control Lists</h2>
-
-<p>
-DN Lists appear in the Grid Access Control Lists (GACL) used by GridSite.
-These are stored as .gacl files in directories: if the .gacl file is
-present, it governs access to the directory; if it is absent, then the
-parent directories are searched upwards until a .gacl is found.
-
-<p>
-The GridSite <a href="gacl.html">GACL Reference</a> explains the XML format
-of these files, but they
-can be edited using the ACL editor built into the GridSite system by people
-who have the Admin permission within the ACL.
-
-<p>
-If you have this permission in a given directory, when you view directory
-listings or files in that directory you will see the option "Manage
-Directory" in the page footer. This allows you to get a listing of the
-directory and the .gacl file will appear at the top if it's present. If not,
-then there will be a button to create a new .gacl file with the same
-permissions as have been inherited by that directory from its parent.
-
-<p>
-GACL allows quite complex conditions to be imposed on access, but normally
-you can think of an ACL as being composed of a number of entries, each of
-which contains one condition (the required credential) and a set of allowed
-and denied permissions.
-
-<p>
-Credentials can be individual user's certificate names or whole groups of
-certificate names if a DN List is given. (You can also specifiy hostname
-patterns using Unix shell wildcards (eg *.ac.uk) or EDG VOMS attribute
-certificates - see the GACL Reference for details.)
-
-<p>
-Permissions can be Admin (edit the ACL), Write (create, modify or delete
-files), List (browse the directory) or Read (read files.) Permissions can be
-allowed or denied. If denied by any entry, the permission is not available
-to that user or DN List (depending on what credential type was associated
-with the Deny.)
-
-</body>
+++ /dev/null
-<title>GridSite Config Guide</title>
-<body>
-<h1 align=center>GridSite Config Guide</h1>
-
-<p>
-This Guide is intended for webmasters setting up
-<a href="http://www.gridsite.org/">GridSite</a> with an Apache 2.0
-webserver. We assume you have root access to the server machine to do this.
-There is a separate <a href="admin.html">Admin Guide</a> for
-people administrating areas of GridSite
-websites or fileservers, or managing GridSite's DN List groups. That is, for
-people managing files on the server rather than the server itself.
-
-<h2>Installation</h2>
-
-<p>
-We assume you have installed Apache 2.0 and GridSite, using the
-<a href="install.html">Building and Installation Guide</a> where necessary.
-This Config Guide assumes installation has been done under /usr. For an
-alternative tree like /usr/local, the relative paths should be the same.
-
-<p>
-Installation should have given you an Apache 2.0 httpd binary at
-/usr/sbin/httpd and a set of standard Apache 2.0 modules in
-/usr/lib/httpd/modules/ including the standard mod_ssl
-and our mod_gridsite.so module.
-
-<p>
-GridSite also includes some commands and man pages in /usr/bin and
-/usr/share/man/man1: <a href="urlencode.1.html">urlencode</a> and
-<a href="htcp.1.html">htcp</a>.
-
-<h2>Certificates</h2>
-
-<p>
-You must also install the CA root certificates of the CA's
-used by the users you wish to talk to. These should be installed in
-/etc/grid-security/certificates as files like 01621954.0, and RPMs and tar
-files for many common European and North American CAs are available from
-<a href="https://datagrid.in2p3.fr/distribution/datagrid/security/">
-https://datagrid.in2p3.fr/distribution/datagrid/security/</a>
-
-<p>
-This location also has VOMS server certificate RPMs which install into
-the /etc/grid-security/vomsdir directory. You may also manually install VOMS
-server certificates into that directory with any filename. (GridSite
-currently parses the certificate itself when looking for a match, rather
-than checking the filename.)
-
-<p>
-The server itself needs a certificate to supply to clients that use HTTPS
-connections. You should apply for this from your Certification Authority
-(for example, the <a href="http://ca.grid-support.ac.uk/">UK e-Science
-CA</a>) and your request must use the advertised hostname of your server
-(the one that appears in URLs and not, for instance, the canonical name of
-the host itself.) This advertised hostname should appear in the
-Distinguished Name of your request. (For example
-/C=UK/O=eScience/OU=Manchester/L=HEP/CN=www.gridpp.ac.uk) For compatability
-with standard browsers, the /CN= component should not include any
-Globus-style service name (so <b>not</b> /CN=host/www.gridpp.ac.uk) If
-possible, you should also include the advertised hostname as a DNS Subject
-Alternative Name. Consult your CA first if you're in any doubt about how to
-compose your certificate request.
-
-<p>
-Once you've got your certificate,
-Apache uses the certificate and private key in PEM format. If you obtained
-your certificate and key in PKCS#12 or .p12 format (eg by exporting from a web
-browser), you can convert the .p12 file to .pem with the following commands:
-<pre>
-openssl pkcs12 -in ck.p12 -clcerts -nokeys -out hostcert.pem
-openssl pkcs12 -in ck.p12 -nodes -nocerts -out hostkey.pem
-</pre>
-
-<p>
-Copy the PEM files to /etc/grid-security/ as hostcert.pem (which
-should be world readable) and hostkey.pem (which should only be readable by
-root):
-
-<pre>
-chown root.root hostkey.pem hostcert.pem
-chmod 400 hostkey.pem
-chmod 444 hostcert.pem
-</pre>
-
-<h2>httpd.conf</h2>
-
-<p>
-/etc/httpd/conf/httpd.conf is the key to configuring the Apache 2.0
-webserver. The directives in this file determine which files the server will
-publish, how they are handled, which areas are writeable and who can access
-them. Through mod_gridsite.so, the GridSite system itself is configured by
-directives in this file.
-
-<p>
-The easiest way to get started is to examine the example httpd.conf files we
-provide.
-
-<p>
-<b>Please note: this version of GridSite is <b>not</b> compatible with the
-SHM SSL session cache - use the DBM or per-process caches instead.
-
-<!--
-virtual servers
-directory sections
-order of loadable modules
--->
-
-<h2>httpd-fileserver.conf</h2>
-
-<p>
-<a href="httpd-fileserver.conf">httpd-fileserver.conf</a> is an example
-configuration file to use Apache/GridSite as a read/write HTTP(S)
-fileserver, including comments on how to get the server up and running.
-
-<h2>httpd-webserver.conf</h2>
-
-<p>
-<a href="httpd-webserver.conf">httpd-webserver.conf</a> is an example
-configuration file to use Apache/GridSite as a Web Server
-(that is, primarily for interactive use with a browser)
-including comments on how to get the server up and running.
-
-<h2>GridSite Directives</h2>
-
-<p>
-The <a href="module.html">mod_gridsite reference</a> lists all the GridSite
-httpd.conf directives.
-
-<p>
-To start serving files, make a directory /var/www/htdocs owned by
-nobody.nobody, including the .gacl access control file described below,
-and add the following directive to the HTTPS <Directory> section:
-
-<p>
-GridSiteMethods GET PUT DELETE
-
-<p>
-If you wish to accept Globus GSI Proxies as well as full X.509 user
-certificates, set GridSiteGSIProxyLimit to the depth of proxy you
-wish to accept. (As a _rough_ guide: 0=No Proxies; 1=Proxy on user's
-machine; 2=Proxy owned by running Globus job; 3=Proxy delegated by a
-Globus job.)
-
-<h2>GACL access control</h2>
-
-<p>
-The <a href="gacl.html">GACL reference</a> explains the XML access
-control files used by GridSite. These allow flexible policies to be written,
-in terms of X.509 user certificates, GSI proxies, VOMS attribute
-certificates, DN List groups and DNS hostnames.
-
-<p>
-For example, to give all clients read and list permission:
-<p>
-<pre>
-<gacl>
-<entry>
- <any-user/>
- <allow><read/><list/></allow>
-</entry>
-</gacl>
-</pre>
-
-<p>
-To enable writing, add DN List, Person or VOMS entries to the file.
-For example:
-
-<p>
-<pre>
-<gacl>
-<entry>
- <any-user/>
- <allow><read/><list/></allow>
-</entry>
-<entry>
- <person>
- <dn>/C=UK/O=eScience/OU=Manchester/L=HEP/CN=Andrew McNab</dn>
- </person>
- <allow><write/></allow>
-</entry>
-</gacl>
-</pre>
-
-<p>
-The GACL file that governs a directory is stored as .gacl in that directory.
-If no .gacl is present, then GridSite will search the parent directories in
-ascending order until one is found.
-
-<!--
-<h2>DN Lists</h2>
-<h2>gridsite-admin.cgi</h2>
-<h2>Other CGI</h2>
--->
-
-</body>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions
+ targetNamespace="http://www.gridsite.org/namespaces/delegation-1"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://www.gridsite.org/namespaces/delegation-1"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <types>
+ <schema
+ targetNamespace="http://www.gridsite.org/namespaces/delegation-1"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+ <complexType name="DelegationException">
+ <sequence>
+ <element name="message" nillable="true" type="xsd:string"/>
+ </sequence>
+ </complexType>
+ </schema>
+ </types>
+
+ <message name="getProxyReqResponse">
+ <part name="getProxyReqReturn" type="xsd:string"/>
+ </message>
+ <message name="getProxyReqRequest">
+ <part name="delegationID" type="xsd:string"/>
+ </message>
+
+ <message name="DelegationException">
+ <part name="fault" type="tns:DelegationException"/>
+ </message>
+
+ <message name="putProxyResponse"/>
+ <message name="putProxyRequest">
+ <part name="delegationID" type="xsd:string"/>
+ <part name="proxy" type="xsd:string"/>
+ </message>
+
+ <portType name="Delegation">
+ <operation name="getProxyReq" parameterOrder="delegationID">
+ <documentation>
+ Starts the delegation procedure by asking for a certificate
+ signing request from the server. The server answers with a
+ certificate signing request which includes the public key
+ for the new delegated credentials. Uses PEM encoding.
+ </documentation>
+ <input message="tns:getProxyReqRequest" name="getProxyReqRequest"/>
+ <output message="tns:getProxyReqResponse" name="getProxyReqResponse"/>
+ <fault message="tns:DelegationException" name="DelegationException"/>
+ </operation>
+
+ <operation name="putProxy" parameterOrder="delegationID proxy">
+ <documentation>
+ Finishes the delegation procedure by sending the signed
+ proxy certificate to the server. Uses PEM encoding.
+ </documentation>
+ <input message="tns:putProxyRequest" name="putProxyRequest"/>
+ <output message="tns:putProxyResponse" name="putProxyResponse"/>
+ <fault message="tns:DelegationException" name="DelegationException"/>
+ </operation>
+ </portType>
+
+ <binding name="DelegationSoapBinding" type="tns:Delegation">
+ <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <operation name="getProxyReq">
+ <wsdlsoap:operation soapAction=""/>
+ <input name="getProxyReqRequest">
+ <wsdlsoap:body namespace="http://www.gridsite.org/namespaces/delegation-1" use="literal"/>
+ </input>
+ <output name="getProxyReqResponse">
+ <wsdlsoap:body namespace="http://www.gridsite.org/namespaces/delegation-1" use="literal"/>
+ </output>
+ <fault name="DelegationException">
+ <wsdlsoap:fault name="DelegationException" use="literal"/>
+ </fault>
+ </operation>
+
+ <operation name="putProxy">
+ <wsdlsoap:operation soapAction=""/>
+ <input name="putProxyRequest">
+ <wsdlsoap:body namespace="http://www.gridsite.org/namespaces/delegation-1" use="literal"/>
+ </input>
+ <output name="putProxyResponse">
+ <wsdlsoap:body namespace="http://www.gridsite.org/namespaces/delegation-1" use="literal"/>
+ </output>
+ <fault name="DelegationException">
+ <wsdlsoap:fault name="DelegationException" use="literal"/>
+ </fault>
+ </operation>
+ </binding>
+
+</definitions>
-.TH findproxyfile 1 "October 2004" findproxyfile "FINDPROXYFILE Manual"
+.TH findproxyfile 1 "October 2004" "findproxyfile" "GridSite Manual"
.SH NAME
.B findproxyfile
\- returns full path to GSI Proxy file
+++ /dev/null
-<title>GridSite: Grid Access Control Language</title>
-<body>
-<h1 align=center>GridSite: Grid Access Control Language</h1>
-
-<p>
-GACL is the authorization policy language used by
-<a href="http://www.gridsite.org/">GridSite</a> GACL allows
-policies to be written in terms of common Grid credentials: X.509
-identities, GSI proxies, VOMS attribute certificates and lists of X.509
-identities.
-
-<p>
-GridSite both uses GACL policies and provides a GACL manipulation API for
-C/C++ in the GridSite library.
-
-<h2>Credentials</h2>
-
-<p>
-In GridSite 1.1.x, four credential types are supported:
-
-<p>
-<person>
-<dn>/O=Grid/CN=Name</dn>
-</person>
-
-<p>
-<voms>
-<fqan>/vo.dom.ain/group</fqan>
-</voms>
-
-<p>
-<dn-list>
-<url>https://www.vo.dom.ain/dn-lists/group</url>
-</dn-list>
-
-<p>
-<dns>
-<hostname>host*.dom.ain</hostname>
-</dns>
-
-<h2>Permissions</h2>
-
-<p>
-Five permissions are supported: Admin, Write, List, Exec and Read. Admin is
-permission to modify the authorization policy itself, but applications can
-map the other permissions to local methods as appropriate to their
-environment. For filesystems and fileservers, Write, List and Read have
-their usual meanings: creating or modifying files or directories; browsing
-directories; reading files. Exec is not used by GridSite itself, and
-applications are free to give it a meaning within their own contexts.
-
-<p>
-In 1.0.x, only per-directory GACL files are supported, and the file is stored
-in the directory in question, or in one of its parent directories. (GridSite
-searches upwards until it finds one.)
-
-<p>
-In GACL files, the permissions are represented by single tags:
-<admin/>, <write/>, <list/>, <exec/>, <read/>.
-Permission
-tags are contained within Allow or Deny blocks. For example:
-<allow><read/><list/></allow> or
-<deny><admin/></deny>.
-
-<h2>Entries</h2>
-
-<p>
-Entries associate credentials with permission statements. Entries consist of
-one or more credential blocks, and either an Allow or a Deny block, or both.
-If multiple credentials are present in one entry, they must all be held by a
-user to receive the association permissions. (So Entries provide logical AND
-of credentials.)
-
-<h2>Access Control Lists</h2>
-
-<p>
-ACLs consist of a list of one or more Entry blocks. When a user's credentials
-are compared to the ACL, the permissions given to the user by Allow blocks
-are recorded, along with those forbidden by Deny blocks. When all entries
-have been evaluated, any forbidden permissions are removed from those
-granted. (So Deny always wins over Allow, even between different Entries,
-but otherwise ACLs provide logical OR of credentials.)
-
-</body>
-.de Sh \" Subsection
-.br
-.if t .Sp
-.ne 5
-.PP
-\fB\\$1\fR
-.PP
-..
-.de Sp \" Vertical space (when we can't use .PP)
-.if t .sp .5v
-.if n .sp
-..
-.de Ip \" List item
-.br
-.ie \\n(.$>=3 .ne \\$3
-.el .ne 3
-.IP "\\$1" \\$2
-..
-.TH "GSEXEC" 8 "2005-05-27" "GridSite Apache Extensions" "gsexec"
-
+.TH GSEXEC 8 "October 2005" "gsexec" "GridSite Manual"
.SH NAME
-gsexec \- Switch user before executing external programs
+.B gsexec
+\- Switch user before executing external programs
.SH "SYNOPSIS"
-.PP
-\fBgsexec\fR -\fBV\fR
+.BR gsexec
+[-V]
-
.SH "SUMMARY"
-
-.PP
+
gsexec is used by the Apache HTTP Server to switch to another user before
executing CGI programs\&. In order to achieve this, it must run as root\&.
Since the HTTP daemon normally doesn't run as root, the gsexec executable
needs the setuid bit set and must be owned by root\&. It should never be
writable for any other person than root\&.
-.PP
-gsexec is based on Apache's suexec.
-For further information about the concepts and the security model of
-the original suexec
-please refer to the suexec documentation:
+gsexec is based on Apache's suexec, and its behaviour is controlled with
+the Apache configuration file directives
+.BR GridSiteExecMethod
+and
+.BR GridSiteUserGroup
+added to Apache by
+.BR mod_gridsite(8)
+Four execution methods are supported: nosetuid, suexec, X509DN and directory,
+and these may be set on a per-directory basis within the Apache configuration
+file.
+
+.SH "NOSETUID METHOD"
+
+This is the default behaviour, but can also be produced by giving
+.BR "GridSiteExecMethod nosetuid"
+
+CGI programs will then be executed without using gsexec, and will
+run as the Unix user given by the User and Group Apache directives (normally
+apache.apache on Red Hat derived systems.)
+
+.SH "SUEXEC METHOD"
+
+If
+.BR "GridSiteExecMethod suexec"
+is given for this virtual host or directory, then CGI programs will be
+executed using the user and group given by the
+.BR "GridSiteUserGroup user group"
+directive, which may also be set on a per-directory basis (unlike suexec's
+.BR SuexecUserGroup
+which is per-server only.) The CGI program must either be owned by root,
+the Apache user
+and group specified at gsexec build-time (normally apache.apache) or by
+the user and group given with the
+.BR GridSiteUserGroup
+directive.
+
+.SH "X509DN METHOD"
+
+If
+.BR "GridSiteExecMethod X509DN"
+is given, then the CGI program runs as a pool user, detemined using lock
+files in the exec mapping directory chosen as build time of gsexec.
+The pool user is chosen according
+to the client's full certificate X.509 DN (ie with any trailing GSI proxy
+name components stripped off.) Subsequent requests by the same X.509
+identity will be mapped to the same pool user. The CGI program must either be
+owned by root, the Apache user
+and group specified at gsexec build-time (normally apache.apache) or by
+the pool user selected.
+
+.SH "DIRECTORY METHOD"
+
+If
+.BR "GridSiteExecMethod directory"
+is given, then the CGI program runs as a pool user chosen according
+to the directory in which the CGI is located: all CGIs in that directory
+run as the same pool user. The CGI program must either be
+owned by root, the Apache user
+and group specified at gsexec build-time (normally apache.apache) or by
+the pool user selected.
-(http://httpd\&.apache\&.org/docs-2\&.0/suexec\&.html)\&.
-
+
+.SH "EXECMAPDIR"
+
+The default exec mapping directory is /var/www/execmapdir and this is fixed
+when the gsexec executable is built. The exec mapping directory and all
+of its lock files must be owned and only writable by root. To initialise the
+lock files, create an empty lock file for each pool user, with the pool
+username as the filename (eg user0001, user0002, ...) As the pool users are
+leased to X.509 identities or directories, they will become hard linked to
+lock files with the URL-encoded X.509 DN or full directory path.
+
+You can recycle pool users by removing the corresponding URL-encoded
+hard link.
+.BR stat(1)
+and
+.BR "ls(1)"
+with option
+.BR "-i"
+can be used to print the inodes of lock files to match up the hard links.
+
+.BR "However, you must ensure that all files and processes owned by the pool"
+.BR "user are deleted before recycling!"
.SH "OPTIONS"
-
.TP
-V
If you are root, this option displays the compile options of gsexec\&.
For security reasons all configuration options are changeable only at
compile time\&.
+.SH "MORE INFORMATION"
+For further information about the concepts and the security model of
+the original Apache suexec
+please refer to the suexec documentation:
+
+http://httpd\&.apache\&.org/docs-2\&.0/suexec\&.html
+
+For examples using the gsexec extensions, please see the GridSite gsexec
+page:
+
+http://www.gridsite.org/wiki/Gsexec
+
+.SH AUTHORS
+
+Apache project, for original suexec
+
+Andrew McNab <Andrew.McNab@manchester.ac.uk> for gsexec modifications.
+
+gsexec is part of GridSite: http://www.gridsite.org/
+
+.SH "SEE ALSO"
+.BR httpd(8),
+.BR suexec(8),
+.BR mod_gridsite(8)
-.TH htcp 1 "July 2004" htcp "HTCP Manual"
+.TH HTCP 1 "October 2005" "htcp" "GridSite Manual"
.SH NAME
-.B htcp, htrm, htls, htll, htmkdir
-\- get, put, delete or list HTTP/HTTPS files or directories
+.B htcp, htmv, htrm, htls, htll, htmkdir, htfind, htping
+\- file transfers and queries via HTTP/HTTPS/SiteCast
.SH SYNOPSIS
-.B htcp [options]
-.I Source-URL[s] [Destination URL]
+.B htcp, htmv
+[options] Source-URL[s] Destination-URL
+
+.B htrm, htls, htll, htmkir, htfind
+[options] Target-URL[s]
+
+.B htping
+[options]
.SH DESCRIPTION
.B htcp
is a client to fetch files or directory listings from remote servers using
HTTP or HTTPS, or to put or delete files or directories onto remote servers
using HTTPS. htcp is similar to scp(1), but uses HTTP/HTTPS rather than ssh
-as its transfer protocol.
+as its transfer protocol. htcp can also use the HTCP protocol to query
+HTTP(S) fileservers via SiteCast.
-When talking to an HTTPS server, htcp can run "anonymously", with a
+When talking to a fileserver with HTTPS, htcp can run "anonymously", with a
standard X.509 user certificate and key, or with a GSI Proxy. This makes
htcp very useful in Grid environments where many users have certificates
and where jobs and users have access to GSI proxies.
destinations. If no scheme is given, the URL scheme is assumed to be file:
and relative to the current directory if not an absolute path.
-If multiple sources are given, they will be used in turn and the destination
-must be a directory (directories are indicated by a trailing /) However,
-source and destination cannot both refer to remote servers.
+If multiple sources are given during a copy, they will be used in turn and
+the destination must be a directory (directories are indicated by a trailing
+/) However, source and destination cannot both refer to remote servers.
.SH OPTIONS
.IP "-v/--verbose"
Calling the program as htrm has the same effect.
.IP "--list"
-.br
Instead of copying files, output lists of files located in the URL-directories
given on the command line. Calling the program as htls has the same effect.
a trailing slash means create a directory. No file body is sent. Calling the
program as htmkdir has the same effect.
+.IP "--move"
+Move/rename files on a single remote server, given the two, absolute URLs
+of the remote file names. Server must support HTTP/WebDAV MOVE. Calling the
+program as htmv has the same effect.
+
+.IP "--ping"
+Query specified multicast groups with the HTCP NOP ("No Operation") code.
+SiteCast enabled servers will respond immediately with a NOP reply, and all
+of the responses will be listed, with the round trip time in milliseconds.
+Any waiting times specified in the --groups option will be ignored. Calling
+the program as htping has the same effect.
+(--groups must be used for this option to work.)
+
+.IP "--find"
+Query specified multicast groups with the HTCP TST code. SiteCast enabled
+servers will respond with TST replies if they have the files corresponding
+to the given SiteCast target URL(s). All of the transfer URLs returned
+will be listed. Waiting times specified in the --groups option will be used
+to space out the multicast queries, but the program listens for responses
+continuously. Calling the program as htfind has the same effect.
+(--groups must be used for this option to work.)
+
+.IP "--groups <IP Groups>"
+IP multicast groups to use for SiteCast queries. IP Groups is a comma
+separated list of groups, in the format: nnn.nnn.nnn.nnn:port[:ttl[:seconds]]
+The IP number and port must be specified. The IP time-to-live, ttl, controls
+how many networks the multicast packets may pass through - the default, 1,
+limits packets to the local network. Multiple groups may be specified,
+separated by commas. If multiple groups are specified, then seconds is the
+time to wait before making the next multicast - 1 second is the default.
+
+.IP "--timeout <seconds>"
+A request timeout used for multicast ping.
+
.IP "--anon"
-.br
Do not attempt to use X.509 user certificates or GSI proxies to authenticate
to the remote HTTPS server. This means you are "anonymous", but the server's
identity may still be verified and the connection is still encrypted.
but leaves you vulnerable to "man in the middle" attacks by hostile servers
masquerading as your target.
-.IP "--downgrade-size <minimum file size for downgrade>"
-Try to use HTTP-Downgrade for HTTPS URLs. Compatible servers will perform
+.IP "--grid-http"
+Try to use GridHTTP redirection for HTTPS URLs. Compatible servers will perform
authentication and authorization on the HTTPS connection and then redirect
to HTTP for the GET or PUT file transfer. htcp makes the HTTP request using
-the GRID_AUTH_ONETIME single-use passcode obtained via HTTPS. The downgrade
-option will be ignored for directory operations, HTTP URLs, or if the file
-size is less than the value given. If a downgraded transfer isn't possible,
-a normal HTTPS data transfer will be done.
+the GRID_AUTH_ONETIME single-use passcode obtained via HTTPS. The --grid-http
+option will be ignored for directory operations or HTTP URLs. If a redirected
+transfer isn't possible, a normal HTTPS data transfer will be attempted.
+
+.IP "--sitecast"
+Try to use SiteCast to locate remote files which are to be copied (currently
+only for the
+.BR fetching
+of remote files.) If no location is found via SiteCast, then a direct request
+for the given URL is tried. (--groups must be used for this option to work.)
+
+.IP "--domain <SiteCast domain>"
+Try to use SiteCast to locate remote files which are to be copied (currently
+only for the
+.BR fetching
+of remote files)
+.BR "if the domain component of the URL matches"
+the SiteCast domain given.
+If no location is found via SiteCast, then a direct request
+for the given URL is tried. (--groups must be used for this option to work.)
.SH FILES
.IP /tmp/x509up_uID
The manpage libcurl-errors(3) lists all the curl error codes.
.SH TO DO
-Recursive copying. Server-side wildcards. Parallel streams. Error recovery.
-
-.SH BUGS
-Not enough beta testing (hint hint...)
+Recursive copying. Server-side wildcards. Parallel streams. Better error
+recovery.
.SH AUTHOR
-Andrew McNab <Andrew.McNab@man.ac.uk>
+Andrew McNab <Andrew.McNab@manchester.ac.uk>
htcp is part of GridSite: http://www.gridsite.org/
.SH "SEE ALSO"
--- /dev/null
+.so man1/htcp.1
--- /dev/null
+.so man1/htcp.1
--- /dev/null
+.so man1/htcp.1
##############################################################################
## GridSite httpd-fileserver.conf - Andrew McNab <Andrew.McNab@man.ac.uk>
##
-## Example configuration file for GridSite as an HTTP(S) fileserver.
-##
## For GridSite documentation, see http://www.gridsite.org/
##
+## Example configuration file for GridSite as an HTTP(S) fileserver,
+## listening on ports 80/777 (HTTP) and 443/488 (HTTPS)
+##
+## (777/488 is to allow firewalls to distinguish between Grid and
+## Web HTTP(S) traffic. See http://www.gridsite.org/wiki/IP_Ports )
+##
## This file should be renamed /etc/httpd/conf/httpd.conf and Apache
## restarted to use Apache2/GridSite as a simple HTTP(S) fileserver.
##
## in /etc/grid-security/dn-lists/
##
## To start serving files, make a directory /var/www/htdocs owned by
-## nobody.nobody, including the file .gacl containing:
+## apache.apache, including the file .gacl containing:
##
## <gacl>
## <entry>
##
## and add the following directive to the HTTPS <Directory> section:
##
-## GridSiteMethods GET PUT DELETE
+## GridSiteMethods GET PUT DELETE MOVE
##
## If you wish to accept Globus GSI Proxies as well as full X.509 user
## certificates, set GridSiteGSIProxyLimit to the depth of proxy you
##
## (or with --cert /tmp/x509up_u`id -u` --key /tmp/x509up_u`id -u` to use
## a Globus GSI Proxy created with grid-proxy-init.)
+##
##############################################################################
ServerRoot "/etc/httpd"
TypesConfig /etc/mime.types
# User and group who will own files created by Apache
-User nobody
-Group nobody
+User apache
+Group apache
DocumentRoot "/var/www/htdocs"
HostnameLookups On
######################################################################
-# Plain unauthenticated HTTP on port 80
+# Plain unauthenticated HTTP on ports 80 and 777
######################################################################
Listen 80
-<VirtualHost *:80>
+Listen 777
+<VirtualHost *:80 *:777>
<Directory "/var/www/htdocs">
GridSiteIndexes on
</VirtualHost>
######################################################################
-# Secured and possibly authenticated HTTPS on port 443
+# Secured and possibly authenticated HTTPS on ports 443 and 488
######################################################################
Listen 443
+Listen 488
SSLSessionCacheTimeout 300
-SSLSessionCache dbm:/var/cache/mod_ssl/scache
-# This version of GridSite is NOT compatible with the SHM SSL cache!!!
-<VirtualHost *:443>
+SSLSessionCache shm:/var/cache/mod_ssl/shm_cache
+
+<VirtualHost *:443 *:488>
SSLEngine on
SSLCertificateFile /etc/grid-security/hostcert.pem
GridSiteAuth on
GridSiteDNlists /etc/grid-security/dn-lists/
GridSiteGSIProxyLimit 0
-# GridSiteMethods GET PUT DELETE
+# GridSiteMethods GET PUT DELETE MOVE
</Directory>
</VirtualHost>
##############################################################################
## GridSite httpd-webserver.conf - Andrew McNab <Andrew.McNab@man.ac.uk>
##
+## For GridSite documentation, see http://www.gridsite.org/
+##
## Example configuration file for GridSite as a Web Server
## (that is, primarily for interactive use with a browser.)
+## Listening is on ports 80/777 (HTTP) and 443/488 (HTTPS).
##
-## For GridSite documentation, see http://www.gridsite.org/
+## (777/488 is to allow firewalls to distinguish between Grid and
+## Web HTTP(S) traffic. See http://www.gridsite.org/wiki/IP_Ports )
##
## This file should be renamed /etc/httpd/conf/httpd.conf and Apache
## restarted to use Apache2/GridSite as a webserver.
## (Lists in /etc/grid-security/dn-lists/ override lists elsewhere.)
##
## To start serving files, make a directory /var/www/htdocs owned by
-## nobody.nobody, including the file .gacl containing:
+## apache.apache, including the file .gacl containing:
##
## <gacl>
## <entry>
##
## and add the following directive to the HTTPS <Directory> section:
##
-## GridSiteMethods GET PUT DELETE
+## GridSiteMethods GET PUT DELETE MOVE
##
## If you wish to accept Globus GSI Proxies as well as full X.509 user
## certificates, set GridSiteGSIProxyLimit to the depth of proxy you
TypesConfig /etc/mime.types
# User and group who will own files created by Apache
-User nobody
-Group nobody
+User apache
+Group apache
DocumentRoot "/var/www/htdocs"
HostnameLookups On
######################################################################
-# Plain unauthenticated HTTP on port 80
+# Plain unauthenticated HTTP on ports 80 and 777
######################################################################
Listen 80
-<VirtualHost *:80>
+Listen 777
+<VirtualHost *:80 *:777>
## This is used to serve the Manage Directory links in footers,
## and to allow you to edit files and ACLs via your browser.
</VirtualHost>
######################################################################
-# Secured and possibly authenticated HTTPS on port 443
+# Secured and possibly authenticated HTTPS on ports 443 and 488
######################################################################
Listen 443
+Listen 488
SSLSessionCacheTimeout 300
-SSLSessionCache dbm:/var/cache/mod_ssl/scache
-# This version of GridSite is NOT compatible with the SHM SSL cache!!!
-<VirtualHost *:443>
+SSLSessionCache shm:/var/cache/mod_ssl/shm_cache
+
+<VirtualHost *:443 *:488>
SSLEngine on
SSLCertificateFile /etc/grid-security/hostcert.pem
## This directive allows authorized people to write/delete files
## from non-browser clients - eg with htcp(1)
- GridSiteMethods GET PUT DELETE
+ GridSiteMethods GET PUT DELETE MOVE
## These directives (and the ScriptAlias above) allow authorized
## people to manage files, ACLs and DN Lists through their web
supported by Apache, including static file serving, SSI, CGI, PHP, JSP and
mod_perl.
-<h2>Guides</h2>
+<p>
+The <a href="http://www.gridsite.org/wiki/">GridSite Wiki</a> includes
+guides and cookbook examples about using GridSite, along with up to date
+information about the APIs.
+
+<h2>Reference</h2>
<p>
-<dl>
-<dt><b><a href="user.html">User Guide</a></b>
-<dd>End-user documentation for people managing webpages and files on
- GridSite servers, either through the web interface or with command
- line clients like htcp.
+The following reference documents and man pages are put in
+/usr/share/doc/gridsite-VERSION when GridSite is installed.
+
<p>
+<dl>
-<dt><b><a href="admin.html">Admin Guide</a></b>
-<dd>For people administering areas of GridSite websites or fileservers, or
- managing GridSite's support for DN List groups.
+<dt><b><a href="htcp.1.html">htcp(1)</a></b>
+<dd>A command line tool for copying files to or from HTTP(S) servers.
<p>
-<dt><b><a href="install.html">Building and Installation</a></b>
-<dd>Instructions for building GridSite from source, and installing from
- binaries or RPMs.
+<dt><b><a href="mod_gridsite.8.html">mod_gridsite(8)</a></b>
+<dd>An Apache 2.0 module which enforces access control via Grid Access
+ Control Lists, and X.509, GSI or VOMS credentials. mod_gridsite also
+ gives Apache built-in support for the HTTP PUT and DELETE methods, and
+ formatting of HTML pages with standard headers and footers.
<p>
-<dt><b><a href="config.html">Config Guide</a></b>
-<dd>For webmasters setting up Apache 2.0 and GridSite, and writing the
- Apache httpd.conf file.
+<dt><b><a href="gsexec.8.html">gsexec(8)</a></b>
+<dd>A modified version of suexec(8), for use with mod_gridsite(8). gsexec
+ allows CGI programs to be run as pool users, depending on the client's
+ X.509 identity or the directory in which the CGI is located.
<p>
<dt><b><a href="httpd-fileserver.conf">httpd-fileserver.conf</a></b> and
webservers, with explanatory comments.
<p>
-</dl>
-
-<h2>Reference</h2>
-
-<p>
-<dl>
-<dt><b><a href="gacl.html">Grid Access Control Lists</a></b>
-<dd>Syntax and usage of the XML Grid Access Control Lists used by GridSite.
+<dt><b><a href="urlencode.1.html">urlencode(1)</a></b>
+<dd>A command for URL-encoding strings.
<p>
-<dt><b><a href="htcp.1.html">htcp</a></b> and
- <b><a href="urlencode.1.html">urlencode</a></b> man pages
-<dd>Command line tools for copying files to or from HTTP(S) servers, and
- for URL-encoding strings.
+<dt><b><a href="findproxyfile.1.html">findproxyfile(1)</a></b>
+<dd>The finxproxyfile command returns full path to a GSI Proxy file,
+ either in the proxy cache maintained by the GridSite G-HTTPS and
+ delegation portType functions, or in other standard places.
<p>
+<dt><b><a href="delegation-1.wsdl">delegation-1.wsdl</a></b>
+<dd>A WSDL description of a delegation Web Service including the Delegation
+ portType.
+<p>
+
<!--
<dt><b><a href="gridsite-admin.html">gridsite-admin.cgi</a></b>
<dd>A CGI program providing site administration functions for users with
<p>
-->
-<dt><b><a href="module.html">mod_gridsite</a></b>
-<dd>An Apache 2.0 module which enforces access control via Grid Access
- Control Lists, and X.509, GSI or VOMS credentials. mod_gridsite also
- gives Apache built-in support for the HTTP PUT and DELETE methods, and
- formatting of HTML pages with standard headers and footers.
-<p>
-
-<!--
-<dt><b><a href="library.html">libgridsite</a></b>
-<dd>The GridSite library provides common functions for other components of
- the GridSite system, and utilities for programs using CGI, X.509, GSI,
- VOMS and HTTP.
-<p>
--->
-
-<dt><b><a href="gridsite_8h.html">gridsite.h API reference</a></b>
+<dt><b><a href="doxygen/gridsite_8h.html">gridsite.h API reference</a></b>
<dd>A detailed description of the C API provided by libgridsite, generated
from the sources by doxygen.
<p>
+++ /dev/null
-<title>GridSite: Building and Installation Guide</title>
-<body>
-<h1 align=center>GridSite: Building and Installation Guide</h1>
-
-<p>
-This Guide explains how to build GridSite from source, and how to install
-the server components alongside an Apache 2.0 webserver. There is a
-separate <a href="config.html">Config Guide</a> which explains how to modify
-the httpd.conf file, and how to set up other files and directories used by
-the system. You should look through all of this Building and Installation
-Guide to decide which is the easiest route for your system.
-
-<h2>Installing with RPM</h2>
-
-<p>
-If you are installing on Linux with a binary RPM release, you can skip
-most of this Guide, install the binary rpm(s) and go straight
-to the Config Guide.
-
-<!--
-<p>
-We currently distribute GridSite RPMs for RedHat Linux versions 9 and 7.3
-from our download area at
-<a href="https://www.gridsite.org/download/">
-https://www.gridsite.org/download/</a>
--->
-
-<p>
-<b>RedHat 9, Fedora, RHEL, Scientific Linix</b>:
-This is the simpler case, since the standard release includes a suitable
-version of Apache 2.0: just install the gridsite-...-1.i386.rpm to get the
-various GridSite components.
-
-<p>
-<b>Earlier, eg RedHat 7.3</b>:
-This is more complicated because you must also install a back-ported Apache
-2.0 RPM or build it from source.
-<!--
-We distribute RPMs built on 7.3 aimed at RedHat 7.3
-machines with updates, from our download area. These are built from the
-tar.gz and .spec files distributed by the
-Apache Foundation itself, using the
-<a href="build-apache2.sh">build-apache2.sh</a> script in the GridSite
-/usr/share/doc/gridsite directory. The Apache RPMs install in /usr, and you
-should at least install the httpd and mod_ssl RPMs.
-You must also install the gridsite-...-1.i386.rpm as above.
--->
-
-<p>
-GridSite also depends on shared libraries from libcurl and libxml2, and the
-RPMs distributed as part of the standard RedHat, from 7.3 onwards, are
-sufficient.
-
-<p>
-With the RPMs installed, you can proceed to the
-<a href="config.html">Config Guide</a>.
-
-<h2>Requirements for building GridSite from source</h2>
-
-<p>
-GridSite is currently only supported on Linux, but should be
-straightforwardly
-portable to other Unix platforms where the GNU build tools are available.
-
-<p>
-GridSite consists of a core library (libgridsite[.so|.a]), an Apache module
-(mod_gridsite.so), a CGI utility (gridsite-admin.cgi) and some command line
-tools (htcp, urlencode.)
-
-<p>
-All of the components use the GridSite library, and this in turn depends on
-libcurl and libxml2. You will need the development versions of these
-packages installed before you can proceed.
-<!--
-(They are available as part of
-RedHat Linux releases 7.x onwards, for instance.)
--->
-
-<h2>Building GridSite with Make</h2>
-
-<p>
-Our download area at
-<a href="https://www.gridsite.org/download/">
-https://www.gridsite.org/download/</a> includes a tar-ball
-distribution of the sources, which can be unpacked and used to build
-GridSite from source. (Bleeding-edge developers can get the current snapshot
-of the same files from our CVS area.)
-
-<p>
-GridSite needs a copy of the Apache 2.0 include files to build, and the
-location of this is set by the MYCFLAGS variable in the top-level Makefile.
-For manual builds, the default
-<b>MYCFLAGS=-I/usr/local/include/httpd</b> is used.
-If you wish to use the GridSite module with Apache
-2.0 installed elsewhere, you should change the MYCFLAGS variable to point to
-the includes directory installed by the development part of that Apache 2.0
-distribution.
-
-<p>
-<pre>
-make
-make install
-</pre>
-
-<p>
-will build all components and install them all under the default
-locations of /usr/local/[lib|bin|include|sbin] The default prefix for manual
-builds is
-/usr/local, as set by the prefix variable in the top level Makefile
-(/usr is the default for RPMs.)
-
-<h2>Building GridSite with RPM</h2>
-
-<p>
-For RedHat Linux and derivatives, building with RPM is recommended.
-The command <b>make rpm</b> in the top level of the source tree
-will build the GridSite and htcp binary RPMs in the
-directory ../RPMTMP/RPMS/i386 relative to the working directory. An SRPM is
-put into ../RPMTMP/SRPMS
-This build assumes the Apache 2.0 includes are in /usr/include/httpd.
-
-<!--
-<p>
-<b>If you make RPMs on a RedHat 9 system (or a 7.3 system with a 2.0 httpd RPM
-installed), you can install the resulting GridSite
-RPM alongside the standard Apache 2.0 RPM without having to
-modify shared library or Apache module paths.</b>
--->
-
-<p>
-For other configurations,
-you can modify the assumed location of the Apache 2.0 includes
-by changing the MYCFLAGS variable in the rpm target near the
-foot of the top level Makefile.
-
-<h2>Building Apache 2.0</h2>
-
-<p>
-If it is not possible to use binary RPMs of Apache 2.0,
-then it can be built from source using the build-apache2.sh script
-found in the GridSite docs directory.
-The script includes instructions on how to build from the tarballs
-distributed by the Apache Foundation.
-(it removes the -C option from "configure -C" in the .spec file
-and builds the RPMs under the current directory.)
-
-<p>
-If these targets do not work on your build platform,
-the Makefile and the scriptlets in the included SPEC files are a good
-starting point for building Apache by hand yourself. The complexities of
-this are outside of the scope of this Guide, but you are welcome to ask for
-assistance on the
-<a href="http://www.gridsite.org/discuss.html">GridSite
-Discussion List</a>, although
-<a href="http://www.apache.org/">www.apache.org</a> is a better starting
-point for purely Apache problems.
-
-</body>
+++ /dev/null
-library docs
--- /dev/null
+.TH MOD_GRIDSITE 8 "October 2005" "mod_gridsite" "GridSite Manual"
+.SH NAME
+.B mod_gridsite
+\- Grid extensions to Apache httpd
+.SH SYNOPSIS
+.B LoadModule gridsite_module mod_gridsite.so
+.SH DESCRIPTION
+.B mod_gridsite
+is an Apache 2.0 module which enforces access control via Grid
+Access Control Lists, and X.509, GSI or VOMS credentials. mod_gridsite also
+gives Apache built-in support for the HTTP PUT and DELETE methods, and
+formatting of HTML pages with standard headers and footers.
+
+Since mod_gridsite access
+control within Apache itself, Grid authorization and
+the associated verified credentials are available to all technologies
+supported by Apache, including static file serving, SSI, CGI, PHP, mod_perl
+and Java servlets via a connector to Tomcat.
+
+Operation of mod_gridsite can be configured using runtime directives
+in Apache's standard httpd.conf configuration file. The module must first be
+loaded with a LoadModule directive:
+
+LoadModule gridsite_module /PATH/TO/MODULES/mod_gridsite.so
+
+The module's behaviour is then controlled by GridSite... directives within
+Apache <Directory ...> sections, allowing different directories to use
+GridSite features in different ways.
+
+.SH DIRECTIVES
+
+.IP "GridSiteIndexes on|off"
+Determines whether GridSite generates HTML directory listings. These
+have some advantages over standard Apache directory listings (eg the
+displayed filenames are never truncated) and will include standard
+headers and footers if GridSiteHtmlFormat is on.
+(Default: GridSiteIndexes off)
+
+.IP "GridSiteIndexHeader file"
+If the named file is found in the directory being listed, the file
+is included verbatim at the top of the listing and excluded from
+the file-by-file listing. The file can either be HTML or plain text (in
+which case browsers will be treat it as one HTML paragraph.)
+(Default: none)
+
+.IP "GridSiteHtmlFormat on|off"
+Determines where HTML pages receive additional formatting before being
+sent to the client. This includes the "Last modified",
+"View page history", "Switch to HTTP(S)",
+"Print View" and "Built with GridSite" footer
+elements. If header and footer files are found, they will be used too.
+(Default: GridSiteHtmlFormat off)
+
+.IP "GridSiteHeadFile file"
+.IP "GridSiteFootFile file"
+Set the filenames to be searched for as standard headers and footers
+for HTML pages. For each HTML page, the directory of that page is tried
+first, and then parent directories in ascending order until a header /
+footer file is found. Header files are inserted in place of HTML
+<body[ ...]> tags; footer files in place of </body>. (These
+standard files should each include the appropriate body tag as a
+replacement.)
+(Defaults: GridSiteHeadFile gridsitehead.txt,
+GridSiteFootFile gridsitefoot.txt)
+
+.IP "GridSiteAuth on|off"
+Enables GridSite access control features, using
+GACL files. The files are named .gacl and are
+per-directory. The current directory is tried and then parent
+directories in ascending order until a .gacl file is found.
+(Default: GridSiteAuth off)
+
+.IP "GridSiteAdminList uri"
+All members of the DN List with name "uri" receive the full set
+of permissions, irrespective of per-directory .gacl files. People in
+this group have full control over the whole site.
+(Default: none)
+
+.IP "GridSiteGSIProxyLimit limit"
+When using GSI Proxy credentials,
+proxies with delegation depth greater than "limit" will
+be ignored by mod_gridsite authorization decisions. A limit of zero
+implies only full X.509
+certificates (and no proxies) will be accepted. A limit of 1 implies
+that only the initial proxy, usually created on the user's own machine,
+is acceptable. Higher levels lead to proxies on remote machines, eg
+used by running jobs, being accepted.
+(Default: GridSiteGSIProxyLimit 1)
+
+.IP "GridSiteMethods [GET] [PUT] [DELETE] [MOVE]"
+Specifies which HTTP methods are supported by GridSite. GET (and HEAD)
+are always supported. PUT and DELETE support is turned on by this
+directive, subject to a positive statement that write permission is
+allowed for the directory in question, by a GACL file.
+(Default: GridSite GET)
+
+.IP "GridSiteDNlists directory1[:directory2[:directory3]...]"
+Sets up the DN List path used by GACL for
+evaluating <dn-list> credentials. If this directive is not used,
+then GACL will use the GRST_DN_LISTS variable from Apache's own
+environment. If that is not set either, then /etc/grid-security/dn-lists
+is searched.
+(Default: none)
+
+.IP "GridSiteDNlistsURI uri"
+If GridSiteDNlistsURI is used, then the URI given appears to be
+populated with all the DN lists on the current DN lists path which
+match the current server. That is, for server https://example.org/
+with DN lists URI /dn-lists/, all DN lists with URLs starting
+https://example.org/dn-lists/ will appear to be present in /dn-lists/,
+irrespective of where in the path they are stored.
+(Default: none)
+<p>
+
+.IP "GridSiteAdminURI uri"
+GridSiteAdminURI gives the absolute URI on the server of the GridSite
+Admin CGI program, which is used for file management, HTML and GACL
+editing. This should be used in conjunction with the standard Apache
+directive ScriptAlias to map that URI to the real-gridsite-admin.cgi
+executable. For example:
+
+ScriptAlias /real-gridsite-admin.cgi /PATH/TO/real-gridsite-admin.cgi
+
+This URI is always reached by an internal redirection from the value
+set by GridSiteAdminFile, and is never visible to users.
+(Default: none)
+
+.IP "GridSiteAdminFile cgifilename"
+If GridSiteAdminURI is set, then the cgifilename of GridSiteAdminFile
+appears to be present in all directories when explicitly
+requested (it does not appear in directory listings.) Requests for these
+ghost CGI URIs are internally redirected to the value set by
+GridSiteAdminURI. (Default: GridSiteAdminFile gridsite-admin.cgi)
+
+.IP "GridSiteEnvs on|off"
+This makes mod_gridsite export several variables into the environment
+of CGI programs and other dynamic content systems. The variable names
+are listed below. For gridsite-admin.cgi mechanism to work, this switch
+must be left in its default state of on.
+(Default: GridSiteEnvs on)
+
+.IP "GridSiteEditable [ext1 [ext2 [ext3] ...]]]"
+A space-separated list of file extensions which can safely be edited
+by the GridSite Text/HTML editor. The extensions are given without the
+initial dot.
+(Default: GridSiteEditable txt shtml html htm css js php jsp)
+
+.IP "GridSiteHelpURI uri"
+If set, gives the URI to use for "Website Help" links in HTML
+page footers. (Default: none)
+
+.IP "GridSiteLink on|off"
+Turns off the link in the HTML page footers which gives credit to GridSite.
+(Default: GridSiteLink on)
+
+.IP "GridSiteUnzip path"
+If "path" is set by this directive, then real-gridsite-admin.cgi
+will offer to list the contents of .zip archives on the server.
+Users with write access are able to unpack the contents into the same
+directory as the .zip file. The value of "path" must point
+to the location of the unzip binary. (Default: none)
+
+.IP "GridSiteGridHTTP on|off"
+Enable GridHTTP for this server, virtual server or directory:
+HTTPS requests made with the header
+.BR "Upgrade: GridHTTP/1.0"
+will be redirected to an HTTP version of the file. (Default: off)
+
+.IP "GridSiteGridHTTPport port"
+Sets the port to use for the unencrypted HTTP component of GridHTTP
+HTTPS->HTTP transfers. The same setting will be used for all virtual hosts
+which support GridHTTP. (Default: 777)
+
+.IP "GridSiteOnetimesDir path"
+Location of authentication cookies directory, relative to ServerRoot.
+Used by GridHTTP to record the credentials obtained via HTTPS,
+and available to the corresponding HTTP request. (Default: /var/www/onetimes)
+
+.IP "GridSiteACLFormat GACL|XACML"
+Format to use when writing .gacl files. (Both formats are automatically
+recognised when reading.) (Default: GACL)
+
+.IP "GridSiteExecMethod nosetuid|suexec|X509DN|directory"
+Execution strategy for CGI scripts and executables. For options other
+than nosetuid, suexec (or gsexec renamed suexec) must installed. For
+X509DN and directory, gsexec must be installed, as suexec. See
+.BR "gsexec(8)"
+for an explanation of the different execution strategies.
+(Default: nosetuid)
+
+.IP "GridSiteUserGroup user group"
+Unix user and group when using suexec (or gsexec as suexec.) This
+is equivalent to the suexec SuexecUserGroup directive, but can be
+specified on a per-directory basis. (Default: none)
+
+.IP "GridSiteDiskMode GroupNone|GroupRead|GroupWrite WorldNone|WorldRead"
+The file creation permissions mode, taking two arguments to specify
+the group and other permissions. The mode always includes read and write
+permission for the CGI user itself.
+(Default: GroupNone WorldNone)
+
+.IP "GridSiteCastUniPort port"
+The
+.BR UDP
+unicast port to listen on for HTCP queries, and from which to
+send replies to HTCP unicast and multicast queries. Ideally, this should be
+a privileged port below 1024. This directive may not appear within a virtual
+server. (Default: 777)
+
+.IP "GridSiteCastGroup group[:port]"
+A UDP multicast group on which to listen for HTCP queries, plus an optional
+port. If no port is given, then 777 is used. Multiple GridSiteCastGroup
+directives can be given to cause the UDP responder to listen to more than
+one multicast group. This directive may not appear within a virtual server.
+
+.IP "GridSiteCastAlias URL-prefix path-prefix"
+Maps SiteCast generic URLs to the local filesystem. When processing
+HTCP queries, matching SiteCast URLs will have URL-prefix stripped off
+and the remaining portion of the URL added to path-prefix to construct a
+local path and filename. If a file is found with that name, a SiteCast HTCP
+response will be returned to the querying host. Otherwise the queries are
+ignored.
+This directive may appear within virtual servers, and the virtual server's
+servername and first port will determine the host and port name used to
+construct the transfer URL.
+
+.SH ENVIRONMENT
+
+The following variables are present in the environment of CGI programs and
+other dynamic content systems if the
+.BR "GridSiteEnvs on"
+directive is in effect.
+
+.IP GRST_PERM
+Numerical value of the permission bit-map obtained by comparing the
+user with the GACL in force. (These should be tested using the
+GRSTgaclPermHasXXXX functions from GACL.)
+
+.IP GRST_ADMIN_LIST
+URI of the DN List, listing people with full admin and write access
+to the whole site.
+
+.IP GRST_GSIPROXY_LIMIT
+Maximum valid delegation level for GSI Proxies.
+
+.IP GRST_DIR_PATH
+Absolute path in the local filesystem to the directory holding the
+file being requested.
+
+.IP GRST_DESTINATION_TRANSLATED
+Present if a WebDAV
+.BR "Destination:"
+header was given in the request with a local URL. Contains the translation of
+the URL given into an absolute path in the local filesystem.
+
+.IP GRST_HELP_URI
+URI of website help pages set by GridSiteHelpURI directive.
+
+.IP GRST_ADMIN_FILE
+Filename of per-directory ghost gridsite-admin.cgi program. (This is
+used by real-gridsite-admin.cgi to construct links in its pages.)
+
+.IP GRST_EDITABLE
+Space-separated list of extensions which can safely be edited with a
+Text/HTML editor.
+
+.IP "GRST_HEAD_FILE and GRST_FOOT_FILE"
+Filenames of standard header and footer files.
+
+.IP GRST_DN_LISTS
+DN lists search path.
+
+.IP GRST_DN_LISTS_URI
+Directory of virtual URIs used to publish this site's DN Lists.
+
+.IP GRST_UNZIP
+Full path to the
+.BR "unzip(1)"
+binary, used to list and unpack .zip files.
+
+.IP GRST_NO_LINK
+If set, do not include credit links to GridSite in page footers.
+
+.IP GRST_ACL_FORMAT
+Format to use when writing .gacl files: either GACL or XACML.
+
+.IP GRST_EXEC_METHOD
+Specified by
+.BR GridSiteExecMethod
+either suexec, X509DN or directory.
+
+.IP GRST_EXEC_DIRECTORY
+The directory containing the CGI script or executable (used by gsexec
+to determine which pool account to use in directory mapping mode.)
+
+.IP GRST_DISK_MODE
+The
+.BR Apache
+disk permission modes bit pattern, in hexadecimal, starting with 0x.
+(Similar to the Unix bit pattern, except with hexadecimal rather than
+octal values: eg 0x600 [Apache] vs 0600 [Unix]
+are both read/write for user only.)
+
+.SH AUTHOR
+Andrew McNab <Andrew.McNab@manchester.ac.uk>
+
+mod_gridsite is part of GridSite: http://www.gridsite.org/
+.SH "SEE ALSO"
+.BR htcp(1),
+.BR httpd(8),
+.BR gsexec(8)
+++ /dev/null
-<title>GridSite Apache module: mod_gridsite</title>
-<body>
-<h1 align=center>GridSite Apache module: mod_gridsite</h1>
-
-<p>
-mod_gridsite is an Apache 2.0 module which enforces access control via Grid
-Access Control Lists, and X.509, GSI or VOMS credentials. mod_gridsite also
-gives Apache built-in support for the HTTP PUT and DELETE methods, and
-formatting of HTML pages with standard headers and footers.
-
-<p>
-Since mod_gridsite access
-control within Apache itself, Grid authorization and
-the associated verified credentials are available to all technologies
-supported by Apache, including static file serving, SSI, CGI, PHP, mod_perl
-and Java servlets via a connector to Tomcat.
-
-<p>
-Operation of mod_gridsite can be configured using runtime directives
-in Apache's standard httpd.conf configuration file. The module must first be
-loaded with a LoadModule directive:
-
-<p>
-<b>LoadModule gridsite_module /PATH/TO/MODULES/mod_gridsite.so</b>
-
-<p>
-The module's behaviour is then controlled by GridSite... directives within
-Apache <Directory ...> sections, allowing different directories to use
-GridSite features in different ways.
-
-<h2>GridSite directives</h2>
-
-<dl>
-<dt><b>GridSiteIndexes on|off</b>
-<dd>Determines whether GridSite generates HTML directory listings. These
- have some advantages over standard Apache directory listings (eg the
- displayed filenames are never truncated) and will include standard
- headers and footers if GridSiteHtmlFormat is on.
- <br>
- (Default: GridSiteIndexes off)
-<p>
-
-<dt><b>GridSiteIndexHeader file</b>
-<dd>If the named file is found in the directory being listed, the file
- is included verbatim at the top of the listing and excluded from
- the file-by-file listing. The file can either be HTML or plain text (in
- which case browsers will be treat it as one HTML paragraph.)
- <br>
- (Default: none)
-<p>
-
-<dt><b>GridSiteHtmlFormat on|off</b>
-<dd>Determines where HTML pages receive additional formatting before being
- sent to the client. This includes the "Last modified",
- "View page history", "Switch to HTTP(S)",
- "Print View" and "Built with GridSite" footer
- elements. If header and footer files are found, they will be used too.
- <br>
- (Default: GridSiteHtmlFormat off)
-<p>
-
-<dt><b>GridSiteHeadFile file</b><br>
- <b>GridSiteFootFile file</b>
-<dd>Set the filenames to be searched for as standard headers and footers
- for HTML pages. For each HTML page, the directory of that page is tried
- first, and then parent directories in ascending order until a header /
- footer file is found. Header files are inserted in place of HTML
- <body[ ...]> tags; footer files in place of </body>. (These
- standard files should each include the appropriate body tag as a
- replacement.)
- <br>
- (Defaults: GridSiteHeadFile gridsitehead.txt,
- GridSiteFootFile gridsitefoot.txt)
-<p>
-
-<dt><b>GridSiteAuth on|off</b>
-<dd>Enables GridSite access control features, using
- <a href="gacl.html">GACL</a> files. The files are named .gacl and are
- per-directory. The current directory is tried and then parent
- directories in ascending order until a .gacl file is found.
- <br>
- (Default: GridSiteAuth off)
-<p>
-
-<dt><b>GridSiteAdminList uri</b>
-<dd>All members of the DN List with name "uri" receive the full set
- of permissions, irrespective of per-directory .gacl files. People in
- this group have full control over the whole site.
- <br>
- (Default: none)
-<p>
-
-<dt><b>GridSiteGSIProxyLimit limit</b>
-<dd>When using GSI Proxy credentials,
- proxies with delegation depth greater than "limit" will
- be ignored by mod_gridsite authorization decisions. A limit of zero
- implies only full X.509
- certificates (and no proxies) will be accepted. A limit of 1 implies
- that only the initial proxy, usually created on the user's own machine,
- is acceptable. Higher levels lead to proxies on remote machines, eg
- used by running jobs, being accepted.
- <br>
- (Default: GridSiteGSIProxyLimit 1)
-<p>
-
-<dt><b>GridSiteMethods [GET] [PUT] [DELETE]</b>
-<dd>Specifies which HTTP methods are supported by GridSite. GET (and HEAD)
- are always supported. PUT and DELETE support is turned on by this
- directive, subject to a positive statement that write permission is
- allowed for the directory in question, by a GACL file.
- <br>
- (Default: GridSite GET)
-<p>
-
-<dt><b>GridSiteDNlists directory1[:directory2[:directory3]...]</b>
-<dd>Sets up the DN List path used by <a href="gacl.html">GACL</a> for
- evaluating <dn-list> credentials. If this directive is not used,
- then GACL will use the GRST_DN_LISTS variable from Apache's own
- environment. If that is not set either, then /etc/grid-security/dn-lists
- is searched.
- <br>
- (Default: none)
-<p>
-
-<dt><b>GridSiteDNlistsURI uri</b>
-<dd>If GridSiteDNlistsURI is used, then the URI given appears to be
- populated with all the DN lists on the current DN lists path which
- match the current server. That is, for server https://example.org/
- with DN lists URI /dn-lists/, all DN lists with URLs starting
- https://example.org/dn-lists/ will appear to be present in /dn-lists/,
- irrespective of where in the path they are stored.
- <br>
- (Default: none)
-<p>
-
-<dt><b>GridSiteAdminURI uri</b>
-<dd>GridSiteAdminURI gives the absolute URI on the server of the GridSite
- Admin CGI program, which is used for file management, HTML and GACL
- editing. This should be used in conjunction with the standard Apache
- directive ScriptAlias to map that URI to the real-gridsite-admin.cgi
- executable. For example:
- <br>
- <b>ScriptAlias /real-gridsite-admin.cgi
- /PATH/TO/real-gridsite-admin.cgi</b>
- <br>
- This URI is always reached by an internal redirection from the value
- set by GridSiteAdminFile, and is never visible to users.
- <br>
- (Default: none)
-<p>
-
-<dt><b>GridSiteAdminFile cgifilename</b>
-<dd>If GridSiteAdminURI is set, then the cgifilename of GridSiteAdminFile
- appears to be present in all directories when explicitly
- requested (it does not appear in directory listings.) Requests for these
- ghost CGI URIs are internally redirected to the value set by
- GridSiteAdminURI.
- <br>
- (Default: GridSiteAdminFile gridsite-admin.cgi)
-<p>
-
-<dt><b>GridSiteEnvs on|off</b>
-<dd>This makes mod_gridsite export several variables into the environment
- of CGI programs and other dynamic content systems. The variable names
- are listed below. For gridsite-admin.cgi mechanism to work, this switch
- must be left in its default state of on.
- <br>
- (Default: GridSiteEnvs on)
-<p>
-
-<dt><b>GridSiteEditable [ext1 [ext2 [ext3] ...]]]</b>
-<dd>A space-separated list of file extensions which can safely be edited
- by the GridSite Text/HTML editor. The extensions are given without the
- initial dot.
- <br>
- (Default: GridSiteEditable txt shtml html htm css js php jsp)
-<p>
-
-<dt><b>GridSiteHelpURI uri</b>
-<dd>If set, gives the URI to use for "Website Help" links in HTML
- page footers.
- <br>
- (Default: none)
-<p>
-
-<dt><b>GridSiteLink on|off</b>
-<dd>Turns off the link in the HTML page footers which gives credit to
- GridSite.
- <br>
- (Default: GridSiteLink on)
-<p>
-
-<dt><b>GridSiteUnzip path</b>
-<dd>If "path" is set by this directive, then real-gridsite-admin.cgi
- will offer to list the contents of .zip archives on the server.
- Users with write access are able to unpack the contents into the same
- directory as the .zip file. The value of "path" must point
- to the location of the
- <a href="http://www.info-zip.org/UnZip.html">unzip</a> binary.
- <br>
- (Default: none)
-<p>
-
-<dt><b>GridSiteDowngrade on|off</b>
-<dd>Enable HTTPS Downgrade for this server, virtual server or directory:
- HTTPS requests made with the header HTTP-Downgrade-Size:
- will be redirected to an HTTP version of the file, unless the file is
- smaller than the given size.
- <br>
- (Default: off)
-<p>
-
-<dt><b>GridSiteAuthCookiesDir path</b>
-<dd>Location of authentication cookies directory, relative to ServerRoot.
- Used by HTTPS Downgrade to record the credentials obtained via HTTPS,
- and available to the corresponding HTTP request.
- <br>
- (Default: gridauthcookies)
-<p>
-
-<dt><b>GridSiteACLFormat GACL|XACML</b>
-<dd>Format to use when writing .gacl files. (Both formats are automatically
- recognised when reading.)
- <br>
- (Default: GACL)
-<p>
-
-<dt><b>GridSiteExecMethod nosetuid|suexec|X509DN|directory</b>
-<dd>Execution strategy for CGI scripts and executables. For options other
- than nosetuid, suexec (or gsexec renamed suexec) must installed. For
- X509DN and directory, gsexec must be installed, as suexec.
- <br>
- With X509DN, the CGI process runs as a pool user, detemined using lock
- files in the pool mapping directory chosen as build time of gsexec.
- (/var/www/execmapdir by default.) The pool user is chosen according
- to the client's full certificate X.509 DN (ie without any GSI proxy
- name components.)
- <br>
- With directory, the CGI process runs as a pool user chosen according
- to the directory in which the CGI is located: all CGIs in that directory
- run as the same pool user.
- <br>
- (Default: nosetuid)
-<p>
-
-<dt><b>GridSiteUserGroup user group</b>
-<dd>Unix user and group when using suexec (or gsexec as suexec.) This
- is equivalent to the suexec SuexecUserGroup directive, but can be
- specified on a per-directory basis.
- <br>
- (Default: none)
-<p>
-
-<dt><b>GridSiteDiskMode GroupNone|GroupRead|GroupWrite WorldNone|WorldRead</b>
-<dd>The file creation permissions mode, taking two arguments to specify
- the group and other permissions. The mode always includes read and write
- permission for the CGI user itself.
- <br>
- (Default: GroupNone WorldNone)
-<p>
-
-</dl>
-
-<h2>Environment variables</h2>
-
-<p>
-The following variables are present in the environment of CGI programs and
-other dynamic content systems if the <b>GridSiteEnvs on</b> directive is
-in effect.
-
-<p>
-<dl>
-<dt><b>GRST_PERM</b>
-<dd>Numerical value of the permission bit-map obtained by comparing the
- user with the GACL in force. (These should be tested using the
- GRSTgaclPermHasXXXX functions from GACL.)
-<p>
-
-<dt><b>GRST_ADMIN_LIST</b>
-<dd>URI of the DN List, listing people with full admin and write access
- to the whole site.
-<p>
-
-<dt><b>GRST_GSIPROXY_LIMIT</b>
-<dd>Maximum valid delegation level for GSI Proxies.
-<p>
-
-<dt><b>GRST_DIR_PATH</b>
-<dd>Absolute path in the local filesystem to the directory holding the
- file being requested.
-<p>
-
-<dt><b>GRST_HELP_URI</b>
-<dd>URI of website help pages set by GridSiteHelpURI directive.
-<p>
-
-<dt><b>GRST_ADMIN_FILE</b>
-<dd>Filename of per-directory ghost gridsite-admin.cgi program. (This is
- used by real-gridsite-admin.cgi to construct links in its pages.)
-<p>
-
-<dt><b>GRST_EDITABLE</b>
-<dd>Space-separated list of extensions which can safely be edited with a
- Text/HTML editor.
-<p>
-
-<dt><b>GRST_HEAD_FILE</b> and <b>GRST_FOOT_FILE</b>
-<dd>Filenames of standard header and footer files.
-<p>
-
-<dt><b>GRST_DN_LISTS</b>
-<dd>DN lists search path.
-<p>
-
-<dt><b>GRST_DN_LISTS_URI</b>
-<dd>Directory of virtual URIs used to publish this site's DN Lists.
-<p>
-
-<dt><b>GRST_UNZIP</b>
-<dd>Full path to the unzip binary, used to list and unpack .zip files.
-<p>
-
-<dt><b>GRST_NO_LINK</b>
-<dd>If set, do not include credit links to GridSite in page footers.
-<p>
-
-<dt><b>GRST_ACL_FORMAT</b>
-<dd>Format to use when writing .gacl files: either GACL or XACML.
-<p>
-
-<dt><b>GRST_EXEC_METHOD</b>
-<dd>Specified by GridSiteExecMethod, either suexec, X509DN or directory.
-<p>
-
-<dt><b>GRST_EXEC_DIRECTORY</b>
-<dd>The directory containing the CGI script or executable (used by gsexec
- to determine which pool account to use in directory mapping mode.)
-<p>
-
-<dt><b>GRST_DISK_MODE</b>
-<dd>The <b>Apache</b> disk permission modes bit pattern, in hexadecimal,
- starting with 0x.
- (Similar to the Unix bit pattern, except with hexadecimal rather than
- octal values: eg 0x600 [Apache] vs 0600 [Unix]
- are both read/write for user only.)
-<p>
-
-</dl>
-
-</body>
-.TH urlencode 1 "November 2003" urlencode "URLENCODE Manual"
+.TH URLENCODE 1 "November 2003" "urlencode" "GridSite Manual"
.SH NAME
.B urlencode
\- convert strings to or from URL-encoded form
.SH EXIT CODES
0 is always returned.
-.SH BUGS
-Not enough beta testing (hint hint...)
-
.SH AUTHOR
-Andrew McNab <Andrew.McNab@man.ac.uk>
+Andrew McNab <Andrew.McNab@manchester.ac.uk>
urlencode is part of GridSite: http://www.gridsite.org/
+++ /dev/null
-<title>GridSite User Guide</title>
-<body>
-<h1 align=center>GridSite User Guide</h1>
-
-<p><i>If you are setting up a GridSite-based website you may wish to use this
-file as the basis of your end-user documentation. If so, copy all of the
-files from the GridSite doc directory (probably
-<small>/usr/share/doc/gridsite-VERSION/</small>)
-to somewhere on your website like
-<b>/gridsite-doc/</b> and add <b>GridSiteHelpURI /gridsite-doc/user.html</b>
-to the virtual server configuration in
-httpd.conf - you should also look through the rest of the HTML source since
-there are some comments you may find helpful.</i>
-
-<p>
-This Guide is intended for people using GridSite websites with conventional
-web browsers, especially people with write access to areas of the site.
- There is a separate
-<a href="admin.html">Administration Guide</a>
- with additional information for people managing access control and group
-membership. This Guide assumes you are familiar with basic Web and HTML
-concepts. Towards the end we discuss how to access servers with command
-line tools like curl and htcp.
-
-<h2>Reading from HTTP and HTTPS servers</h2>
-
-<p>
-GridSite servers are usually accessible both via HTTP and via HTTPS. You can
-always tell which version you are using by looking at whether the URL in your
-browser's location window starts with "http://" or
-"https://" HTTPS means that the connection to the server is
-encrypted, that you can verify you're talking to the real server and not an
-imposter, and gives you the option to authenticate to the site and perhaps
-gain write access.
-
-<p>
- Simple browsing of the website via HTTP or HTTPS is reasonably
- self-explanatory. If configured, additional links may appear in the footer
- of each webpage with links to this help,
-<!-- if GridSiteHelpURI uri is set -->
- and to switch between HTTP and HTTPS versions of the page. Pages may also
- have a link to the page History,
-<!-- GridSiteAdminURI uri must be set and gridsite-admin.cgi working for
- the history-viewing mechanism to work -->
- showing the dates of changes to that page and names of its authors.
-
-<p>
- When looking at HTTPS pages, you may find your browser reports it cannot
- verify the server's certificate since it does not recognise the
- Certification Authority (CA) it uses. You should attempt to load the CA's
- root certificate into your browser to stop these warnings. (This means your
- browser will be able to identify any servers using fake certificates which
- you shouldn't trust.) How you obtain the CA Root Certificate from a
- trust-worthy source depends on the CA. For example, the UK e-Science CA
- lets you download it <a href="http://ca.grid-support.ac.uk/">from their
- website</a>.
-<!-- if most of your users use one or two CAs, you could add a link to their
-CA root cert loading instructions here -->
-
-<h2>Authenticating</h2>
-
-<p>
- To go beyond reading pages you need to obtain a user certificate and load it
- into your web browser. How you do this again depends on the Certification
- Authority you have access to (for most Grid projects, CAs are organised
- on a national basis.) To use the UK e-Science CA example again,
- <a href="http://ca.grid-support.ac.uk/">from their website</a> has links to
- the procedure for applying for a certificate from within a web browser.
-<!-- again, a link to your CA would be good here -->
-
-<p>
-A user certificate usually has a version of your name and affiliation as its
-Distinguished Name (DN) - for example,
-"/C=UK/O=eScience/OU=Manchester/L=HEP/CN=Andrew McNab"
-
-<p>
-Once you've obtained a user certificate in your name from your CA, you need
-to make sure it is loaded into the browser you normally use to browse the
-web. How you do this is different for different browsers and to some extent
-for different CAs (but if you applied
-for the CA through your browser, you may already have it there.)
-
-<p>
-Browsers want the certificate and private key in the PKCS#12 format, which
-is normally a single file with the extension ".p12".
-Many programs which are based on OpenSSL, such as Globus and curl, prefer
-the PEM (".pem") format for certificates, with separate
-certificate and key files ("usercert.pem" and
-"userkey.pem", for example.) If you only have the files in .pem
-format and have access to openssl, you
-can use its command line tools to convert PEM to PKCS#12:
-<pre>
-openssl pkcs12 -in usercert.pem -inkey userkey.pem -export -out certkey.p12
-</pre>
-
-<p>
-<b>Be very careful not to accidentally overwrite .pem or .p12 files when
-doing this kind of thing! In particular, if you lose your private key, you
-cannot retrieve it from your CA.</b>
-
-<p>
- Once your user certificate is loaded, you should be able to see your
- certificate name appear when you look at an HTTPS GridSite page which has
- the page footers enabled - for example, the "Switch to HTTP" link
- present. If GridSite understands your user certificate, it displays a
- "You are ..." line in the footer. (However, the Apache webserver
- must also be set up with your CAs root certificate for this to work. The
- <a href="https://www.gridpp.ac.uk/">GridPP HTTPS home page</a> is set up
- to recognise a good range of European and North American Grid CAs.)
-<!-- the CA root certificates normally go somewhere like
-/etc/grid-security/certificates and httpd.conf should reflect this with the
-directive SSLCACertificatePath /etc/grid-security/certificates -->
-
-<h2>Authorization</h2>
-
-<p>
- Once users can prove their identity to the web server, it then becomes
- possible to give them appropriate rights depending on that identity.
- GridSite allows site administrators to specify these rights for individuals
- and groups using
-<a href="gacl.html">GACL</a>
- access control files. (The
-<a href="admin.html">Administration Guide</a>
- explains how to manage these files.) GACL defines who can
- read files, who can list directories,
- who can write or create files and who can modify the GACL policy files. To
- get increased access to an area of a site, you need to contact the
- administrator for that area and give the DN of your certificate (it's not
- necessary to send any certificate files.)
-
-<h2>Managing Directories and Files</h2>
-
-<p>
-If you have list permission for the directory containing a page, you should
-see an extra link "Manage Directory" in the page's set of footer
-links, which allows you to browse the directory even if the normal
-index.html is present. If page histories are available, this listing view
-also has links to them.
-
-<p>
-The real power of GridSite becomes available if you have write access to a
-directory. In that case, the "Manage Directory" page has
-additional links to Delete or Rename pages and other files, and to Edit HTML
-and plain text files. An Edit link also appears in the footer links of HTML
-pages.
-
-<p>
-If you use the Edit function, you are presented with an HTML form containing
-the current filename and the full HTML or plain text of the page for you to
-edit. This allows you to maintain the content of the site "in
-place" and to see the result of your changes immediately, in context.
-
-<p>
-If you modify the filename in the form before saving, GridSite will make a
-new file with that name, and the old file will still be present, unmodified.
-(However, you cannot use this feature for creating a file in a different
-directory.)
-As you make changes, the history of the changes and your certificate DN are
-recorded, and available in the history page for that file.
-
-<p>
- For people with write access, the "Manage Directory" page also has
- options to upload a file from the computer your browser is running on, and to
- create files and directories. If it's enabled, you can also view the
- contents of WinZIP / PKZIP / .zip files, and unpack their contents into the
- current directory. (This feature is very useful if you have several files
- to upload at one time.)
-<!-- This needs the GridSiteUnzip path directive in httpd.conf -->
-
-<h2>HTML Formatting in GridSite</h2>
-
-<p>
-As well as providing access control and file management, GridSite provides
-some simple formatting of HTML pages by adding standard headers and footers.
-(If this isn't sufficient, GridSite will happily coexist with HTML
-preprocessor languages like SSI, PHP and JSP.)
-
-<p>
- If HTML formatting is enabled
- for the current directory, GridSite looks for the files gridsitehead.txt and
- gridsitefoot.txt in that directory, or goes up through the parent
- directories until they are found.
-<!-- GridSiteHtmlFormat on turns this on and GridSiteHeadFile file and
-GridSiteFootFile file can change the names of the header and footer. If
-you change from the defaults, you need to change this paragraph. -->
-
-<p>
-The <body> and </body> tags from the HTML file are replaced with
-the contents of the gridsitehead.txt and gridsitefoot.txt files, which
-should normally be chunks of HTML including a replacement <body>
-or </body> tag. If either tag is absent from the original page, then
-the header or footer is just added rather than being inserted in place of
-the tag. (One consequence of this absence is that HTML header tags like
-<title> can end up after a <body> tag, and can get ignored by
-browsers - so always include <body> ... </body> in your pages.)
-
-<p>
-This simple system is suprisingly flexible, and allows a variety of top and
-bottom, or sidebar navigation layouts of pages. Since the <body ...>
-tag is under full control of the author of the gridsitehead.txt file,
-backgrounds, colour schemes and style sheets can easily be specified.
-
-<p>
-For example:
-
-<p>
-<table border=1 cellpadding=3>
-<tr><th>Source</th><th>HTML</th></tr>
-<tr><td>page.html</td><td><title>PAGE TITLE</title></td></tr>
-<tr><td>page.html<br>(replaced)</td><td><body></td></tr>
-<tr><td>gridsitehead.txt</td>
- <td><body text=blue><br>
- Heading text<br>
- <table border=1><br><tr><br><td>Standard<br><br>
- sidebar</td><br><td></td></tr>
-<tr><td>page.html</td><td><p><br>Page content...</td></tr>
-<tr><td>page.html<br>(replaced)</td><td></body></td></tr>
-<tr><td>gridsitefoot.txt</td><td></td><br></tr><br>
- </table><br>Footer text<br></body></td></tr>
-</table>
-
-<p>
-produces pages with a layout like:
-
-<p>
-<table border=1 cellpadding=3>
-<tr><td colspan=2>Heading text</td></tr>
-<tr><td>Standard<br>sidebar</td><td>Page content...</td><tr>
-<tr><td colspan=2>Footer text</td></tr>
-</table>
-
-<h2>Command line use</h2>
-
-<p>
-GridSite adds support for the HTTP PUT and DELETE methods, and this makes it
-easy to create or delete files from within programs and commands without
-using a web browser and HTML forms. It is straightforward, although slightly
-awkward, to use a standard HTTPS-aware client like
-<a href="http://curl.haxx.se/">curl</a> to upload files, but GridSite
-provides htcp as a more convenient client program, which is easier to use
-with GSI Proxies and X.509 user certificates, and has a syntax closer to the
-familiar scp command.
-
-<p>
-The following examples assume the GridSite server has GSI support and use a
-GSI proxy as the client certificate. For non-GSI use, just skip the
-grid-proxy-init stage, and replace the proxy
-filename with $HOME/.globus/usercert.pem and $HOME/.globus/userkey.pem (or
-wherever your PEM format certificate and key are stored.)
-
-<p>
-First generate a GSI proxy with grid-proxy-init. This will create a proxy file
-in /tmp/x509up_uXXXXX where XXXXX is your Unix UID (also given by <b>id
--u</b>.) The GSI proxy contains a
-temporary private key and certificate signed by your long-term user
-certificate.
-
-<p>
-You should make sure you have a copy of the CA root certificates of the CA's
-used by the servers you wish to talk to. These are usually installed in
-/etc/grid-security/certificates as files like 01621954.0, and RPMs and tar
-files for many common European and North American CAs are available from
-<a href="https://datagrid.in2p3.fr/distribution/datagrid/security/">
-https://datagrid.in2p3.fr/distribution/datagrid/security/</a>
-
-<p>
-To upload a file with curl:
-<pre>
-curl --cert /tmp/x509up_u`id -n` --key /tmp/x509up_u`id -n` \
- --capath /etc/grid-security/certificates \
- --upload-file /tmp/new.file.txt https://server/new.file.txt
-</pre>
-
-<p>
-The equivalent htcp command is:
-<pre>
-htcp /tmp/new.file.txt https://server/new.file.txt
-</pre>
-since htcp looks for the GSI proxy and CA certificates automatically. htcp
-can also be used to copy remote files to the local machine by reversing the
-arguments. For more details, see the
-<a href="htcp.1.html">htcp(1)</a> man page.
-
-<p>
-htcp also has options for deleting files, and doing short or long listings,
-and these can also be accessed using the htrm, htls and htll commands (which
-are normally symbolic links to htcp.)
-
-<p>
-Directory indexes are based on parsing the index returned by the web server
-and by using the HTTP HEAD method to obtain the file size and modification
-times.
-
-<p>
-All of the ht** commands can accept multiple source file arguments, and this
-allows you to copy multiple files to or from the server. Shell wildcard
-expansion on the local machine is especially useful:
-<pre>
-htcp /tmp/new.*.txt https://server/
-</pre>
-
-</body>
/*
- Copyright (c) 2002-3, Andrew McNab, University of Manchester
+ Copyright (c) 2002-5, Andrew McNab, University of Manchester
All rights reserved.
Redistribution and use in source and binary forms, with or
int length;
int tag; } ;
+#define GRST_HTTP_PORT 777
+#define GRST_HTTPS_PORT 488
+#define GRST_HTCP_PORT 777
+
+#define GRSThtcpNOPop 0
+#define GRSThtcpTSTop 1
+
+typedef struct { unsigned char length_msb;
+ unsigned char length_lsb;
+ char text[1]; } GRSThtcpCountstr;
+
+#define GRSThtcpCountstrLen(string) (256*((string)->length_msb) + (string)->length_lsb)
+
+typedef struct { unsigned char total_length_msb;
+ unsigned char total_length_lsb;
+ unsigned char version_msb;
+ unsigned char version_lsb;
+ unsigned char data_length_msb;
+ unsigned char data_length_lsb;
+ unsigned int response : 4;
+ unsigned int opcode : 4;
+ unsigned int rr : 1;
+ unsigned int f1 : 1;
+ unsigned int reserved : 6;
+ unsigned int trans_id; /* must be 4 bytes */
+ GRSThtcpCountstr *method;
+ GRSThtcpCountstr *uri;
+ GRSThtcpCountstr *version;
+ GRSThtcpCountstr *req_hdrs;
+ GRSThtcpCountstr *resp_hdrs;
+ GRSThtcpCountstr *entity_hdrs;
+ GRSThtcpCountstr *cache_hdrs; } GRSThtcpMessage;
+
int GRSTgaclInit(void);
/* #define GACLnewCred(x) GRSTgaclCredNew((x)) */
int GRSTx509GetVomsCreds(int *, int, size_t, char *, X509 *, STACK_OF(X509) *, char *);
GRSTgaclCred *GRSTx509CompactToCred(char *);
-int GRSTx509CompactCreds(int *, int, size_t, char *, STACK_OF(X509) *, char *);
+int GRSTx509CompactCreds(int *, int, size_t, char *, STACK_OF(X509) *, char *, X509 *);
char *GRSTx509CachedProxyFind(char *, char *, char *);
char *GRSTx509FindProxyFileName(void);
int GRSTx509MakeProxyCert(char **, FILE *, char *, char *, char *, int);
struct GRSTasn1TagList taglist[], int, int *);
int GRSTasn1GetX509Name(char *, int, char *, char *,
struct GRSTasn1TagList taglist[], int);
+
+int GRSThtcpNOPrequestMake(char **, int *, unsigned int);
+int GRSThtcpNOPresponseMake(char **, int *, unsigned int);
+int GRSThtcpTSTrequestMake(char **, int *, unsigned int, char *, char *, char *);
+int GRSThtcpTSTresponseMake(char **, int *, unsigned int, char *, char *, char *);
+int GRSThtcpMessageParse(GRSThtcpMessage *, char *, int);
-module.version=1.1.11
+module.version=1.1.14
module.age=1
# Build
#
-build: libgridsite.so.$(VERSION) libgridsite.a htcp mod_gridsite.so \
+build: apidoc \
+ libgridsite.so.$(VERSION) libgridsite.a htcp mod_gridsite.so \
urlencode findproxyfile real-gridsite-admin.cgi gsexec \
# gridsite-delegation.cgi # htproxyput
# First, normal versions using system OpenSSL rather than Globus OpenSSL
-libgridsite.so.$(VERSION): grst_x509.o grst_gacl.o grst_xacml.o grst_http.o grst_asn1.o
+libgridsite.so.$(VERSION): grst_x509.o grst_gacl.o grst_xacml.o grst_http.o grst_asn1.o grst_htcp.o
gcc -shared -Wl,-soname,libgridsite.so.$(MINOR_VERSION) \
- -o libgridsite.so.$(PATCH_VERSION) grst_x509.o grst_gacl.o grst_xacml.o grst_http.o grst_asn1.o
+ -o libgridsite.so.$(PATCH_VERSION) grst_x509.o grst_gacl.o grst_xacml.o grst_http.o grst_asn1.o grst_htcp.o
-libgridsite.a: grst_x509.o grst_gacl.o grst_xacml.o grst_http.o grst_asn1.o
- ar src libgridsite.a grst_x509.o grst_gacl.o grst_xacml.o grst_http.o grst_asn1.o
+libgridsite.a: grst_x509.o grst_gacl.o grst_xacml.o grst_http.o grst_asn1.o grst_htcp.o
+ ar src libgridsite.a grst_x509.o grst_gacl.o grst_xacml.o grst_http.o grst_asn1.o grst_htcp.o
grst_x509.o: grst_x509.c ../interface/gridsite.h
- gcc $(MYCFLAGS) \
+ gcc -g $(MYCFLAGS) \
-I/usr/kerberos/include -c grst_x509.c
grst_gacl.o: grst_gacl.c ../interface/gridsite.h
- gcc $(MYCFLAGS) \
+ gcc -g $(MYCFLAGS) \
-I/usr/kerberos/include `xml2-config --cflags` -c grst_gacl.c
grst_xacml.o: grst_xacml.c ../interface/gridsite.h
- gcc $(MYCFLAGS) \
+ gcc -g $(MYCFLAGS) \
-I/usr/kerberos/include `xml2-config --cflags` -c grst_xacml.c
grst_http.o: grst_http.c ../interface/gridsite.h
- gcc $(MYCFLAGS) \
+ gcc -g $(MYCFLAGS) \
-I/usr/kerberos/include -c grst_http.c
grst_asn1.o: grst_asn1.c ../interface/gridsite.h
- gcc $(MYCFLAGS) \
+ gcc -g $(MYCFLAGS) \
-I/usr/kerberos/include -c grst_asn1.c
+grst_htcp.o: grst_htcp.c ../interface/gridsite.h
+ gcc -g $(MYCFLAGS) \
+ -I/usr/kerberos/include -c grst_htcp.c
+
# Then build versions using Globus OpenSSL if configured
ifdef OPENSSL_GLOBUS_LIBS
libgridsite_globus.so.$(VERSION): \
grst_x509_globus.o grst_gacl_globus.o grst_http_globus.o \
- grst_asn1_globus.o grst_xacml_globus.o
+ grst_asn1_globus.o grst_xacml_globus.o grst_htcp_globus.o
gcc -shared -Wl,-soname,libgridsite_globus.so.$(MINOR_VERSION) \
-o libgridsite_globus.so.$(PATCH_VERSION) \
grst_x509_globus.o grst_gacl_globus.o grst_xacml_globus.o grst_http_globus.o grst_asn1_globus.o
grst_x509_globus.o grst_gacl_globus.o grst_http_globus.o grst_asn1_globus.o
grst_x509_globus.o: grst_x509.c ../interface/gridsite.h
- gcc $(MYCFLAGS) $(OPENSSL_GLOBUS_FLAGS) \
+ gcc -g $(MYCFLAGS) $(OPENSSL_GLOBUS_FLAGS) \
-I/usr/kerberos/include -c grst_x509.c \
-o grst_x509_globus.o
grst_gacl_globus.o: grst_gacl.c ../interface/gridsite.h
- gcc $(MYCFLAGS) $(OPENSSL_GLOBUS_FLAGS) \
+ gcc -g $(MYCFLAGS) $(OPENSSL_GLOBUS_FLAGS) \
-I/usr/kerberos/include `xml2-config --cflags` -c grst_gacl.c \
-o grst_gacl_globus.o
grst_xacml_globus.o: grst_xacml.c ../interface/gridsite.h
- gcc $(MYCFLAGS) $(OPENSSL_GLOBUS_FLAGS) \
+ gcc -g $(MYCFLAGS) $(OPENSSL_GLOBUS_FLAGS) \
-I/usr/kerberos/include `xml2-config --cflags` -c grst_xacml.c \
-o grst_xacml_globus.o
grst_http_globus.o: grst_http.c ../interface/gridsite.h
- gcc $(MYCFLAGS) $(OPENSSL_GLOBUS_FLAGS) \
+ gcc -g $(MYCFLAGS) $(OPENSSL_GLOBUS_FLAGS) \
-I/usr/kerberos/include -c grst_http.c \
-o grst_http_globus.o
grst_asn1_globus.o: grst_asn1.c ../interface/gridsite.h
- gcc $(MYCFLAGS) $(OPENSSL_GLOBUS_FLAGS) \
+ gcc -g $(MYCFLAGS) $(OPENSSL_GLOBUS_FLAGS) \
-I/usr/kerberos/include -c grst_asn1.c \
-o grst_asn1_globus.o
+grst_htcp_globus.o: grst_htcp.c ../interface/gridsite.h
+ gcc -g $(MYCFLAGS) $(OPENSSL_GLOBUS_FLAGS) \
+ -I/usr/kerberos/include -c grst_htcp.c \
+ -o grst_htcp_globus.o
+
else
libgridsite_globus.so.$(VERSION): libgridsite.so.$(VERSION)
endif
gsexec: gsexec.c gsexec.h
- gcc -DVERSION=\"$(PATCH_VERSION)\" -I/usr/include/httpd \
- -I/usr/include/apr-0 \
+ gcc -g -DVERSION=\"$(PATCH_VERSION)\" $(MYCFLAGS) \
-o gsexec gsexec.c
urlencode: urlencode.c libgridsite.a
- gcc -DVERSION=\"$(PATCH_VERSION)\" $(MYCFLAGS) \
+ gcc -g -DVERSION=\"$(PATCH_VERSION)\" $(MYCFLAGS) \
-o urlencode urlencode.c -L. \
- -I/usr/kerberos/include -lgridsite
+ -I/usr/kerberos/include -lgridsite
-htcp: htcp.c
- gcc -DVERSION=\"$(PATCH_VERSION)\" -I. -o htcp htcp.c \
- `curl-config --cflags` `curl-config --libs`
+htcp: htcp.c libgridsite.a
+ gcc -g -DVERSION=\"$(PATCH_VERSION)\" $(MYCFLAGS) \
+ -o htcp htcp.c -L. \
+ -I/usr/kerberos/include \
+ `curl-config --cflags` `curl-config --libs` -lgridsite
mod_gridsite.so: mod_gridsite.c mod_ssl-private.h libgridsite.a
- gcc $(MYCFLAGS) -shared -Wl,-soname=gridsite_module \
+ gcc -g $(MYCFLAGS) -shared -Wl,-soname=gridsite_module \
-I/usr/kerberos/include \
-I/usr/include/libxml2 \
-DVERSION=\"$(VERSION)\" -o mod_gridsite.so \
real-gridsite-admin.cgi: grst_admin_main.c grst_admin_gacl.c \
grst_admin_file.c grst_admin.h
- gcc $(MYCFLAGS) $(MYLDFLAGS) -o real-gridsite-admin.cgi \
+ gcc -g $(MYCFLAGS) $(MYLDFLAGS) -o real-gridsite-admin.cgi \
grst_admin_main.c \
grst_admin_gacl.c \
grst_admin_file.c \
-DVERSION=\"$(VERSION)\" -lgridsite -lssl -lcrypto -lxml2 -lz -lm
findproxyfile: findproxyfile.c libgridsite.a
- gcc -DVERSION=\"$(PATCH_VERSION)\" $(MYCFLAGS) $(MYLDFLAGS) \
+ gcc -g -DVERSION=\"$(PATCH_VERSION)\" $(MYCFLAGS) $(MYLDFLAGS) \
-o findproxyfile findproxyfile.c -L. \
-I/usr/kerberos/include -lgridsite \
-lssl -lcrypto -lxml2 -lz -lm
showx509exts: showx509exts.c libgridsite.a
- gcc -DVERSION=\"$(PATCH_VERSION)\" $(MYCFLAGS) $(MYLDFLAGS) \
+ gcc -g -DVERSION=\"$(PATCH_VERSION)\" $(MYCFLAGS) $(MYLDFLAGS) \
-o showx509exts showx509exts.c -L. \
-I/usr/kerberos/include \
-lgridsite \
- -lssl -lcrypto
+ -lssl -lcrypto -lxml2 -lz -lm
apidoc:
doxygen Doxyfile
+ mkdir -p ../doc/doxygen
+ cp -f doxygen/*.html doxygen/*.css doxygen/*.png ../doc/doxygen
+ cd ../doc ; for i in *.1 *.8 ; do ../src/roffit < $$i \
+ > $$i.html ; done
gaclexample: gaclexample.c libgridsite.a
- gcc -o gaclexample gaclexample.c -I. -L. \
+ gcc -g -o gaclexample gaclexample.c -I. -L. \
-I/usr/kerberos/include -lgridsite \
-lssl -lcrypto -lxml2 -lz -lm
xacmlexample: xacmlexample.c libgridsite.a
- gcc -o xacmlexample xacmlexample.c -I. -L. \
+ gcc -g -o xacmlexample xacmlexample.c -I. -L. \
-I/usr/kerberos/include -lgridsite \
-lssl -lcrypto -lxml2 -lz -lm
$(GSOAPDIR)/bin/soapcpp2 -c delegation.h
libstdsoap2.a: $(GSOAPDIR)/stdsoap2.c
- gcc -c -DWITH_OPENSSL $(GSOAPDIR)/stdsoap2.c
+ gcc -g -c -DWITH_OPENSSL $(GSOAPDIR)/stdsoap2.c
ar src libstdsoap2.a stdsoap2.o
gridsite-delegation.cgi: grst-delegation.c delegation.h delegation.wsdl \
soapC.c soapServer.c
- gcc $(MYCFLAGS) $(MYLDFLAGS) -o gridsite-delegation.cgi \
+ gcc -g $(MYCFLAGS) $(MYLDFLAGS) -o gridsite-delegation.cgi \
grst-delegation.c \
-I/usr/kerberos/include -I$(GSOAPDIR)/include \
-DVERSION=\"$(VERSION)\" -L$(GSOAPDIR)/lib \
htproxyput: htproxyput.c delegation.h delegation.wsdl \
soapC.c soapServer.c
- gcc $(MYCFLAGS) $(MYLDFLAGS) -o htproxyput \
+ gcc -g $(MYCFLAGS) $(MYLDFLAGS) -o htproxyput \
htproxyput.c \
-I/usr/kerberos/include \
-g -DVERSION=\"$(VERSION)\" \
proxyput-example: proxyput-example.c delegation.h delegation.wsdl \
soapC.c soapServer.c
- gcc $(MYCFLAGS) $(MYLDFLAGS) -o proxyput-example \
+ gcc -g $(MYCFLAGS) $(MYLDFLAGS) -o proxyput-example \
proxyput-example.c \
-I/usr/kerberos/include \
-g -DVERSION=\"$(VERSION)\" \
$(prefix)/lib/libgridsite_globus.so.$(MAJOR_VERSION)
ln -sf libgridsite_globus.so.$(PATCH_VERSION) \
$(prefix)/lib/libgridsite_globus.so.$(MINOR_VERSION)
- cp -f doxygen/index.html \
- $(prefix)/share/doc/gridsite-$(PATCH_VERSION)/doxygen-index.html
- cp -f doxygen/* $(prefix)/share/doc/gridsite-$(PATCH_VERSION)
cp -f ../CHANGES ../README ../INSTALL ../LICENSE ../VERSION \
$(prefix)/share/doc/gridsite-$(PATCH_VERSION)
cp -f ../doc/*.html ../doc/*.conf ../doc/*.1 ../doc/*.8 ../doc/*.sh \
- $(prefix)/share/doc/gridsite-$(VERSION)
+ ../doc/*.wsdl $(prefix)/share/doc/gridsite-$(VERSION)
cp -f ../doc/*.1 $(prefix)/share/man/man1
cp -f ../doc/*.8 $(prefix)/share/man/man8
gzip -f $(prefix)/share/man/man1/*.1
gzip -f $(prefix)/share/man/man8/*.8
- cd ../doc ; for i in *.1 *.8 ; do ../src/roffit < $$i \
- > $(prefix)/share/doc/gridsite-$(VERSION)/$$i.html ; done
cp -f htcp $(prefix)/bin
ln -sf htcp $(prefix)/bin/htls
ln -sf htcp $(prefix)/bin/htll
ln -sf htcp $(prefix)/bin/htrm
ln -sf htcp $(prefix)/bin/htmkdir
+ ln -sf htcp $(prefix)/bin/htmv
+ ln -sf htcp $(prefix)/bin/htping
+ ln -sf htcp $(prefix)/bin/htfind
cp -f gsexec $(prefix)/sbin
cp -f mod_gridsite.so $(prefix)/lib/httpd/modules
Doxyfile doxygen.css doxyheader.html \
../gridsite-$(PATCH_VERSION)/src
cp -f ../doc/*.html ../doc/*.1 ../doc/*.8 ../doc/*.conf ../doc/*.sh \
- ../gridsite-$(PATCH_VERSION)/doc
+ ../doc/*.wsdl ../gridsite-$(PATCH_VERSION)/doc
cp -f ../interface/*.h \
../gridsite-$(PATCH_VERSION)/interface
cd .. ; tar zcvf gridsite-$(PATCH_VERSION).src.tar.gz \
../htcp-bin-$(PATCH_VERSION)/man/man1
cp -f ../doc/README.htcp-bin ../htcp-bin-$(PATCH_VERSION)
cp -f htcp ../htcp-bin-$(PATCH_VERSION)/bin
- cp -f ../doc/htcp.1 ../doc/htrm.1 ../doc/htls.1 ../doc/htll.1 \
- ../doc/htmkdir.1 ../htcp-bin-$(PATCH_VERSION)/man/man1
+ cp -f ../doc/htcp.1 ../doc/htrm.1 ../doc/htls.1 ../doc/htmkdir.1 \
+ ../doc/htll.1 ../doc/htmv.1 ../doc/htping.1 ../doc/htfind.1 \
+ ../htcp-bin-$(PATCH_VERSION)/man/man1
ln -sf htcp ../htcp-bin-$(PATCH_VERSION)/bin/htls
ln -sf htcp ../htcp-bin-$(PATCH_VERSION)/bin/htll
ln -sf htcp ../htcp-bin-$(PATCH_VERSION)/bin/htrm
ln -sf htcp ../htcp-bin-$(PATCH_VERSION)/bin/htmkdir
+ ln -sf htcp ../htcp-bin-$(PATCH_VERSION)/bin/htmv
+ ln -sf htcp ../htcp-bin-$(PATCH_VERSION)/bin/htping
+ ln -sf htcp ../htcp-bin-$(PATCH_VERSION)/bin/htfind
cd ../htcp-bin-$(VERSION) ; tar zcvf ../htcp-$(VERSION).bin.tar.gz .
rm -Rf ../htcp-bin-$(PATCH_VERSION)
Prefix: %(echo ${MYPREFIX:-/usr})
URL: http://www.gridsite.org/
Vendor: GridPP
-#Requires: libxml2,curl-ssl,mod_ssl
+Requires: libxml2
#Buildrequires: libxml2-devel,curl-ssl-devel,httpd-devel
Packager: Andrew McNab <Andrew.McNab@manchester.ac.uk>
%package -n htcp
Group: Applications/Internet
Summary: HTTP(S) read/write client
-#Requires: curl-ssl
+Requires: curl
%description -n htcp
htcp is a client to fetch files or directory listings from remote
%package gsexec
Group: Applications/Internet
Summary: gsexec binary for the Apache HTTP server
-#Requires: curl-ssl
%description gsexec
This package includes the /usr/sbin/gsexec binary which can be installed
ln -sf %(echo ${MYPREFIX:-/usr})/share/doc/gridsite-%{version} \
%(echo ${MYPREFIX:-/usr})/share/doc/gridsite
-%postun
+#%postun
rm -f %(echo ${MYPREFIX:-/usr})/share/doc/gridsite
%files
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/share/doc/gridsite-%{version}
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/share/man/man1/urlencode.1.gz
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/share/man/man1/findproxyfile.1.gz
+%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/share/man/man8/mod_gridsite.8.gz
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/include/gridsite.h
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/include/gridsite-gacl.h
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/lib/libgridsite.a
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/bin/htll
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/bin/htrm
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/bin/htmkdir
+%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/bin/htmv
+%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/bin/htping
+%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/bin/htfind
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/share/man/man1/htcp.1.gz
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/share/man/man1/htrm.1.gz
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/share/man/man1/htls.1.gz
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/share/man/man1/htll.1.gz
%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/share/man/man1/htmkdir.1.gz
+%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/share/man/man1/htmv.1.gz
+%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/share/man/man1/htping.1.gz
+%attr(-, root, root) %(echo ${MYPREFIX:-/usr})/share/man/man1/htfind.1.gz
%files gsexec
%attr(4510, root, apache) %(echo ${MYPREFIX:-/usr})/sbin/gsexec
ASN1_OBJECT *obj = NULL;
unsigned char coordstmp[81], *q;
const unsigned char *shortname;
-
+
for (i=1; ; ++i)
{
- sprintf(coordstmp, coords, i, 1);
+ snprintf(coordstmp, sizeof(coordstmp), coords, i, 1);
iobj = GRSTasn1SearchTaglist(taglist, lasttag, coordstmp);
if (iobj < 0) break;
- sprintf(coordstmp, coords, i, 2);
+ snprintf(coordstmp, sizeof(coordstmp), coords, i, 2);
istr = GRSTasn1SearchTaglist(taglist, lasttag, coordstmp);
if (istr < 0) break;
x509name[len] = '\0';
- return GRST_RET_OK;
+ return (x509name[0] != '\0') ? GRST_RET_OK : GRST_RET_FAILED;
}
if (doc == NULL) return NULL;
cur = xmlDocGetRootElement(doc);
- if (cur == NULL) return NULL;
+ if (cur == NULL)
+ {
+ xmlFreeDoc(doc);
+ return NULL;
+ }
- if (!xmlStrcmp(cur->name, (const xmlChar *) "Policy")) { acl=GRSTxacmlAclParse(doc, cur, acl);}
- else if (!xmlStrcmp(cur->name, (const xmlChar *) "gacl")) {acl=GRSTgaclAclParse(doc, cur, acl);}
+ if (!xmlStrcmp(cur->name, (const xmlChar *) "Policy"))
+ {
+ acl=GRSTxacmlAclParse(doc, cur, acl);
+ }
+ else if (!xmlStrcmp(cur->name, (const xmlChar *) "gacl"))
+ {
+ acl=GRSTgaclAclParse(doc, cur, acl);
+ }
else /* ACL format not recognised */
{
- free(doc);
- free(cur);
+ xmlFreeDoc(doc);
return NULL;
}
-
xmlFreeDoc(doc);
return acl;
--- /dev/null
+/*
+ Copyright (c) 2002-5, Andrew McNab, University of Manchester
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or
+ without modification, are permitted provided that the following
+ conditions are met:
+
+ o Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+ o Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef VERSION
+#define VERSION "x.x.x"
+#endif
+
+#define _GNU_SOURCE
+#include <stdio.h>
+
+#include <string.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "gridsite.h"
+
+int GRSThtcpNOPrequestMake(char **request, int *request_length,
+ unsigned int trans_id)
+/*
+ Make a complete HTCP NOP request and return a pointer to malloc'd
+ memory pointing to it.
+*/
+{
+ *request_length =
+ asprintf(request,"%c%c" /* place holder for total length */
+ "%c%c" /* HTCP version 0.0 */
+ "%c%c" /* DATA length place holder */
+ "%c%c" /* OPCODE,RESPONSE,RESERVED,F1,RR */
+ "%c%c%c%c" /* TRANS-ID placeholder */
+ "%c%c", /* AUTH (LENGTH=2 means no AUTH) */
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ GRSThtcpNOPop * 16, 2,
+ 0, 0, 0, 0,
+ 0, 2);
+
+ if (*request_length < 0) return GRST_RET_FAILED;
+
+ (*request)[0] = *request_length / 256;
+ (*request)[1] = *request_length % 256;
+
+ (*request)[4] = (*request_length - 6) / 256;
+ (*request)[5] = (*request_length - 6) % 256;
+
+ memcpy(&((*request)[8]), &trans_id, 4);
+
+ return GRST_RET_OK;
+}
+
+int GRSThtcpNOPresponseMake(char **message, int *message_length,
+ unsigned int trans_id)
+/*
+ Make a complete HTCP NOP response for a found file and return a pointer
+ to malloc'd memory pointing to it.
+*/
+{
+ *message_length =
+ asprintf(message,
+ "%c%c" /* place holder for total length */
+ "%c%c" /* HTCP version 0.0 */
+ "%c%c" /* DATA length place holder */
+ "%c%c" /* OPCODE,RESPONSE,RESERVED,F1,RR */
+ "%c%c%c%c" /* TRANS-ID place holder */
+ "%c%c", /* AUTH (LENGTH=2 means no AUTH) */
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ GRSThtcpNOPop * 16, 1, /* RR=1, MO=0, RESPONSE=0 (ie found) */
+ 0, 0, 0, 0,
+ 0, 2);
+
+ if (*message_length < 0) return GRST_RET_FAILED;
+
+ (*message)[0] = *message_length / 256;
+ (*message)[1] = *message_length % 256;
+
+ (*message)[4] = (*message_length - 6) / 256;
+ (*message)[5] = (*message_length - 6) % 256;
+
+ memcpy(&((*message)[8]), &trans_id, 4);
+
+ return GRST_RET_OK;
+}
+
+int GRSThtcpTSTrequestMake(char **request, int *request_length,
+ unsigned int trans_id,
+ char *method, char *uri, char *req_hdrs)
+/*
+ Make a complete HTCP TST request and return a pointer to malloc'd
+ memory pointing to it.
+*/
+{
+ if ((method == NULL) || (uri == NULL) || (req_hdrs == NULL))
+ return GRST_RET_FAILED;
+
+ *request_length =
+ asprintf(request,"%c%c" /* place holder for total length */
+ "%c%c" /* HTCP version 0.0 */
+ "%c%c" /* DATA length place holder */
+ "%c%c" /* OPCODE,RESPONSE,RESERVED,F1,RR */
+ "%c%c%c%c" /* TRANS-ID placeholder */
+ "%c%c%s" /* OP-DATA: METHOD */
+ "%c%c%s" /* OP-DATA: URI */
+ "%c%c%s" /* OP-DATA: VERSION */
+ "%c%c%s" /* OP-DATA: REQ-HDRS */
+ "%c%c", /* AUTH (LENGTH=2 means no AUTH) */
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ GRSThtcpTSTop * 16, 2,
+ 0, 0, 0, 0,
+ strlen(method) / 256, strlen(method) % 256, method,
+ strlen(uri) / 256, strlen(uri) % 256, uri,
+ 0, 8, "HTTP/1.1",
+ strlen(req_hdrs)/256, strlen(req_hdrs) % 256, req_hdrs,
+ 0, 2);
+
+ if (*request_length < 0) return GRST_RET_FAILED;
+
+ (*request)[0] = *request_length / 256;
+ (*request)[1] = *request_length % 256;
+
+ (*request)[4] = (*request_length - 6) / 256;
+ (*request)[5] = (*request_length - 6) % 256;
+
+ memcpy(&((*request)[8]), &trans_id, 4);
+
+ return GRST_RET_OK;
+}
+
+int GRSThtcpTSTresponseMake(char **message, int *message_length,
+ unsigned int trans_id,
+ char *resp_hdrs, char *entity_hdrs,
+ char *cache_hdrs)
+/*
+ Make a complete HTCP TST response for a found file and return a pointer
+ to malloc'd memory pointing to it.
+*/
+{
+ if ((resp_hdrs != NULL) && (entity_hdrs != NULL) && (cache_hdrs != NULL))
+ /* found file response */
+ *message_length =
+ asprintf(message,
+ "%c%c" /* place holder for total length */
+ "%c%c" /* HTCP version 0.0 */
+ "%c%c" /* DATA length place holder */
+ "%c%c" /* OPCODE,RESPONSE,RESERVED,F1,RR */
+ "%c%c%c%c" /* TRANS-ID place holder */
+ "%c%c%s" /* OP-DATA: RESP-HDRS */
+ "%c%c%s" /* OP-DATA: ENTITY-HDRS */
+ "%c%c%s" /* OP-DATA: CACHE-HDRS */
+ "%c%c", /* AUTH (LENGTH=2 means no AUTH) */
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ GRSThtcpTSTop * 16, 1, /* RR=1, MO=0, RESPONSE=0 (ie found) */
+ 0, 0, 0, 0,
+ strlen(resp_hdrs) / 256, strlen(resp_hdrs) % 256, resp_hdrs,
+ strlen(entity_hdrs) / 256, strlen(entity_hdrs) % 256, entity_hdrs,
+ strlen(cache_hdrs) / 256, strlen(cache_hdrs) % 256, cache_hdrs,
+ 0, 2);
+ else if (cache_hdrs != NULL)
+ /* not found file response, just cache_hdrs given */
+ *message_length =
+ asprintf(message,
+ "%c%c" /* place holder for total length */
+ "%c%c" /* HTCP version 0.0 */
+ "%c%c" /* DATA length place holder */
+ "%c%c" /* OPCODE,RESPONSE,RESERVED,F1,RR */
+ "%c%c%c%c" /* TRANS-ID */
+ "%c%c%s" /* OP-DATA: CACHE-HDRS */
+ "%c%c", /* AUTH (LENGTH=2 means no AUTH) */
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ GRSThtcpTSTop * 16 + 1, 1, /* RR=1, MO=0, RESPONSE=1 (missing) */
+ 0, 0, 0, 0,
+ strlen(cache_hdrs) / 256, strlen(cache_hdrs) % 256, cache_hdrs,
+ 0, 2);
+ else return GRST_RET_FAILED;
+
+ if (*message_length < 0) return GRST_RET_FAILED;
+
+ (*message)[0] = *message_length / 256;
+ (*message)[1] = *message_length % 256;
+
+ (*message)[4] = (*message_length - 6) / 256;
+ (*message)[5] = (*message_length - 6) % 256;
+
+ memcpy(&((*message)[8]), &trans_id, 4);
+
+ return GRST_RET_OK;
+}
+
+int GRSThtcpMessageParse(GRSThtcpMessage *parsed, char *raw, int length)
+{
+ GRSThtcpCountstr *s;
+
+ bzero(parsed, sizeof(GRSThtcpMessage));
+
+ if (length < (void *) &(parsed->method)
+ - (void *) &(parsed->total_length_msb) + 2)
+ return GRST_RET_FAILED;
+
+ memcpy(parsed, raw, (void *) &(parsed->method)
+ - (void *) &(parsed->total_length_msb));
+
+ if (parsed->opcode == GRSThtcpNOPop) return GRST_RET_OK;
+
+ if ((parsed->opcode == GRSThtcpTSTop) && (parsed->rr == 0))
+ {
+ /* a TST request */
+
+ /* point to start of data/auth in raw */
+ s = (GRSThtcpCountstr *) &(((GRSThtcpMessage *) raw)->method);
+
+ /* METHOD string */
+
+ if ((void *) s + 2 + GRSThtcpCountstrLen(s) > (void *) raw + length)
+ return GRST_RET_FAILED;
+ parsed->method = s;
+ s = (GRSThtcpCountstr *) ((void *) s + 2 + GRSThtcpCountstrLen(s));
+
+ /* URI string */
+
+ if ((void *) s + 2 + GRSThtcpCountstrLen(s) > (void *) raw + length)
+ return GRST_RET_FAILED;
+ parsed->uri = s;
+ s = (GRSThtcpCountstr *) ((void *) s + 2 + GRSThtcpCountstrLen(s));
+
+ /* VERSION string */
+
+ if ((void *) s + 2 + GRSThtcpCountstrLen(s) > (void *) raw + length)
+ return GRST_RET_FAILED;
+ parsed->version = s;
+ s = (GRSThtcpCountstr *) ((void *) s + 2 + GRSThtcpCountstrLen(s));
+
+ /* REQ-HDRS string */
+
+ if ((void *) s + 2 + GRSThtcpCountstrLen(s) > (void *) raw + length)
+ return GRST_RET_FAILED;
+ parsed->req_hdrs = s;
+ s = (GRSThtcpCountstr *) ((void *) s + 2 + GRSThtcpCountstrLen(s));
+
+ return GRST_RET_OK;
+ }
+
+ if ((parsed->opcode == GRSThtcpTSTop) && (parsed->rr == 1))
+ {
+ /* a TST response */
+
+ /* point to start of data/auth in raw */
+ s = (GRSThtcpCountstr *) &(((GRSThtcpMessage *) raw)->method);
+
+ /* RESP-HDRS string */
+
+ if ((void *) s + 2 + GRSThtcpCountstrLen(s) > (void *) raw + length)
+ return GRST_RET_FAILED;
+ parsed->resp_hdrs = s;
+ s = (GRSThtcpCountstr *) ((void *) s + 2 + GRSThtcpCountstrLen(s));
+
+ /* ENTITY-HDRS string */
+
+ if ((void *) s + 2 + GRSThtcpCountstrLen(s) > (void *) raw + length)
+ return GRST_RET_FAILED;
+ parsed->entity_hdrs = s;
+ s = (GRSThtcpCountstr *) ((void *) s + 2 + GRSThtcpCountstrLen(s));
+
+ /* CACHE-HDRS string */
+
+ if ((void *) s + 2 + GRSThtcpCountstrLen(s) > (void *) raw + length)
+ return GRST_RET_FAILED;
+ parsed->cache_hdrs = s;
+ s = (GRSThtcpCountstr *) ((void *) s + 2 + GRSThtcpCountstrLen(s));
+
+ return GRST_RET_OK;
+ }
+
+ return GRST_RET_FAILED;
+}
*q = '\0';
return out;
}
+
+/// Return a one-time passcode string, for use with GridHTTP
+/**
+ * Returns
+ *
+ * String is timestamp+SHA1_HASH(timestamp+":"+method+":"+URL)
+ * Timestamps and hashes are in lowercase hexadecimal. Timestamps are
+ * seconds since 00:00:00 on January 1, 1970 UTC.
+ */
+
+/*
+char *GRSThttpMakeOneTimePasscode(time_t timestamp, char *method, char *url)
+{
+ int len, i;
+ char *stringtohash, hashedstring[EVP_MAX_MD_SIZE], *returnstring;
+ const EVP_MD *m;
+ EVP_MD_CTX ctx;
+
+ m = EVP_sha1();
+ if (m == NULL) return NULL;
+
+ asprintf(&stringtohash, "%08x:%s:%s", timestamp, method, url);
+
+ EVP_DigestInit(&ctx, m);
+ EVP_DigestUpdate(&ctx, stringtohash, strlen(stringtohash));
+ EVP_DigestFinal(&ctx, hashedstring, &len);
+
+ returnstring = malloc(9 + len * 2);
+
+ sprintf(returnstring, "%08x", timestamp);
+
+ for (i=0;
+
+ return returnstring;
+}
+*/
unsigned char *asn1string,
struct GRSTasn1TagList taglist[],
int lasttag,
- char *vomsdir)
+ char *vomsdir, int acnumber)
{
-#define GRST_ASN1_COORDS_VOMS_DN "-1-1-1-1-3-1-1-1-%d-1-%d"
-#define GRST_ASN1_COORDS_VOMS_INFO "-1-1-1-1"
-#define GRST_ASN1_COORDS_VOMS_SIG "-1-1-1-3"
+#define GRST_ASN1_COORDS_VOMS_DN "-1-1-%d-1-3-1-1-1-%%d-1-%%d"
+#define GRST_ASN1_COORDS_VOMS_INFO "-1-1-%d-1"
+#define GRST_ASN1_COORDS_VOMS_SIG "-1-1-%d-3"
int ret, isig, iinfo;
- char *certpath, acvomsdn[200];
+ char *certpath, acvomsdn[200], dn_coords[200],
+ info_coords[200], sig_coords[200];
unsigned char *q;
DIR *vomsDIR;
struct dirent *vomsdirent;
time_t voms_service_time1, voms_service_time2;
if ((vomsdir == NULL) || (vomsdir[0] == '\0')) return GRST_RET_FAILED;
+
+ snprintf(dn_coords, sizeof(dn_coords),
+ GRST_ASN1_COORDS_VOMS_DN, acnumber);
- if (GRSTasn1GetX509Name(acvomsdn, sizeof(acvomsdn),
- GRST_ASN1_COORDS_VOMS_DN,
+ if (GRSTasn1GetX509Name(acvomsdn, sizeof(acvomsdn), dn_coords,
asn1string, taglist, lasttag) != GRST_RET_OK) return GRST_RET_FAILED;
- iinfo = GRSTasn1SearchTaglist(taglist, lasttag, GRST_ASN1_COORDS_VOMS_INFO);
- isig = GRSTasn1SearchTaglist(taglist, lasttag, GRST_ASN1_COORDS_VOMS_SIG);
+ snprintf(info_coords, sizeof(info_coords),
+ GRST_ASN1_COORDS_VOMS_INFO, acnumber);
+ iinfo = GRSTasn1SearchTaglist(taglist, lasttag, info_coords);
+
+ snprintf(sig_coords, sizeof(sig_coords),
+ GRST_ASN1_COORDS_VOMS_SIG, acnumber);
+ isig = GRSTasn1SearchTaglist(taglist, lasttag, sig_coords);
if ((iinfo < 0) || (isig < 0)) return GRST_RET_FAILED;
#if OPENSSL_VERSION_NUMBER >= 0x0090701fL
EVP_MD_CTX_init(&ctx);
EVP_VerifyInit_ex(&ctx, EVP_md5(), NULL);
+#else
+ EVP_VerifyInit(&ctx, EVP_md5());
#endif
EVP_VerifyUpdate(&ctx,
#if OPENSSL_VERSION_NUMBER >= 0x0090701fL
EVP_MD_CTX_cleanup(&ctx);
-#endif
+#endif
EVP_PKEY_free(prvkey);
if (ret != 1) /* signature doesnt match, look for more */
/// Get the VOMS attributes in the given extension
/*
* Puts any VOMS credentials found into the Compact Creds string array
- * starting at *creds. Always returns GRST_RET_OK.
+ * starting at *creds. Always returns GRST_RET_OK - even for invalid
+ * credentials, which are just ignored.
*/
int GRSTx509ParseVomsExt(int *lastcred, int maxcreds, size_t credlen,
X509_EXTENSION *ex, char *ucuserdn, char *vomsdir)
{
#define MAXTAG 500
-#define GRST_ASN1_COORDS_FQAN "-1-1-1-1-7-1-2-1-2-%d"
-#define GRST_ASN1_COORDS_USER_DN "-1-1-1-1-2-1-1-1-1-%d-1-%d"
-#define GRST_ASN1_COORDS_TIME1 "-1-1-1-1-6-1"
-#define GRST_ASN1_COORDS_TIME2 "-1-1-1-1-6-2"
+#define GRST_ASN1_COORDS_FQAN "-1-1-%d-1-7-1-2-1-2-%d"
+#define GRST_ASN1_COORDS_USER_DN "-1-1-%d-1-2-1-1-1-1-%%d-1-%%d"
+#define GRST_ASN1_COORDS_TIME1 "-1-1-%d-1-6-1"
+#define GRST_ASN1_COORDS_TIME2 "-1-1-%d-1-6-2"
ASN1_OCTET_STRING *asn1data;
- char *asn1string, s[81], acuserdn[200], acvomsdn[200];
+ char *asn1string, acuserdn[200], acvomsdn[200],
+ dn_coords[200], fqan_coords[200], time1_coords[200],
+ time2_coords[200];
long asn1length;
- int lasttag=-1, itag, i;
+ int lasttag=-1, itag, i, acnumber = 1;
struct GRSTasn1TagList taglist[MAXTAG+1];
time_t actime1, actime2, time_now;
GRSTasn1ParseDump(NULL, asn1string, asn1length, taglist, MAXTAG, &lasttag);
- GRSTasn1GetX509Name(acuserdn, sizeof(acuserdn), GRST_ASN1_COORDS_USER_DN,
- asn1string, taglist, lasttag);
- if (GRSTx509NameCmp(ucuserdn, acuserdn) != 0) return GRST_RET_FAILED;
+ for (acnumber = 1; ; ++acnumber) /* go through ACs one by one */
+ {
+ snprintf(dn_coords, sizeof(dn_coords), GRST_ASN1_COORDS_USER_DN, acnumber);
+ if (GRSTasn1GetX509Name(acuserdn, sizeof(acuserdn), dn_coords,
+ asn1string, taglist, lasttag) != GRST_RET_OK) break;
- if (GRSTx509VerifyVomsSig(&time1_time, &time2_time,
- asn1string, taglist, lasttag, vomsdir)
- != GRST_RET_OK) return GRST_RET_FAILED;
+ if (GRSTx509NameCmp(ucuserdn, acuserdn) != 0) continue;
- itag = GRSTasn1SearchTaglist(taglist, lasttag, GRST_ASN1_COORDS_TIME1);
- actime1 = GRSTasn1TimeToTimeT(&asn1string[taglist[itag].start+
- taglist[itag].headerlength],
- taglist[itag].length);
- if (actime1 > time1_time) time1_time = actime1;
+ if (GRSTx509VerifyVomsSig(&time1_time, &time2_time,
+ asn1string, taglist, lasttag, vomsdir, acnumber)
+ != GRST_RET_OK) continue;
- itag = GRSTasn1SearchTaglist(taglist, lasttag, GRST_ASN1_COORDS_TIME2);
- actime2 = GRSTasn1TimeToTimeT(&asn1string[taglist[itag].start+
+ snprintf(time1_coords, sizeof(time1_coords), GRST_ASN1_COORDS_TIME1, acnumber);
+ itag = GRSTasn1SearchTaglist(taglist, lasttag, time1_coords);
+ actime1 = GRSTasn1TimeToTimeT(&asn1string[taglist[itag].start+
taglist[itag].headerlength],
taglist[itag].length);
- if (actime2 < time2_time) time2_time = actime2;
+ if (actime1 > time1_time) time1_time = actime1;
- time(&time_now);
- if ((time1_time > time_now) || (time2_time < time_now))
- return GRST_RET_OK; /* expiration isnt invalidity ...? */
+ snprintf(time2_coords, sizeof(time2_coords), GRST_ASN1_COORDS_TIME2, acnumber);
+ itag = GRSTasn1SearchTaglist(taglist, lasttag, time2_coords);
+ actime2 = GRSTasn1TimeToTimeT(&asn1string[taglist[itag].start+
+ taglist[itag].headerlength],
+ taglist[itag].length);
+ if (actime2 < time2_time) time2_time = actime2;
- for (i=1; ; ++i)
- {
- sprintf(s, GRST_ASN1_COORDS_FQAN, i);
- itag = GRSTasn1SearchTaglist(taglist, lasttag, s);
+ time(&time_now);
+ if ((time1_time > time_now) || (time2_time < time_now))
+ continue; /* expiration isnt invalidity ...? */
- if (itag > -1)
- {
- if (*lastcred < maxcreds - 1)
- {
- ++(*lastcred);
+ for (i=1; ; ++i)
+ {
+ snprintf(fqan_coords, sizeof(fqan_coords), GRST_ASN1_COORDS_FQAN, acnumber, i);
+ itag = GRSTasn1SearchTaglist(taglist, lasttag, fqan_coords);
- snprintf(&creds[*lastcred * (credlen + 1)], credlen+1,
+ if (itag > -1)
+ {
+ if (*lastcred < maxcreds - 1)
+ {
+ ++(*lastcred);
+ snprintf(&creds[*lastcred * (credlen + 1)], credlen+1,
"VOMS %010lu %010lu 0 %.*s",
time1_time, time2_time,
taglist[itag].length,
&asn1string[taglist[itag].start+
taglist[itag].headerlength]);
- }
- }
- else break;
+ }
+ }
+ else break;
+ }
}
-
+
return GRST_RET_OK;
}
*/
int GRSTx509CompactCreds(int *lastcred, int maxcreds, size_t credlen,
- char *creds, STACK_OF(X509) *certstack, char *vomsdir)
+ char *creds, STACK_OF(X509) *certstack, char *vomsdir,
+ X509 *peercert)
{
int i, j, delegation = 0;
char credtemp[credlen+1];
/* found the 1st non-CA cert */
}
+ if (peercert != NULL)
+ {
+ if (usercert != NULL) /* found a (GSI proxy) cert after user cert */
+ {
+ gsiproxycert = peercert;
+ ++delegation;
+ }
+
+ if ((usercert == NULL) &&
+ (GRSTx509IsCA(peercert) != GRST_RET_OK)) usercert = peercert;
+ /* found the 1st non-CA cert */
+ }
+
if ((usercert == NULL) /* if no usercert ("EEC"), we're not interested */
||
(snprintf(credtemp, credlen+1, "X509USER %010lu %010lu %d %s",
}
/******************************************************************************
+Based on gridmapdir_userid:
+
Function: gridmapdir_userid
Description:
This is equivalent to globus_gss_assist_gridmap but for the dynamic
int GRSTexecGetMapping(char **target_uname, char **target_gname,
char *mapdir, char *key)
{
- char *encodedkey;
+ char *encodedkey;
+ struct passwd *pw = NULL;
if (key[0] != '/') return 1; /* must be a proper X.509 DN or path */
encodedkey = mapdir_urlencode(key);
-log_err("encodedkey=%s\n", encodedkey);
*target_uname = mapdir_otherlink(mapdir, encodedkey);
-log_err("*target_uname=%s\n", *target_uname);
if (*target_uname == NULL) /* maybe no lease yet */
{
free(encodedkey);
-// nasty hack for now
-*target_gname = strdup(*target_uname);
-
+ /*
+ * Get the group name of target user.
+ (Contributed by Gerben Venekamp venekamp@nikhef.nl )
+ */
+
+ if ((pw = getpwnam(*target_uname)) != NULL)
+ {
+ struct group grp = { NULL, NULL, -1, NULL };
+ struct group *tst = NULL;
+ char tmp_buf[100];
+
+ /*
+ * NOTE: Do not use the getgrgid() function call! Calling this function
+ * will overwrite the contents of the internal buffer associated with
+ * this call. Hence, further down the execution path we will run into
+ * a wall, head first; simply because the guid has changed to that of
+ * the targer uid. The only solution out of the situation is avoiding
+ * the function call and manage the needed buffers ourselves.
+ */
+
+ switch (getgrgid_r(pw->pw_gid, &grp, tmp_buf, sizeof(tmp_buf), &tst))
+ {
+ case 0: /* no error */
+ *target_gname = strdup(grp.gr_name);
+ break;
+ case ERANGE:
+ log_err("The buffer for holding strings is too small "
+ "(%d byte now)\n", sizeof(tmp_buf));
+ break;
+ default:
+ log_err("Could not get group name for user (%s)\n",
+ *target_uname);
+ }
+
+ /* Test if all was well. */
+
+ if (target_gname == NULL)
+ {
+ exit(102);
+ }
+ }
+ else
+ {
+ log_err("Could not get info for the target user (%s)\n",*target_uname);
+ exit(102);
+ }
+
+ log_no_err("target group name determined (%s -> %s)\n",
+ *target_uname, *target_gname);
+
return 0;
}
uid_t httpd_uid; /* uid for AP_HTTPD_USER */
gid_t httpd_gid; /* uid for AP_HTTPD_GROUP */
char *mapping_type; /* suexec / X509DN / directory */
+ char *grst_cred_0; /* GRST_CRED_0 */
char *map_x509dn; /* DN to use as pool acct. key */
char *map_directory; /* directory as pool acct. key */
}
mapping_type = getenv("GRST_EXEC_METHOD");
-// log_err("mapping_type from GRST_EXEC_METHOD=%s\n",mapping_type);
if ((mapping_type == NULL) ||
(mapping_type[0] == '\0') ||
(strcasecmp(mapping_type, "suexec") == 0))
}
else if (strcasecmp(mapping_type, "X509DN") == 0)
{
-// log_err("X509DN mapping type\n");
- if ((map_x509dn = getenv("GRST_CRED_0")) == NULL)
+ if ((grst_cred_0 = getenv("GRST_CRED_0")) == NULL)
map_x509dn = getenv("SSL_CLIENT_S_DN");
+ else map_x509dn = index(grst_cred_0, '/');
if ((map_x509dn == NULL) || (map_x509dn[0] == '\0'))
{
exit(151);
}
- if (GRSTexecGetMapping(&target_uname, &target_gname,
- GRST_EXECMAPDIR, map_x509dn)
+ if (GRSTexecGetMapping(&target_uname, &target_gname,
+ GRST_EXECMAPDIR, map_x509dn)
!= 0)
{
log_err("GRSTexecGetMapping() failed mapping \"%s\"\n",
/*
- Copyright (c) 2002-4, Andrew McNab, University of Manchester
+ Copyright (c) 2002-5, Andrew McNab, University of Manchester
All rights reserved.
Redistribution and use in source and binary forms, with or
#include <string.h>
#include <malloc.h>
#include <dirent.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <sys/time.h>
+#include <sys/select.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
#include <curl/curl.h>
+#include "gridsite.h"
+
/* deal with older versions of libcurl and curl.h */
#ifndef CURLOPT_WRITEDATA
#define HTCP_LIST 4
#define HTCP_LONGLIST 5
#define HTCP_MKDIR 6
+#define HTCP_MOVE 7
+#define HTCP_PING 8
+#define HTCP_FIND 9
+
+#define HTCP_SITECAST_GROUPS 32
+
+#define HTCP_HOST_CONF "/etc/htcp.conf"
+#define HTCP_USER_CONF ".htcp.conf"
struct grst_stream_data { char *source;
char *destination;
char *errorbuf;
int noverify;
int anonymous;
- long long downgrade;
- int verbose; } ;
+ int gridhttp;
+ int verbose;
+ int timeout;
+ char *groups;
+ int sitecast;
+ char *domain; } ;
struct grst_index_blob { char *text;
size_t used;
struct grst_header_data { int retcode;
char *location;
- char *gridauthonetime;
+ char *gridhttponetime;
size_t length;
int length_set;
time_t modified;
int modified_set;
struct grst_stream_data *common_data; } ;
+struct grst_sitecast_group { unsigned char quad1; unsigned char quad2;
+ unsigned char quad3; unsigned char quad4;
+ int port; int timewait; int ttl; };
+
size_t headers_callback(void *ptr, size_t size, size_t nmemb, void *p)
/* Find the values of the return code, Content-Length, Last-Modified
and Location headers */
else if (strncmp(s, "Location: ", 10) == 0)
{
header_data->location = strdup(&s[10]);
+
+ for (q=header_data->location; *q != '\0'; ++q)
+ if ((*q == '\r') || (*q == '\n')) *q = '\0';
if (header_data->common_data->verbose > 0)
fprintf(stderr, "Received Location: %s\n", header_data->location);
}
- else if (strncmp(s, "Set-Cookie: GRID_AUTH_ONETIME=", 30) == 0)
+ else if (strncmp(s, "Set-Cookie: GRIDHTTP_ONETIME=", 29) == 0)
{
- header_data->gridauthonetime = strdup(&s[12]);
- q = index(header_data->gridauthonetime, ';');
+ header_data->gridhttponetime = strdup(&s[12]);
+ q = index(header_data->gridhttponetime, ';');
if (q != NULL) *q = '\0';
if (header_data->common_data->verbose > 0)
- fprintf(stderr, "Received Grid Auth Cookie: %s\n",
- header_data->gridauthonetime);
+ fprintf(stderr, "Received GridHTTP Auth Cookie: %s\n",
+ header_data->gridhttponetime);
}
else if (strncmp(s, "Last-Modified: ", 15) == 0)
{
}
if (common_data->noverify)
- curl_easy_setopt(easyhandle, CURLOPT_SSL_VERIFYHOST, 0);
- else curl_easy_setopt(easyhandle, CURLOPT_SSL_VERIFYHOST, 2);
+ {
+ curl_easy_setopt(easyhandle, CURLOPT_SSL_VERIFYPEER, 0);
+ curl_easy_setopt(easyhandle, CURLOPT_SSL_VERIFYHOST, 0);
+ }
+ else
+ {
+ curl_easy_setopt(easyhandle, CURLOPT_SSL_VERIFYPEER, 2);
+ curl_easy_setopt(easyhandle, CURLOPT_SSL_VERIFYHOST, 2);
+ }
return 1;
}
CURL *easyhandle;
struct stat statbuf;
struct grst_header_data header_data;
- struct curl_slist *dgheader_slist = NULL, *nodgheader_slist = NULL;
+ struct curl_slist *gh_header_slist = NULL, *nogh_header_slist = NULL;
easyhandle = curl_easy_init();
- if (common_data->downgrade >= (long long) 0)
+ if (common_data->gridhttp)
{
- asprintf(&p, "HTTP-Downgrade-Size: %lld", common_data->downgrade);
- dgheader_slist = curl_slist_append(dgheader_slist, p);
+ asprintf(&p, "Upgrade: GridHTTP/1.0");
+ gh_header_slist = curl_slist_append(gh_header_slist, p);
free(p);
- nodgheader_slist = curl_slist_append(nodgheader_slist,
- "HTTP-Downgrade-Size:");
+ nogh_header_slist = curl_slist_append(nogh_header_slist, "Upgrade:");
}
curl_easy_setopt(easyhandle, CURLOPT_USERAGENT, common_data->useragent);
}
if (common_data->verbose > 0)
- fprintf(stderr, "%s -> %s\n", sources[isrc], thisdestination);
+ fprintf(stderr, "Copy %s -> %s\n", sources[isrc], thisdestination);
if (common_data->method == HTCP_GET)
{
curl_easy_setopt(easyhandle, CURLOPT_WRITEDATA, common_data->fp);
curl_easy_setopt(easyhandle, CURLOPT_URL, sources[isrc]);
- if ((common_data->downgrade >= (long long) 0) &&
+ if ((common_data->gridhttp) &&
(strncmp(sources[isrc], "https://", 8) == 0))
{
if (common_data->verbose > 0)
- fprintf(stderr, "Add HTTP-Downgrade-Size: %lld header\n",
- common_data->downgrade);
+ fprintf(stderr, "Add Upgrade: GridHTTP/1.0\n");
- curl_easy_setopt(easyhandle,CURLOPT_HTTPHEADER,dgheader_slist);
+ curl_easy_setopt(easyhandle,CURLOPT_HTTPHEADER,gh_header_slist);
}
else
- curl_easy_setopt(easyhandle,CURLOPT_HTTPHEADER,nodgheader_slist);
+ curl_easy_setopt(easyhandle,CURLOPT_HTTPHEADER,nogh_header_slist);
}
else if (common_data->method == HTCP_PUT)
{
curl_easy_setopt(easyhandle, CURLOPT_INFILESIZE, statbuf.st_size);
curl_easy_setopt(easyhandle, CURLOPT_UPLOAD, 1);
- if (((long long) statbuf.st_size >= common_data->downgrade) &&
+ if ((common_data->gridhttp) &&
(strncmp(thisdestination, "https://", 8) == 0))
- curl_easy_setopt(easyhandle,CURLOPT_HTTPHEADER,dgheader_slist);
+ curl_easy_setopt(easyhandle,CURLOPT_HTTPHEADER,gh_header_slist);
else
- curl_easy_setopt(easyhandle,CURLOPT_HTTPHEADER,nodgheader_slist);
+ curl_easy_setopt(easyhandle,CURLOPT_HTTPHEADER,nogh_header_slist);
}
header_data.retcode = 0;
header_data.location = NULL;
- header_data.gridauthonetime = NULL;
+ header_data.gridhttponetime = NULL;
header_data.common_data = common_data;
thiserror = curl_easy_perform(easyhandle);
fclose(common_data->fp);
- if ((common_data->downgrade >= (long long) 0) &&
+ if ((common_data->gridhttp) &&
(thiserror == 0) &&
(header_data.retcode == 302) &&
(header_data.location != NULL) &&
(strncmp(header_data.location, "http://", 7) == 0) &&
- (header_data.gridauthonetime != NULL))
+ (header_data.gridhttponetime != NULL))
{
if (common_data->verbose > 0)
- fprintf(stderr, "... Found (%d)\nHTTP-Downgrade to %s\n",
+ fprintf(stderr, "... Found (%d)\nGridHTTP redirect to %s\n",
header_data.retcode, header_data.location);
/* try again with new URL and all the previous CURL options */
header_data.retcode = 0;
curl_easy_setopt(easyhandle, CURLOPT_URL, header_data.location);
- curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, nodgheader_slist);
+ curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, nogh_header_slist);
curl_easy_setopt(easyhandle, CURLOPT_COOKIE,
- header_data.gridauthonetime);
+ header_data.gridhttponetime);
thiserror = curl_easy_perform(easyhandle);
fclose(common_data->fp);
return anyerror;
}
+int do_move(char *source, char *destination,
+ struct grst_stream_data *common_data)
+{
+ int anyerror = 0, thiserror;
+ char *destination_header;
+ CURL *easyhandle;
+ struct grst_header_data header_data;
+ struct curl_slist *header_slist = NULL;
+
+ easyhandle = curl_easy_init();
+
+ header_data.common_data = common_data;
+
+ easyhandle = curl_easy_init();
+
+ asprintf(&destination_header, "Destination: %s", destination);
+ header_slist = curl_slist_append(header_slist, destination_header);
+ curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, header_slist);
+
+ curl_easy_setopt(easyhandle, CURLOPT_USERAGENT, common_data->useragent);
+ if (common_data->verbose > 1)
+ curl_easy_setopt(easyhandle, CURLOPT_VERBOSE, 1);
+
+ curl_easy_setopt(easyhandle, CURLOPT_HEADERFUNCTION, headers_callback);
+ curl_easy_setopt(easyhandle, CURLOPT_WRITEHEADER, &header_data);
+
+ curl_easy_setopt(easyhandle, CURLOPT_ERRORBUFFER, common_data->errorbuf);
+ curl_easy_setopt(easyhandle, CURLOPT_CUSTOMREQUEST, "MOVE");
+ curl_easy_setopt(easyhandle, CURLOPT_NOBODY, 1);
+
+ set_std_opts(easyhandle, common_data);
+
+ if (common_data->verbose > 0)
+ fprintf(stderr, "Moving %s to %s\n", source, destination);
+
+ curl_easy_setopt(easyhandle, CURLOPT_URL, source);
+
+ header_data.retcode = 0;
+ thiserror = curl_easy_perform(easyhandle);
+
+ if ((thiserror != 0) ||
+ (header_data.retcode < 200) ||
+ (header_data.retcode >= 300))
+ {
+ fprintf(stderr, "... curl error: %s (%d), HTTP error: %d\n",
+ common_data->errorbuf, thiserror, header_data.retcode);
+
+ if (thiserror != 0) anyerror = thiserror;
+ else anyerror = header_data.retcode;
+ }
+ else if (common_data->verbose > 0)
+ fprintf(stderr, "... OK (%d)\n", header_data.retcode);
+
+ curl_easy_cleanup(easyhandle);
+
+ return anyerror;
+}
+
int do_mkdirs(char *sources[], struct grst_stream_data *common_data)
{
int isrc, anyerror = 0, thiserror;
return anyerror;
}
+int do_ping(struct grst_stream_data *common_data_ptr)
+{
+ int request_length, response_length, i, ret, s, igroup;
+ struct sockaddr_in srv, from;
+ socklen_t fromlen;
+#define MAXBUF 8192
+ char *request, response[MAXBUF], *p;
+ GRSThtcpMessage msg;
+ struct timeval start_timeval, wait_timeval, response_timeval;
+ struct grst_sitecast_group sitecast_groups[HTCP_SITECAST_GROUPS];
+ fd_set readsckts;
+
+ /* parse common_data_ptr->groups */
+
+ p = common_data_ptr->groups;
+ igroup = -1;
+
+ for (igroup=-1; igroup+1 < HTCP_SITECAST_GROUPS; ++igroup)
+ {
+ sitecast_groups[igroup+1].port = GRST_HTCP_PORT;
+ sitecast_groups[igroup+1].timewait = 1;
+ sitecast_groups[igroup+1].ttl = 1;
+
+ ret = sscanf(p, "%d.%d.%d.%d:%d:%d:%d",
+ &(sitecast_groups[igroup+1].quad1),
+ &(sitecast_groups[igroup+1].quad2),
+ &(sitecast_groups[igroup+1].quad3),
+ &(sitecast_groups[igroup+1].quad4),
+ &(sitecast_groups[igroup+1].port),
+ &(sitecast_groups[igroup+1].ttl),
+ &(sitecast_groups[igroup+1].timewait));
+
+ if (ret == 0) break; /* end of list ? */
+
+ if (ret < 5)
+ {
+ fprintf(stderr, "Failed to parse multicast group "
+ "parameter %s\n", p);
+ return CURLE_FAILED_INIT;
+ }
+
+ ++igroup;
+
+ if ((p = index(p, ',')) == NULL) break;
+ ++p;
+ }
+
+ if (igroup == -1)
+ {
+ fprintf(stderr, "Failed to parse multicast group parameter %s\n", p);
+ return CURLE_FAILED_INIT;
+ }
+
+ if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ {
+ fprintf(stderr, "Failed to open UDP socket\n");
+ return CURLE_FAILED_INIT;
+ }
+
+ /* loop through multicast groups and send off the NOP pings */
+
+ gettimeofday(&start_timeval, NULL);
+
+ for (i=0; i <= igroup; ++i)
+ {
+ bzero(&srv, sizeof(srv));
+ srv.sin_family = AF_INET;
+ srv.sin_port = htons(sitecast_groups[i].port);
+ srv.sin_addr.s_addr = htonl(sitecast_groups[i].quad1*0x1000000
+ + sitecast_groups[i].quad2*0x10000
+ + sitecast_groups[i].quad3*0x100
+ + sitecast_groups[i].quad4);
+
+ GRSThtcpNOPrequestMake(&request, &request_length,
+ (int) (start_timeval.tv_usec + i));
+
+ sendto(s, request, request_length, 0, (struct sockaddr *) &srv,
+ sizeof(srv));
+ free(request);
+ }
+
+ /* reusing wait_timeval is a Linux-specific feature of select() */
+ wait_timeval.tv_sec = common_data_ptr->timeout
+ ? common_data_ptr->timeout : 60;
+ wait_timeval.tv_usec = 0;
+
+ while ((wait_timeval.tv_sec > 0) || (wait_timeval.tv_usec > 0))
+ {
+ FD_ZERO(&readsckts);
+ FD_SET(s, &readsckts);
+
+ ret = select(s + 1, &readsckts, NULL, NULL, &wait_timeval);
+ gettimeofday(&response_timeval, NULL);
+
+ if (ret > 0)
+ {
+ response_length = recvfrom(s, response, MAXBUF,
+ 0, &from, &fromlen);
+
+ if ((GRSThtcpMessageParse(&msg, response, response_length)
+ == GRST_RET_OK) &&
+ (msg.opcode == GRSThtcpNOPop) && (msg.rr == 1) &&
+ (msg.trans_id >= (int) start_timeval.tv_usec) &&
+ (msg.trans_id <= (int) (start_timeval.tv_usec + igroup)))
+ {
+ printf("%s:%d %.3fms\n",
+ inet_ntoa(from.sin_addr),
+ ntohs(from.sin_port),
+ (((long) 1000000 * response_timeval.tv_sec) +
+ ((long) response_timeval.tv_usec) -
+ ((long) 1000000 * start_timeval.tv_sec) -
+ ((long) start_timeval.tv_usec)) / 1000.0);
+ }
+ }
+ }
+
+ return GRST_RET_OK;
+}
+
+int do_finds(char *sources[],
+ struct grst_stream_data *common_data_ptr, int num)
+{
+ int isrc;
+
+ int request_length, response_length, i, ret, s, igroup;
+ struct sockaddr_in srv, from;
+ socklen_t fromlen;
+#define MAXBUF 8192
+ char *request, response[MAXBUF], *p;
+ GRSThtcpMessage msg;
+ struct timeval start_timeval, wait_timeval;
+ struct grst_sitecast_group sitecast_groups[HTCP_SITECAST_GROUPS];
+ fd_set readsckts;
+
+ /* parse common_data_ptr->groups */
+
+ if (common_data_ptr->groups == NULL)
+ {
+ fprintf(stderr, "No multicast groups given\n");
+ return CURLE_FAILED_INIT;
+ }
+
+ p = common_data_ptr->groups;
+ igroup = -1;
+
+ for (igroup=-1; igroup+1 < HTCP_SITECAST_GROUPS;)
+ {
+ sitecast_groups[igroup+1].port = GRST_HTCP_PORT;
+ sitecast_groups[igroup+1].timewait = 1;
+ sitecast_groups[igroup+1].ttl = 1;
+
+ ret = sscanf(p, "%d.%d.%d.%d:%d:%d:%d",
+ &(sitecast_groups[igroup+1].quad1),
+ &(sitecast_groups[igroup+1].quad2),
+ &(sitecast_groups[igroup+1].quad3),
+ &(sitecast_groups[igroup+1].quad4),
+ &(sitecast_groups[igroup+1].port),
+ &(sitecast_groups[igroup+1].ttl),
+ &(sitecast_groups[igroup+1].timewait));
+
+ if (ret == 0) break; /* end of list ? */
+
+ if (ret < 5)
+ {
+ fprintf(stderr, "Failed to parse multicast group "
+ "parameter %s\n", p);
+ return CURLE_FAILED_INIT;
+ }
+
+ ++igroup;
+
+ if ((p = index(p, ',')) == NULL) break;
+ ++p;
+ }
+
+ if (igroup == -1)
+ {
+ fprintf(stderr, "Failed to parse multicast group parameter %s\n", p);
+ return CURLE_FAILED_INIT;
+ }
+
+ if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ {
+ fprintf(stderr, "Failed to open UDP socket\n");
+ return CURLE_FAILED_INIT;
+ }
+
+ /* loop through multicast groups since we need to take each
+ ones timewait into account */
+
+ gettimeofday(&start_timeval, NULL);
+
+ for (i=0; i <= igroup; ++i)
+ {
+ if (common_data_ptr->verbose)
+ fprintf(stderr, "Querying multicast group %d.%d.%d.%d:%d:%d:%d\n",
+ sitecast_groups[i].quad1, sitecast_groups[i].quad2,
+ sitecast_groups[i].quad3, sitecast_groups[i].quad4,
+ sitecast_groups[i].port, sitecast_groups[i].ttl,
+ sitecast_groups[i].timewait);
+
+ bzero(&srv, sizeof(srv));
+ srv.sin_family = AF_INET;
+ srv.sin_port = htons(sitecast_groups[i].port);
+ srv.sin_addr.s_addr = htonl(sitecast_groups[i].quad1*0x1000000
+ + sitecast_groups[i].quad2*0x10000
+ + sitecast_groups[i].quad3*0x100
+ + sitecast_groups[i].quad4);
+
+ /* send off queries, one for each source file */
+
+ for (isrc=0; sources[isrc] != NULL; ++isrc)
+ {
+ GRSThtcpTSTrequestMake(&request, &request_length,
+ (int) (start_timeval.tv_usec + isrc),
+ "GET", sources[isrc], "");
+
+ sendto(s, request, request_length, 0,
+ (struct sockaddr *) &srv, sizeof(srv));
+
+ free(request);
+ }
+
+ /* reusing wait_timeval is a Linux-specific feature of select() */
+ wait_timeval.tv_usec = 0;
+ wait_timeval.tv_sec = sitecast_groups[i].timewait;
+
+ while ((wait_timeval.tv_sec > 0) || (wait_timeval.tv_usec > 0))
+ {
+ FD_ZERO(&readsckts);
+ FD_SET(s, &readsckts);
+
+ ret = select(s + 1, &readsckts, NULL, NULL, &wait_timeval);
+
+ if (ret > 0)
+ {
+ response_length = recvfrom(s, response, MAXBUF,
+ 0, &from, &fromlen);
+
+ if ((GRSThtcpMessageParse(&msg, response, response_length)
+ == GRST_RET_OK) &&
+ (msg.opcode == GRSThtcpTSTop) && (msg.rr == 1) &&
+ (msg.trans_id >= (int) start_timeval.tv_usec) &&
+ (msg.trans_id < (int) (start_timeval.tv_usec + num)) &&
+ (msg.resp_hdrs != NULL) &&
+ (GRSThtcpCountstrLen(msg.resp_hdrs) > 12))
+ {
+ if (num > 1) printf("%s -> %.*s\n",
+ sources[msg.trans_id - (int) start_timeval.tv_usec],
+ GRSThtcpCountstrLen(msg.resp_hdrs) - 12,
+ &(msg.resp_hdrs->text[10]));
+ else printf("%.*s\n",
+ GRSThtcpCountstrLen(msg.resp_hdrs) - 12,
+ &(msg.resp_hdrs->text[10]));
+ }
+ }
+ }
+
+ }
+
+ return GRST_RET_OK;
+}
+
+int translate_sitecast_url(char **source_ptr,
+ struct grst_stream_data *common_data_ptr)
+{
+ int request_length, response_length, i, ret, s, igroup;
+ struct sockaddr_in srv, from;
+ socklen_t fromlen;
+#define MAXBUF 8192
+ char *request, response[MAXBUF], *p;
+ GRSThtcpMessage msg;
+ struct timeval start_timeval, wait_timeval;
+ struct grst_sitecast_group sitecast_groups[HTCP_SITECAST_GROUPS];
+ fd_set readsckts;
+
+ /* parse common_data_ptr->groups */
+
+ if (common_data_ptr->groups == NULL)
+ {
+ fprintf(stderr, "No multicast groups given\n");
+ return CURLE_FAILED_INIT;
+ }
+
+ p = common_data_ptr->groups;
+ igroup = -1;
+
+ for (igroup=-1; igroup+1 < HTCP_SITECAST_GROUPS;)
+ {
+ sitecast_groups[igroup+1].port = GRST_HTCP_PORT;
+ sitecast_groups[igroup+1].timewait = 1;
+ sitecast_groups[igroup+1].ttl = 1;
+
+ ret = sscanf(p, "%d.%d.%d.%d:%d:%d:%d",
+ &(sitecast_groups[igroup+1].quad1),
+ &(sitecast_groups[igroup+1].quad2),
+ &(sitecast_groups[igroup+1].quad3),
+ &(sitecast_groups[igroup+1].quad4),
+ &(sitecast_groups[igroup+1].port),
+ &(sitecast_groups[igroup+1].ttl),
+ &(sitecast_groups[igroup+1].timewait));
+
+ if (ret == 0) break; /* end of list ? */
+
+ if (ret < 5)
+ {
+ fprintf(stderr, "Failed to parse multicast group "
+ "parameter %s\n", p);
+ return CURLE_FAILED_INIT;
+ }
+
+ ++igroup;
+
+ if ((p = index(p, ',')) == NULL) break;
+ ++p;
+ }
+
+ if (igroup == -1)
+ {
+ fprintf(stderr, "Failed to parse multicast group parameter %s\n", p);
+ return CURLE_FAILED_INIT;
+ }
+
+ if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ {
+ fprintf(stderr, "Failed to open UDP socket\n");
+ return CURLE_FAILED_INIT;
+ }
+
+ /* loop through multicast groups since we need to take each
+ ones timewait into account */
+
+ gettimeofday(&start_timeval, NULL);
+
+ for (i=0; i <= igroup; ++i)
+ {
+ if (common_data_ptr->verbose)
+ fprintf(stderr, "Querying multicast group %d.%d.%d.%d:%d:%d:%d\n",
+ sitecast_groups[i].quad1, sitecast_groups[i].quad2,
+ sitecast_groups[i].quad3, sitecast_groups[i].quad4,
+ sitecast_groups[i].port, sitecast_groups[i].ttl,
+ sitecast_groups[i].timewait);
+
+ bzero(&srv, sizeof(srv));
+ srv.sin_family = AF_INET;
+ srv.sin_port = htons(sitecast_groups[i].port);
+ srv.sin_addr.s_addr = htonl(sitecast_groups[i].quad1*0x1000000
+ + sitecast_groups[i].quad2*0x10000
+ + sitecast_groups[i].quad3*0x100
+ + sitecast_groups[i].quad4);
+
+ /* send off queries, one for each source file */
+
+ GRSThtcpTSTrequestMake(&request, &request_length,
+ (int) (start_timeval.tv_usec),
+ "GET", *source_ptr, "");
+
+ sendto(s, request, request_length, 0,
+ (struct sockaddr *) &srv, sizeof(srv));
+
+ free(request);
+
+ /* reusing wait_timeval is a Linux-specific feature of select() */
+ wait_timeval.tv_usec = 0;
+ wait_timeval.tv_sec = sitecast_groups[i].timewait;
+
+ while ((wait_timeval.tv_sec > 0) || (wait_timeval.tv_usec > 0))
+ {
+ FD_ZERO(&readsckts);
+ FD_SET(s, &readsckts);
+
+ ret = select(s + 1, &readsckts, NULL, NULL, &wait_timeval);
+
+ if (ret > 0)
+ {
+ response_length = recvfrom(s, response, MAXBUF,
+ 0, &from, &fromlen);
+
+ if ((GRSThtcpMessageParse(&msg, response, response_length)
+ == GRST_RET_OK) &&
+ (msg.opcode == GRSThtcpTSTop) && (msg.rr == 1) &&
+ (msg.trans_id == (int) start_timeval.tv_usec) &&
+ (msg.resp_hdrs != NULL) &&
+ (GRSThtcpCountstrLen(msg.resp_hdrs) > 12))
+ {
+ /* found one */
+
+ if (common_data_ptr->verbose > 0)
+ fprintf(stderr, "Sitecast %s -> %.*s\n",
+ *source_ptr,
+ GRSThtcpCountstrLen(msg.resp_hdrs) - 12,
+ &(msg.resp_hdrs->text[10]));
+
+ free(*source_ptr);
+
+ asprintf(source_ptr, "%.*s",
+ GRSThtcpCountstrLen(msg.resp_hdrs) - 12,
+ &(msg.resp_hdrs->text[10]));
+
+ return GRST_RET_OK;
+ }
+ }
+ }
+
+ }
+
+ return GRST_RET_OK;
+}
+
size_t rawindex_callback(void *ptr, size_t size, size_t nmemb, void *data)
{
if ( ((struct grst_index_blob *) data)->used + size * nmemb >=
curl_easy_setopt(easyhandle, CURLOPT_NOBODY, 1);
}
- header_data.gridauthonetime = NULL;
+ header_data.gridhttponetime = NULL;
header_data.length_set = 0;
header_data.modified_set = 0;
header_data.retcode = 0;
asprintf(&s, "%s%s", sources[isrc], list[i].filename);
curl_easy_setopt(easyhandle, CURLOPT_URL, s);
- header_data.gridauthonetime = NULL;
+ header_data.gridhttponetime = NULL;
header_data.length_set = 0;
header_data.modified_set = 0;
header_data.retcode = 0;
"(Version: %s)\n", p, p, VERSION);
}
-int main(int argc, char *argv[])
-{
- char **sources, *destination = NULL, *executable, *p;
- int c, i, option_index, anyerror;
- struct stat statbuf;
- struct grst_stream_data common_data;
- struct passwd *userpasswd;
- struct option long_options[] = { {"verbose", 0, 0, 'v'},
+struct option long_options[] = { {"verbose", 0, 0, 'v'},
{"cert", 1, 0, 0},
{"key", 1, 0, 0},
{"capath", 1, 0, 0},
{"mkdir", 0, 0, 0},
{"no-verify", 0, 0, 0},
{"anon", 0, 0, 0},
- {"downgrade-size", 1, 0, 0},
-// {"streams", 1, 0, 0},
-// {"blocksize", 1, 0, 0},
-// {"recursive", 0, 0, 0},
+ {"grid-http", 0, 0, 0},
+ {"move", 0, 0, 0},
+ {"ping", 0, 0, 0},
+ {"groups", 1, 0, 0},
+ {"timeout", 1, 0, 0},
+ {"sitecast", 0, 0, 0},
+ {"domain", 1, 0, 0},
+ {"find", 0, 0, 0},
+ {"conf", 1, 0, 0},
{0, 0, 0, 0} };
+int update_common_data(struct grst_stream_data *, int, char *);
+
+void parse_conf(struct grst_stream_data *common_data_ptr, char *conf_file)
+{
+ int option_index;
+ char line[1001], *p;
+ FILE *fp;
+
+ fp = fopen(conf_file, "r");
+ if (fp == NULL)
+ {
+ if (common_data_ptr->verbose)
+ fprintf(stderr, "Failed to open configuration file %s\n", conf_file);
+ return;
+ }
+
+ if (common_data_ptr->verbose)
+ fprintf(stderr, "Opened configuration file %s\n", conf_file);
+
+ while (fgets(line, sizeof(line), fp) != NULL)
+ {
+ if ((p = index(line, '\n')) != NULL) *p = '\0';
+
+ for (option_index=0;
+ long_options[option_index].name != NULL; ++option_index)
+ {
+ if (long_options[option_index].has_arg &&
+ (strncmp(line, long_options[option_index].name,
+ strlen(long_options[option_index].name)) == 0) &&
+ (line[strlen(long_options[option_index].name)] == '='))
+ {
+ update_common_data(common_data_ptr, option_index,
+ strdup(&line[strlen(long_options[option_index].name) + 1]));
+ break;
+ }
+
+ if (!long_options[option_index].has_arg &&
+ (strcmp(line, long_options[option_index].name) == 0))
+ {
+ update_common_data(common_data_ptr, option_index, "");
+ break;
+ }
+ }
+ }
+
+ fclose(fp);
+}
+
+int update_common_data(struct grst_stream_data *common_data_ptr,
+ int option_index, char *optarg)
+{
+ if (option_index == 1) common_data_ptr->cert = optarg;
+ else if (option_index == 2) common_data_ptr->key = optarg;
+ else if (option_index == 3) common_data_ptr->capath = optarg;
+ else if (option_index == 4) common_data_ptr->method = HTCP_DELETE;
+ else if (option_index == 5) common_data_ptr->method = HTCP_LIST;
+ else if (option_index == 6) common_data_ptr->method = HTCP_LONGLIST;
+ else if (option_index == 7) common_data_ptr->method = HTCP_MKDIR;
+ else if (option_index == 8) common_data_ptr->noverify = 1;
+ else if (option_index == 9) common_data_ptr->anonymous = 1;
+ else if (option_index ==10) common_data_ptr->gridhttp = 1;
+ else if (option_index ==11) common_data_ptr->method = HTCP_MOVE;
+ else if (option_index ==12) common_data_ptr->method = HTCP_PING;
+ else if (option_index ==13) common_data_ptr->groups = optarg;
+ else if (option_index ==14) common_data_ptr->timeout = atoi(optarg);
+ else if (option_index ==15) common_data_ptr->sitecast = 1;
+ else if (option_index ==16) { common_data_ptr->sitecast = 1;
+ common_data_ptr->domain = optarg; }
+ else if (option_index ==17) common_data_ptr->method = HTCP_FIND;
+ /* option_index == 18 is used by the --conf command line-only option */
+ else return GRST_RET_FAILED;
+
+ return GRST_RET_OK;
+}
+
+int main(int argc, char *argv[])
+{
+ char **sources, *destination = NULL, *executable, *p, *htcp_conf;
+ int c, i, option_index, anyerror;
+ struct stat statbuf;
+ struct grst_stream_data common_data;
+ struct grst_sitecast_group sitecast_groups[HTCP_SITECAST_GROUPS];
+ struct passwd *userpasswd;
+
#if (LIBCURL_VERSION_NUM < 0x070908)
char *tmp_ca_roots = NULL;
#endif
common_data.verbose = 0;
common_data.noverify = 0;
common_data.anonymous = 0;
- common_data.downgrade = (long long) -1;
+ common_data.gridhttp = 0;
+ common_data.groups = NULL;
+ common_data.timeout = 0;
+ common_data.sitecast = 0;
+ common_data.domain = NULL;
+
+ if ((argc > 1) && ((strcmp(argv[1], "--verbose") == 0) ||
+ (strcmp(argv[1], "-v") == 0))) common_data.verbose = 1;
+
+ /* examine any configuration files */
+
+ parse_conf(&common_data, HTCP_HOST_CONF);
+
+ userpasswd = getpwuid(geteuid());
+ asprintf(&htcp_conf, "%s/%s", userpasswd->pw_dir, HTCP_USER_CONF);
+ parse_conf(&common_data, htcp_conf);
+ free(htcp_conf);
+
+ htcp_conf = getenv("HTCP_CONF");
+ if (htcp_conf != NULL) parse_conf(&common_data, htcp_conf);
+
+ common_data.verbose = 0;
+
while (1)
{
option_index = 0;
if (c == -1) break;
else if (c == 0)
{
- if (option_index == 1) common_data.cert = optarg;
- else if (option_index == 2) common_data.key = optarg;
- else if (option_index == 3) common_data.capath = optarg;
- else if (option_index == 4) common_data.method = HTCP_DELETE;
- else if (option_index == 5) common_data.method = HTCP_LIST;
- else if (option_index == 6) common_data.method = HTCP_LONGLIST;
- else if (option_index == 7) common_data.method = HTCP_MKDIR;
- else if (option_index == 8) common_data.noverify = 1;
- else if (option_index == 9) common_data.anonymous = 1;
- else if (option_index ==10) common_data.downgrade = atoll(optarg);
+ if (option_index == 18) parse_conf(&common_data, optarg);
+ else update_common_data(&common_data, option_index, optarg);
}
else if (c == 'v') ++(common_data.verbose);
}
common_data.cert = getenv("X509_USER_CERT");
common_data.key = getenv("X509_USER_KEY");
- userpasswd = getpwuid(geteuid());
-
if ((common_data.cert == NULL) &&
(userpasswd != NULL) &&
(userpasswd->pw_dir != NULL))
else if (strcmp(executable,"htll")==0) common_data.method=HTCP_LONGLIST;
else if (strcmp(executable,"htrm")==0) common_data.method=HTCP_DELETE;
else if (strcmp(executable,"htmkdir")==0) common_data.method=HTCP_MKDIR;
+ else if (strcmp(executable,"htmv")==0) common_data.method=HTCP_MOVE;
+ else if (strcmp(executable,"htping")==0) common_data.method=HTCP_PING;
+ else if (strcmp(executable,"htfind")==0) common_data.method=HTCP_FIND;
+ }
+
+ if (common_data.method == HTCP_PING)
+ {
+ if (common_data.groups != NULL) return do_ping(&common_data);
+
+ fprintf(stderr, "Must specify at least one multicast group\n\n");
+ printsyntax(argv[0]);
+ return CURLE_FAILED_INIT;
}
if ((common_data.method == HTCP_DELETE) ||
(common_data.method == HTCP_LIST) ||
+ (common_data.method == HTCP_FIND) ||
(common_data.method == HTCP_MKDIR) ||
(common_data.method == HTCP_LONGLIST))
{
printsyntax(argv[0]);
return CURLE_URL_MALFORMAT;
}
-
+
sources = (char **) malloc(sizeof(char *) * (1 + argc - optind));
for (i=0; i < argc - optind; ++i)
{
anyerror = do_deletes(sources, &common_data);
else if (common_data.method == HTCP_MKDIR)
anyerror = do_mkdirs(sources, &common_data);
+ else if (common_data.method == HTCP_FIND)
+ anyerror = do_finds(sources, &common_data, argc - optind);
else if (common_data.method == HTCP_LONGLIST)
anyerror = do_listings(sources, &common_data, 1);
else anyerror = do_listings(sources, &common_data, 0);
return anyerror;
}
+ if (common_data.method == HTCP_MOVE)
+ {
+ if (optind >= argc - 1)
+ {
+ fputs("Must give exactly 2 non-option arguments\n\n", stderr);
+ printsyntax(argv[0]);
+ return CURLE_URL_MALFORMAT;
+ }
+
+ anyerror = do_move(argv[optind], argv[optind + 1], &common_data);
+
+ if (anyerror > 99) anyerror = CURLE_HTTP_RETURNED_ERROR;
+
+ return anyerror;
+ }
+
if (optind >= argc - 1)
{
fputs("Must give at least 2 non-option arguments\n\n", stderr);
for (i=0; i < (argc - optind - 1); ++i)
{
if (strncmp(argv[optind + i], "file:", 5) == 0)
- sources[i] = &argv[optind + i][5];
- else sources[i] = argv[optind + i];
+ sources[i] = strdup(&argv[optind + i][5]);
+ else sources[i] = strdup(argv[optind + i]);
if (sources[i][0] == '\0')
{
sources[i] = NULL;
- if (strncmp(argv[optind + i], "file:", 5) == 0)
- destination = &argv[optind + i][5];
- else destination = argv[optind + i];
+ if (strncmp(argv[optind+i], "file:", 5) == 0)
+ {
+ if ((argv[optind+i][strlen(argv[optind+i]) - 1] != '/') &&
+ (stat(&argv[optind + i][5], &statbuf) == 0) &&
+ S_ISDIR(statbuf.st_mode))
+ asprintf(&destination, "%s/", &argv[optind + i][5]);
+ else destination = strdup(&argv[optind + i][5]);
+ }
+ else if ((strncmp(argv[optind+i], "http://", 7) != 0) &&
+ (strncmp(argv[optind+i], "https://", 8) != 0))
+ {
+ if ((argv[optind+i][strlen(argv[optind+i]) - 1] != '/') &&
+ (stat(argv[optind+i], &statbuf) == 0) &&
+ S_ISDIR(statbuf.st_mode))
+ asprintf(&destination, "%s/", argv[optind+i]);
+ else destination = strdup(argv[optind+i]);
+ }
+ else destination = strdup(argv[optind+i]);
if (destination[0] == '\0')
{
return CURLE_URL_MALFORMAT;
}
- if ((common_data.method == HTCP_GET) &&
- ((strncmp(sources[i], "http://", 7) != 0) &&
- (strncmp(sources[i], "https://", 8) != 0)))
+ if (common_data.method == HTCP_GET)
{
- fputs("Cannot have both source and "
+ if ((strncmp(sources[i], "http://", 7) != 0) &&
+ (strncmp(sources[i], "https://", 8) != 0))
+ {
+ fputs("Cannot have both source and "
"destination local (for now)\n\n",stderr);
- printsyntax(argv[0]);
- return CURLE_URL_MALFORMAT;
+ printsyntax(argv[0]);
+ return CURLE_URL_MALFORMAT;
+ }
+
+ if ((common_data.sitecast) &&
+ ((common_data.domain == NULL) ||
+
+ ((strncmp(sources[i], "http://", 7) == 0) &&
+ (strncmp(&sources[i][7], common_data.domain,
+ strlen(common_data.domain)) == 0) &&
+ ((sources[i][7+strlen(common_data.domain)] == ':') ||
+ (sources[i][7+strlen(common_data.domain)] == '/'))) ||
+
+ ((strncmp(sources[i], "https://", 8) == 0) &&
+ (strncmp(&sources[i][8], common_data.domain,
+ strlen(common_data.domain)) == 0) &&
+ ((sources[i][8+strlen(common_data.domain)] == ':') ||
+ (sources[i][8+strlen(common_data.domain)] == '/')))))
+ {
+ translate_sitecast_url(&sources[i], &common_data);
+ }
}
}
/*
- Copyright (c) 2003-5, Andrew McNab and Shiv Kaushal, University of Manchester
- All rights reserved.
+ Copyright (c) 2003-5, Andrew McNab and Shiv Kaushal,
+ University of Manchester. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
#endif
#include <apr_strings.h>
+#include <apr_tables.h>
#include <ap_config.h>
#include <httpd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <netdb.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
+#include <sys/select.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
#include <libxml/parser.h>
#include <libxml/tree.h>
module AP_MODULE_DECLARE_DATA gridsite_module;
+#define GRST_SITECAST_GROUPS 32
+
+struct sitecast_group
+ { int socket; int quad1; int quad2; int quad3; int quad4; int port; };
+
+#define GRST_SITECAST_ALIASES 32
+
+struct sitecast_alias
+ { const char *sitecast_url; const char *local_path; server_rec *server; };
+
+/* Globals, defined by main server directives in httpd.conf
+ These are assigned default values in create_gridsite_srv_config() */
+
+int gridhttpport = 0;
+char *onetimesdir = NULL;
+char *sitecastdnlists = NULL;
+struct sitecast_group sitecastgroups[GRST_SITECAST_GROUPS+1];
+struct sitecast_alias sitecastaliases[GRST_SITECAST_ALIASES];
+
typedef struct
{
int auth;
char *editable;
char *headfile;
char *footfile;
- int downgrade;
- char *authcookiesdir;
+ int gridhttp;
int soap2cgi;
char *aclformat;
char *execmethod;
ap_unix_identity_t execugid;
apr_fileperms_t diskmode;
-} mod_gridsite_cfg; /* per-directory config choices */
-
+} mod_gridsite_dir_cfg; /* per-directory config choices */
typedef struct
{
static void mod_gridsite_soap2cgi_insert(request_rec *r)
{
- mod_gridsite_cfg *conf;
+ mod_gridsite_dir_cfg *conf;
soap2cgi_ctx *ctx;
- conf = (mod_gridsite_cfg *) ap_get_module_config(r->per_dir_config,
+ conf = (mod_gridsite_dir_cfg *) ap_get_module_config(r->per_dir_config,
&gridsite_module);
if (conf->soap2cgi)
return APR_SUCCESS;
}
-char *make_admin_footer(request_rec *r, mod_gridsite_cfg *conf,
+char *make_admin_footer(request_rec *r, mod_gridsite_dir_cfg *conf,
int isdirectory)
/*
make string holding last modified text and admin links
return out;
}
-int html_format(request_rec *r, mod_gridsite_cfg *conf)
+int html_format(request_rec *r, mod_gridsite_dir_cfg *conf)
/*
try to do GridSite formatting of .html files (NOT .shtml etc)
*/
return OK;
}
-int html_dir_list(request_rec *r, mod_gridsite_cfg *conf)
+int html_dir_list(request_rec *r, mod_gridsite_dir_cfg *conf)
/*
output HTML directory listing, with level of formatting controlled
by GridSiteHtmlFormat/conf->format
return OK;
}
-int http_downgrade(request_rec *r, mod_gridsite_cfg *conf)
+int http_gridhttp(request_rec *r, mod_gridsite_dir_cfg *conf)
{
int i;
char *httpurl, *filetemplate, *cookievalue, *envname_i,
sizeof(gridauthcookie))
!= APR_SUCCESS) return HTTP_INTERNAL_SERVER_ERROR;
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "Generated GridHTTP onetime passcode %016llx", gridauthcookie);
+
filetemplate = apr_psprintf(r->pool, "%s/%016llxXXXXXX",
- ap_server_root_relative(r->pool,
- conf->authcookiesdir),
- gridauthcookie);
-
+ ap_server_root_relative(r->pool,
+ onetimesdir),
+ gridauthcookie);
+
if (apr_file_mktemp(&fp,
filetemplate,
APR_CREATE | APR_WRITE | APR_EXCL,
r->pool)
!= APR_SUCCESS) return HTTP_INTERNAL_SERVER_ERROR;
+
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "Created passcode file %s", filetemplate);
expires_time = apr_time_now() + apr_time_from_sec(300);
/* onetime cookies are valid for only 5 mins! */
- apr_file_printf(fp, "expires=%lu\ndomain=%s\npath=%s\nonetime=yes\n",
- (time_t) apr_time_sec(expires_time), r->hostname, r->uri);
+ apr_file_printf(fp,
+ "expires=%lu\ndomain=%s\npath=%s\nonetime=yes\nmethod=%s\n",
+ (time_t) apr_time_sec(expires_time),
+ r->hostname, r->uri, r->method);
+ /* above variables are evaluated in order and method= MUST be last! */
for (i=0; ; ++i)
{
apr_table_add(r->headers_out,
apr_pstrdup(r->pool, "Set-Cookie"),
apr_psprintf(r->pool,
- "GRID_AUTH_ONETIME=%s; "
+ "GRIDHTTP_ONETIME=%s; "
"expires=%s; "
"domain=%s; "
"path=%s",
cookievalue, expires_str, r->hostname, r->uri));
-
- httpurl = apr_pstrcat(r->pool, "http://", r->hostname,
- ap_escape_uri(r->pool, r->uri), NULL);
+
+ if (gridhttpport != DEFAULT_HTTP_PORT)
+ httpurl = apr_psprintf(r->pool, "http://%s:%d%s", r->hostname,
+ gridhttpport, ap_escape_uri(r->pool, r->uri));
+ else httpurl = apr_pstrcat(r->pool, "http://", r->hostname,
+ ap_escape_uri(r->pool, r->uri), NULL);
+
apr_table_setn(r->headers_out, apr_pstrdup(r->pool, "Location"), httpurl);
r->status = HTTP_MOVED_TEMPORARILY;
return OK;
}
-int http_put_method(request_rec *r, mod_gridsite_cfg *conf)
+int http_put_method(request_rec *r, mod_gridsite_dir_cfg *conf)
{
char buf[2048];
size_t length;
/* *** otherwise assume trying to create a regular file *** */
- if (apr_file_open(&fp, r->filename, APR_WRITE | APR_CREATE | APR_BUFFERED,
+ if (apr_file_open(&fp, r->filename,
+ APR_WRITE | APR_CREATE | APR_BUFFERED | APR_TRUNCATE,
conf->diskmode, r->pool) != 0) return HTTP_INTERNAL_SERVER_ERROR;
/* we force the permissions, rather than accept any existing ones */
apr_file_perms_set(r->filename, conf->diskmode);
// TODO: need to add Range: support at some point too
+// Also return 201 Created rather than 200 OK if not already existing
retcode = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK);
if (retcode == OK)
return retcode;
}
-int http_delete_method(request_rec *r, mod_gridsite_cfg *conf)
+int http_delete_method(request_rec *r, mod_gridsite_dir_cfg *conf)
{
- if (remove(r->filename) != 0) return HTTP_FORBIDDEN;
+ if (apr_file_remove(r->filename, r->pool) != 0) return HTTP_FORBIDDEN;
ap_set_content_length(r, 0);
ap_set_content_type(r, "text/html");
return OK;
}
-static int mod_gridsite_dir_handler(request_rec *r, mod_gridsite_cfg *conf)
+int http_move_method(request_rec *r, mod_gridsite_dir_cfg *conf)
+{
+ char *destination_translated = NULL;
+
+ if (r->notes != NULL) destination_translated =
+ (char *) apr_table_get(r->notes, "GRST_DESTINATION_TRANSLATED");
+
+
+ if ((destination_translated == NULL) ||
+ (apr_file_rename(r->filename, destination_translated, r->pool) != 0))
+ return HTTP_FORBIDDEN;
+
+ ap_set_content_length(r, 0);
+ ap_set_content_type(r, "text/html");
+
+ return OK;
+}
+
+static int mod_gridsite_dir_handler(request_rec *r, mod_gridsite_dir_cfg *conf)
/*
handler switch for directories
*/
return DECLINED; /* *** nothing to see here, move along *** */
}
-static int mod_gridsite_nondir_handler(request_rec *r, mod_gridsite_cfg *conf)
+static int mod_gridsite_nondir_handler(request_rec *r, mod_gridsite_dir_cfg *conf)
/*
one big handler switch for everything other than directories, since we
might be responding to MIME * / * for local PUT, MOVE, COPY and DELETE,
and GET inside ghost directories.
*/
{
- char *downgradesize;
- apr_off_t numericsize;
+ char *upgradeheader, *upgradespaced, *p;
+ const char *https_env;
- /* *** is this a write method or HTTP downgrade?
+ /* *** is this a write method or GridHTTP HTTPS->HTTP redirection?
only possible if GridSiteAuth on *** */
if (conf->auth)
{
- if ((conf->downgrade) &&
- ((downgradesize = (char *) apr_table_get(r->headers_in,
- "HTTP-Downgrade-Size")) != NULL) &&
- ((numericsize = (apr_off_t) atoll(downgradesize)) >= 0) &&
+ if ((conf->gridhttp) &&
+ ((r->method_number == M_GET) ||
+ ((r->method_number == M_PUT) &&
+ (strstr(conf->methods, " PUT ") != NULL))) &&
+ ((upgradeheader = (char *) apr_table_get(r->headers_in,
+ "Upgrade")) != NULL) &&
+ ((https_env=apr_table_get(r->subprocess_env,"HTTPS")) != NULL) &&
+ (strcasecmp(https_env, "on") == 0))
+ {
+ upgradespaced = apr_psprintf(r->pool, " %s ", upgradeheader);
+
+ for (p=upgradespaced; *p != '\0'; ++p)
+ if ((*p == ',') || (*p == '\t')) *p = ' ';
// TODO: what if we're pointing at a CGI or some dynamic content???
- (((r->method_number == M_GET) && (r->finfo.size >= numericsize))
- || (r->method_number == M_PUT)) &&
+
+ if (strstr(upgradespaced, " GridHTTP/1.0 ") != NULL)
+ return http_gridhttp(r, conf);
+ }
- (strcasecmp(apr_table_get(r->subprocess_env, "HTTPS"), "on") == 0))
- return http_downgrade(r, conf);
-
if ((r->method_number == M_PUT) &&
(conf->methods != NULL) &&
(strstr(conf->methods, " PUT " ) != NULL))
(conf->methods != NULL) &&
(strstr(conf->methods, " DELETE ") != NULL))
return http_delete_method(r, conf);
+
+ if ((r->method_number == M_MOVE) &&
+ (conf->methods != NULL) &&
+ (strstr(conf->methods, " MOVE ") != NULL))
+ return http_move_method(r, conf);
}
/* *** check if a special ghost admin CGI *** */
}
static int mod_gridsite_dnlistsuri_dir_handler(request_rec *r,
- mod_gridsite_cfg *conf)
+ mod_gridsite_dir_cfg *conf)
/*
virtual DN-list file lister: make all DN lists on the dn-lists
path of this server appear to be in the dn-lists directory itself
}
static int mod_gridsite_dnlistsuri_handler(request_rec *r,
- mod_gridsite_cfg *conf)
+ mod_gridsite_dir_cfg *conf)
/*
virtual DN-list file generator
*/
return HTTP_NOT_FOUND;
}
+static void *create_gridsite_srv_config(apr_pool_t *p, server_rec *s)
+{
+ int i;
+
+ if (!(s->is_virtual))
+ {
+ gridhttpport = GRST_HTTP_PORT;
+
+ onetimesdir = apr_pstrdup(p, "/var/www/onetimes");
+ /* GridSiteOnetimesDir dir-path */
+
+ sitecastdnlists = NULL;
+
+ sitecastgroups[0].quad1 = 0;
+ sitecastgroups[0].quad2 = 0;
+ sitecastgroups[0].quad3 = 0;
+ sitecastgroups[0].quad4 = 0;
+ sitecastgroups[0].port = GRST_HTCP_PORT;
+ /* GridSiteCastUniPort udp-port */
+
+ for (i=1; i <= GRST_SITECAST_GROUPS; ++i)
+ sitecastgroups[i].port = 0;
+ /* GridSiteCastGroup mcast-list */
+
+ for (i=1; i <= GRST_SITECAST_ALIASES; ++i)
+ {
+ sitecastaliases[i].sitecast_url = NULL;
+ sitecastaliases[i].local_path = NULL;
+ sitecastaliases[i].server = NULL;
+ } /* GridSiteCastAlias url path */
+ }
+
+ return NULL;
+}
+
static void *create_gridsite_dir_config(apr_pool_t *p, char *path)
{
- mod_gridsite_cfg *conf = apr_palloc(p, sizeof(*conf));
+ mod_gridsite_dir_cfg *conf = apr_palloc(p, sizeof(*conf));
- if (path == NULL) /* set up server defaults */
+ if (path == NULL) /* set up document root defaults */
{
conf->auth = 0; /* GridSiteAuth on/off */
conf->envs = 1; /* GridSiteEnvs on/off */
conf->footfile = apr_pstrdup(p, GRST_FOOTFILE);
/* GridSiteHeadFile and GridSiteFootFile file name */
- conf->downgrade = 0; /* GridSiteDowngrade on/off */
- conf->authcookiesdir = apr_pstrdup(p, "gridauthcookies");
- /* GridSiteAuthCookiesDir dir-path */
+ conf->gridhttp = 0; /* GridSiteGridHTTP on/off */
conf->soap2cgi = 0; /* GridSiteSoap2cgi on/off */
conf->aclformat = apr_pstrdup(p, "GACL");
/* GridSiteACLFormat gacl/xacml */
conf->editable = NULL; /* GridSiteEditable types */
conf->headfile = NULL; /* GridSiteHeadFile file name */
conf->footfile = NULL; /* GridSiteFootFile file name */
- conf->downgrade = UNSET; /* GridSiteDowngrade on/off */
- conf->authcookiesdir= NULL; /* GridSiteAuthCookiesDir dir-path */
+ conf->gridhttp = UNSET; /* GridSiteGridHTTP on/off */
conf->soap2cgi = UNSET; /* GridSiteSoap2cgi on/off */
conf->aclformat = NULL; /* GridSiteACLFormat gacl/xacml */
conf->execmethod = NULL; /* GridSiteExecMethod */
void *vdirect)
/* merge directory with server-wide directory configs */
{
- mod_gridsite_cfg *conf, *server, *direct;
+ mod_gridsite_dir_cfg *conf, *server, *direct;
- server = (mod_gridsite_cfg *) vserver;
- direct = (mod_gridsite_cfg *) vdirect;
+ server = (mod_gridsite_dir_cfg *) vserver;
+ direct = (mod_gridsite_dir_cfg *) vdirect;
conf = apr_palloc(p, sizeof(*conf));
if (direct->auth != UNSET) conf->auth = direct->auth;
if (direct->footfile != NULL) conf->footfile = direct->footfile;
else conf->footfile = server->footfile;
- if (direct->downgrade != UNSET) conf->downgrade = direct->downgrade;
- else conf->downgrade = server->downgrade;
-
- if (direct->authcookiesdir != NULL)
- conf->authcookiesdir = direct->authcookiesdir;
- else conf->authcookiesdir = server->authcookiesdir;
+ if (direct->gridhttp != UNSET) conf->gridhttp = direct->gridhttp;
+ else conf->gridhttp = server->gridhttp;
if (direct->soap2cgi != UNSET) conf->soap2cgi = direct->soap2cgi;
else conf->soap2cgi = server->soap2cgi;
static const char *mod_gridsite_take1_cmds(cmd_parms *a, void *cfg,
const char *parm)
{
- int n;
+ int n, i;
char *p;
- if (strcasecmp(a->cmd->name, "GridSiteAdminFile") == 0)
+ if (strcasecmp(a->cmd->name, "GridSiteOnetimesDir") == 0)
+ {
+ if (a->server->is_virtual)
+ return "GridSiteOnetimesDir cannot be used inside a virtual server";
+
+ onetimesdir = apr_pstrdup(a->pool, parm);
+ }
+ else if (strcasecmp(a->cmd->name, "GridSiteGridHTTPport") == 0)
+ {
+ gridhttpport = atoi(parm);
+ }
+ else if (strcasecmp(a->cmd->name, "GridSiteCastDNlists") == 0)
+ {
+ if (a->server->is_virtual)
+ return "GridSiteDNlists cannot be used inside a virtual server";
+
+ sitecastdnlists = apr_pstrdup(a->pool, parm);
+ }
+ else if (strcasecmp(a->cmd->name, "GridSiteCastUniPort") == 0)
+ {
+ if (a->server->is_virtual)
+ return "GridSiteCastUniPort cannot be used inside a virtual server";
+
+ if (sscanf(parm, "%d", &(sitecastgroups[0].port)) != 1)
+ return "Failed parsing GridSiteCastUniPort numeric value";
+ }
+ else if (strcasecmp(a->cmd->name, "GridSiteCastGroup") == 0)
+ {
+ if (a->server->is_virtual)
+ return "GridSiteCastGroup cannot be used inside a virtual server";
+
+ for (i=1; i <= GRST_SITECAST_GROUPS; ++i)
+ {
+ if (sitecastgroups[i].port == 0) /* a free slot */
+ {
+ sitecastgroups[i].port = GRST_HTCP_PORT;
+
+ if (sscanf(parm, "%d.%d.%d.%d:%d",
+ &(sitecastgroups[i].quad1),
+ &(sitecastgroups[i].quad2),
+ &(sitecastgroups[i].quad3),
+ &(sitecastgroups[i].quad4),
+ &(sitecastgroups[i].port)) < 4)
+ return "Failed parsing GridSiteCastGroup nnn.nnn.nnn.nnn[:port]";
+
+ break;
+ }
+ }
+
+ if (i > GRST_SITECAST_GROUPS)
+ return "Maximum GridSiteCastGroup groups reached";
+ }
+ else if (strcasecmp(a->cmd->name, "GridSiteAdminFile") == 0)
{
if (index(parm, '/') != NULL)
return "/ not permitted in GridSiteAdminFile";
- ((mod_gridsite_cfg *) cfg)->adminfile =
+ ((mod_gridsite_dir_cfg *) cfg)->adminfile =
apr_pstrdup(a->pool, parm);
}
else if (strcasecmp(a->cmd->name, "GridSiteAdminURI") == 0)
{
if (*parm != '/') return "GridSiteAdminURI must begin with /";
- ((mod_gridsite_cfg *) cfg)->adminuri =
+ ((mod_gridsite_dir_cfg *) cfg)->adminuri =
apr_pstrdup(a->pool, parm);
}
else if (strcasecmp(a->cmd->name, "GridSiteHelpURI") == 0)
{
if (*parm != '/') return "GridSiteHelpURI must begin with /";
- ((mod_gridsite_cfg *) cfg)->helpuri =
+ ((mod_gridsite_dir_cfg *) cfg)->helpuri =
apr_pstrdup(a->pool, parm);
}
else if (strcasecmp(a->cmd->name, "GridSiteDNlists") == 0)
{
- ((mod_gridsite_cfg *) cfg)->dnlists =
+ ((mod_gridsite_dir_cfg *) cfg)->dnlists =
apr_pstrdup(a->pool, parm);
}
else if (strcasecmp(a->cmd->name, "GridSiteDNlistsURI") == 0)
if (*parm != '/') return "GridSiteDNlistsURI must begin with /";
if ((*parm != '\0') && (parm[strlen(parm) - 1] == '/'))
- ((mod_gridsite_cfg *) cfg)->dnlistsuri =
+ ((mod_gridsite_dir_cfg *) cfg)->dnlistsuri =
apr_pstrdup(a->pool, parm);
else
- ((mod_gridsite_cfg *) cfg)->dnlistsuri =
+ ((mod_gridsite_dir_cfg *) cfg)->dnlistsuri =
apr_pstrcat(a->pool, parm, "/", NULL);
}
else if (strcasecmp(a->cmd->name, "GridSiteAdminList") == 0)
{
- ((mod_gridsite_cfg *) cfg)->adminlist =
+ ((mod_gridsite_dir_cfg *) cfg)->adminlist =
apr_pstrdup(a->pool, parm);
}
else if (strcasecmp(a->cmd->name, "GridSiteGSIProxyLimit") == 0)
n = -1;
if ((sscanf(parm, "%d", &n) == 1) && (n >= 0))
- ((mod_gridsite_cfg *) cfg)->gsiproxylimit = n;
+ ((mod_gridsite_dir_cfg *) cfg)->gsiproxylimit = n;
else return "GridSiteGSIProxyLimit must be a number >= 0";
}
else if (strcasecmp(a->cmd->name, "GridSiteUnzip") == 0)
{
if (*parm != '/') return "GridSiteUnzip must begin with /";
- ((mod_gridsite_cfg *) cfg)->unzip =
+ ((mod_gridsite_dir_cfg *) cfg)->unzip =
apr_pstrdup(a->pool, parm);
}
else if (strcasecmp(a->cmd->name, "GridSiteMethods") == 0)
{
- ((mod_gridsite_cfg *) cfg)->methods =
+ ((mod_gridsite_dir_cfg *) cfg)->methods =
apr_psprintf(a->pool, " %s ", parm);
- for (p = ((mod_gridsite_cfg *) cfg)->methods;
+ for (p = ((mod_gridsite_dir_cfg *) cfg)->methods;
*p != '\0';
++p) if (*p == '\t') *p = ' ';
}
else if (strcasecmp(a->cmd->name, "GridSiteEditable") == 0)
{
- ((mod_gridsite_cfg *) cfg)->editable =
+ ((mod_gridsite_dir_cfg *) cfg)->editable =
apr_psprintf(a->pool, " %s ", parm);
- for (p = ((mod_gridsite_cfg *) cfg)->editable;
+ for (p = ((mod_gridsite_dir_cfg *) cfg)->editable;
*p != '\0';
++p) if (*p == '\t') *p = ' ';
}
else if (strcasecmp(a->cmd->name, "GridSiteHeadFile") == 0)
{
- ((mod_gridsite_cfg *) cfg)->headfile =
+ ((mod_gridsite_dir_cfg *) cfg)->headfile =
apr_pstrdup(a->pool, parm);
}
else if (strcasecmp(a->cmd->name, "GridSiteFootFile") == 0)
{
- ((mod_gridsite_cfg *) cfg)->footfile =
+ ((mod_gridsite_dir_cfg *) cfg)->footfile =
apr_pstrdup(a->pool, parm);
}
else if (strcasecmp(a->cmd->name, "GridSiteIndexHeader") == 0)
if (index(parm, '/') != NULL)
return "/ not permitted in GridSiteIndexHeader";
- ((mod_gridsite_cfg *) cfg)->indexheader =
- apr_pstrdup(a->pool, parm);
- }
- else if (strcasecmp(a->cmd->name, "GridSiteAuthCookiesDir") == 0)
- {
- if (index(parm, '/') != NULL)
- return "/ not permitted in GridSiteAuthCookiesDir";
-
- ((mod_gridsite_cfg *) cfg)->authcookiesdir =
+ ((mod_gridsite_dir_cfg *) cfg)->indexheader =
apr_pstrdup(a->pool, parm);
}
else if (strcasecmp(a->cmd->name, "GridSiteACLFormat") == 0)
(strcasecmp(parm,"XACML") != 0))
return "GridsiteACLFormat must be either GACL or XACML";
- ((mod_gridsite_cfg *) cfg)->aclformat = apr_pstrdup(a->pool, parm);
+ ((mod_gridsite_dir_cfg *) cfg)->aclformat = apr_pstrdup(a->pool, parm);
}
else if (strcasecmp(a->cmd->name, "GridSiteExecMethod") == 0)
{
if (strcasecmp(parm, "nosetuid") == 0)
{
- ((mod_gridsite_cfg *) cfg)->execmethod = NULL;
+ ((mod_gridsite_dir_cfg *) cfg)->execmethod = NULL;
return NULL;
}
(strcasecmp(parm, "directory") != 0))
return "GridsiteExecMethod must be nosetuid, suexec, X509DN or directory";
- ((mod_gridsite_cfg *) cfg)->execmethod = apr_pstrdup(a->pool, parm);
+ ((mod_gridsite_dir_cfg *) cfg)->execmethod = apr_pstrdup(a->pool, parm);
}
return NULL;
static const char *mod_gridsite_take2_cmds(cmd_parms *a, void *cfg,
const char *parm1, const char *parm2)
{
+ int i;
+
if (strcasecmp(a->cmd->name, "GridSiteUserGroup") == 0)
{
if (!(unixd_config.suexec_enabled))
/* NB ap_uname2id/ap_gname2id are NOT thread safe - but OK
as long as not used in .htaccess, just at server start time */
- ((mod_gridsite_cfg *) cfg)->execugid.uid = ap_uname2id(parm1);
- ((mod_gridsite_cfg *) cfg)->execugid.gid = ap_gname2id(parm2);
- ((mod_gridsite_cfg *) cfg)->execugid.userdir = 0;
+ ((mod_gridsite_dir_cfg *) cfg)->execugid.uid = ap_uname2id(parm1);
+ ((mod_gridsite_dir_cfg *) cfg)->execugid.gid = ap_gname2id(parm2);
+ ((mod_gridsite_dir_cfg *) cfg)->execugid.userdir = 0;
}
else if (strcasecmp(a->cmd->name, "GridSiteDiskMode") == 0)
{
return "Second parameter of GridSiteDiskMode must be "
"WorldNone or WorldRead!";
- ((mod_gridsite_cfg *) cfg)->diskmode =
+ ((mod_gridsite_dir_cfg *) cfg)->diskmode =
APR_UREAD | APR_UWRITE
| ( APR_GREAD * (strcasecmp(parm1, "GroupRead") == 0))
| ((APR_GREAD | APR_GWRITE) * (strcasecmp(parm1, "GroupWrite") == 0))
| ((APR_GREAD | APR_WREAD) * (strcasecmp(parm2, "WorldRead") == 0));
}
+ else if (strcasecmp(a->cmd->name, "GridSiteCastAlias") == 0)
+ {
+ for (i=0; i < GRST_SITECAST_ALIASES; ++i) /* look for free slot */
+ {
+ if (sitecastaliases[i].sitecast_url == NULL)
+ {
+ sitecastaliases[i].sitecast_url = parm1;
+ sitecastaliases[i].local_path = parm2;
+ sitecastaliases[i].server = a->server;
+ break;
+ }
+ }
+ }
return NULL;
}
{
if (strcasecmp(a->cmd->name, "GridSiteAuth") == 0)
{
- ((mod_gridsite_cfg *) cfg)->auth = flag;
+ ((mod_gridsite_dir_cfg *) cfg)->auth = flag;
}
else if (strcasecmp(a->cmd->name, "GridSiteEnvs") == 0)
{
- ((mod_gridsite_cfg *) cfg)->envs = flag;
+ ((mod_gridsite_dir_cfg *) cfg)->envs = flag;
}
else if (strcasecmp(a->cmd->name, "GridSiteHtmlFormat") == 0)
{
- ((mod_gridsite_cfg *) cfg)->format = flag;
+ ((mod_gridsite_dir_cfg *) cfg)->format = flag;
}
else if (strcasecmp(a->cmd->name, "GridSiteIndexes") == 0)
{
- ((mod_gridsite_cfg *) cfg)->indexes = flag;
+ ((mod_gridsite_dir_cfg *) cfg)->indexes = flag;
}
else if (strcasecmp(a->cmd->name, "GridSiteLink") == 0)
{
- ((mod_gridsite_cfg *) cfg)->gridsitelink = flag;
+ ((mod_gridsite_dir_cfg *) cfg)->gridsitelink = flag;
}
- else if (strcasecmp(a->cmd->name, "GridSiteDowngrade") == 0)
+ else if (strcasecmp(a->cmd->name, "GridSiteGridHTTP") == 0)
{
// TODO: return error if try this on non-HTTPS virtual server
- ((mod_gridsite_cfg *) cfg)->downgrade = flag;
+ ((mod_gridsite_dir_cfg *) cfg)->gridhttp = flag;
}
else if (strcasecmp(a->cmd->name, "GridSiteSoap2cgi") == 0)
{
- ((mod_gridsite_cfg *) cfg)->soap2cgi = flag;
+ ((mod_gridsite_dir_cfg *) cfg)->soap2cgi = flag;
}
return NULL;
AP_INIT_TAKE1("GridSiteIndexHeader", mod_gridsite_take1_cmds,
NULL, OR_FILEINFO, "filename of directory header"),
- AP_INIT_FLAG("GridSiteDowngrade", mod_gridsite_flag_cmds,
+ AP_INIT_FLAG("GridSiteGridHTTP", mod_gridsite_flag_cmds,
NULL, OR_FILEINFO, "on or off"),
- AP_INIT_TAKE1("GridSiteAuthCookiesDir", mod_gridsite_take1_cmds,
- NULL, OR_FILEINFO, "directory with Grid Auth Cookies"),
-
+ AP_INIT_TAKE1("GridSiteGridHTTPport", mod_gridsite_take1_cmds,
+ NULL, RSRC_CONF, "GridHTTP port"),
+ AP_INIT_TAKE1("GridSiteOnetimesDir", mod_gridsite_take1_cmds,
+ NULL, RSRC_CONF, "directory with GridHTTP onetime passcodes"),
+
+ AP_INIT_TAKE1("GridSiteCastDNlists", mod_gridsite_take1_cmds,
+ NULL, RSRC_CONF, "DN Lists directories search path for SiteCast"),
+ AP_INIT_TAKE1("GridSiteCastUniPort", mod_gridsite_take1_cmds,
+ NULL, RSRC_CONF, "UDP port for unicast/replies"),
+ AP_INIT_TAKE1("GridSiteCastGroup", mod_gridsite_take1_cmds,
+ NULL, RSRC_CONF, "multicast group[:port] to listen for HTCP on"),
+ AP_INIT_TAKE2("GridSiteCastAlias", mod_gridsite_take2_cmds,
+ NULL, RSRC_CONF, "URL and local path mapping"),
+
AP_INIT_FLAG("GridSiteSoap2cgi", mod_gridsite_flag_cmds,
NULL, OR_FILEINFO, "on or off"),
static int mod_gridsite_first_fixups(request_rec *r)
{
- mod_gridsite_cfg *conf;
+ mod_gridsite_dir_cfg *conf;
if (r->finfo.filetype != APR_DIR) return DECLINED;
- conf = (mod_gridsite_cfg *)
+ conf = (mod_gridsite_dir_cfg *)
ap_get_module_config(r->per_dir_config, &gridsite_module);
/* we handle DN Lists as regular files, even if they also match
return DECLINED;
}
+void GRST_creds_to_conn(conn_rec *conn,
+ STACK_OF(X509) *certstack, X509 *peercert)
+{
+ int i, lastcred;
+ const int maxcreds = 99;
+ const size_t credlen = 1024;
+ char creds[maxcreds][credlen+1], envname[14];
+
+ if ((certstack != NULL) && (conn->notes != NULL) &&
+ (apr_table_get(conn->notes, "GRST_creds_to_conn") != NULL)) return;
+
+ /* Put result of GRSTx509CompactCreds() into connection notes */
+
+ apr_table_set(conn->notes, "GRST_creds_to_conn", "yes");
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, conn->base_server,
+ "set GRST_creds_to_conn");
+
+ if (GRSTx509CompactCreds(&lastcred, maxcreds, credlen, (char *) creds,
+ certstack, GRST_VOMS_DIR, peercert) == GRST_RET_OK)
+ {
+ for (i=0; i <= lastcred; ++i)
+ {
+ apr_table_setn(conn->notes,
+ apr_psprintf(conn->pool, "GRST_CRED_%d", i),
+ apr_pstrdup(conn->pool, creds[i]));
+
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, conn->base_server,
+ "store GRST_CRED_%d=%s", i, creds[i]);
+
+ }
+
+ /* free remaining dup'd certs? */
+ }
+}
+
static int mod_gridsite_perm_handler(request_rec *r)
/*
Do authentication/authorization here rather than in the normal module
We also publish environment variables here if requested by GridSiteEnv.
*/
{
- int retcode = DECLINED, i, n;
+ int retcode = DECLINED, i, n, file_is_acl = 0,
+ destination_is_acl = 0, proxylevel;
char *dn, *p, envname[14], *grst_cred_0 = NULL, *dir_path,
- *remotehost, s[99], *grst_cred_i, *file, *cookies,
- *gridauthonetime, *cookiefile, oneline[1025], *key_i;
+ *remotehost, s[99], *grst_cred_i, *cookies, *file,
+ *gridauthonetime = NULL, *cookiefile, oneline[1025], *key_i,
+ *destination = NULL, *destination_uri = NULL, *querytmp,
+ *destination_prefix = NULL, *destination_translated = NULL;
const char *content_type;
time_t now, notbefore, notafter;
apr_table_t *env;
apr_finfo_t cookiefile_info;
apr_file_t *fp;
+ request_rec *destreq;
GRSTgaclCred *cred = NULL, *cred_0 = NULL;
GRSTgaclUser *user = NULL;
- GRSTgaclPerm perm = GRST_PERM_NONE;
+ GRSTgaclPerm perm = GRST_PERM_NONE, destination_perm = GRST_PERM_NONE;
GRSTgaclAcl *acl = NULL;
- mod_gridsite_cfg *cfg;
+ mod_gridsite_dir_cfg *cfg;
+ SSLConnRec *sslconn;
+ STACK_OF(X509) *certstack;
+ X509 *peercert;
- cfg = (mod_gridsite_cfg *)
+ cfg = (mod_gridsite_dir_cfg *)
ap_get_module_config(r->per_dir_config, &gridsite_module);
if (cfg == NULL) return DECLINED;
env = r->subprocess_env;
- if ((p = (char *) apr_table_get(r->headers_in, "Cookie")) != NULL)
- {
- cookies = apr_pstrcat(r->pool, " ", p, NULL);
- gridauthonetime = strstr(cookies, " GRID_AUTH_ONETIME=");
-
- if (gridauthonetime != NULL)
- {
- for (p = &gridauthonetime[19]; (*p != '\0') && (*p != ';'); ++p)
- if (!isalnum(*p)) *p = '_';
-
- cookiefile = apr_psprintf(r->pool, "%s/%s",
- ap_server_root_relative(r->pool,
- cfg->authcookiesdir),
- &gridauthonetime[19]);
-
- if ((apr_stat(&cookiefile_info , cookiefile,
- APR_FINFO_TYPE, r->pool) == APR_SUCCESS) &&
- (cookiefile_info.filetype == APR_REG) &&
- (apr_file_open(&fp, cookiefile, APR_READ, 0, r->pool)
- == APR_SUCCESS))
- {
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "Open Grid Auth Cookie file %s", cookiefile);
-
- while (apr_file_gets(oneline,
- sizeof(oneline), fp) == APR_SUCCESS)
- {
- p = index(oneline, '\n');
- if (p != NULL) *p = '\0';
-
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "%s: %s", cookiefile, oneline);
-
- if ((strncmp(oneline, "expires=", 8) == 0) &&
- (apr_time_from_sec(atoll(&oneline[8])) <
- apr_time_now()))
- break;
- else if ((strncmp(oneline, "domain=", 7) == 0) &&
- (strcmp(&oneline[7], r->hostname) != 0))
- break; /* exact needed in the version */
- else if ((strncmp(oneline, "path=", 5) == 0) &&
- (strcmp(&oneline[5], r->uri) != 0))
- break;
- else if (strncmp(oneline, "onetime=yes", 11) == 0)
- apr_file_remove(cookiefile, r->pool);
- else if (strncmp(oneline, "GRST_CRED_", 10) == 0)
- {
- grst_cred_i = index(oneline, '=');
- if (grst_cred_i == NULL) continue;
- *grst_cred_i = '\0';
- ++grst_cred_i;
-
- i = atoi(&oneline[10]);
- cred = GRSTx509CompactToCred(grst_cred_i);
-
- if (cred == NULL) continue;
-
- if ((i == 0) && (user == NULL))
- {
- if (GRSTgaclCredGetDelegation(cred)
- <= ((mod_gridsite_cfg *) cfg)->gsiproxylimit)
- {
- user = GRSTgaclUserNew(cred);
-
- ap_log_error(APLOG_MARK, APLOG_DEBUG,
- 0, r->server,
- "Using identity %s from "
- "GRID_AUTH_ONETIME",
- grst_cred_i);
-
- if (((mod_gridsite_cfg *) cfg)->envs)
- apr_table_setn(env, oneline, grst_cred_i);
- }
- }
- else if ((i > 0) && (user != NULL))
- {
- GRSTgaclUserAddCred(user, cred);
-
- if (((mod_gridsite_cfg *) cfg)->envs)
- apr_table_set(env,oneline,grst_cred_i);
- }
- }
- }
+ /* do we need/have per-connection (SSL) cred variable(s)? */
+
+ sslconn = (SSLConnRec *) ap_get_module_config(r->connection->conn_config,
+ &ssl_module);
- apr_file_close(fp);
- }
- }
+ if ((sslconn != NULL) && (sslconn->ssl != NULL) &&
+ (r->connection->notes != NULL) &&
+ (apr_table_get(r->connection->notes, "GRST_creds_to_conn") == NULL))
+ {
+ certstack = SSL_get_peer_cert_chain(sslconn->ssl);
+ peercert = SSL_get_peer_certificate(sslconn->ssl);
+
+ GRST_creds_to_conn(r->connection, certstack, peercert);
}
-
- /* do we need/have per-connection (SSL) cred variable(s)? */
+ proxylevel = ((mod_gridsite_dir_cfg *) cfg)->gsiproxylimit + 1;
+
if ((user == NULL) &&
(r->connection->notes != NULL) &&
((grst_cred_0 = (char *)
- apr_table_get(r->connection->notes, "GRST_CRED_0")) != NULL))
+ apr_table_get(r->connection->notes, "GRST_CRED_0")) != NULL) &&
+ (sscanf(grst_cred_0, "X509USER %*d %*d %d ", &proxylevel) == 1) &&
+ (proxylevel <= ((mod_gridsite_dir_cfg *) cfg)->gsiproxylimit))
{
- if (((mod_gridsite_cfg *) cfg)->envs)
- apr_table_setn(env, "GRST_CRED_0", grst_cred_0);
+ apr_table_setn(env, "GRST_CRED_0", grst_cred_0);
cred_0 = GRSTx509CompactToCred(grst_cred_0);
- if ((cred_0 != NULL) &&
- (GRSTgaclCredGetDelegation(cred_0)
- <= ((mod_gridsite_cfg *) cfg)->gsiproxylimit))
+ if (cred_0 != NULL)
{
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"Using identity %s from SSL/TLS", grst_cred_0);
if (grst_cred_i = (char *)
apr_table_get(r->connection->notes,envname))
{
- if (((mod_gridsite_cfg *) cfg)->envs)
+ if (((mod_gridsite_dir_cfg *) cfg)->envs)
apr_table_setn(env,
apr_pstrdup(r->pool, envname),
grst_cred_i);
}
}
- if ((user != NULL) && ((mod_gridsite_cfg *) cfg)->dnlists)
- GRSTgaclUserSetDNlists(user, ((mod_gridsite_cfg *) cfg)->dnlists);
+ if ((user != NULL) && ((mod_gridsite_dir_cfg *) cfg)->dnlists)
+ GRSTgaclUserSetDNlists(user, ((mod_gridsite_dir_cfg *) cfg)->dnlists);
- /* this checks for NULL arguments itself */
- if (GRSTgaclDNlistHasUser(((mod_gridsite_cfg *) cfg)->adminlist, user))
- perm = GRST_PERM_ALL;
- else
- {
- remotehost = (char *) ap_get_remote_host(r->connection,
+ /* add DNS credential */
+
+ remotehost = (char *) ap_get_remote_host(r->connection,
r->per_dir_config, REMOTE_DOUBLE_REV, NULL);
- if ((remotehost != NULL) && (*remotehost != '\0'))
- {
- cred = GRSTgaclCredNew("dns");
- GRSTgaclCredAddValue(cred, "hostname", remotehost);
+ if ((remotehost != NULL) && (*remotehost != '\0'))
+ {
+ cred = GRSTgaclCredNew("dns");
+ GRSTgaclCredAddValue(cred, "hostname", remotehost);
+
+ if (user == NULL) user = GRSTgaclUserNew(cred);
+ else GRSTgaclUserAddCred(user, cred);
+ }
+
+ /* check for Destination: header and evaluate if present */
- if (user == NULL) user = GRSTgaclUserNew(cred);
- else GRSTgaclUserAddCred(user, cred);
+ if ((destination = (char *) apr_table_get(r->headers_in,
+ "Destination")) != NULL)
+ {
+ destination_prefix = apr_psprintf(r->pool, "https://%s:%d/",
+ r->server->server_hostname, (int) r->server->port);
+
+ if (strncmp(destination_prefix, destination,
+ strlen(destination_prefix)) == 0)
+ destination_uri = &destination[strlen(destination_prefix)-1];
+ else if ((int) r->server->port == 443)
+ {
+ destination_prefix = apr_psprintf(r->pool, "https://%s/",
+ r->server->server_hostname);
+
+ if (strncmp(destination_prefix, destination,
+ strlen(destination_prefix)) == 0)
+ destination_uri = &destination[strlen(destination_prefix)-1];
}
+
+ if (destination_uri != NULL)
+ {
+ destreq = ap_sub_req_method_uri("GET", destination_uri, r, NULL);
+
+ if ((destreq != NULL) && (destreq->filename != NULL)
+ && (destreq->path_info != NULL))
+ {
+ destination_translated = apr_pstrcat(r->pool,
+ destreq->filename, destreq->path_info, NULL);
+ apr_table_setn(r->notes, "GRST_DESTINATION_TRANSLATED",
+ destination_translated);
+
+ if (((mod_gridsite_dir_cfg *) cfg)->envs)
+ apr_table_setn(env, "GRST_DESTINATION_TRANSLATED",
+ destination_translated);
+
+ p = rindex(destination_translated, '/');
+ if ((p != NULL) && (strcmp(&p[1], GRST_ACL_FILE) == 0))
+ destination_is_acl = 1;
+ }
+ }
+ }
+
+ /* this checks for NULL arguments itself */
+ if (GRSTgaclDNlistHasUser(((mod_gridsite_dir_cfg *) cfg)->adminlist, user))
+ {
+ perm = GRST_PERM_ALL;
+ if (destination_translated != NULL) destination_perm = GRST_PERM_ALL;
+ }
+ else
+ {
acl = GRSTgaclAclLoadforFile(r->filename);
if (acl != NULL) perm = GRSTgaclAclTestUser(acl, user);
+ GRSTgaclAclFree(acl);
+
+ if (destination_translated != NULL)
+ {
+ acl = GRSTgaclAclLoadforFile(destination_translated);
+ if (acl != NULL) destination_perm = GRSTgaclAclTestUser(acl, user);
+ GRSTgaclAclFree(acl);
+
+ apr_table_setn(r->notes, "GRST_DESTINATION_PERM",
+ apr_psprintf(r->pool, "%d", destination_perm));
+
+ if (((mod_gridsite_dir_cfg *) cfg)->envs)
+ apr_table_setn(env, "GRST_DESTINATION_PERM",
+ apr_psprintf(r->pool, "%d", destination_perm));
+ }
}
+
+ /* first look for GRIDHTTP_ONETIME cookie */
+
+ if ((p = (char *) apr_table_get(r->headers_in, "Cookie")) != NULL)
+ {
+ cookies = apr_pstrcat(r->pool, " ", p, NULL);
+ gridauthonetime = strstr(cookies, " GRIDHTTP_ONETIME=");
+
+ if (gridauthonetime != NULL)
+ {
+ for (p = &gridauthonetime[18];
+ (*p != '\0') && (*p != ';'); ++p)
+ if (!isalnum(*p)) *p = '\0';
+ }
+ }
+
+ /* then look for GRIDHTTP_ONETIME in QUERY_STRING ie after ? */
+
+ if (gridauthonetime == NULL)
+ {
+ if ((r->parsed_uri.query != NULL) && (r->parsed_uri.query[0] != '\0'))
+ {
+ querytmp = apr_pstrcat(r->pool,"&",r->parsed_uri.query,"&",NULL);
+
+ gridauthonetime = strstr(querytmp, "&GRIDHTTP_ONETIME=");
+
+ if (gridauthonetime != NULL)
+ {
+ for (p = &gridauthonetime[18];
+ (*p != '\0') && (*p != '&'); ++p)
+ if (!isalnum(*p)) *p = '\0';
+ }
+ }
+ }
+
+ if ((gridauthonetime != NULL) && (gridauthonetime[0] != '\0'))
+ {
+ cookiefile = apr_psprintf(r->pool, "%s/%s",
+ ap_server_root_relative(r->pool,
+ onetimesdir),
+ &gridauthonetime[18]);
+
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "Opening GridHTTP onetime file %s", cookiefile);
+
+ if ((apr_stat(&cookiefile_info, cookiefile,
+ APR_FINFO_TYPE, r->pool) == APR_SUCCESS) &&
+ (cookiefile_info.filetype == APR_REG) &&
+ (apr_file_open(&fp, cookiefile, APR_READ, 0, r->pool)
+ == APR_SUCCESS))
+ {
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "Reading GridHTTP onetime file %s", cookiefile);
+
+ while (apr_file_gets(oneline,
+ sizeof(oneline), fp) == APR_SUCCESS)
+ {
+ p = index(oneline, '\n');
+ if (p != NULL) *p = '\0';
+
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "%s: %s", cookiefile, oneline);
+
+ if ((strncmp(oneline, "expires=", 8) == 0) &&
+ (apr_time_from_sec(atoll(&oneline[8])) <
+ apr_time_now()))
+ break;
+ else if ((strncmp(oneline, "domain=", 7) == 0) &&
+ (strcmp(&oneline[7], r->hostname) != 0))
+ break; /* exact needed in the version */
+ else if ((strncmp(oneline, "path=", 5) == 0) &&
+ (strcmp(&oneline[5], r->uri) != 0))
+ break;
+ else if (strncmp(oneline, "onetime=yes", 11) == 0)
+ apr_file_remove(cookiefile, r->pool);
+ else if (strncmp(oneline, "method=PUT", 10) == 0)
+ perm |= GRST_PERM_WRITE;
+ else if (strncmp(oneline, "method=GET", 10) == 0)
+ perm |= GRST_PERM_READ;
+ }
+
+ apr_file_close(fp);
+ }
+ }
+
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+ "After GACL/Onetime evaluation, GRST_PERM=%d", perm);
+ /* set permission and GACL environment variables */
+
apr_table_setn(r->notes, "GRST_PERM", apr_psprintf(r->pool, "%d", perm));
- if (((mod_gridsite_cfg *) cfg)->envs)
+ if (((mod_gridsite_dir_cfg *) cfg)->envs)
{
apr_table_setn(env, "GRST_PERM", apr_psprintf(r->pool, "%d", perm));
apr_table_setn(env, "GRST_DIR_PATH", dir_path);
}
- if (((mod_gridsite_cfg *) cfg)->helpuri != NULL)
+ if (((mod_gridsite_dir_cfg *) cfg)->helpuri != NULL)
apr_table_setn(env, "GRST_HELP_URI",
- ((mod_gridsite_cfg *) cfg)->helpuri);
+ ((mod_gridsite_dir_cfg *) cfg)->helpuri);
- if (((mod_gridsite_cfg *) cfg)->adminfile != NULL)
+ if (((mod_gridsite_dir_cfg *) cfg)->adminfile != NULL)
apr_table_setn(env, "GRST_ADMIN_FILE",
- ((mod_gridsite_cfg *) cfg)->adminfile);
+ ((mod_gridsite_dir_cfg *) cfg)->adminfile);
- if (((mod_gridsite_cfg *) cfg)->editable != NULL)
+ if (((mod_gridsite_dir_cfg *) cfg)->editable != NULL)
apr_table_setn(env, "GRST_EDITABLE",
- ((mod_gridsite_cfg *) cfg)->editable);
+ ((mod_gridsite_dir_cfg *) cfg)->editable);
- if (((mod_gridsite_cfg *) cfg)->headfile != NULL)
+ if (((mod_gridsite_dir_cfg *) cfg)->headfile != NULL)
apr_table_setn(env, "GRST_HEAD_FILE",
- ((mod_gridsite_cfg *) cfg)->headfile);
+ ((mod_gridsite_dir_cfg *) cfg)->headfile);
- if (((mod_gridsite_cfg *) cfg)->footfile != NULL)
+ if (((mod_gridsite_dir_cfg *) cfg)->footfile != NULL)
apr_table_setn(env, "GRST_FOOT_FILE",
- ((mod_gridsite_cfg *) cfg)->footfile);
+ ((mod_gridsite_dir_cfg *) cfg)->footfile);
- if (((mod_gridsite_cfg *) cfg)->dnlists != NULL)
+ if (((mod_gridsite_dir_cfg *) cfg)->dnlists != NULL)
apr_table_setn(env, "GRST_DN_LISTS",
- ((mod_gridsite_cfg *) cfg)->dnlists);
+ ((mod_gridsite_dir_cfg *) cfg)->dnlists);
- if (((mod_gridsite_cfg *) cfg)->dnlistsuri != NULL)
+ if (((mod_gridsite_dir_cfg *) cfg)->dnlistsuri != NULL)
apr_table_setn(env, "GRST_DN_LISTS_URI",
- ((mod_gridsite_cfg *) cfg)->dnlistsuri);
+ ((mod_gridsite_dir_cfg *) cfg)->dnlistsuri);
- if (((mod_gridsite_cfg *) cfg)->adminlist != NULL)
+ if (((mod_gridsite_dir_cfg *) cfg)->adminlist != NULL)
apr_table_setn(env, "GRST_ADMIN_LIST",
- ((mod_gridsite_cfg *) cfg)->adminlist);
+ ((mod_gridsite_dir_cfg *) cfg)->adminlist);
apr_table_setn(env, "GRST_GSIPROXY_LIMIT",
apr_psprintf(r->pool, "%d",
- ((mod_gridsite_cfg *)cfg)->gsiproxylimit));
+ ((mod_gridsite_dir_cfg *)cfg)->gsiproxylimit));
- if (((mod_gridsite_cfg *) cfg)->unzip != NULL)
+ if (((mod_gridsite_dir_cfg *) cfg)->unzip != NULL)
apr_table_setn(env, "GRST_UNZIP",
- ((mod_gridsite_cfg *) cfg)->unzip);
+ ((mod_gridsite_dir_cfg *) cfg)->unzip);
- if (!(((mod_gridsite_cfg *) cfg)->gridsitelink))
+ if (!(((mod_gridsite_dir_cfg *) cfg)->gridsitelink))
apr_table_setn(env, "GRST_NO_LINK", "1");
- if (((mod_gridsite_cfg *) cfg)->aclformat != NULL)
+ if (((mod_gridsite_dir_cfg *) cfg)->aclformat != NULL)
apr_table_setn(env, "GRST_ACL_FORMAT",
- ((mod_gridsite_cfg *) cfg)->aclformat);
+ ((mod_gridsite_dir_cfg *) cfg)->aclformat);
- if (((mod_gridsite_cfg *) cfg)->execmethod != NULL)
+ if (((mod_gridsite_dir_cfg *) cfg)->execmethod != NULL)
{
apr_table_setn(env, "GRST_EXEC_METHOD",
- ((mod_gridsite_cfg *) cfg)->execmethod);
+ ((mod_gridsite_dir_cfg *) cfg)->execmethod);
- if ((strcasecmp(((mod_gridsite_cfg *) cfg)->execmethod,
+ if ((strcasecmp(((mod_gridsite_dir_cfg *) cfg)->execmethod,
"directory") == 0) && (r->filename != NULL))
{
if ((r->content_type != NULL) &&
apr_table_setn(env, "GRST_DISK_MODE",
apr_psprintf(r->pool, "0x%04x",
- ((mod_gridsite_cfg *)cfg)->diskmode));
+ ((mod_gridsite_dir_cfg *)cfg)->diskmode));
}
- if (((mod_gridsite_cfg *) cfg)->auth)
+ if (((mod_gridsite_dir_cfg *) cfg)->auth)
{
/* *** Check HTTP method to decide which perm bits to check *** */
- if (r->filename != NULL)
- {
- file = rindex(r->filename, '/');
- if (file != NULL) ++file;
- else file = r->filename;
- }
- else file = NULL;
+ if ((r->filename != NULL) &&
+ ((p = rindex(r->filename, '/')) != NULL) &&
+ (strcmp(&p[1], GRST_ACL_FILE) == 0)) file_is_acl = 1;
content_type = r->content_type;
if ((content_type != NULL) &&
(strcmp(content_type, DIR_MAGIC_TYPE) == 0) &&
- (((mod_gridsite_cfg *) cfg)->dnlistsuri != NULL) &&
+ (((mod_gridsite_dir_cfg *) cfg)->dnlistsuri != NULL) &&
(strncmp(r->uri,
- ((mod_gridsite_cfg *) cfg)->dnlistsuri,
- strlen(((mod_gridsite_cfg *) cfg)->dnlistsuri)) == 0) &&
- (strlen(r->uri) > strlen(((mod_gridsite_cfg *) cfg)->dnlistsuri)))
+ ((mod_gridsite_dir_cfg *) cfg)->dnlistsuri,
+ strlen(((mod_gridsite_dir_cfg *) cfg)->dnlistsuri)) == 0) &&
+ (strlen(r->uri) > strlen(((mod_gridsite_dir_cfg *) cfg)->dnlistsuri)))
content_type = "text/html";
if ( GRSTgaclPermHasNone(perm) ||
((r->method_number == M_POST) && !GRSTgaclPermHasRead(perm) ) ||
- (((r->method_number == M_PUT) || (r->method_number == M_DELETE)) &&
- !GRSTgaclPermHasWrite(perm) &&
- ((file == NULL) || (strcmp(file, GRST_ACL_FILE) != 0)) ) ||
-
- (((r->method_number == M_PUT) || (r->method_number == M_DELETE)) &&
- !GRSTgaclPermHasAdmin(perm) &&
- (file != NULL) &&
- (strcmp(file, GRST_ACL_FILE) == 0) ) ) retcode = HTTP_FORBIDDEN;
+ (((r->method_number == M_PUT) ||
+ (r->method_number == M_DELETE)) &&
+ !GRSTgaclPermHasWrite(perm) && !file_is_acl) ||
+
+ ((r->method_number == M_MOVE) &&
+ ((!GRSTgaclPermHasWrite(perm) && !file_is_acl) ||
+ (!GRSTgaclPermHasAdmin(perm) && file_is_acl) ||
+ (!GRSTgaclPermHasWrite(destination_perm)
+ && !destination_is_acl) ||
+ (!GRSTgaclPermHasAdmin(destination_perm)
+ && destination_is_acl)) ) ||
+
+ (((r->method_number == M_PUT) ||
+ (r->method_number == M_DELETE)) &&
+ !GRSTgaclPermHasAdmin(perm) && file_is_acl)
+
+ ) retcode = HTTP_FORBIDDEN;
}
return retcode;
int errdepth = X509_STORE_CTX_get_error_depth(ctx);
int returned_ok;
int first_non_ca;
+ STACK_OF(X509) *certstack;
/*
* GSI Proxy user-cert-as-CA handling:
}
else
{
- int i, lastcred;
- STACK_OF(X509) *peer_certs;
- const int maxcreds = 99;
- const size_t credlen = 1024;
- char creds[maxcreds][credlen+1], envname[14];
-
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, "Valid certificate"
" chain reported by GRSTx509CheckChain()");
- /*
- * Always put result of GRSTx509CompactCreds() into environment
- */
- if (peer_certs = (STACK_OF(X509) *) X509_STORE_CTX_get_chain(ctx))
- {
- if (GRSTx509CompactCreds(&lastcred, maxcreds, credlen,
- (char *) creds, peer_certs, GRST_VOMS_DIR) == GRST_RET_OK)
- {
- for (i=0; i <= lastcred; ++i)
- {
- apr_table_setn(conn->notes,
- apr_psprintf(conn->pool, "GRST_CRED_%d", i),
- apr_pstrdup(conn->pool, creds[i]));
-
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
- "store GRST_CRED_%d=%s", i, creds[i]);
- }
- }
- /* free remaining dup'd certs? */
- }
+ /* Put result of GRSTx509CompactCreds() into connection notes */
+ if ((certstack =
+ (STACK_OF(X509) *) X509_STORE_CTX_get_chain(ctx)) != NULL)
+ GRST_creds_to_conn(conn, certstack, NULL);
}
}
return returned_ok;
}
+void sitecast_handle_NOP_request(server_rec *main_server,
+ GRSThtcpMessage *htcp_mesg, int igroup,
+ struct sockaddr_in *client_addr_ptr)
+{
+ int outbuf_len;
+ char *outbuf;
+
+ if (GRSThtcpNOPresponseMake(&outbuf, &outbuf_len,
+ htcp_mesg->trans_id) == GRST_RET_OK)
+ {
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, main_server,
+ "SiteCast sends NOP response from port %d to %s:%d",
+ sitecastgroups[0].port, inet_ntoa(client_addr_ptr->sin_addr),
+ ntohs(client_addr_ptr->sin_port));
+
+ sendto(sitecastgroups[0].socket, outbuf, outbuf_len, 0,
+ client_addr_ptr, sizeof(struct sockaddr_in));
+
+ free(outbuf);
+ }
+}
+
+void sitecast_handle_TST_GET(server_rec *main_server,
+ GRSThtcpMessage *htcp_mesg, int igroup,
+ struct sockaddr_in *client_addr_ptr)
+{
+ int i, outbuf_len, ialias, port;
+ char *filename, *outbuf, *location, *local_uri = NULL;
+ struct stat statbuf;
+ SSLSrvConfigRec *ssl_srv;
+
+ /* check sanity of requested uri */
+
+ if (strncmp(htcp_mesg->uri->text, "http://", 7) == 0)
+ {
+ for (i=7; i < GRSThtcpCountstrLen(htcp_mesg->uri); ++i)
+ if (htcp_mesg->uri->text[i] == '/')
+ {
+ local_uri = &(htcp_mesg->uri->text[i]);
+ break;
+ }
+ }
+ else if (strncmp(htcp_mesg->uri->text, "https://", 8) == 0)
+ {
+ for (i=8; i < GRSThtcpCountstrLen(htcp_mesg->uri); ++i)
+ if (htcp_mesg->uri->text[i] == '/')
+ {
+ local_uri = &(htcp_mesg->uri->text[i]);
+ break;
+ }
+ }
+
+ if (local_uri == NULL)
+ {
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, main_server,
+ "SiteCast responder only handles http(s):// (%*s requested by %s:%d)",
+ GRSThtcpCountstrLen(htcp_mesg->uri),
+ htcp_mesg->uri->text,
+ inet_ntoa(client_addr_ptr->sin_addr),
+ ntohs(client_addr_ptr->sin_port));
+ return;
+ }
+
+ /* find if any GridSiteCastAlias lines match */
+
+ for (ialias=0; ialias < GRST_SITECAST_ALIASES ; ++ialias)
+ {
+ if (sitecastaliases[ialias].sitecast_url == NULL) return; /* no match */
+
+ if ((strlen(sitecastaliases[ialias].sitecast_url)
+ <= GRSThtcpCountstrLen(htcp_mesg->uri)) &&
+ (strncmp(sitecastaliases[ialias].sitecast_url,
+ htcp_mesg->uri->text,
+ strlen(sitecastaliases[ialias].sitecast_url))==0)) break;
+ }
+
+ if (ialias == GRST_SITECAST_ALIASES)
+ {
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, main_server,
+ "SiteCast responder does not handle %*s requested by %s:%d",
+ GRSThtcpCountstrLen(htcp_mesg->uri),
+ htcp_mesg->uri->text,
+ inet_ntoa(client_addr_ptr->sin_addr),
+ ntohs(client_addr_ptr->sin_port));
+
+ return; /* no match */
+ }
+
+ /* convert URL to filename, using alias mapping */
+
+ asprintf(&filename, "%s%*s",
+ sitecastaliases[ialias].local_path,
+ GRSThtcpCountstrLen(htcp_mesg->uri)
+ - strlen(sitecastaliases[ialias].sitecast_url),
+ &(htcp_mesg->uri->text[strlen(sitecastaliases[ialias].sitecast_url)]) );
+
+ if (stat(filename, &statbuf) == 0) /* found file */
+ {
+ ssl_srv = (SSLSrvConfigRec *)
+ ap_get_module_config(sitecastaliases[ialias].server->module_config,
+ &ssl_module);
+
+ port = sitecastaliases[ialias].server->addrs->host_port;
+ if (port == 0) port = ((ssl_srv != NULL) && (ssl_srv->enabled))
+ ? GRST_HTTPS_PORT : GRST_HTTP_PORT;
+
+ asprintf(&location, "Location: http%s://%s:%d%s\r\n",
+ ((ssl_srv != NULL) && (ssl_srv->enabled)) ? "s" : "",
+ sitecastaliases[ialias].server->server_hostname, port,
+ local_uri);
+
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, main_server,
+ "SiteCast finds %*s at %s, redirects with %s",
+ GRSThtcpCountstrLen(htcp_mesg->uri),
+ htcp_mesg->uri->text, filename, location);
+
+ if (GRSThtcpTSTresponseMake(&outbuf, &outbuf_len,
+ htcp_mesg->trans_id,
+ location, "", "") == GRST_RET_OK)
+ {
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, main_server,
+ "SiteCast sends TST response from port %d to %s:%d",
+ sitecastgroups[0].port, inet_ntoa(client_addr_ptr->sin_addr),
+ ntohs(client_addr_ptr->sin_port));
+
+ sendto(sitecastgroups[0].socket, outbuf, outbuf_len, 0,
+ client_addr_ptr, sizeof(struct sockaddr_in));
+
+ free(outbuf);
+ }
+
+ free(location);
+ }
+
+ free(filename);
+}
+
+void sitecast_handle_request(server_rec *main_server,
+ char *reqbuf, int reqbuf_len, int igroup,
+ struct sockaddr_in *client_addr_ptr)
+{
+ GRSThtcpMessage htcp_mesg;
+
+ if (GRSThtcpMessageParse(&htcp_mesg,reqbuf,reqbuf_len) != GRST_RET_OK)
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, main_server,
+ "SiteCast responder rejects format of UDP message from %s:%d",
+ inet_ntoa(client_addr_ptr->sin_addr),
+ ntohs(client_addr_ptr->sin_port));
+ return;
+ }
+
+ if (htcp_mesg.rr != 0) /* ignore HTCP responses: we just do requests */
+ {
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, main_server,
+ "SiteCast responder ignores HTCP response from %s:%d",
+ inet_ntoa(client_addr_ptr->sin_addr),
+ ntohs(client_addr_ptr->sin_port));
+ return;
+ }
+
+ if (htcp_mesg.opcode == GRSThtcpNOPop)
+ {
+ sitecast_handle_NOP_request(main_server, &htcp_mesg,
+ igroup, client_addr_ptr);
+ return;
+ }
+
+ if (htcp_mesg.opcode == GRSThtcpTSTop)
+ {
+ if (((GRSThtcpCountstrLen(htcp_mesg.method) == 3) &&
+ (strncmp(htcp_mesg.method->text, "GET", 3) == 0)) ||
+ ((GRSThtcpCountstrLen(htcp_mesg.method) == 4) &&
+ (strncmp(htcp_mesg.method->text, "HEAD", 4) == 0)))
+ {
+ sitecast_handle_TST_GET(main_server, &htcp_mesg,
+ igroup, client_addr_ptr);
+ return;
+ }
+
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, main_server,
+ "SiteCast responder rejects method %*s in TST message from %s:%d",
+ GRSThtcpCountstrLen(htcp_mesg.method), htcp_mesg.method->text,
+ inet_ntoa(client_addr_ptr->sin_addr),
+ ntohs(client_addr_ptr->sin_port));
+ return;
+ }
+
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, main_server,
+ "SiteCast does not implement HTCP op-code %d in message from %s:%d",
+ htcp_mesg.opcode,
+ inet_ntoa(client_addr_ptr->sin_addr),
+ ntohs(client_addr_ptr->sin_port));
+}
+
+void sitecast_responder(server_rec *main_server)
+{
+#define GRST_SITECAST_MAXBUF 8192
+ char reqbuf[GRST_SITECAST_MAXBUF], *p;
+ int n, reqbuf_len, i, j, igroup,
+ quad1, quad2, quad3, quad4, port, retval, client_addr_len;
+ struct sockaddr_in srv, client_addr;
+ struct ip_mreq mreq;
+ fd_set readsckts;
+ struct hostent *server_hostent;
+
+ strcpy((char *) main_server->process->argv[0], "GridSiteCast UDP responder");
+
+ /* initialise unicast/replies socket first */
+
+ bzero(&srv, sizeof(srv));
+ srv.sin_family = AF_INET;
+ srv.sin_port = htons(sitecastgroups[0].port);
+
+ if ((server_hostent = gethostbyname(main_server->server_hostname)) == NULL)
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, main_server,
+ "SiteCast UDP Responder fails to look up servername %s",
+ main_server->server_hostname);
+ return;
+ }
+
+ srv.sin_addr.s_addr = (u_int32_t) (server_hostent->h_addr_list[0][0]);
+
+ if (((sitecastgroups[0].socket
+ = socket(AF_INET, SOCK_DGRAM, 0)) < 0) ||
+ (bind(sitecastgroups[0].socket,
+ (struct sockaddr *) &srv, sizeof(srv)) < 0))
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, main_server,
+ "mod_gridsite: sitecast responder fails on unicast bind (%s)",
+ strerror(errno));
+ return;
+ }
+
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, main_server,
+ "SiteCast UDP unicast/replies on %d.%d.%d.%d:%d",
+ server_hostent->h_addr_list[0][0],
+ server_hostent->h_addr_list[0][1],
+ server_hostent->h_addr_list[0][2],
+ server_hostent->h_addr_list[0][3],
+ sitecastgroups[0].port);
+
+ /* initialise multicast listener sockets next */
+
+ for (i=1; (i <= GRST_SITECAST_GROUPS) &&
+ (sitecastgroups[i].port != 0); ++i)
+ {
+ bzero(&srv, sizeof(srv));
+ srv.sin_family = AF_INET;
+ srv.sin_port = htons(sitecastgroups[i].port);
+ srv.sin_addr.s_addr = htonl(sitecastgroups[i].quad1*0x1000000
+ + sitecastgroups[i].quad2*0x10000
+ + sitecastgroups[i].quad3*0x100
+ + sitecastgroups[i].quad4);
+
+ if (((sitecastgroups[i].socket
+ = socket(AF_INET, SOCK_DGRAM, 0)) < 0) ||
+ (bind(sitecastgroups[i].socket,
+ (struct sockaddr *) &srv, sizeof(srv)) < 0))
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, main_server,
+ "SiteCast UDP Responder fails on multicast bind (%s)",
+ strerror(errno));
+ return;
+ }
+
+ bzero(&mreq, sizeof(mreq));
+ mreq.imr_multiaddr.s_addr = srv.sin_addr.s_addr;
+ mreq.imr_interface.s_addr = htonl(INADDR_ANY);
+
+ if (setsockopt(sitecastgroups[i].socket, IPPROTO_IP,
+ IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0)
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, main_server,
+ "SiteCast UDP Responder fails on setting multicast");
+ return;
+ }
+
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, main_server,
+ "SiteCast UDP Responder listening on %d.%d.%d.%d:%d",
+ sitecastgroups[i].quad1, sitecastgroups[i].quad2,
+ sitecastgroups[i].quad3, sitecastgroups[i].quad4, sitecastgroups[i].port);
+ }
+
+ while (1) /* **** main listening loop **** */
+ {
+ /* set up bitmasks for select */
+
+ FD_ZERO(&readsckts);
+
+ n = 0;
+ for (i=0; (i <= GRST_SITECAST_GROUPS) &&
+ (sitecastgroups[i].port != 0); ++i) /* reset bitmask */
+ {
+ FD_SET(sitecastgroups[i].socket, &readsckts);
+ if (sitecastgroups[i].socket > n) n = sitecastgroups[i].socket;
+ }
+
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, main_server,
+ "SiteCast UDP Responder waiting for requests");
+
+ if ((retval = select(n + 1, &readsckts, NULL, NULL, NULL)) < 1)
+ continue; /* < 1 on timeout or error */
+
+ for (igroup=0; (igroup <= GRST_SITECAST_GROUPS) &&
+ (sitecastgroups[igroup].port != 0); ++igroup)
+ {
+ if (FD_ISSET(sitecastgroups[igroup].socket, &readsckts))
+ {
+ client_addr_len = sizeof(client_addr);
+
+ if ((reqbuf_len = recvfrom(sitecastgroups[igroup].socket,
+ reqbuf, GRST_SITECAST_MAXBUF, 0,
+ (struct sockaddr *) &client_addr, &client_addr_len)) >= 0)
+ {
+ ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, main_server,
+ "SiteCast receives UDP message from %s:%d "
+ "to %d.%d.%d.%d:%d",
+ inet_ntoa(client_addr.sin_addr),
+ ntohs(client_addr.sin_port),
+ sitecastgroups[igroup].quad1,
+ sitecastgroups[igroup].quad2,
+ sitecastgroups[igroup].quad3,
+ sitecastgroups[igroup].quad4,
+ sitecastgroups[igroup].port);
+
+ sitecast_handle_request(main_server, reqbuf,
+ reqbuf_len, igroup,
+ &client_addr);
+ }
+ }
+ }
+
+ } /* **** end of main listening loop **** */
+}
+
static int mod_gridsite_server_post_config(apr_pool_t *pPool,
apr_pool_t *pLog, apr_pool_t *pTemp, server_rec *main_server)
{
SSL_CTX *ctx;
SSLSrvConfigRec *sc;
server_rec *this_server;
+ apr_proc_t *procnew = NULL;
+ apr_status_t status;
+ const char *userdata_key = "sitecast_init";
+
+ apr_pool_userdata_get((void **) &procnew, userdata_key,
+ main_server->process->pool);
+
+ /* we only fork responder if one not already forked and we have at
+ least one GridSiteCastAlias defined. This means it is possible
+ to run a responder with no groups - listening on unicast only! */
+
+ if ((procnew == NULL) &&
+ (sitecastaliases[0].sitecast_url != NULL))
+ {
+ /* UDP multicast responder required but not yet started */
+
+ procnew = apr_pcalloc(main_server->process->pool, sizeof(*procnew));
+ apr_pool_userdata_set((const void *) procnew, userdata_key,
+ apr_pool_cleanup_null, main_server->process->pool);
+
+ status = apr_proc_fork(procnew, pPool);
+
+ if (status < 0)
+ {
+ ap_log_error(APLOG_MARK, APLOG_CRIT, status, main_server,
+ "mod_gridsite: Failed to spawn SiteCast responder process");
+ return HTTP_INTERNAL_SERVER_ERROR;
+ }
+ else if (status == APR_INCHILD)
+ {
+ ap_log_error(APLOG_MARK, APLOG_NOTICE, status, main_server,
+ "mod_gridsite: Spawning SiteCast responder process");
+ sitecast_responder(main_server);
+ exit(-1);
+ }
+
+ apr_pool_note_subprocess(main_server->process->pool,
+ procnew, APR_KILL_AFTER_TIMEOUT);
+ }
+
+ /* continue with normal HTTP/HTTPS servers */
ap_add_version_component(pPool,
apr_psprintf(pPool, "mod_gridsite/%s", VERSION));
this_server != NULL;
this_server = this_server->next)
{
+ /* we do some GridSite OpenSSL magic for HTTPS servers */
+
sc = ap_get_module_config(this_server->module_config, &ssl_module);
if ((sc != NULL) &&
static int mod_gridsite_handler(request_rec *r)
{
- mod_gridsite_cfg *conf;
+ mod_gridsite_dir_cfg *conf;
- conf = (mod_gridsite_cfg *)
+ conf = (mod_gridsite_dir_cfg *)
ap_get_module_config(r->per_dir_config, &gridsite_module);
if ((conf->dnlistsuri != NULL) &&
static ap_unix_identity_t *mod_gridsite_get_suexec_id_doer(const request_rec *r)
{
- mod_gridsite_cfg *conf;
+ mod_gridsite_dir_cfg *conf;
- conf = (mod_gridsite_cfg *)
+ conf = (mod_gridsite_dir_cfg *)
ap_get_module_config(r->per_dir_config, &gridsite_module);
if ((conf->execugid.uid != UNSET) &&
return &(conf->execugid);
}
-
-
-
+
return NULL;
}
STANDARD20_MODULE_STUFF,
create_gridsite_dir_config, /* dir config creater */
merge_gridsite_dir_config, /* dir merger */
- NULL, /* server config */
- NULL, /* merge server config */
+ create_gridsite_srv_config, /* create server config */
+ NULL, /* merge server config */
mod_gridsite_cmds, /* command apr_table_t */
register_hooks /* register hooks */
};
lasttag=-1;
ex = X509_get_ext(cert, i);
-
+
OBJ_obj2txt(s, sizeof(s), X509_EXTENSION_get_object(ex), 1);
printf("%d OID=%s\n", i, s);
ASN1_OBJECT *obj = NULL;
const EVP_MD *m;
EVP_MD_CTX ctx;
+ char creds[501][101];
+ int lastcred = -1;
- itag = GRSTasn1SearchTaglist(taglist, &lasttag,
+ itag = GRSTasn1SearchTaglist(taglist, lasttag,
"-1-1-1-1-2-1-1-1-1-1-1-1");
X509_NAME *xname;
printf("n=%d dn=%s obj2txt=%s\n", n, dn, OBJ_obj2txt(NULL,0,obj,1));
- GRSTasn1GetX509Name(buf, 99, "-1-1-1-1-2-1-1-1-1-%d-1-%d", p1, taglist, &lasttag);
+ GRSTasn1GetX509Name(buf, 99, "-1-1-1-1-2-1-1-1-1-%d-1-%d",
+ p1, taglist, lasttag);
printf("%s\n", buf);
- GRSTasn1GetX509Name(buf, 99, "-1-1-1-1-3-1-1-1-%d-1-%d", p1, taglist, &lasttag);
+ GRSTasn1GetX509Name(buf, 99, "-1-1-1-1-3-1-1-1-%d-1-%d",
+ p1, taglist, lasttag);
printf("%s\n", buf);
+
+ lastcred = -1;
+ ret = GRSTx509ParseVomsExt(&lastcred, 500, 100, creds, 0, 2000040861,
+ ex,
+ "/C=UK/O=eScience/OU=Manchester/L=HEP/CN=Andrew McNab",
+ "/etc/grid-security/vomsdir");
+
+
+ printf("GRSTx509ParseVomsExt() returns %d, %d\n", ret, lastcred);
+
+ for (j=0; j <= lastcred; ++j)
+ printf("cred=%d %s\n", j, creds[j]);
/*
m = EVP_md5();