Bug 616139 - sudo tgt-admin --dump => EOF
Summary: sudo tgt-admin --dump => EOF
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: sudo   
(Show other bugs)
Version: 5.5
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Daniel Kopeček
QA Contact: BaseOS QE Security Team
Depends On:
TreeView+ depends on / blocked
Reported: 2010-07-19 18:09 UTC by François Cami
Modified: 2012-03-07 09:26 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-03-07 09:26:47 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
kickstart to help reproduce the problem (2.10 KB, text/plain)
2010-07-19 18:09 UTC, François Cami
no flags Details

Description François Cami 2010-07-19 18:09:50 UTC
Created attachment 432973 [details]
kickstart to help reproduce the problem

Description of problem:
`tgt-admin --dump` works fine (outputs the current tgtd configuration), but `sudo tgt-admin --dump` does not.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Install RHEL5 with scsi-target-utils
2. configure a LUN with tgt-adm
3. use tgt-admin to dump configuration
4. use tgt-admin to dump configuration, with sudo
Actual results:
The first dump contains the configuration, the second (with sudo) does not.

Expected results:
Both outputs should be identical.

Additional info:
I am including a kickstart file to help reproduce the bug. The kickstart installs all the necessary packages and creates a shell script in /root to demonstrate the problem. The root password of the installed system is "testiscsi".
Note that I am not sure the problem comes from scsi-target-utils and not from sudo.

Comment 1 François Cami 2010-07-19 18:11:01 UTC
Sample output:

[root@localhost ~]# tgt-admin --dump
default-driver iscsi

<target iqn.2010-07.NET.YOURDOMAIN:storage.vm1.smh>
	backing-store /dev/tgtdtest/lun0

[root@localhost ~]# sudo tgt-admin --dump
[root@localhost ~]#

The sudoers file includes the line:
root	ALL=(ALL) 	ALL

Comment 2 Mike Christie 2011-02-02 10:19:37 UTC
Sorry for the late response. I just saw this.

Try the current scsi-target-utils in RHEL 5.6.

Comment 3 Roland Friedwagner 2011-02-10 22:16:32 UTC
Funny one.

I confirm the bug/feature for RHEL 5.6::

  $ rpm -qf $(command -v tgt-admin)
  $ tgt-admin --dump
  default-driver iscsi
  <target iqn.2008-09.com.redhat.example:tgt1>
          backing-store /dev/sda1
  $ sudo tgt-admin --dump

Reason is PATH Environment is reset by sudo to "/usr/bin:/bin"
So this all is the same::

  $ sudo tgt-admin --dump
  $ PATH=/usr/bin:/bin /usr/sbin/tgt-admin --dump
  $ sudo /usr/sbin/tgt-admin --dump
  $ sudo bash -c "/usr/sbin/tgt-admin --dump"

  # workaround (not really;):
  $ sudo PATH=/sbin:$PATH tgt-admin --dump
  default-driver iscsi
  <target iqn.2008-09.com.redhat.example:tgt1>
          backing-store /dev/sda1

Comment 4 Andy Grover 2011-12-20 21:04:13 UTC
see bug 80215, I think this is more properly a sudo issue.

Comment 5 Daniel Kopeček 2012-03-07 09:26:47 UTC

(In reply to comment #4)
> see bug 80215, I think this is more properly a sudo issue.

I don't consider this as a bug. You can change/set the path either by the workaround described above or using the secure_path Defaults option.

Note You need to log in before you can comment on or make changes to this bug.