Problem
The command setpasswd(AS) fails with the following error:
Error: Bad section: <lmxserver> or keyword: <locale> Bad section: <lmxserver> or keyword: <locale> while executing "exec $lmpath(SRVCONFIG_PATH) -g "lmxserver,locale"" invoked from within "set locale [exec $lmpath(SRVCONFIG_PATH) -g "lmxserver,locale"]..." invoked from within "if { $user_id == "root" } {
set old_pwd ""set locale [exec $lmpath(SRVCONFIG_PATH) -g "lmxserver,locale"] if { $locale == "fr_FR.ISO8859-1" } ..."
(file "/bin/setpasswd" line 63)After resolving this issue the command may subsequently fail with the error:
Error: can't read "lmpath(PASSWD_PATH)": no such element in array can't read "lmpath(PASSWD_PATH)": no such element in array while executing "set env(TCL_LIBRARY) $lmpath(PASSWD_PATH)..." (file "/bin/setpasswd" line 143)
Cause
The /bin/setpasswd TCL script is looking for the locale keyword in /usr/net/servers/lanman/lanman.ini file which now uses "lang" instead of "locale".
There are also several TCL environment parameters required for this script which have not been set up.
Solution
First make a backup of the current /bin/setpasswd script, for
example to /bin/setpasswd.orig. Then using your favorite editor
amend line 67 of the /bin/setpasswd script as follows
("locale" is replaced with "lang").Before change:set locale [exec $lmpath(SRVCONFIG_PATH) -g "lmxserver,locale"]After change:set locale [exec $lmpath(SRVCONFIG_PATH) -g "lmxserver,lang"]In addition, the following lines should be appended to the end of the /opt/K/SCO/asusrv/4.0.2/cntl/lmpaths.tcl file to define all the required parameters for this script:
set lmpath(PASSWD_PATH) "/usr/net/servers/lanman/addon/passwd"
set lmpath(PASSWD_NAME) "passwd"
set lmpath(UPASSWD_PATH) "/usr/net/servers/lanman/addon/passwd/upasswd"
set lmpath(UPASSWD_NAME) "upasswd"
set lmpath(EXPECT_PATH) "/usr/net/servers/lanman/addon/passwd/expect"
set lmpath(EXPECT_NAME) "expect"The setpasswd(AS) command should now run OK (there is no need to
reboot or restart the AFPS server). See also
setpasswd(AS)ta#100012, "How can I change a lost or expired password in AFPS 3.5.x or 4.0.2?"
ta#100049, "Users get an error that upwd failed when using setpasswd, but root works fine."