diff options
author | Balint Reczey <balint@balintreczey.hu> | 2021-11-07 15:18:49 +0100 |
---|---|---|
committer | Balint Reczey <balint@balintreczey.hu> | 2021-11-07 15:18:49 +0100 |
commit | 749c1780621163ca5108f164861324bafa9e0ae8 (patch) | |
tree | 51001872624a692018c45bf39276df94b603fb19 /lib/getdef.c | |
parent | d906ecd3b652d95af6ffb974a2f6669501bb9496 (diff) | |
download | shadow-749c1780621163ca5108f164861324bafa9e0ae8.tar.gz |
New upstream version 4.9upstream/4.9
Diffstat (limited to 'lib/getdef.c')
-rw-r--r-- | lib/getdef.c | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/lib/getdef.c b/lib/getdef.c index 00f6abfe..80eb18c4 100644 --- a/lib/getdef.c +++ b/lib/getdef.c @@ -61,6 +61,7 @@ struct itemdef { {"ENV_TZ", NULL}, \ {"FAILLOG_ENAB", NULL}, \ {"FTMP_FILE", NULL}, \ + {"HMAC_CRYPTO_ALGO", NULL}, \ {"ISSUE_FILE", NULL}, \ {"LASTLOG_ENAB", NULL}, \ {"LOGIN_STRING", NULL}, \ @@ -77,6 +78,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[] = { @@ -105,6 +116,7 @@ static struct itemdef def_table[] = { {"MAIL_FILE", NULL}, {"MAX_MEMBERS_PER_GROUP", NULL}, {"MD5_CRYPT_ENAB", NULL}, + {"NONEXISTENT", NULL}, {"PASS_MAX_DAYS", NULL}, {"PASS_MIN_DAYS", NULL}, {"PASS_WARN_AGE", NULL}, @@ -116,6 +128,9 @@ static struct itemdef def_table[] = { {"BCRYPT_MAX_ROUNDS", NULL}, {"BCRYPT_MIN_ROUNDS", NULL}, #endif +#ifdef USE_YESCRYPT + {"YESCRYPT_COST_FACTOR", NULL}, +#endif {"SUB_GID_COUNT", NULL}, {"SUB_GID_MAX", NULL}, {"SUB_GID_MIN", NULL}, @@ -149,6 +164,8 @@ static struct itemdef def_table[] = { {"USE_TCB", NULL}, #endif {"FORCE_SHADOW", NULL}, + {"GRANT_AUX_GROUP_SUBIDS", NULL}, + {"PREVENT_NO_AUTH", NULL}, {NULL, NULL} }; @@ -157,6 +174,7 @@ static struct itemdef knowndef_table[] = { #ifdef USE_PAM PAMDEFS #endif + FOREIGNDEFS {NULL, NULL} }; @@ -249,7 +267,7 @@ int getdef_num (const char *item, int dflt) if ( (getlong (d->value, &val) == 0) || (val > INT_MAX) || (val < INT_MIN)) { - fprintf (stderr, + fprintf (shadow_logfd, _("configuration error - cannot parse %s value: '%s'"), item, d->value); return dflt; @@ -284,7 +302,7 @@ unsigned int getdef_unum (const char *item, unsigned int dflt) if ( (getlong (d->value, &val) == 0) || (val < 0) || (val > INT_MAX)) { - fprintf (stderr, + fprintf (shadow_logfd, _("configuration error - cannot parse %s value: '%s'"), item, d->value); return dflt; @@ -317,7 +335,7 @@ long getdef_long (const char *item, long dflt) } if (getlong (d->value, &val) == 0) { - fprintf (stderr, + fprintf (shadow_logfd, _("configuration error - cannot parse %s value: '%s'"), item, d->value); return dflt; @@ -350,7 +368,7 @@ unsigned long getdef_ulong (const char *item, unsigned long dflt) if (getulong (d->value, &val) == 0) { /* FIXME: we should have a getulong */ - fprintf (stderr, + fprintf (shadow_logfd, _("configuration error - cannot parse %s value: '%s'"), item, d->value); return dflt; @@ -388,7 +406,7 @@ int putdef_str (const char *name, const char *value) cp = strdup (value); if (NULL == cp) { (void) fputs (_("Could not allocate space for config info.\n"), - stderr); + shadow_logfd); SYSLOG ((LOG_ERR, "could not allocate space for config info")); return -1; } @@ -413,7 +431,6 @@ static /*@observer@*/ /*@null@*/struct itemdef *def_find (const char *name) { struct itemdef *ptr; - /* * Search into the table. */ @@ -433,7 +450,7 @@ static /*@observer@*/ /*@null@*/struct itemdef *def_find (const char *name) goto out; } } - fprintf (stderr, + fprintf (shadow_logfd, _("configuration error - unknown item '%s' (notify administrator)\n"), name); SYSLOG ((LOG_CRIT, "unknown configuration item `%s'", name)); |