From e540cc39abfda1a5d55dd73e475ae10bc4abf08f Mon Sep 17 00:00:00 2001 From: kohsuke Date: Thu, 12 Feb 2009 20:59:25 +0000 Subject: [PATCH] also do pfexec git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15265 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/lifecycle/ZFSInstaller.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/lifecycle/ZFSInstaller.java b/core/src/main/java/hudson/lifecycle/ZFSInstaller.java index a23670c4bc..2dd3e6dc62 100644 --- a/core/src/main/java/hudson/lifecycle/ZFSInstaller.java +++ b/core/src/main/java/hudson/lifecycle/ZFSInstaller.java @@ -225,8 +225,8 @@ public class ZFSInstaller extends AdministrativeMonitor implements Serializable new String[]{"/usr/bin/pfexec", javaExe, "-jar", slaveJar}, listener.getLogger(), null, Collections.emptyMap()); } else { - // try sudo with the given password - ProcessBuilder pb = new ProcessBuilder(javaExe,"-jar",slaveJar); + // try sudo with the given password. Also run in pfexec so that we can elevate the privileges + ProcessBuilder pb = new ProcessBuilder("/usr/bin/pfexec",javaExe,"-jar",slaveJar); proc = EmbeddedSu.startWithSu(rootUsername, rootPassword, pb); channel = new Channel("zfs migration thread", Computer.threadPoolForRemoting, proc.getInputStream(), proc.getOutputStream(), listener.getLogger());