* lib/tcbfuncs.c: Avoid implicit int to mode_t conversion.

This commit is contained in:
nekral-guest 2010-03-18 00:05:57 +00:00
parent fba0a83c03
commit 1d6673a166
2 changed files with 3 additions and 2 deletions

View File

@ -20,6 +20,7 @@
* lib/tcbfuncs.c: Removed dead return.
* lib/tcbfuncs.c: move_dir() and shadowtcb_move() need a non NULL
stored_tcb_user.
* lib/tcbfuncs.c: Avoid implicit int to mode_t conversion.
2010-03-17 Nicolas François <nicolas.francois@centraliens.net>

View File

@ -502,7 +502,7 @@ shadowtcb_status shadowtcb_create(const char *name, uid_t uid)
fprintf(stderr, _("%s: Cannot change owner of %s: %s\n"), Prog, shadow, strerror(errno));
goto out_free;
}
if (chmod(shadow, authgid == shadowgid ? 0600 : 0640) != 0) {
if (chmod(shadow, (mode_t) ((authgid == shadowgid) ? 0600 : 0640)) != 0) {
fprintf(stderr, _("%s: Cannot change mode of %s: %s\n"), Prog, shadow, strerror(errno));
goto out_free;
}
@ -510,7 +510,7 @@ shadowtcb_status shadowtcb_create(const char *name, uid_t uid)
fprintf(stderr, _("%s: Cannot change owner of %s: %s\n"), Prog, dir, strerror(errno));
goto out_free;
}
if (chmod(dir, authgid == shadowgid ? 02700 : 02710) != 0) {
if (chmod(dir, (mode_t) ((authgid == shadowgid) ? 02700 : 02710)) != 0) {
fprintf(stderr, _("%s: Cannot change mode of %s: %s\n"), Prog, dir, strerror(errno));
goto out_free;
}