From a06d47ff3062ac7fd1f84f83056f14c8788753cd Mon Sep 17 00:00:00 2001 From: az Date: Sun, 26 Feb 2023 19:48:25 +0100 Subject: [PATCH] [skip ci] remove sudo without password check from UbuntuProv --- .../provs/framework/core/platforms/UbuntuProv.kt | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/platforms/UbuntuProv.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/platforms/UbuntuProv.kt index 254e333..c85db20 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/platforms/UbuntuProv.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/core/platforms/UbuntuProv.kt @@ -13,13 +13,6 @@ class UbuntuProv internal constructor( progressType: ProgressType ) : Prov(processor, name, progressType) { - init { - val user = cmdNoLog("whoami").out?.trim() - if ("root" != user && !cmdNoLog("timeout 1 sudo id").success) { - println("IMPORTANT INFO:\nUser $user cannot sudo without entering a password, i.e. some functions may fail!\nIf you need to run functions with sudo, please ensure $user can sudo without password.") - } - } - override fun cmd(cmd: String, dir: String?, sudo: Boolean): ProvResult = taskWithResult { exec(SHELL, "-c", commandWithDirAndSudo(cmd, dir, sudo)) }