nwbind: report mars-nwe version as server description
All checks were successful
Source release / source-package (push) Successful in 48s

Replace the old hard-coded server description date with a Mars NWE
version string built from the existing _VERS_H_, _VERS_L_ and _VERS_P_
build macros.

WHOAMI and similar clients display this value in the line:

  Server <name> is running <description>.

Instead of reporting the legacy fixed value "14-Jun-03", the server now
reports a stable release-style description such as:

  mars-nwe-0.99.pl28

Also advance the response buffer after writing the revision string so the
description field does not overwrite the previous field.
This commit is contained in:
Mario Fetka
2026-05-27 21:03:53 +02:00
parent 9aa71115b7
commit 8e8bf9ec33

View File

@@ -1,7 +1,5 @@
/* nwbind.c */
#define REVISION_DATE "14-Jun-03" // (M@K)
/* NCP Bindery SUB-SERVER */
/* authentification and some message and queue handling */
@@ -1752,15 +1750,21 @@ static void handle_fxx(int gelen, int func)
case 0xc9 : { /* GET FILE SERVER DESCRIPTION STRINGs */
char *company = "KoanSoftware.com";
char *revision = "Version %d.%d.pl%d [KOAN]"; // (M@K)
char *revision_date = REVISION_DATE;
char revision_date[64];
char *copyright = "(C)M.Stover";
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);
l = 1 + sprintf(responsedata+k, revision,
_VERS_H_, _VERS_L_, _VERS_P_ );
k += l;
strcpy(responsedata+k, revision_date);
k += (strlen(revision_date)+1);
strcpy(responsedata+k, copyright);