Remove tailing slash on home dir

Closes #434

Signed-off-by: ed neville <ed@s5h.net>
This commit is contained in:
ed neville 2021-12-17 11:30:57 +00:00
parent c0e4ccd032
commit 53763ae6ee

View File

@ -584,6 +584,12 @@ static void new_pwent (struct passwd *pwent)
SYSLOG ((LOG_INFO, SYSLOG ((LOG_INFO,
"change user '%s' home from '%s' to '%s'", "change user '%s' home from '%s' to '%s'",
pwent->pw_name, pwent->pw_dir, user_newhome)); pwent->pw_name, pwent->pw_dir, user_newhome));
if (strlen(user_newhome) > 1
&& '/' == user_newhome[strlen(user_newhome)-1]) {
user_newhome[strlen(user_newhome)-1]='\0';
}
pwent->pw_dir = user_newhome; pwent->pw_dir = user_newhome;
} }
if (sflg) { if (sflg) {