Skip to content

Commit a260f18

Browse files
committed
shadowlock: disable until proper unit tests are run
Commit 8eb5397 fixed an issue where the shadowlock objects were not being created or used. That brought to light an issue with the implementation of that class. For now, comment out the use of the shadowlock to get us back to where we were prior to the commit and give us some time to fix it and ensure all tests pass as expected. See #10 for more details. Signed-off-by: Andrew Geissler <[email protected]> Change-Id: I570dd6bd3a308e3608525f5e08182c6491fbb7a3
1 parent 8eb5397 commit a260f18

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

user_mgr.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ void UserMgr::createUser(std::string userName,
300300
throwForInvalidPrivilege(priv);
301301
throwForInvalidGroups(groupNames);
302302
// All user management lock has to be based on /etc/shadow
303-
phosphor::user::shadow::Lock lock{};
303+
// TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
304304
throwForUserExists(userName);
305305
throwForUserNameConstraints(userName, groupNames);
306306
throwForMaxGrpUserCount(groupNames);
@@ -346,7 +346,7 @@ void UserMgr::createUser(std::string userName,
346346
void UserMgr::deleteUser(std::string userName)
347347
{
348348
// All user management lock has to be based on /etc/shadow
349-
phosphor::user::shadow::Lock lock{};
349+
// TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
350350
throwForUserDoesNotExist(userName);
351351
try
352352
{
@@ -369,7 +369,7 @@ void UserMgr::deleteUser(std::string userName)
369369
void UserMgr::renameUser(std::string userName, std::string newUserName)
370370
{
371371
// All user management lock has to be based on /etc/shadow
372-
phosphor::user::shadow::Lock lock{};
372+
// TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
373373
throwForUserDoesNotExist(userName);
374374
throwForUserExists(newUserName);
375375
throwForUserNameConstraints(newUserName,
@@ -410,7 +410,7 @@ void UserMgr::updateGroupsAndPriv(const std::string& userName,
410410
throwForInvalidPrivilege(priv);
411411
throwForInvalidGroups(groupNames);
412412
// All user management lock has to be based on /etc/shadow
413-
phosphor::user::shadow::Lock lock{};
413+
// TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
414414
throwForUserDoesNotExist(userName);
415415
const std::vector<std::string>& oldGroupNames =
416416
usersList[userName].get()->userGroups();
@@ -645,7 +645,7 @@ int UserMgr::setPamModuleArgValue(const std::string& moduleName,
645645
void UserMgr::userEnable(const std::string& userName, bool enabled)
646646
{
647647
// All user management lock has to be based on /etc/shadow
648-
phosphor::user::shadow::Lock lock{};
648+
// TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
649649
throwForUserDoesNotExist(userName);
650650
try
651651
{
@@ -678,7 +678,7 @@ static constexpr size_t t2OutputIndex = 1;
678678
bool UserMgr::userLockedForFailedAttempt(const std::string& userName)
679679
{
680680
// All user management lock has to be based on /etc/shadow
681-
phosphor::user::shadow::Lock lock{};
681+
// TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
682682
std::vector<std::string> output;
683683

684684
output = executeCmd("/usr/sbin/pam_tally2", "-u", userName.c_str());
@@ -716,7 +716,7 @@ bool UserMgr::userLockedForFailedAttempt(const std::string& userName,
716716
const bool& value)
717717
{
718718
// All user management lock has to be based on /etc/shadow
719-
phosphor::user::shadow::Lock lock{};
719+
// TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
720720
std::vector<std::string> output;
721721
if (value == true)
722722
{
@@ -735,7 +735,7 @@ bool UserMgr::userLockedForFailedAttempt(const std::string& userName,
735735
bool UserMgr::userPasswordExpired(const std::string& userName)
736736
{
737737
// All user management lock has to be based on /etc/shadow
738-
phosphor::user::shadow::Lock lock{};
738+
// TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
739739

740740
struct spwd spwd
741741
{};
@@ -780,7 +780,7 @@ bool UserMgr::userPasswordExpired(const std::string& userName)
780780
UserSSHLists UserMgr::getUserAndSshGrpList()
781781
{
782782
// All user management lock has to be based on /etc/shadow
783-
phosphor::user::shadow::Lock lock{};
783+
// TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
784784

785785
std::vector<std::string> userList;
786786
std::vector<std::string> sshUsersList;
@@ -838,7 +838,7 @@ size_t UserMgr::getIpmiUsersCount()
838838
bool UserMgr::isUserEnabled(const std::string& userName)
839839
{
840840
// All user management lock has to be based on /etc/shadow
841-
phosphor::user::shadow::Lock lock{};
841+
// TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
842842
std::array<char, 4096> buffer{};
843843
struct spwd spwd;
844844
struct spwd* resultPtr = nullptr;
@@ -1105,7 +1105,7 @@ UserInfoMap UserMgr::getUserInfo(std::string userName)
11051105
void UserMgr::initUserObjects(void)
11061106
{
11071107
// All user management lock has to be based on /etc/shadow
1108-
phosphor::user::shadow::Lock lock{};
1108+
// TODO phosphor-user-manager#10 phosphor::user::shadow::Lock lock{};
11091109
std::vector<std::string> userNameList;
11101110
std::vector<std::string> sshGrpUsersList;
11111111
UserSSHLists userSSHLists = getUserAndSshGrpList();

0 commit comments

Comments
 (0)