Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 297811 - LESS env variable is not propagated when doing `sudo su'
Summary: LESS env variable is not propagated when doing `sudo su'
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-21 17:59 UTC by Igor Franchuk
Modified: 2009-12-21 18:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Franchuk 2009-12-21 17:59:51 UTC
ESC[1m when viewing MAN pages

Reproducible: Always

Steps to Reproduce:
1.sudo su
2.man fc
3.

Actual Results:  
FC(1P)                                                    POSIX Programmer's Manual                                                    FC(1P)

ESC[1mPROLOGESC[0m
       This  manual page is part of the POSIX Programmer's Manual.  The Linux implementation of this interface may differ (consult the corre-
       sponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

Expected Results:  
FC(1P)                                                    POSIX Programmer's Manual                                                    FC(1P)

PROLOG
       This  manual page is part of the POSIX Programmer's Manual.  The Linux implementation of this interface may differ (consult the corre-
       sponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.


somehow PAGER is missing from the enviroment when user makes sudo su

you may work around this problem by adding 

PAGER		/usr/bin/less -isR 

to /etc/man.conf file
Comment 1 Alex Legler (RETIRED) archtester gentoo-dev Security 2009-12-21 18:25:31 UTC
The environment is reset by sudo. Consult `man sudoers' on env_reset or use a proper way to become root (`su').
Comment 2 Igor Franchuk 2009-12-21 18:40:34 UTC
This bug occurs because app-admin/sudo-1.7.2_p1 won't forward LESS and PAGER enviroment variables (any reasons why it shouldn't?). 

You can fix this problem by adding the following line in sudoers

Defaults	env_reset,env_keep+="PAGER, LESS"

This behavior differs from app-admin/sudo-1.6.9_p16 that would forward PAGER and LESS variables.