Bug 385

Summary: PAGER & LESS variables won't be forwarded
Product: Sudo Reporter: C3PO <igor>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED INVALID    
Severity: normal    
Priority: low    
Version: 1.7.2   
Hardware: PC   
OS: Linux   

Description C3PO 2009-12-21 13:54:59 MST
when user enters #sudo su, the variables LESS and PAGER from the current environment won't be forwarded. This behavior differs from the previous versions (any reasons?). The absence of PAGER and LESS affects man pages formatting, ( ESC[1m )

Temporary workaround:

adding Defaults	env_reset,env_keep+="PAGER, LESS" will fix the problem
Comment 1 Todd C. Miller 2010-05-07 13:30:33 MDT
Starting with version 1.6.9, sudo starts commands with a fresh environment that only contains a few variables.  I don't think it is appropriate to include PAGER or LESS in this list as those variables can be used to cause programs like man to run arbitrary commands.

You can get the pre-1.6.9 behavior by negating the "env_reset" Defaults setting in sudoers or by adding the variables you wish to preserver to the env_keep list.