Merge pull request #432 from galaxy4public/tcb-missing-chmod

Add missing chmod() for shadowtcb_move()
This commit is contained in:
Serge Hallyn 2021-10-30 11:02:12 -05:00 committed by GitHub
commit b17a17c93d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -523,6 +523,12 @@ shadowtcb_status shadowtcb_move (/*@NULL@*/const char *user_newname, uid_t user_
Prog, tcbdir, strerror (errno));
goto out_free;
}
if (chmod (tcbdir, dirmode.st_mode & 07777) != 0) {
fprintf (shadow_logfd,
_("%s: Cannot change mode of %s: %s\n"),
Prog, tcbdir, strerror (errno));
goto out_free;
}
ret = SHADOWTCB_SUCCESS;
out_free:
free (tcbdir);