Skip to content

Commit

Permalink
fix: adduser Check whether the account exists
Browse files Browse the repository at this point in the history
  • Loading branch information
huerni committed Sep 19, 2024
1 parent 0609159 commit 7856f0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/CraneCtld/AccountManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ AccountManager::Result AccountManager::AddUser(uint32_t uid, User&& new_user) {

// Check whether the account exists
const Account* find_account = GetExistedAccountInfoNoLock_(object_account);

if (!find_account) {
return Result{false, fmt::format("Unknown account '{}'", object_account)};
}
// Check if user's allowed partition is a subset of parent's allowed
// partition
for (auto&& [partition, qos] : new_user.account_to_attrs_map[object_account]
Expand Down

0 comments on commit 7856f0c

Please sign in to comment.