[Pkg-shadow-commits] r2020 - in upstream/trunk: . libmisc
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Sun May 25 21:23:29 UTC 2008
Author: nekral-guest
Date: 2008-05-25 21:23:28 +0000 (Sun, 25 May 2008)
New Revision: 2020
Modified:
upstream/trunk/ChangeLog
upstream/trunk/libmisc/chowndir.c
Log:
* Avoid assignment in comparisons, implicit comparison of integers to booleans.
* The return value of closedir is not checked on purpose.
* Add brackets.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2008-05-25 20:58:16 UTC (rev 2019)
+++ upstream/trunk/ChangeLog 2008-05-25 21:23:28 UTC (rev 2020)
@@ -1,5 +1,13 @@
2008-05-25 Nicolas François <nicolas.francois at 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 at centraliens.net>
+
* libmisc/chkname.h, libmisc/chkname.c: check_group_name (resp.
check_user_name) renamed to is_valid_user_name (resp.
is_valid_group_name). is_valid_user_name and is_valid_group_name
Modified: upstream/trunk/libmisc/chowndir.c
===================================================================
--- upstream/trunk/libmisc/chowndir.c 2008-05-25 20:58:16 UTC (rev 2019)
+++ upstream/trunk/libmisc/chowndir.c 2008-05-25 21:23:28 UTC (rev 2020)
@@ -104,9 +104,11 @@
* 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!) */
@@ -117,16 +119,18 @@
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);
+ sb.st_gid == old_gid ? new_gid : sb.st_gid);
+ }
}
return rc;
}
+
More information about the Pkg-shadow-commits
mailing list