Skip to content

Commit

Permalink
Fixed the runtime version checker for HPSS 7.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonAlt committed Feb 27, 2023
1 parent 49792fa commit dbe9318
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use fedora version formatting, ie. 2.17, 2.17~rc1.
AC_INIT([globus-gridftp-server-hpss], [2.18], [Globus <[email protected]>])
AC_INIT([globus-gridftp-server-hpss], [2.19~a3], [Globus <[email protected]>])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
# automake 1.11.1 (RHEL 6.8) does not support AM_PROG_AR
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
Expand Down
2 changes: 1 addition & 1 deletion packaging/fedora/globus-gridftp-server-hpss.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Summary: HPSS Connector for Globus
Name: @PACKAGE_NAME@-@HPSS_MAJOR@.@HPSS_MINOR@
Version: @PACKAGE_VERSION@
Release: 2%{?dist}+%{_gcs_tag}
Release: 1%{?dist}+%{_gcs_tag}
License: ASL 2.0
URL: https://github.com/JasonAlt/GridFTP-DSI-for-HPSS
Source: @PACKAGE_NAME@-%{version}.tar.gz
Expand Down
15 changes: 11 additions & 4 deletions source/module/dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* System includes
*/
#include <string.h>
#include <stdlib.h>

/*
* Globus includes
Expand Down Expand Up @@ -47,19 +48,25 @@ dsi_init(globus_gfs_operation_t Operation,

/*
* Verify the HPSS version.
*
* HPSS_MAJOR_VERSION could be either double digits, ie 07 for pre HPSS 8.x or
* single digit, ie 8, for HPSS 8.x and later.
*/
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
// Runtime version string
char * version_string = Hpss_BuildLevelString();
char major[2] = {version_string[0]};
char minor[2] = {version_string[2]};

if (version_string == NULL ||
strlen(version_string) < 3 ||
version_string[0] != TOSTRING(HPSS_MAJOR_VERSION)[0] ||
version_string[2] != TOSTRING(HPSS_MINOR_VERSION)[0])
atoi(major) != HPSS_MAJOR_VERSION ||
atoi(minor) != HPSS_MINOR_VERSION)
{
ERROR("The HPSS connector was not built for this version of HPSS. "
"Runtime verion is %s. Buildtime version was %d.%d",
version_string,
"Runtime version is %s. Buildtime version was %d.%d",
version_string ? version_string : "NULL",
HPSS_MAJOR_VERSION,
HPSS_MINOR_VERSION);
result = HPSSWrongVersion();
Expand Down

0 comments on commit dbe9318

Please sign in to comment.