Giter Site home page Giter Site logo

Comments (13)

crschnick avatar crschnick commented on May 12, 2024

Yes, it is sometimes necessary to create some shell scripts. That is done in /tmp by default as I assumed that users would have write access to that. Does your user not have any rights or just not for /tmp ?

How exactly does the connection chain look like here? Is it possible to create an elevated shell environment first, and create the ssh connection in that so that everything is done as root?

from xpipe.

Go2Engle avatar Go2Engle commented on May 12, 2024

Correct this user does not have permissions other then its home directory other then elevating with sudo. I just noticed even when trying to connect with a standard shell now I'm getting the below. maybe placing the scripts in a .xpipe folder within the user directory would be a better all rounder solution?

io.xpipe.core.process.ProcessOutputException: Process returned exit code 1:
-bash: line 13: /tmp/xpipe/exec/exec-762986757.sh: Permission denied
at io.xpipe.core.process.ProcessOutputException.of(ProcessOutputException.java:34)
at io.xpipe.ext.proc.a.a(SourceFile:280)
at io.xpipe.ext.proc.a.discardOrThrow(SourceFile:346)
at io.xpipe.core.process.CommandControl.execute(CommandControl.java:41)
at io.xpipe.app.util.ScriptHelper.createExecScript(ScriptHelper.java:117)
at io.xpipe.app.util.ScriptHelper.constructInitFile(ScriptHelper.java:76)
at io.xpipe.ext.procx.g.prepareIntermediateTerminalOpen(SourceFile:98)
at io.xpipe.ext.procx.g.prepareTerminalOpen(SourceFile:89)
at io.xpipe.core.store.ShellStore.prepareLaunchCommand(ShellStore.java:27)
at io.xpipe.ext.base.action.LaunchAction$Action.execute(LaunchAction.java:29)
at io.xpipe.app.comp.storage.store.StoreEntryWrapper.executeDefaultAction(StoreEntryWrapper.java:197)
at io.xpipe.app.comp.storage.store.StoreEntryComp.lambda$createSimple$1(StoreEntryComp.java:77)
at io.xpipe.app.util.ThreadHelper.lambda$runFailableAsync$0(ThreadHelper.java:18)
at java.lang.Thread.run(Thread.java:1589)

from xpipe.

crschnick avatar crschnick commented on May 12, 2024

Yes that would make sense, I just went for /tmp as these are indeed intended to be temporary files. I think a good solution would be a dynamic detection, i.e. check if we have permissions for /tmp/ and if not, go for something like ~/.xpipe/tmp. Where exactly the directory resides doesn't really matter in the end.

from xpipe.

Go2Engle avatar Go2Engle commented on May 12, 2024

yeah that sounds like a perfect solution!

from xpipe.

crschnick avatar crschnick commented on May 12, 2024

Can you try whether this build works for you: https://github.com/xpipe-io/xpipe_staging/releases/tag/1.3.2

It should fall back to a subdirectory in the user home in case it doesn't have all permissions for /tmp.

from xpipe.

Go2Engle avatar Go2Engle commented on May 12, 2024

still getting the below =[

io.xpipe.core.process.ProcessOutputException: Process returned exit code 1:
-bash: line 27: /tmp/xpipe/exec/askpass-1331980410.sh.1.txt: Permission denied
at io.xpipe.core.process.ProcessOutputException.of(ProcessOutputException.java:34)
at io.xpipe.ext.proc.a.a(SourceFile:280)
at io.xpipe.ext.proc.a.discardOrThrow(SourceFile:346)
at io.xpipe.core.process.CommandControl.execute(CommandControl.java:41)
at io.xpipe.ext.procx.dialect.c.prepareAskpassContent(SourceFile:691)
at io.xpipe.app.util.ScriptHelper.createAskPassScript(ScriptHelper.java:161)
at io.xpipe.app.util.ScriptHelper.createAskPassScript(ScriptHelper.java:139)
at io.xpipe.app.util.ScriptHelper.createAskPassScript(ScriptHelper.java:127)
at io.xpipe.ext.procx.util.a.a(SourceFile:45)
at io.xpipe.ext.procx.util.a.a(SourceFile:118)
at io.xpipe.ext.procx.g.prepareIntermediateTerminalOpen(SourceFile:107)
at io.xpipe.ext.procx.g.prepareTerminalOpen(SourceFile:89)
at io.xpipe.core.store.ShellStore.prepareLaunchCommand(ShellStore.java:27)
at io.xpipe.ext.base.action.LaunchAction$Action.execute(LaunchAction.java:29)
at io.xpipe.app.comp.storage.store.StoreEntryWrapper.executeDefaultAction(StoreEntryWrapper.java:197)
at io.xpipe.app.comp.storage.store.StoreEntryComp.lambda$createSimple$1(StoreEntryComp.java:77)
at io.xpipe.app.util.ThreadHelper.lambda$runFailableAsync$0(ThreadHelper.java:18)
at java.lang.Thread.run(Thread.java:1589)

from xpipe.

crschnick avatar crschnick commented on May 12, 2024

Hmm ... what is the exit code of test -r /tmp && test -w /tmp && test -x /tmp for your user? That is what this build is checking

from xpipe.

Go2Engle avatar Go2Engle commented on May 12, 2024

looks like exit code for that is 0. So I checked again and the user does have permissions to the /tmp folder(my bad there, I should have fully checked that 🤦‍♂️) but it looks like the files within the folder are owned by root? do you think that could be causing the issue?

image

from xpipe.

crschnick avatar crschnick commented on May 12, 2024

I see, I will just rewrite the entire tempory directory logic to be bullet-proof as there are also a few other issues with it.

from xpipe.

crschnick avatar crschnick commented on May 12, 2024

Alright, I updated the build at https://github.com/xpipe-io/xpipe_staging/releases/tag/1.3.2 to now be more robust with regards to temporary directory handling. So you can try that out

from xpipe.

Go2Engle avatar Go2Engle commented on May 12, 2024

We are golden now!

PS: If anyone else does have this issue you will first need to manually sudo rm -rf /tmp/xpipe to remove stuff that was previously created, or you will still have the previous errors.

from xpipe.

crschnick avatar crschnick commented on May 12, 2024

Your suggestion of putting the files into the user home directory actually makes more sense, so I switched the logic around in 1.3.2.. It will put the files into ~/.xpipe/temp by default and if by some weird configuration you don't have permissions for that directory, it will use /tmp.

(In case you downloaded the staging release, note that it is a incompatible version to the normal releases and won't get updates. So you would have to download and install a proper release again. I am in the process of completely separating both types of installation so in the future you can have staging and normal releases side by side.)

from xpipe.

Go2Engle avatar Go2Engle commented on May 12, 2024

Awesome ok sounds good! I'll do a manual re-install then!

from xpipe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.