-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filename too long #8
Comments
Hi @neil-benn, tks to open this issue ;). Take a look in OutProcessUtils.getCurrentClasspath() output (call it in your current project main) and verify if is possible to reduce... you can construct your classpath manually too... Copy source of RootExecutor in a new file and replace OneRunOutProcess constructor call with one that accepts custom classpath. You maybe will like to use OutProcessUtils.generateClassPath(Class...). Let me know if you could solve this, I will update library with a new RootExecutor constructor. |
You are correct; this is a spring boot app so there are a lot of jars in the classpath. It's not so easy to reduce the classpath so something that says 'do not inherit the current classpath would solve the issue. I was just trawling through your source code for outprocess when I came to the same conclusion :). |
Yep that worked - the actual test doesn't work but the process runs with elevated permissions. Teh new constructor is:
|
However; the fundamental underlying call isn't working too well; I am executing:
However; no directory is created. I've obviously checked this in command prompt and it works (as admin) but not in rootexecutor. Am I doing something wrong in the command format? |
Nope; no matter what I try the command always returns '1' and fails. The elevation works perfectly but the command doesn't. |
I see two problems:
Use OutProcessUtils.generateClassPath(RootExecutor.class, OneRunOutProcess.class, YOURCLASSTHATISCREATINGLAMBDAORINNERCLASS.class) |
Thanks; the sysout did seem really weird to me! I see what you mean about the classpath; in fact because of FST it is massive. I note that in the source you have got rid of FST. I think I'll need that version as this makes the dependent libraries much lighter. |
Done! Version 1.2.3 was released. |
Closed by timeout. |
When running this as a simpe test; the code is:
// Specify JVM options (optional)
RootExecutor rootExecutor = new RootExecutor("-Xmx64m");
I get an error:
java.io.IOException: Cannot run program ""C:\Users\neilb\AppData\Local\Temp\run-as-root18038586148998856981-elevate"": CreateProcess error=206, The filename or extension is too long
The OS in Win10 64 bit; is there a way to get the filename length down?
The text was updated successfully, but these errors were encountered: