nwbind: use build date in server information
All checks were successful
Source release / source-package (push) Successful in 49s

Keep the server information fields semantically distinct after replacing
the legacy KOAN/14-Jun-03 strings.

The revision string now reports the Mars NWE release version, for
example:

  Mars NWE 0.99.pl28

and the separate revision-date field is populated from a CMake-provided
build date in the traditional NetWare-style format, for example:

  27-May-26

The build date can be overridden through CMake for reproducible builds;
otherwise it defaults to the current UTC build date.
This commit is contained in:
Mario Fetka
2026-05-27 21:36:45 +02:00
parent 8e8bf9ec33
commit ca32f0a128
3 changed files with 15 additions and 9 deletions

View File

@@ -12,6 +12,11 @@ SET (VERSION_PATCH "28")
SET (MARS_NWE_VERSION_BASE "${VERSION_MAJOR}.${VERSION_MINOR}.pl${VERSION_PATCH}")
SET (MARS_NWE_VERSION "${MARS_NWE_VERSION_BASE}")
set(MARS_NWE_BUILD_DATE "" CACHE STRING "Mars NWE build date used in server info (DD-Mon-YY)")
if(MARS_NWE_BUILD_DATE STREQUAL "")
string(TIMESTAMP MARS_NWE_BUILD_DATE "%d-%b-%y" UTC)
endif()
find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")

View File

@@ -18,6 +18,7 @@ add_definitions(
-D_VERS_H_=${VERSION_MAJOR}
-D_VERS_L_=${VERSION_MINOR}
-D_VERS_P_=${VERSION_PATCH}
-DMARS_NWE_BUILD_DATE=\"${MARS_NWE_BUILD_DATE}\"
)
IF(MARS_NWE_QUOTA_SUPPORT)

View File

@@ -1,5 +1,9 @@
/* nwbind.c */
#ifndef MARS_NWE_BUILD_DATE
#define MARS_NWE_BUILD_DATE "unknown"
#endif
/* NCP Bindery SUB-SERVER */
/* authentification and some message and queue handling */
@@ -1748,17 +1752,13 @@ static void handle_fxx(int gelen, int func)
} break;
case 0xc9 : { /* GET FILE SERVER DESCRIPTION STRINGs */
char *company = "KoanSoftware.com";
char *revision = "Version %d.%d.pl%d [KOAN]"; // (M@K)
char revision_date[64];
char *copyright = "(C)M.Stover";
char *company = "www.disconnected-by-peer.at";
char *revision = "Mars NWE %d.%d.pl%d";
char *revision_date = MARS_NWE_BUILD_DATE;
char *copyright = "(C) Martin Stover and contributors";
int k=strlen(company)+1;
int l;
snprintf(revision_date, sizeof(revision_date),
"mars-nwe-%d.%d.pl%d",
_VERS_H_, _VERS_L_, _VERS_P_);
revision_date[sizeof(revision_date)-1] = '\0';
memset(responsedata, 0, 512);
strcpy(responsedata, company);