-
-
Notifications
You must be signed in to change notification settings - Fork 494
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
Overwrite soname in place if there is room #159
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1082,6 +1082,15 @@ void ElfFile<ElfFileParamNames>::modifySoname(sonameMode op, const std::string & | |
|
||
debug("new SONAME is '%s'\n", newSoname.c_str()); | ||
|
||
/* If new SONAME fits in existing space, overwrite. This works around | ||
issue #44. */ | ||
if (newSoname.size() <= sonameSize) { | ||
debug("overwriting old SONAME with new...\n"); | ||
strcpy(soname, newSoname.c_str()); | ||
changed = true; | ||
return; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This functionality will have to change now @reidpr I agree that this is not an ideal tracking each Either way this code will produce errors for now if done with other commands. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I opened https://github.com/NixOS/patchelf/pull/363/files# to help make this simpler. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello, thanks for the heads up. I still hope (after 3 years) this PR will get merged, but I don't have time to maintain it. |
||
} | ||
|
||
/* Grow the .dynstr section to make room for the new SONAME. */ | ||
debug("SONAME is too long, resizing...\n"); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we already know the size of
newSoname
, memcpy is the better choice: