diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 95146ad64..b6657539e 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -917,6 +917,10 @@ def app_checkurl(auth, url, app=None): raise MoulinetteError(errno.EINVAL, m18n.n('domain_unknown')) if domain in apps_map: + # Domain already has apps on sub path + if path == '/': + raise MoulinetteError(errno.EPERM, + m18n.n('app_location_install_failed')) # Loop through apps for p, a in apps_map[domain].items(): # Skip requested app checking @@ -926,7 +930,7 @@ def app_checkurl(auth, url, app=None): if path == p: raise MoulinetteError(errno.EINVAL, m18n.n('app_location_already_used')) - elif path.startswith(p) or p.startswith(path): + elif path.startswith(p): raise MoulinetteError(errno.EPERM, m18n.n('app_location_install_failed'))