Bug 309 - AIX 5.3 with sudo version 1.6.9 odmget not working
AIX 5.3 with sudo version 1.6.9 odmget not working
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.9
IBM IRIX
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-30 09:24 MDT by Pascal Froling
Modified: 2008-11-10 01:53 MST (History)
1 user (show)

See Also:


Attachments
sudo configure, make, make install (23.17 KB, text/plain)
2008-10-30 09:24 MDT, Pascal Froling
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Froling 2008-10-30 09:24:51 MDT
Created attachment 236 [details]
sudo configure, make, make install

Working Example:

Machine X
uname: AIX
oslevel -s: 5300-08-03-0831
sudo -V: Sudo version 1.6.7p5
rpm -qa|egrep sudo: sudo-1.6.7p5-3

AsRoot: odmget -q"uniquetype=disk/fcp/scsd" PdAt|egrep -p "GUID"
Returns: 
PdAt:
        uniquetype = "disk/fcp/scsd"
        attribute = "GUID"
        deflt = "none"
        values = ""
        width = ""
        type = "R"
        generic = ""
        rep = "s"
        nls_index = 0

AsRoot: sudo odmget -q"uniquetype=disk/fcp/scsd" PdAt|egrep -p "GUID"
PdAt:
        uniquetype = "disk/fcp/scsd"
        attribute = "GUID"
        deflt = "none"
        values = ""
        width = ""
        type = "R"
        generic = ""
        rep = "s"
        nls_index = 0

Failing Example:

Machine X
uname: AIX
oslevel -s: 5300-08-03-0831
sudo -V: Sudo version 1.6.9p15
rpm -qa|egrep sudo: sudo-1.6.9p15-2noldap

AsRoot: odmget -q"uniquetype=disk/fcp/scsd" PdAt|egrep -p "GUID"
PdAt:
        uniquetype = "disk/fcp/scsd"
        attribute = "GUID"
        deflt = "none"
        values = ""
        width = ""
        type = "R"
        generic = ""
        rep = "s"
        nls_index = 0

AsRoot: sudo odmget -q"uniquetype=disk/fcp/scsd" PdAt|egrep -p "GUID"
0518-506 odmget: Cannot open object class PdAt
        Check path name and permissions.

Failing Example sudo build from scratch (see attachment)

Machine X
uname: AIX
oslevel -s: 5300-08-03-0831
sudo -V: Sudo version 1.6.9p17
rpm -qa|egrep sudo: no rpm

AsRoot: odmget -q"uniquetype=disk/fcp/scsd" PdAt|egrep -p "GUID"
PdAt:
        uniquetype = "disk/fcp/scsd"
        attribute = "GUID"
        deflt = "none"
        values = ""
        width = ""
        type = "R"
        generic = ""
        rep = "s"
        nls_index = 0

AsRoot: sudo odmget -q"uniquetype=disk/fcp/scsd" PdAt|egrep -p "GUID"
0518-506 odmget: Cannot open object class PdAt
        Check path name and permissions.

I checked permissions and paths. They are the same on other machines.
Issue comes up when on AIX commands are ran with sudo which access the AIX ODM using the above command (odmget). I did various test, which al resulted in above error.

Thanks in advance,

Pascal Froling
Comment 1 Todd C. Miller 2008-11-06 07:33:59 MST
It sounds like odmget needs something in the environment to work properly.  Starting with sudo 1.6.9, sudo will clear the environment before executing a command.  See the UPGRADE file that comes with sudo for details.

The simple solution is probably to disable the environment clearing with a line like:

Defaults !env_reset

at the top of sudoers.  A better solution is to find the environment variables you need and add them with lines like:

Defaults env_keep += "SOMETHING"
Comment 2 Pascal Froling 2008-11-10 01:53:18 MST
Thanks for your response Todd. I read the UPGRADE file but didnt think for the AIX odm there was a variable set. With your comment I had a closer look and found this while doing the env command as root:

ODMDIR=/etc/objrepos

Adding this to the /etc/sudoers file like:

Defaults env_keep += "ODMDIR"
solved the issue I had with the AIX ODM commands.

Sudo version 1.6.9p17

AsRoot: sudo odmget -q"uniquetype=disk/fcp/scsd" PdAt|egrep -p "GUID"
PdAt:
        uniquetype = "disk/fcp/scsd"
        attribute = "GUID"
        deflt = "none"
        values = ""
        width = ""
        type = "R"
        generic = ""
        rep = "s"
        nls_index = 0

Thanks,

Pascal Froling