Skip to contentSkip to conversation

ld.so(8): make lack of separator escaping explicit

PATCH Superseded Mike Frysinger 2 participants 6 messages Feb 5, 2018 – Feb 6, 2018 4 messages not in the archive Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ld.so(8): make lack of separator escaping explicit

Make it clear that the delimiters in LD_LIBRARY_PATH cannot be escaped so people don't try various methods (like \:) to workaround it.

---
 man8/ld.so.8 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
man8/ld.so.8 +2 -1
index 64e1fb2afdc3..fb568ef8721a 100644
@@ -271,7 +271,8 @@ This is useful when using a debugger.
 .B LD_LIBRARY_PATH
 A list of directories in which to search for
 ELF libraries at execution time.
-The items in the list are separated by either colons or semicolons.
+The items in the list are separated by either colons or semicolons,
+and there is no support for escaping either separator.
 Similar to the
 .B PATH
 environment variable.
Signature · 6 lines
2.16.1

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20180205161357.8131-1-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org

#2 lore raw

Am 05.02.2018 17:13, schrieb Mike Frysinger:

Quoted 13 lines

Make it clear that the delimiters in LD_LIBRARY_PATH cannot be escaped so people don't try various methods (like \:) to workaround it.

---
 man8/ld.so.8 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
man8/ld.so.8 +0 -0
index 64e1fb2afdc3..fb568ef8721a 100644

man8/ld.so.8 This is useful when using a debugger. · line 278

Quoted 9 lines
man8/ld.so.8 +2 -1
@@ -271,7 +271,8 @@ This is useful when using a debugger.
 .B LD_LIBRARY_PATH
 A list of directories in which to search for
 ELF libraries at execution time.
-The items in the list are separated by either colons or semicolons.
+The items in the list are separated by either colons or semicolons,
+and there is no support for escaping either separator.
 Similar to the
 .B PATH
 environment variable.

I am not sure that i understand that. You say that a libname like libfoo.1.2:3 is unparseable ?

re,
wh
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 4 lines · walter harms

Am 05.02.2018 17:13, schrieb Mike Frysinger:

Quoted 3 lines

Make it clear that the delimiters in LD_LIBRARY_PATH cannot be escaped so people don't try various methods (like \:) to workaround it.

Quoted 15 lines

man8/ld.so.8 This is useful when using a debugger. · line 278

Quoted 12 lines
man8/ld.so.8 +2 -1
@@ -271,7 +271,8 @@ This is useful when using a debugger.
 .B LD_LIBRARY_PATH
 A list of directories in which to search for
 ELF libraries at execution time.
-The items in the list are separated by either colons or semicolons.
+The items in the list are separated by either colons or semicolons,
+and there is no support for escaping either separator.
 Similar to the
 .B PATH
 environment variable.

I am not sure that i understand that. You say that a libname like libfoo.1.2:3 is unparseable ?

i think you're confusing LD_LIBRARY_PATH with other variables like LD_PRELOAD. my patch here is for the former, and that only loads search paths (i.e. directories), not files.

however, you're correct in that LD_PRELOAD="libfoo.1.2:3" would not work if the file was literally named "libfoo.1.2:3". it would search for "libfoo.1.2" and "3", and there is no way to change that behavior.

i'll send another patch.
-mike

#5 lore raw

PATCH v2 1/1 ld.so.8: make lack of separator escaping explicit

In reply to a message not in the archive

Make it clear that the delimiters in LD_PRELOAD, LD_LIBRARY_PATH, and LD_AUDIT cannot be escaped so people don't try various methods (such as \:) to workaround it.

---
 man8/ld.so.8 | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
man8/ld.so.8 +6 -3
index 64e1fb2afdc3..bd1457e1e7f5 100644
@@ -271,7 +271,8 @@ This is useful when using a debugger.
 .B LD_LIBRARY_PATH
 A list of directories in which to search for
 ELF libraries at execution time.
-The items in the list are separated by either colons or semicolons.
+The items in the list are separated by either colons or semicolons,
+and there is no support for escaping either separator.
 Similar to the
 .B PATH
 environment variable.
@@ -310,7 +311,8 @@ as shell variables!)
 .B LD_PRELOAD
 A list of additional, user-specified, ELF shared
 objects to be loaded before all others.
-The items of the list can be separated by spaces or colons.
+The items of the list can be separated by spaces or colons,
+and there is no support for escaping either separator.
 This can be used to selectively override functions in other shared objects.
 The objects are searched for using the rules given under DESCRIPTION.
 .IP
@@ -352,7 +354,8 @@ many obsolete or only for internal use.
 A colon-separated list of user-specified, ELF shared objects
 to be loaded before all others in a separate linker namespace
 (i.e., one that does not intrude upon the normal symbol bindings that
-would occur in the process).
+would occur in the process)
+and there is no support for escaping the separator.
 These objects can be used to audit the operation of the dynamic linker.
 .IP
 .B LD_AUDIT
Signature · 6 lines
2.16.1

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20180205214802.18397-1-vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org

#7 lore raw

Re: [PATCH v2] ld.so.8: make lack of separator escaping explicit

Am 05.02.2018 22:48, schrieb Mike Frysinger:

Quoted 34 lines

Make it clear that the delimiters in LD_PRELOAD, LD_LIBRARY_PATH, and LD_AUDIT cannot be escaped so people don't try various methods (such as \:) to workaround it.

---
 man8/ld.so.8 | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
man8/ld.so.8 +4 -2
index 64e1fb2afdc3..bd1457e1e7f5 100644
@@ -271,7 +271,8 @@ This is useful when using a debugger.
 .B LD_LIBRARY_PATH
 A list of directories in which to search for
 ELF libraries at execution time.
-The items in the list are separated by either colons or semicolons.
+The items in the list are separated by either colons or semicolons,
+and there is no support for escaping either separator.
 Similar to the
 .B PATH
 environment variable.
@@ -310,7 +311,8 @@ as shell variables!)
 .B LD_PRELOAD
 A list of additional, user-specified, ELF shared
 objects to be loaded before all others.
-The items of the list can be separated by spaces or colons.
+The items of the list can be separated by spaces or colons,
+and there is no support for escaping either separator.
 This can be used to selectively override functions in other shared objects.
 The objects are searched for using the rules given under DESCRIPTION.
 .IP

man8/ld.so.8 many obsolete or only for internal use. · line 361

Quoted 9 lines
man8/ld.so.8 +2 -1
@@ -352,7 +354,8 @@ many obsolete or only for internal use.
 A colon-separated list of user-specified, ELF shared objects
 to be loaded before all others in a separate linker namespace
 (i.e., one that does not intrude upon the normal symbol bindings that
-would occur in the process).
+would occur in the process)
+and there is no support for escaping the separator.
 These objects can be used to audit the operation of the dynamic linker.
 .IP
 .B LD_AUDIT

Everything is alright. NTL i would suggest to make consequences more clear, e.g.:

"There is \fBno way\rR to have libraryname like libfoo-1:2. In this case ld.so will
always search for \fBibfoo-1\fR and \fB2\fR."

your mileage may vary.

re,
wh

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw

Re: [PATCH v2] ld.so.8: make lack of separator escaping explicit

Quoted 40 lines · walter harms

Am 05.02.2018 22:48, schrieb Mike Frysinger:

Quoted 27 lines

Make it clear that the delimiters in LD_PRELOAD, LD_LIBRARY_PATH, and LD_AUDIT cannot be escaped so people don't try various methods (such as \:) to workaround it.

man8/ld.so.8 +4 -2
@@ -271,7 +271,8 @@ This is useful when using a debugger.
 .B LD_LIBRARY_PATH
 A list of directories in which to search for
 ELF libraries at execution time.
-The items in the list are separated by either colons or semicolons.
+The items in the list are separated by either colons or semicolons,
+and there is no support for escaping either separator.
 Similar to the
 .B PATH
 environment variable.
@@ -310,7 +311,8 @@ as shell variables!)
 .B LD_PRELOAD
 A list of additional, user-specified, ELF shared
 objects to be loaded before all others.
-The items of the list can be separated by spaces or colons.
+The items of the list can be separated by spaces or colons,
+and there is no support for escaping either separator.
 This can be used to selectively override functions in other shared objects.
 The objects are searched for using the rules given under DESCRIPTION.
 .IP

man8/ld.so.8 many obsolete or only for internal use. · line 361

Quoted 9 lines
man8/ld.so.8 +2 -1
@@ -352,7 +354,8 @@ many obsolete or only for internal use.
 A colon-separated list of user-specified, ELF shared objects
 to be loaded before all others in a separate linker namespace
 (i.e., one that does not intrude upon the normal symbol bindings that
-would occur in the process).
+would occur in the process)
+and there is no support for escaping the separator.
 These objects can be used to audit the operation of the dynamic linker.
 .IP
 .B LD_AUDIT

Everything is alright. NTL i would suggest to make consequences more clear, e.g.:

Quoted 2 lines

"There is \fBno way\rR to have libraryname like libfoo-1:2. In this case ld.so will
always search for \fBibfoo-1\fR and \fB2\fR."

could do. lets see what Michael thinks.
-mike