]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
getdefs: add foreign (non-shadow-utils) items 286/head
authorKarel Zak <kzak@redhat.com>
Thu, 8 Oct 2020 10:17:30 +0000 (12:17 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 8 Oct 2020 10:30:53 +0000 (12:30 +0200)
The login.defs is shared between more upstream projects (util-linux,
etc.). We need to improve compatibility between the projects do not
report valid, but foreign items.

Addresses: https://github.com/shadow-maint/shadow/issues/276
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/getdef.c

index 54c31303762933eebcd3691fcd0706820dcb8e7e..926836257db8d303c48d634aab0382e86bf9c840 100644 (file)
@@ -77,6 +77,16 @@ struct itemdef {
        {"SU_WHEEL_ONLY", NULL},                \
        {"ULIMIT", NULL},
 
+/*
+ * Items used in other tools (util-linux, etc.)
+ */
+#define FOREIGNDEFS                            \
+       {"ALWAYS_SET_PATH", NULL},              \
+       {"ENV_ROOTPATH", NULL},                 \
+       {"LOGIN_KEEP_USERNAME", NULL},          \
+       {"LOGIN_PLAIN_PROMPT", NULL},           \
+       {"MOTD_FIRSTONLY", NULL},               \
+
 
 #define NUMDEFS        (sizeof(def_table)/sizeof(def_table[0]))
 static struct itemdef def_table[] = {
@@ -158,6 +168,7 @@ static struct itemdef knowndef_table[] = {
 #ifdef USE_PAM
        PAMDEFS
 #endif
+       FOREIGNDEFS
        {NULL, NULL}
 };
 
@@ -414,7 +425,6 @@ static /*@observer@*/ /*@null@*/struct itemdef *def_find (const char *name)
 {
        struct itemdef *ptr;
 
-
        /*
         * Search into the table.
         */