Comments (6)
patchelf writes the changes in a new temporary file and replaces the original with the new one, that's why this happens.
https://github.com/NixOS/patchelf/blob/master/src/patchelf.cc#L378
from patchelf.
Breaking hardlinks is rather unexpected behaviour. Can writeFile
be changed to write directly to the file, rather than through a temp file?
from patchelf.
I found the solution! This is what "static void writeFile()" should look like:
static void writeFile(string fileName, mode_t fileMode)
{
int fd = open(fileName.c_str(), O_TRUNC | O_WRONLY, 0700);
if (fd == -1)
error("open");
if (write(fd, contents, fileSize) != fileSize)
error("write");
if (close(fd) != 0)
error("close");
}
from patchelf.
Excellent! Thanks. I'll test it soon. Without O_CREAT
you can remove , 0700
as it has no effect.
from patchelf.
@edolstra Can you please merge this patch from @darealshinji to fix this issue? Thanks!
darealshinji@bed9cea
from patchelf.
Great. Thanks. Will there be a new stable release that includes this fix?
from patchelf.
Related Issues (20)
- patchelf: cannot find section '.interp'. The input file is most likely statically linked
- Test regression in 0.18.0: repeated-updates.sh, replace-add-needed.sh HOT 5
- patchelf breaks dylibs from recent Firefox Nightly builds HOT 11
- repeated-updates.sh fails on mips64el HOT 1
- What versions support redhat6
- `patchelf --set-interpreter` and `patchelf --set-rpath` depend on the order (at least on i686-linux) HOT 3
- Allow --rename-dynamic-symbols to change the version tag.
- Regression in 0.18.0: --set-rpath creates broken header alignment HOT 3
- `patchefd --set-rpath ... nodejs` broken since ~0.17.2 (0.15.0 works) HOT 3
- when I use zsh plugins zsh-autosuggestions, it something wrong HOT 1
- Program header editing features HOT 5
- SEGV when ELF has a malformed .dynamic section
- Relocatable binaries not handled
- Patchelf 0.18.0 Build failure on s390x with "span : out of range error"
- build failed for NetBSD
- rename-dynamic-symbols produces unusable binary
- Need help for cross-compliling libc.so.6
- patchelf: cannot normalize PT_NOTE segment: non-contiguous SHT_NOTE sections HOT 1
- _arguments:463: command not found: dynamic HOT 6
- `replace-needed.sh` test fails on 32-bit arm
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from patchelf.