Skip to content

Commit

Permalink
showauth for other user names
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Sep 12, 2019
1 parent b24afb9 commit 8ae4e55
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions testApp/utils/showauth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ int main(int argc, char *argv[])
throw std::runtime_error("Unable to determine username");

name[name.size()-1] = '\0';
std::cout<<"User: "<<(&name[0])<<"\n";

const char *user = argc<=1 ? &name[0] : argv[1];

std::cout<<"User: "<<user<<"\n";

pva::PeerInfo::roles_t roles;
pva::osdGetRoles(&name[0], roles);
pva::osdGetRoles(user, roles);

std::cout<<"Groups: \n";
for(pva::PeerInfo::roles_t::const_iterator it(roles.begin()), end(roles.end());
Expand Down

0 comments on commit 8ae4e55

Please sign in to comment.