diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2008-11-04 13:49:53 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2008-11-04 13:49:53 +0000 |
commit | 8ca37caf8521740d66c31267b139610af0413b66 (patch) | |
tree | b1768cd4c354a99636e42a31db8df0bf15d3479f /libutil | |
parent | 324bb988594da72879f2e8e24326331b36bd701b (diff) | |
download | pw-darwin-8ca37caf8521740d66c31267b139610af0413b66.tar.gz pw-darwin-8ca37caf8521740d66c31267b139610af0413b66.tar.zst pw-darwin-8ca37caf8521740d66c31267b139610af0413b66.zip |
Avoid assigning a const char * to a char *.
MFC after: 3 weeks
Diffstat (limited to 'libutil')
-rw-r--r-- | libutil/login_cap.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libutil/login_cap.c b/libutil/login_cap.c index 529ce82..8fee760 100644 --- a/libutil/login_cap.c +++ b/libutil/login_cap.c @@ -61,6 +61,8 @@ static char * internal_string = NULL; static size_t internal_arraysz = 0; static const char ** internal_array = NULL; +static char path_login_conf[] = _PATH_LOGIN_CONF; + static char * allocstr(const char *str) { @@ -215,15 +217,14 @@ login_getclassbyname(char const *name, const struct passwd *pwd) if (dir && snprintf(userpath, MAXPATHLEN, "%s/%s", dir, _FILE_LOGIN_CONF) < MAXPATHLEN) { - login_dbarray[i] = userpath; if (_secure_path(userpath, pwd->pw_uid, pwd->pw_gid) != -1) - i++; /* only use 'secure' data */ + login_dbarray[i++] = userpath; } /* * XXX: Why to add the system database if the class is `me'? */ - if (_secure_path(_PATH_LOGIN_CONF, 0, 0) != -1) - login_dbarray[i++] = _PATH_LOGIN_CONF; + if (_secure_path(path_login_conf, 0, 0) != -1) + login_dbarray[i++] = path_login_conf; login_dbarray[i] = NULL; memset(lc, 0, sizeof(login_cap_t)); |