Skip to content

Why allow empty privilege? #13

@joseph-reynolds

Description

@joseph-reynolds

In the excerpt from

if (!priv.empty() &&

void UserMgr::throwForInvalidPrivilege(const std::string& priv)
{
    if (!priv.empty() &&
        (std::find(privMgr.begin(), privMgr.end(), priv) == privMgr.end()))
    { ...snip... }
}

Why is the empty privilege allowed? Is this related to the priv-noaccess (BMCWeb's NoAccess role)? Can this be removed?
It seems like the caller should be qreuied to specify a valid (nonempty) privilege role (per https://github.com/openbmc/docs/blob/master/architecture/user-management.md#supported-privilege-roles).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions