Skip to content

Commit

Permalink
Merge #2532
Browse files Browse the repository at this point in the history
2532: [daemon] enforce auth on Set and Keys RPC calls r=townsend2010 a=Saviq



Co-authored-by: Michał Sawicz <[email protected]>
  • Loading branch information
2 people authored and Chris Townsend committed Apr 20, 2022
1 parent 7338000 commit e1f4749
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
elif [ '${{ matrix.os }}' == 'macOS' ]; then
[ $RC -eq 0 ] || _run sudo cat /Library/Logs/Multipass/multipassd.log
# Authenticate the root user
_run sudo $MP set local.passphrase=foobar || true
_run $MP set local.passphrase=foobar || true
_run sudo $MP authenticate foobar || true
( echo y; echo y ) | _run sudo PATH=/bin:/usr/local/bin /bin/sh "/Library/Application\\ Support/com.canonical.multipass/uninstall.sh" || true
_run sudo rm -rf /Library/Logs/Multipass
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
fi
_retry_grep 12 5 "multipassd" _run $MP version
_run ${{ matrix.os != 'Windows' && 'sudo' || '' }} $MP set local.driver=${{ matrix.driver }}
_run $MP set local.driver=${{ matrix.driver }}
# Give multipassd time to settle (#1995)
_retry_grep 12 5 "\w,lts\W" _run $MP find
Expand Down
8 changes: 4 additions & 4 deletions src/daemon/daemon_rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,13 @@ grpc::Status mp::DaemonRpc::verify_client_and_dispatch_operation(OperationSignal
grpc::Status mp::DaemonRpc::set(grpc::ServerContext* context, const SetRequest* request,
grpc::ServerWriter<SetReply>* response)
{
return emit_signal_and_wait_for_result(
std::bind(&DaemonRpc::on_set, this, request, response, std::placeholders::_1));
return verify_client_and_dispatch_operation(
std::bind(&DaemonRpc::on_set, this, request, response, std::placeholders::_1), client_cert_from(context));
}

grpc::Status mp::DaemonRpc::keys(grpc::ServerContext* context, const KeysRequest* request,
grpc::ServerWriter<KeysReply>* response)
{
return emit_signal_and_wait_for_result(
std::bind(&DaemonRpc::on_keys, this, request, response, std::placeholders::_1));
return verify_client_and_dispatch_operation(
std::bind(&DaemonRpc::on_keys, this, request, response, std::placeholders::_1), client_cert_from(context));
}

0 comments on commit e1f4749

Please sign in to comment.