Bug 294 - Not able to set Variable in default Profile for CA
Not able to set Variable in default Profile for CA
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.9
PC Other
: normal high
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-10 10:27 MDT by Robert Fields
Modified: 2008-11-06 07:16 MST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Fields 2008-07-10 10:27:20 MDT
The documentation shows an example of how to use a defaults setting for !set_logname.

The documentations shows: Defaults>root !set_logname

I believe it should be: Defaults:root  !set_logname

I get errors with the documentation example but it seems to work fine if I swap out the > for a :.

All of the other examples use a : when specifying users.
Comment 1 Rajan 2008-10-30 08:01:57 MDT
In sudo1.6.9p17 we are facing problem while setting variable in default profile. The variable $AGENTWORKS_DIR is required in CA setup.Whenever we execute awservices command, follwing error generates:

bash-3.00# awservices status
Environment is not set properly. AGENTWORKS_DIR undefined
Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201
Environment is not set properly. AGENTWORKS_DIR undefined
Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201
Environment is not set properly. AGENTWORKS_DIR undefined
Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201
Environment is not set properly. AGENTWORKS_DIR undefined
Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201
Environment is not set properly. AGENTWORKS_DIR undefined
Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201
Environment is not set properly. AGENTWORKS_DIR undefined
Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201
Environment is not set properly. AGENTWORKS_DIR undefined
Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201
Environment is not set properly. AGENTWORKS_DIR undefined
Failed to load codeset table from file /services/config/local/cp1252.xlt, error 201
Segmentation Fault (core dumped).

$AGENTWORKS_DIR is set in default profile file as follows:

if [ "$AGENTWORKS_DIR" = '' ]
then
   AGENTWORKS_DIR=/opt/CA/UnicenterNSM/atech
   export AGENTWORKS_DIR
fi

if [ -f "$AGENTWORKS_DIR"/scripts/envset ]
then
   . "$AGENTWORKS_DIR/scripts/envset"
fi

The same profile settings are present in machines with earlier version of sudo i.e Sudo version 1.6.8p9, but we are not facing any problem on these machine.

Kindly inform if it is a version constraint & secondly is it possible to resolve this issue using sudo 1.6.9p17 version

Regards
Rajan

Comment 2 Todd C. Miller 2008-11-06 07:16:46 MST
The '>' indicates that the default is applied when running commands as that user.  In the example, !set_logname will be applied when running commands as root.  Perhaps you have an older version of sudo that doesn't support runas Defaults.

With respect to the AGENTWORKS_DIR environment variables, since version 1.6.9 sudo will run commands with a clean environment.  If you need to preserve variables you can do so.  See the UPGRADE file included with the sudo distribution for more information.