Create symlink to a directory I don't have permissions over The 2019 Stack Overflow Developer...

Carnot-Caratheodory metric

Inline version of a function returns different value then non-inline version

If a poisoned arrow's piercing damage is reduced to 0, do you still get poisoned?

"Riffle" two strings

Idiomatic way to prevent slicing?

Why could you hear an Amstrad CPC working?

JSON.serialize: is it possible to suppress null values of a map?

Should I use my personal or workplace e-mail when registering to external websites for work purpose?

Spanish for "widget"

Is "plugging out" electronic devices an American expression?

I looked up a future colleague on linkedin before I started a job. I told my colleague about it and he seemed surprised. Should I apologize?

Where does the "burst of radiance" from Holy Weapon originate?

How to answer pointed "are you quitting" questioning when I don't want them to suspect

Is domain driven design an anti-SQL pattern?

Is there a name of the flying bionic bird?

Geography at the pixel level

Any good smartcontract for "business calendar" oracles?

Which Sci-Fi work first showed weapon of galactic-scale mass destruction?

Time travel alters history but people keep saying nothing's changed

Access elements in std::string where positon of string is greater than its size

What is a mixture ratio of propellant?

Unbreakable Formation vs. Cry of the Carnarium

Why is it "Tumoren" and not "Tumore"?

On the insanity of kings as an argument against Monarchy



Create symlink to a directory I don't have permissions over



The 2019 Stack Overflow Developer Survey Results Are InSymbolic link permissions don't change with chmodCan't get directory listing of folder I have permissions torsync: skip files for which I don't have permissionsDefault directory permissions over NFSPermissions don't restrict access to NFS mountConfusing Directory PermissionsPermissions over script in a directorySymlink and folder permissionsWhy don't I have permission to ls directories I own and have r/w permissions for?new files have different permissions





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















Bit of history first: where I work, some developers/shareholders have brought their intellectual property together to form the company I currently work at. IP still remains theirs alone, individually, as well as the source code.



In addition, we have also had some problems with industrial espionage from 3rd parties a few years back.
All of this had led some of those developers/company owners to come up with unorthodox measures to ensure that, even if stolen, our binaries cannot be used.



Current problem: we're renting a 3rd party supercomputer to do some hard number crunching in order to meet a deadline. Trouble is, the executable in case has a static dependency to a text file buried deep inside our network directory structure.



Why not just recompile without this 'dependency'? Because the developer in question is currently currently away on a personal trip, and isn't expected return in order to recompile this code before our deadline is met.



Execution:



./run.sh


Error output:



forrtl: No such file or directory
forrtl: severe (29): file not found, unit 1, file /foo/bar/.xyz
Image PC Routine Line Source
number_crunch 000000000048B933 Unknown Unknown Unknown
number_crunch 0000000000499ADB Unknown Unknown Unknown
number_crunch 0000000000445941 Unknown Unknown Unknown
number_crunch 0000000000403BFE Unknown Unknown Unknown
libc.so.6 00002AAAAB6C10BD Unknown Unknown Unknown
number_crunch 0000000000403B09 Unknown Unknown Unknown


Contents of run.sh:



#!/bin/bash
#SBATCH --nodes=10
#SBATCH --job-name=number_crunch
#SBATCH --cpus-per-task=8

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/share/intel/ics2013/composer_xe_2013_sp1.2.144/compiler/lib/intel64/
module load glibc

./number_crunch


What I need: some way to trick the binary into acknowleding the /foo/bar/.xyz structure, without having root powers.



Is this possible? I know that alias does not allow for slashes in the alias name, and ln requires that I have permission to write on /.









share









New contributor




victorantunes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    Have you got fakeroot available to you? Can you get the system administrators to install it for you?

    – roaima
    7 hours ago











  • @roaima unfortunately, no. System's quite closed in terms of installation requests. Also, I didn't know of fakeroot before. I'll look it up for the future. For the meantime, Alex came up with a nice solution. Thanks, though!

    – victorantunes
    6 hours ago




















1















Bit of history first: where I work, some developers/shareholders have brought their intellectual property together to form the company I currently work at. IP still remains theirs alone, individually, as well as the source code.



In addition, we have also had some problems with industrial espionage from 3rd parties a few years back.
All of this had led some of those developers/company owners to come up with unorthodox measures to ensure that, even if stolen, our binaries cannot be used.



Current problem: we're renting a 3rd party supercomputer to do some hard number crunching in order to meet a deadline. Trouble is, the executable in case has a static dependency to a text file buried deep inside our network directory structure.



Why not just recompile without this 'dependency'? Because the developer in question is currently currently away on a personal trip, and isn't expected return in order to recompile this code before our deadline is met.



Execution:



./run.sh


Error output:



forrtl: No such file or directory
forrtl: severe (29): file not found, unit 1, file /foo/bar/.xyz
Image PC Routine Line Source
number_crunch 000000000048B933 Unknown Unknown Unknown
number_crunch 0000000000499ADB Unknown Unknown Unknown
number_crunch 0000000000445941 Unknown Unknown Unknown
number_crunch 0000000000403BFE Unknown Unknown Unknown
libc.so.6 00002AAAAB6C10BD Unknown Unknown Unknown
number_crunch 0000000000403B09 Unknown Unknown Unknown


Contents of run.sh:



#!/bin/bash
#SBATCH --nodes=10
#SBATCH --job-name=number_crunch
#SBATCH --cpus-per-task=8

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/share/intel/ics2013/composer_xe_2013_sp1.2.144/compiler/lib/intel64/
module load glibc

./number_crunch


What I need: some way to trick the binary into acknowleding the /foo/bar/.xyz structure, without having root powers.



Is this possible? I know that alias does not allow for slashes in the alias name, and ln requires that I have permission to write on /.









share









New contributor




victorantunes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    Have you got fakeroot available to you? Can you get the system administrators to install it for you?

    – roaima
    7 hours ago











  • @roaima unfortunately, no. System's quite closed in terms of installation requests. Also, I didn't know of fakeroot before. I'll look it up for the future. For the meantime, Alex came up with a nice solution. Thanks, though!

    – victorantunes
    6 hours ago
















1












1








1








Bit of history first: where I work, some developers/shareholders have brought their intellectual property together to form the company I currently work at. IP still remains theirs alone, individually, as well as the source code.



In addition, we have also had some problems with industrial espionage from 3rd parties a few years back.
All of this had led some of those developers/company owners to come up with unorthodox measures to ensure that, even if stolen, our binaries cannot be used.



Current problem: we're renting a 3rd party supercomputer to do some hard number crunching in order to meet a deadline. Trouble is, the executable in case has a static dependency to a text file buried deep inside our network directory structure.



Why not just recompile without this 'dependency'? Because the developer in question is currently currently away on a personal trip, and isn't expected return in order to recompile this code before our deadline is met.



Execution:



./run.sh


Error output:



forrtl: No such file or directory
forrtl: severe (29): file not found, unit 1, file /foo/bar/.xyz
Image PC Routine Line Source
number_crunch 000000000048B933 Unknown Unknown Unknown
number_crunch 0000000000499ADB Unknown Unknown Unknown
number_crunch 0000000000445941 Unknown Unknown Unknown
number_crunch 0000000000403BFE Unknown Unknown Unknown
libc.so.6 00002AAAAB6C10BD Unknown Unknown Unknown
number_crunch 0000000000403B09 Unknown Unknown Unknown


Contents of run.sh:



#!/bin/bash
#SBATCH --nodes=10
#SBATCH --job-name=number_crunch
#SBATCH --cpus-per-task=8

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/share/intel/ics2013/composer_xe_2013_sp1.2.144/compiler/lib/intel64/
module load glibc

./number_crunch


What I need: some way to trick the binary into acknowleding the /foo/bar/.xyz structure, without having root powers.



Is this possible? I know that alias does not allow for slashes in the alias name, and ln requires that I have permission to write on /.









share









New contributor




victorantunes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












Bit of history first: where I work, some developers/shareholders have brought their intellectual property together to form the company I currently work at. IP still remains theirs alone, individually, as well as the source code.



In addition, we have also had some problems with industrial espionage from 3rd parties a few years back.
All of this had led some of those developers/company owners to come up with unorthodox measures to ensure that, even if stolen, our binaries cannot be used.



Current problem: we're renting a 3rd party supercomputer to do some hard number crunching in order to meet a deadline. Trouble is, the executable in case has a static dependency to a text file buried deep inside our network directory structure.



Why not just recompile without this 'dependency'? Because the developer in question is currently currently away on a personal trip, and isn't expected return in order to recompile this code before our deadline is met.



Execution:



./run.sh


Error output:



forrtl: No such file or directory
forrtl: severe (29): file not found, unit 1, file /foo/bar/.xyz
Image PC Routine Line Source
number_crunch 000000000048B933 Unknown Unknown Unknown
number_crunch 0000000000499ADB Unknown Unknown Unknown
number_crunch 0000000000445941 Unknown Unknown Unknown
number_crunch 0000000000403BFE Unknown Unknown Unknown
libc.so.6 00002AAAAB6C10BD Unknown Unknown Unknown
number_crunch 0000000000403B09 Unknown Unknown Unknown


Contents of run.sh:



#!/bin/bash
#SBATCH --nodes=10
#SBATCH --job-name=number_crunch
#SBATCH --cpus-per-task=8

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/share/intel/ics2013/composer_xe_2013_sp1.2.144/compiler/lib/intel64/
module load glibc

./number_crunch


What I need: some way to trick the binary into acknowleding the /foo/bar/.xyz structure, without having root powers.



Is this possible? I know that alias does not allow for slashes in the alias name, and ln requires that I have permission to write on /.







permissions





share









New contributor




victorantunes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










share









New contributor




victorantunes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








share



share








edited 9 hours ago







victorantunes













New contributor




victorantunes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









victorantunesvictorantunes

1084




1084




New contributor




victorantunes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





victorantunes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






victorantunes is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1





    Have you got fakeroot available to you? Can you get the system administrators to install it for you?

    – roaima
    7 hours ago











  • @roaima unfortunately, no. System's quite closed in terms of installation requests. Also, I didn't know of fakeroot before. I'll look it up for the future. For the meantime, Alex came up with a nice solution. Thanks, though!

    – victorantunes
    6 hours ago
















  • 1





    Have you got fakeroot available to you? Can you get the system administrators to install it for you?

    – roaima
    7 hours ago











  • @roaima unfortunately, no. System's quite closed in terms of installation requests. Also, I didn't know of fakeroot before. I'll look it up for the future. For the meantime, Alex came up with a nice solution. Thanks, though!

    – victorantunes
    6 hours ago










1




1





Have you got fakeroot available to you? Can you get the system administrators to install it for you?

– roaima
7 hours ago





Have you got fakeroot available to you? Can you get the system administrators to install it for you?

– roaima
7 hours ago













@roaima unfortunately, no. System's quite closed in terms of installation requests. Also, I didn't know of fakeroot before. I'll look it up for the future. For the meantime, Alex came up with a nice solution. Thanks, though!

– victorantunes
6 hours ago







@roaima unfortunately, no. System's quite closed in terms of installation requests. Also, I didn't know of fakeroot before. I'll look it up for the future. For the meantime, Alex came up with a nice solution. Thanks, though!

– victorantunes
6 hours ago












1 Answer
1






active

oldest

votes


















3














What about patching your binary in-place? strings yourbinary | grep -F /foo/bar/.xyz should print out /foo/bar/.xyz. If /foo/bar/.xyz is sufficiently unique in the strings, you could do:



sed -i "s_/foo/bar/.xyz_/control/.xyz_g" yourbinary


where /control/ is a directory you have control over. The replacement string's length (in number of bytes) must be equal to the original string's length. If the replacement string is shorter, you may be able to pad it with null bytes: sed -i "_/foo/bar/.xyz_/contr/xyzx00x00x00_g" yourbinary (o, l, and . were removed for null bytes), but the success of this may depend on whether or not there are hardcoded dependencies on the length of /foo/bar/.xyz. Alternatively, you can make the path longer by adding some / characters (/tmp/////.xyz).



If the replacement string is longer, you're probably out of luck for this style of in-place patching. However, you may be able to combine this with a symlink solution if necessary, where /control/xyz is a path of suitable length but it points to a longer path where the real file resides.



If you have the expertise and you need more control over which instances of the string are replaced, you can do this with a hex editor instead of sed.



I would test this change before doing anything important with it.






share|improve this answer










New contributor




Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Whoa, I had no idea you could do that! It worked, thanks!

    – victorantunes
    6 hours ago














Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






victorantunes is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511264%2fcreate-symlink-to-a-directory-i-dont-have-permissions-over%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














What about patching your binary in-place? strings yourbinary | grep -F /foo/bar/.xyz should print out /foo/bar/.xyz. If /foo/bar/.xyz is sufficiently unique in the strings, you could do:



sed -i "s_/foo/bar/.xyz_/control/.xyz_g" yourbinary


where /control/ is a directory you have control over. The replacement string's length (in number of bytes) must be equal to the original string's length. If the replacement string is shorter, you may be able to pad it with null bytes: sed -i "_/foo/bar/.xyz_/contr/xyzx00x00x00_g" yourbinary (o, l, and . were removed for null bytes), but the success of this may depend on whether or not there are hardcoded dependencies on the length of /foo/bar/.xyz. Alternatively, you can make the path longer by adding some / characters (/tmp/////.xyz).



If the replacement string is longer, you're probably out of luck for this style of in-place patching. However, you may be able to combine this with a symlink solution if necessary, where /control/xyz is a path of suitable length but it points to a longer path where the real file resides.



If you have the expertise and you need more control over which instances of the string are replaced, you can do this with a hex editor instead of sed.



I would test this change before doing anything important with it.






share|improve this answer










New contributor




Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Whoa, I had no idea you could do that! It worked, thanks!

    – victorantunes
    6 hours ago


















3














What about patching your binary in-place? strings yourbinary | grep -F /foo/bar/.xyz should print out /foo/bar/.xyz. If /foo/bar/.xyz is sufficiently unique in the strings, you could do:



sed -i "s_/foo/bar/.xyz_/control/.xyz_g" yourbinary


where /control/ is a directory you have control over. The replacement string's length (in number of bytes) must be equal to the original string's length. If the replacement string is shorter, you may be able to pad it with null bytes: sed -i "_/foo/bar/.xyz_/contr/xyzx00x00x00_g" yourbinary (o, l, and . were removed for null bytes), but the success of this may depend on whether or not there are hardcoded dependencies on the length of /foo/bar/.xyz. Alternatively, you can make the path longer by adding some / characters (/tmp/////.xyz).



If the replacement string is longer, you're probably out of luck for this style of in-place patching. However, you may be able to combine this with a symlink solution if necessary, where /control/xyz is a path of suitable length but it points to a longer path where the real file resides.



If you have the expertise and you need more control over which instances of the string are replaced, you can do this with a hex editor instead of sed.



I would test this change before doing anything important with it.






share|improve this answer










New contributor




Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





















  • Whoa, I had no idea you could do that! It worked, thanks!

    – victorantunes
    6 hours ago
















3












3








3







What about patching your binary in-place? strings yourbinary | grep -F /foo/bar/.xyz should print out /foo/bar/.xyz. If /foo/bar/.xyz is sufficiently unique in the strings, you could do:



sed -i "s_/foo/bar/.xyz_/control/.xyz_g" yourbinary


where /control/ is a directory you have control over. The replacement string's length (in number of bytes) must be equal to the original string's length. If the replacement string is shorter, you may be able to pad it with null bytes: sed -i "_/foo/bar/.xyz_/contr/xyzx00x00x00_g" yourbinary (o, l, and . were removed for null bytes), but the success of this may depend on whether or not there are hardcoded dependencies on the length of /foo/bar/.xyz. Alternatively, you can make the path longer by adding some / characters (/tmp/////.xyz).



If the replacement string is longer, you're probably out of luck for this style of in-place patching. However, you may be able to combine this with a symlink solution if necessary, where /control/xyz is a path of suitable length but it points to a longer path where the real file resides.



If you have the expertise and you need more control over which instances of the string are replaced, you can do this with a hex editor instead of sed.



I would test this change before doing anything important with it.






share|improve this answer










New contributor




Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.










What about patching your binary in-place? strings yourbinary | grep -F /foo/bar/.xyz should print out /foo/bar/.xyz. If /foo/bar/.xyz is sufficiently unique in the strings, you could do:



sed -i "s_/foo/bar/.xyz_/control/.xyz_g" yourbinary


where /control/ is a directory you have control over. The replacement string's length (in number of bytes) must be equal to the original string's length. If the replacement string is shorter, you may be able to pad it with null bytes: sed -i "_/foo/bar/.xyz_/contr/xyzx00x00x00_g" yourbinary (o, l, and . were removed for null bytes), but the success of this may depend on whether or not there are hardcoded dependencies on the length of /foo/bar/.xyz. Alternatively, you can make the path longer by adding some / characters (/tmp/////.xyz).



If the replacement string is longer, you're probably out of luck for this style of in-place patching. However, you may be able to combine this with a symlink solution if necessary, where /control/xyz is a path of suitable length but it points to a longer path where the real file resides.



If you have the expertise and you need more control over which instances of the string are replaced, you can do this with a hex editor instead of sed.



I would test this change before doing anything important with it.







share|improve this answer










New contributor




Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer








edited 6 hours ago









Stéphane Chazelas

313k57593950




313k57593950






New contributor




Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered 8 hours ago









AlexAlex

462




462




New contributor




Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.













  • Whoa, I had no idea you could do that! It worked, thanks!

    – victorantunes
    6 hours ago





















  • Whoa, I had no idea you could do that! It worked, thanks!

    – victorantunes
    6 hours ago



















Whoa, I had no idea you could do that! It worked, thanks!

– victorantunes
6 hours ago







Whoa, I had no idea you could do that! It worked, thanks!

– victorantunes
6 hours ago












victorantunes is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















victorantunes is a new contributor. Be nice, and check out our Code of Conduct.













victorantunes is a new contributor. Be nice, and check out our Code of Conduct.












victorantunes is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511264%2fcreate-symlink-to-a-directory-i-dont-have-permissions-over%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Hudson River Historic District Contents Geography History The district today Aesthetics Cultural...

The number designs the writing. Feandra Aversely Definition: The act of ingrafting a sprig or shoot of one...

Ayherre Geografie Demografie Externe links Navigatiemenu43° 23′ NB, 1° 15′ WL43° 23′ NB, 1°...