* an error string on error.
*/
-char *
-login_getcapstr(login_cap_t *lc, const char *cap, char *def, char *error)
+const char *
+login_getcapstr(login_cap_t *lc, const char *cap, const char *def, const char *error)
{
char *res;
int ret;
if (chars == NULL)
chars = ", \t";
- if ((lstring = login_getcapstr(lc, cap, NULL, NULL)) != NULL)
+ if ((lstring = (char *)login_getcapstr(lc, cap, NULL, NULL)) != NULL)
return arrayize(lstring, chars, NULL);
return NULL;
}
* If there is an error of any kind, return <error>.
*/
-char *
-login_getpath(login_cap_t *lc, const char *cap, char * error)
+const char *
+login_getpath(login_cap_t *lc, const char *cap, const char *error)
{
- char *str;
+ const char *str;
- if ((str = login_getcapstr(lc, (char*)cap, NULL, NULL)) == NULL)
+ if ((str = login_getcapstr(lc, cap, NULL, NULL)) == NULL)
str = error;
else {
- char *ptr = str;
+ char *ptr = (char *)str;
while (*ptr) {
int count = strcspn(ptr, ", \t");
* login_getstyle(lc, "skey", "network");
*/
-char *
-login_getstyle(login_cap_t *lc, char *style, const char *auth)
+const char *
+login_getstyle(login_cap_t *lc, const char *style, const char *auth)
{
int i;
char **authtypes = NULL;
login_cap_t *login_getpwclass(const struct passwd *);
login_cap_t *login_getuserclass(const struct passwd *);
-char *login_getcapstr(login_cap_t*, const char *, char *, char *);
+const char *login_getcapstr(login_cap_t*, const char *, const char *, const char *);
char **login_getcaplist(login_cap_t *, const char *, const char *);
-char *login_getstyle(login_cap_t *, char *, const char *);
+const char *login_getstyle(login_cap_t *, const char *, const char *);
rlim_t login_getcaptime(login_cap_t *, const char *, rlim_t, rlim_t);
rlim_t login_getcapnum(login_cap_t *, const char *, rlim_t, rlim_t);
rlim_t login_getcapsize(login_cap_t *, const char *, rlim_t, rlim_t);
-char *login_getpath(login_cap_t *, const char *, char *);
+const char *login_getpath(login_cap_t *, const char *, const char *);
int login_getcapbool(login_cap_t *, const char *, int);
const char *login_setcryptfmt(login_cap_t *, const char *, const char *);
login_setcryptfmt(login_cap_t *lc, const char *def, const char *error) {
const char *cipher;
- cipher = login_getcapstr(lc, "passwd_format", (char *)def, NULL);
+ cipher = login_getcapstr(lc, "passwd_format", def, NULL);
if (getenv("CRYPT_DEBUG") != NULL)
fprintf(stderr, "login_setcryptfmt: "
"passwd_format = %s\n", cipher);