LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   [bash] sudo: preserve non-std file descriptors (http://www.linuxquestions.org/questions/linux-software-2/%5Bbash%5D-sudo-preserve-non-std-file-descriptors-931545/)

DieZwiebel 02-27-2012 10:18 AM

[bash] sudo: preserve non-std file descriptors
 
Long story short: why isn't this (simplified) sample working?

Code:

root:# sudo -C 3 -u regular-user cat /dev/fd/3 3< /var/log/syslog
cat: /dev/fd/3: No Such file or directory

There is a file that contains

Code:

Defaults closefrom_override
in my /etc/sudoers.d

I am using bash 4.2.20 and Debian Wheezy

Thank you so much for your help!

catkin 02-27-2012 10:41 AM

AFAIK the special file name /dev/fd/3 can only be used in redirections. If that is correct it cannot be used as an argument to cat. Maybe cat </dev/fd/3 would work.


All times are GMT -5. The time now is 09:04 AM.