From b969caac7842864eefb4eedecf012efa3d9e6c4c Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 14 Feb 2020 22:27:56 +0500 Subject: [PATCH] security: check if external app user already exists --- websiteFunctions/website.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index e19a75be1..f7f47abee 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -215,6 +215,16 @@ class WebsiteManager: except: apacheBackend = "0" + import pwd + counter = 0 + while 1: + try: + pwd.getpwnam(externalApp) + externalApp = '%s%s' % (externalApp, str(counter)) + counter = counter + 1 + except: + break + ## Create Configurations execPath = "sudo /usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"