bugDatabase-driven manual pager suite - Bugs: bug #58896, MANSECT not properly set for...

 
 

bug #58896: MANSECT not properly set for MANPAGER

Submitted by:  Rob Hoelz <hoelzro>
Submitted on:  Tue 04 Aug 2020 01:57:44 PM UTC  
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 04 Aug 2020 01:57:44 PM UTC, original submission:  

Hello there!

I believe I have found a bug in man-db - namely, if you set MANSECT when invoking man, only the first section in MANSECT is passed along to MANPAGER.  Here's an example that reproduces the behavior:

<pre>
$ cat > pager
#!/bin/bash

echo "MANSECT: $MANSECT"
$ chmod 755 pager
$ echo $MANSECT
1:l:8:3:0:2:5:4:9:6:7:n
$ MANPAGER=pager man man
MANSECT: 1
</pre>

From a cursory look at the code, I think the problem is in get_section_list; strtok is used on the result of getenv("MANSECT") and alters the environment string in-place, causing the incorrect value to be passed along to future child processes.

I observed this behavior with version 2.9.3 packaged with Arch Linux (which doesn't seem to have any major patches), but I was also able to reproduce it with the current Git HEAD (1c7b46ae as of this writing).

Rob Hoelz <hoelzro>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hoelzro (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.5