src/, lib/, tests/: Rename STRLCPY() to STRTCPY()

It is a wrapper around STRTCPY(), so use a proper name.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2023-11-12 14:00:47 +01:00
committed by Iker Pedrosa
parent 6adaa40135
commit 090c019ada
12 changed files with 38 additions and 38 deletions
+1 -1
View File
@@ -823,7 +823,7 @@ int main (int argc, char **argv)
fail_exit (E_NOPERM);
}
STRLCPY(user_name, pw->pw_name);
STRTCPY(user_name, pw->pw_name);
#ifdef WITH_TCB
if (shadowtcb_set_user (pw->pw_name) == SHADOWTCB_FAILURE) {
fail_exit (E_NOPERM);
+6 -6
View File
@@ -276,7 +276,7 @@ static void process_flags (int argc, char **argv)
exit (E_NOPERM);
}
fflg = true;
STRLCPY(fullnm, optarg);
STRTCPY(fullnm, optarg);
break;
case 'h':
if (!may_change_field ('h')) {
@@ -285,7 +285,7 @@ static void process_flags (int argc, char **argv)
exit (E_NOPERM);
}
hflg = true;
STRLCPY(homeph, optarg);
STRTCPY(homeph, optarg);
break;
case 'o':
if (!amroot) {
@@ -299,7 +299,7 @@ static void process_flags (int argc, char **argv)
_("%s: fields too long\n"), Prog);
exit (E_NOPERM);
}
STRLCPY(slop, optarg);
STRTCPY(slop, optarg);
break;
case 'r':
if (!may_change_field ('r')) {
@@ -308,7 +308,7 @@ static void process_flags (int argc, char **argv)
exit (E_NOPERM);
}
rflg = true;
STRLCPY(roomno, optarg);
STRTCPY(roomno, optarg);
break;
case 'R': /* no-op, handled in process_root_flag () */
break;
@@ -322,7 +322,7 @@ static void process_flags (int argc, char **argv)
exit (E_NOPERM);
}
wflg = true;
STRLCPY(workph, optarg);
STRTCPY(workph, optarg);
break;
default:
usage (E_USAGE);
@@ -510,7 +510,7 @@ static void get_old_fields (const char *gecos)
char *cp; /* temporary character pointer */
char old_gecos[BUFSIZ]; /* buffer for old GECOS fields */
STRLCPY(old_gecos, gecos);
STRTCPY(old_gecos, gecos);
/*
* Now get the full name. It is the first comma separated field in
+2 -2
View File
@@ -258,7 +258,7 @@ static void process_flags (int argc, char **argv)
break;
case 's':
sflg = true;
STRLCPY(loginsh, optarg);
STRTCPY(loginsh, optarg);
break;
default:
usage (E_USAGE);
@@ -553,7 +553,7 @@ int main (int argc, char **argv)
* file, or use the value from the command line.
*/
if (!sflg) {
STRLCPY(loginsh, pw->pw_shell);
STRTCPY(loginsh, pw->pw_shell);
}
/*
+1 -1
View File
@@ -897,7 +897,7 @@ static void change_passwd (struct group *gr)
exit (1);
}
STRLCPY(pass, cp);
STRTCPY(pass, cp);
erase_pass (cp);
cp = agetpass (_("Re-enter new password: "));
if (NULL == cp) {
+2 -2
View File
@@ -553,7 +553,7 @@ int main (int argc, char **argv)
if (NULL == tmptty) {
tmptty = "UNKNOWN";
}
STRLCPY(tty, tmptty);
STRTCPY(tty, tmptty);
#ifndef USE_PAM
is_console = console (tty);
@@ -711,7 +711,7 @@ int main (int argc, char **argv)
sizeof (loginprompt),
_("%s login: "), hostn);
} else {
STRLCPY(loginprompt, _("login: "));
STRTCPY(loginprompt, _("login: "));
}
retcode = pam_set_item (pamh, PAM_USER_PROMPT, loginprompt);
+4 -4
View File
@@ -241,7 +241,7 @@ static int new_password (const struct passwd *pw)
pw->pw_name);
return -1;
}
STRLCPY(orig, clear);
STRTCPY(orig, clear);
erase_pass (clear);
strzero (cipher);
} else {
@@ -303,7 +303,7 @@ static int new_password (const struct passwd *pw)
if (warned && (strcmp (pass, cp) != 0)) {
warned = false;
}
STRLCPY(pass, cp);
STRTCPY(pass, cp);
erase_pass (cp);
if (!amroot && (!obscure (orig, pass, pw) || reuse (pass, pw))) {
@@ -360,7 +360,7 @@ static int new_password (const struct passwd *pw)
#ifdef HAVE_LIBCRACK_HIST
HistUpdate (pw->pw_name, crypt_passwd);
#endif /* HAVE_LIBCRACK_HIST */
STRLCPY(crypt_passwd, cp);
STRTCPY(crypt_passwd, cp);
return 0;
}
@@ -1031,7 +1031,7 @@ int main (int argc, char **argv)
* If there are no other flags, just change the password.
*/
if (!anyflag) {
STRLCPY(crypt_passwd, cp);
STRTCPY(crypt_passwd, cp);
/*
* See if the user is permitted to change the password.
+3 -3
View File
@@ -676,7 +676,7 @@ static /*@only@*/struct passwd * do_check_perms (void)
SYSLOG ((LOG_INFO,
"Change user from '%s' to '%s' as requested by PAM",
name, tmp_name));
if (STRLCPY(name, tmp_name) == -1) {
if (STRTCPY(name, tmp_name) == -1) {
fprintf (stderr, _("Overlong user name '%s'\n"),
tmp_name);
SYSLOG ((LOG_NOTICE, "Overlong user name '%s'",
@@ -778,7 +778,7 @@ static void save_caller_context (char **argv)
(unsigned long) caller_uid));
su_failure (caller_tty, true); /* unknown target UID*/
}
STRLCPY(caller_name, pw->pw_name);
STRTCPY(caller_name, pw->pw_name);
#ifndef USE_PAM
#ifdef SU_ACCESS
@@ -853,7 +853,7 @@ static void process_flags (int argc, char **argv)
}
if (optind < argc) {
STRLCPY(name, argv[optind++]); /* use this login id */
STRTCPY(name, argv[optind++]); /* use this login id */
}
if ('\0' == name[0]) { /* use default user */
struct passwd *root_pw = getpwnam ("root");
+1 -1
View File
@@ -160,7 +160,7 @@ static void catch_signals (unused int sig)
#endif
exit (0);
}
STRLCPY(pass, cp);
STRTCPY(pass, cp);
erase_pass (cp);
if (valid (pass, &pwent)) { /* check encrypted passwords ... */