From ca32f0a128e65b004c0598bebe33a4edb0385fb6 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Wed, 27 May 2026 21:36:45 +0200 Subject: [PATCH] nwbind: use build date in server information 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. --- CMakeLists.txt | 5 +++++ src/CMakeLists.txt | 1 + src/nwbind.c | 18 +++++++++--------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 352ed7f..a61eb5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b4d91ee..eda9a4c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) diff --git a/src/nwbind.c b/src/nwbind.c index 5bc5460..540c75d 100644 --- a/src/nwbind.c +++ b/src/nwbind.c @@ -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);