Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 87226db

Browse files
committed
virt-clone: Priviledge checks should happen after conn opening
Otherwise we don't know what the real default URI will be.
1 parent 4065565 commit 87226db

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

virt-clone

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,11 @@ def main():
208208
cli.set_prompt(options.prompt)
209209
cli.set_force(options.force)
210210

211-
if not User.current().has_priv(User.PRIV_CLONE, options.connect):
211+
conn = cli.getConnection(options.connect)
212+
213+
if not User.current().has_priv(User.PRIV_CLONE, conn.getURI()):
212214
fail(_("Must be privileged to clone Xen guests"))
213215

214-
conn = cli.getConnection(options.connect)
215216
design = clmgr.CloneDesign(connection=conn)
216217

217218
try:

0 commit comments

Comments
 (0)