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 chmodrsync: skip files for which I don't have permissionsDefault directory permissions over NFSCreate Relative Symlink Inside Relative SymlinkPermissions over script in a directoryCan I replace a directory with a symlink without write permissions in parent?Remove Symlink to home directorysymlink on directory permission deniedSymlink and folder permissionsSymlink with seperate permissions on either side

Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?

Can a flute soloist sit?

How to notate time signature switching consistently every measure

What is the motivation for a law requiring 2 parties to consent for recording a conversation

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

How are circuits which use complex ICs normally simulated?

Why can Shazam fly?

Am I thawing this London Broil safely?

Is there a symbol for a right arrow with a square in the middle?

During Temple times, who can butcher a kosher animal?

Why did Acorn's A3000 have red function keys?

Multiply Two Integer Polynomials

FPGA - DIY Programming

When should I buy a clipper card after flying to OAK?

Who coined the term "madman theory"?

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

Earliest use of the term "Galois extension"?

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

Is a "Democratic" Oligarchy-Style System Possible?

A poker game description that does not feel gimmicky

Are there incongruent pythagorean triangles with the same perimeter and same area?

Can you compress metal and what would be the consequences?

Resizing object distorts it (Illustrator CC 2018)

Identify boardgame from Big movie



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 chmodrsync: skip files for which I don't have permissionsDefault directory permissions over NFSCreate Relative Symlink Inside Relative SymlinkPermissions over script in a directoryCan I replace a directory with a symlink without write permissions in parent?Remove Symlink to home directorysymlink on directory permission deniedSymlink and folder permissionsSymlink with seperate permissions on either side



.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. 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 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 to 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|improve this question









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
    yesterday











  • @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
    yesterday


















1















Bit of history first: where I work, some developers/shareholders have brought their intellectual property together to form the company. 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 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 to 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|improve this question









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
    yesterday











  • @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
    yesterday














1












1








1








Bit of history first: where I work, some developers/shareholders have brought their intellectual property together to form the company. 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 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 to 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|improve this question









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. 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 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 to 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 symlink






share|improve this question









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|improve this question









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|improve this question




share|improve this question








edited 22 hours ago









G-Man

13.7k93770




13.7k93770






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 2 days ago









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
    yesterday











  • @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
    yesterday













  • 1





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

    – roaima
    yesterday











  • @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
    yesterday








1




1





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

– roaima
yesterday





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

– roaima
yesterday













@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
yesterday






@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
yesterday











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
    yesterday












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
    yesterday
















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
    yesterday














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 yesterday









Stéphane Chazelas

314k57594952




314k57594952






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 yesterday









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
    yesterday


















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

    – victorantunes
    yesterday

















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

– victorantunes
yesterday






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

– victorantunes
yesterday











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







-permissions, symlink

Popular posts from this blog

Frič See also Navigation menuinternal link

Identify plant with long narrow paired leaves and reddish stems Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?What is this plant with long sharp leaves? Is it a weed?What is this 3ft high, stalky plant, with mid sized narrow leaves?What is this young shrub with opposite ovate, crenate leaves and reddish stems?What is this plant with large broad serrated leaves?Identify this upright branching weed with long leaves and reddish stemsPlease help me identify this bulbous plant with long, broad leaves and white flowersWhat is this small annual with narrow gray/green leaves and rust colored daisy-type flowers?What is this chilli plant?Does anyone know what type of chilli plant this is?Help identify this plant

fontconfig warning: “/etc/fonts/fonts.conf”, line 100: unknown “element blank” The 2019 Stack Overflow Developer Survey Results Are In“tar: unrecognized option --warning” during 'apt-get install'How to fix Fontconfig errorHow do I figure out which font file is chosen for a system generic font alias?Why are some apt-get-installed fonts being ignored by fc-list, xfontsel, etc?Reload settings in /etc/fonts/conf.dTaking 30 seconds longer to boot after upgrade from jessie to stretchHow to match multiple font names with a single <match> element?Adding a custom font to fontconfigRemoving fonts from fontconfig <match> resultsBroken fonts after upgrading Firefox ESR to latest Firefox