Besides setting the value in the array of the values, rtld sometimes needs to recalculate some internal control variable for the change to take effect. Allow the variable description to supply a method called on the update. Lock the function with the bind lock for safe operation. Mark several variables as allowed for update, since the on_update method is provided for them. The list is LD_BIND_NOW, LD_BIND_NOT, LD_LIBMAP_DISABLE, LD_LOADFLTR.
Details
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
| libexec/rtld-elf/rtld.c | ||
|---|---|---|
| 6737 | Is this missing the on_update call? | |
| libexec/rtld-elf/rtld.c | ||
|---|---|---|
| 6626 | Does ld_debug need to be a global variable? | |
| 6651 | Shouldn't we set it to false if the value is NULL? | |
| 6663 | Should ld_bind_not be updated here if lvd->val is NULL? That's what happens during image activation time. | |
| 6688 | Should dangerous_ld_env be recalculated if this variable (and some others) are toggled? | |
| libexec/rtld-elf/rtld.c | ||
|---|---|---|
| 6688 | I decided to never reset dangerous_ld_env back to false is it ever set to true. | |
| libexec/rtld-elf/rtld.c | ||
|---|---|---|
| 6626 | Could you please explain why? I want to never flip it true->false. | |
| libexec/rtld-elf/rtld.c | ||
|---|---|---|
| 6626 | I wasn't sure why it should never flip true -> false, but after thinking some more it seems reasonable if one reads the description of the dangerous_ld_env variable. Maybe some short comment would be good to have. | |
| libexec/rtld-elf/rtld.c | ||
|---|---|---|
| 392–393 | This means that some variables e.g. BIND_NOW can now be updated, right? I think those should be noted in the commit message too. | |
Update the commit message with the list of vars allowed in the commit.
Provide the whole list of changeable vars in rtld_get_var(3).