namespace: allow "namespace" config directive instead of "container"

The namespace config still has the "container" directive, which should have
been named "namespace". It's a leftover from the original working draft that
was named "container extension".

For the time being, keep backwards compatibility by allowing both tokens
"container" as well as "namespace" for the same directive. But consider the
old token as deprecated, it shouldn't be used anymore and might go away
in the near future.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-08-12 12:16:37 +02:00
committed by Enrico Weigelt
parent 3af53d474f
commit e98a3a5ff4

View File

@@ -66,7 +66,7 @@ static int hex2bin(const char *in, char *out)
/*
* loadConfig
*
* Load the container config
* Load the namespace config
*/
static void parseLine(char *line, struct Xnamespace **walk_ns)
{
@@ -84,10 +84,11 @@ static void parseLine(char *line, struct Xnamespace **walk_ns)
if (token == NULL)
return;
// if no "container" statement hasn't been issued yet, use root NS
/* if no "namespace" statement hasn't been issued yet, use root NS */
struct Xnamespace * curr = (*walk_ns ? *walk_ns : &ns_root);
if (strcmp(token, "container") == 0)
if ((strcmp(token, "namespace") == 0) ||
(strcmp(token, "container") == 0)) /* "container" is deprecated ! */
{
if ((token = strtok(NULL, " ")) == NULL)
{
@@ -171,7 +172,7 @@ Bool XnsLoadConfig(void)
FILE *fp = fopen(namespaceConfigFile, "r");
if (fp == NULL) {
FatalError("failed loading container config: %s\n", namespaceConfigFile);
FatalError("failed loading namespace config: %s\n", namespaceConfigFile);
return FALSE;
}