tput triggers AIX ODM access failures with cfgmgr

 

A colleague of mine reported the following issue recently.

 

When they ran cfgmgr on their AIX system the following error message was displayed (several times):

 

# cfgmgr

cfgmgr: 0514-604 Cannot access the CuDv object class in the

        device configuration database.

cfgmgr: 0514-604 Cannot access the CuDv object class in the

        device configuration database.

cfgmgr: 0514-604 Cannot access the CuDv object class in the

        device configuration database.

cfgmgr: 0514-604 Cannot access the CuDv object class in the

        device configuration database.

...

 

I asked them to run cfgmgr -v, and this is what we found in the output:

 

# cfgmgr

cfgmgr is running in phase 2

----------------

Time: 0 LEDS: 0x538

Invoking top level program -- "/etc/methods/cfgprobe -c /etc/drivers/coreprobe.ext"

Time: 0 LEDS: 0x539

Return code = 0

*** stdout includes unprintable char ***

*** no stderr ****

cfgmgr: 0514-604 Cannot access the CuDv object class in the

        device configuration database.

....

 

This message, stdout includes unprintable char, provided me with a clue to the root cause of the problem.

 

I asked them if they'd made any recent changes to root's .profile or .kshrc files. They replied, "Yes!".

 

They had recently placed this entry in root's .kshrc file:

 

tput cnorm

 

This seemingly innocuous entry resets the terminal cursor to its normal visibility state, undoing any previous cursor visibility changes made by tput civis (invisible) or tput cvvis (very visible). In short, it makes the cursor visible by restoring its default visibility state. They did this after they'd had some trouble setting the correct terminal type with their terminal emulator and getting the cursor to display properly.

 

I asked them to remove the entry. Once they did that cfgmgr ran clean, without errors:

 

# cfgmgr

#

 

Unprintable characters, such as binary escape codes from tput cnorm, tput civis, tput clear, or tput bold, can disrupt cfgmgr on AIX systems. While not a widespread issue, this has been a recognised problem for years, particularly in environments with customized root profiles. cfgmgr expects clean standard output (stdout), and any unexpected output, including invisible cursor control codes, can cause ODM access failures.