Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bogus NLSPATH handling #1

Open
jelmd opened this issue Aug 23, 2017 · 0 comments
Open

bogus NLSPATH handling #1

jelmd opened this issue Aug 23, 2017 · 0 comments

Comments

@jelmd
Copy link
Owner

jelmd commented Aug 23, 2017

ksh93 handles NLSPATH not correctly. E.g. if the catalog name is not set (e.g. see src/lib/libast/tm/tmlocale.c), it stops parsing the path on %C or /LC_MESSAGES (sets last=1), checks for this path and because last is not reset to 0, it takes each consecutive path component as a single locale path to lookup. Since pathpath() gets used for the lookup, this may result in picking up regular executables from ${PATH}.

E.g.:

export NLSPATH=/usr/share/locale/%L/LC_MESSAGES/%N.cat:/usr/share/locale/%l/LC_MESSAGES/%N.cat
ksh93 -c "printf '%T\n' '1 Jan'"

results into Sun ${garbage} 1 13:20:01 MET 2017 whereby garbage are the first 10 bytes of /usr/sbin/share - this is a regular executable. pathpath('share', ...) picks it up, because it is looking up the file in all ${PATH} paths.

Fix is to not blindly stop parsing on %C or /LC_MESSAGES (doesn't make sense to me at all, found no spec, which demands such a behavior) and to be able to supply %T handling a customized catalog to use e.g. ksh93_tm instead of NULL.

NOTE that tcsh per default sets the NLSPATH the same way as shown above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant