mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-25 08:09:07 +02:00
[client] Refuse --upload-bundle-insecure only when an upload is requested
A request with no URL, no upload and uploadInsecure set was denied, although uploadInsecure has no effect on a local-only bundle: there is no destination to weaken, and the caller only wanted the file on disk. Pass the upload intent into the gate and apply the empty-URL branch only when the request asks to upload. Reported by cubic on #7514.
This commit is contained in:
@@ -27,7 +27,7 @@ import (
|
||||
|
||||
// DebugBundle creates a debug bundle and returns the location.
|
||||
func (s *Server) DebugBundle(callerCtx context.Context, req *proto.DebugBundleRequest) (resp *proto.DebugBundleResponse, err error) {
|
||||
if err := requirePrivilegeForUploadURL(callerCtx, req.GetUploadURL(), req.GetUploadInsecure()); err != nil {
|
||||
if err := requirePrivilegeForUploadURL(callerCtx, req.GetUploadURL(), req.GetUploadInsecure(), req.GetUpload()); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user