summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Craig <rpcraig@tycho.ncsc.mil>2013-01-30 12:54:46 -0500
committerRobert Craig <rpcraig@tycho.ncsc.mil>2013-01-30 13:46:01 -0500
commit2929313c66014bce5d53cf4323a9db507ca5b139 (patch)
treed65a96b0b7ac76da1e8102250dd686379ba6692a
parentf52abf4ca2ce307e7d4056e02c9e22075ab65459 (diff)
downloadextras-2929313c66014bce5d53cf4323a9db507ca5b139.tar.gz
Fix root inode security labeling issue.
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>
-rw-r--r--ext4_utils/make_ext4fs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index 5c1003d3..f62fee9f 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -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);