Remove tailing slash on home dir
Closes #434 Signed-off-by: ed neville <ed@s5h.net>
This commit is contained in:
parent
c0e4ccd032
commit
53763ae6ee
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user