Add option to enable / disable root user mgmt.
Provided option to enable / disable managing root user
under phosphor-user-manager. Default root user is managed
by phosphor-user-manager, but can be disbaled if needed.
Tested:
1. Verified that root user is listed as an object,
in default build
2. Verified that root user is not listed as an object with
EXTRA_OECONF += "--disable-root_user_mgmt"
Change-Id: I5efdf99746739e8ae77e78056893ee5f635364ea
Signed-off-by: Richard Marian Thomaiyar <richard.marian.thomaiyar@linux.intel.com>
diff --git a/user_mgr.cpp b/user_mgr.cpp
index 17146e6..2f22323 100644
--- a/user_mgr.cpp
+++ b/user_mgr.cpp
@@ -752,10 +752,15 @@
// Any error, break the loop.
break;
}
+#ifdef ENABLE_ROOT_USER_MGMT
// Add all users whose UID >= 1000 and < 65534
// and special UID 0.
if ((pwp->pw_uid == 0) ||
((pwp->pw_uid >= 1000) && (pwp->pw_uid < 65534)))
+#else
+ // Add all users whose UID >=1000 and < 65534
+ if ((pwp->pw_uid >= 1000) && (pwp->pw_uid < 65534))
+#endif
{
std::string userName(pwp->pw_name);
userList.emplace_back(userName);