OSDN Git Service

Fix root inode security labeling issue.
authorRobert Craig <rpcraig@tycho.ncsc.mil>
Wed, 30 Jan 2013 17:54:46 +0000 (12:54 -0500)
committerRobert Craig <rpcraig@tycho.ncsc.mil>
Wed, 30 Jan 2013 18:46:01 +0000 (13:46 -0500)
Introducing the verbose flag accidentally wrapped the
security label function call for the root inode. The
system.img will not be correctly labeled without this change.

Change-Id: If73b63d4ee815bbf428dc3d72b9df000a2075a45
Signed-off-by: Robert Craig <rpcraig@tycho.ncsc.mil>
ext4_utils/make_ext4fs.c

index 5c1003d..f62fee9 100644 (file)
@@ -568,8 +568,10 @@ int make_ext4fs_internal(int fd, const char *_directory,
                if (selabel_lookup(sehnd, &secontext, mountpoint, S_IFDIR) < 0) {
                        error("cannot lookup security context for %s", mountpoint);
                }
-               if (secontext && verbose) {
-                       printf("Labeling %s as %s\n", mountpoint, secontext);
+               if (secontext) {
+                       if (verbose) {
+                               printf("Labeling %s as %s\n", mountpoint, secontext);
+                       }
                        inode_set_selinux(root_inode_num, secontext);
                }
                freecon(secontext);