* Avoid assignment in comparisons, implicit comparison of integers to booleans.
* The return value of closedir is not checked on purpose. * Add brackets.
This commit is contained in:
parent
623d9e2ab3
commit
06d2a32a3e
@ -1,3 +1,11 @@
|
||||
2008-05-25 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/chowndir.c: Avoid assignment in comparisons, implicit
|
||||
comparison of integers to booleans.
|
||||
* libmisc/chowndir.c: The return value of closedir is not checked
|
||||
on purpose.
|
||||
* libmisc/chowndir.c: Add brackets.
|
||||
|
||||
2008-05-25 Nicolas François <nicolas.francois@centraliens.net>
|
||||
|
||||
* libmisc/chkname.h, libmisc/chkname.c: check_group_name (resp.
|
||||
|
@ -104,10 +104,12 @@ chown_tree (const char *root, uid_t old_uid, uid_t new_uid, gid_t old_gid,
|
||||
* Do the entire subdirectory.
|
||||
*/
|
||||
|
||||
if ((rc = chown_tree (new_name, old_uid, new_uid,
|
||||
old_gid, new_gid)))
|
||||
rc = chown_tree (new_name, old_uid, new_uid,
|
||||
old_gid, new_gid);
|
||||
if (0 != rc) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifndef HAVE_LCHOWN
|
||||
/* don't use chown (follows symbolic links!) */
|
||||
if (S_ISLNK (sb.st_mode))
|
||||
@ -117,16 +119,18 @@ chown_tree (const char *root, uid_t old_uid, uid_t new_uid, gid_t old_gid,
|
||||
LCHOWN (new_name, new_uid,
|
||||
sb.st_gid == old_gid ? new_gid : sb.st_gid);
|
||||
}
|
||||
closedir (dir);
|
||||
(void) closedir (dir);
|
||||
|
||||
/*
|
||||
* Now do the root of the tree
|
||||
*/
|
||||
|
||||
if (!stat (root, &sb)) {
|
||||
if (sb.st_uid == old_uid)
|
||||
if (stat (root, &sb) == 0) {
|
||||
if (sb.st_uid == old_uid) {
|
||||
LCHOWN (root, new_uid,
|
||||
sb.st_gid == old_gid ? new_gid : sb.st_gid);
|
||||
}
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user