strc{py,at}_truncate -> strlc{py,at}

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6985 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-09-16 21:39:11 +00:00
parent bf75fac82a
commit d3f5d79294
15 changed files with 52 additions and 48 deletions

View File

@@ -116,7 +116,7 @@ add_one_principal (const char *name,
if(rand_key) {
princ.attributes |= KRB5_KDB_DISALLOW_ALL_TIX;
mask |= KADM5_ATTRIBUTES;
strcpy_truncate (pwbuf, "hemlig", sizeof(pwbuf));
strlcpy (pwbuf, "hemlig", sizeof(pwbuf));
password = pwbuf;
} else if (rand_password) {
random_password (pwbuf, sizeof(pwbuf));

View File

@@ -74,7 +74,7 @@ random_password(char *pw, size_t len)
"abcdefghijklmnopqrstuvwxyz", 7,
"ABCDEFGHIJKLMNOPQRSTUVWXYZ", 2,
"@$%&*()-+=:,/<>1234567890", 1);
strcpy_truncate(pw, pass, len);
strlcpy(pw, pass, len);
memset(pass, 0, strlen(pass));
free(pass);
#endif

View File

@@ -85,12 +85,12 @@ ret_vals(krb5_storage *sp, Kadm_vals *vals)
switch(field) {
case KADM_NAME:
krb5_ret_stringz(sp, &tmp_string);
strcpy_truncate(vals->name, tmp_string, sizeof(vals->name));
strlcpy(vals->name, tmp_string, sizeof(vals->name));
free(tmp_string);
break;
case KADM_INST:
krb5_ret_stringz(sp, &tmp_string);
strcpy_truncate(vals->instance, tmp_string,
strlcpy(vals->instance, tmp_string,
sizeof(vals->instance));
free(tmp_string);
break;
@@ -113,13 +113,13 @@ ret_vals(krb5_storage *sp, Kadm_vals *vals)
break;
case KADM_MODNAME:
krb5_ret_stringz(sp, &tmp_string);
strcpy_truncate(vals->mod_name, tmp_string,
strlcpy(vals->mod_name, tmp_string,
sizeof(vals->mod_name));
free(tmp_string);
break;
case KADM_MODINST:
krb5_ret_stringz(sp, &tmp_string);
strcpy_truncate(vals->mod_instance, tmp_string,
strlcpy(vals->mod_instance, tmp_string,
sizeof(vals->mod_instance));
free(tmp_string);
break;