1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

cd: validate $OLDPWD (Solaris patch 185-Bug17714341)

This change was pulled in from:
https://raw.githubusercontent.com/oracle/solaris-userland/master/components/ksh93/patches/185-Bug17714341.patch

No public information about the reasons for this change is
available, but it seems reasonable to trust that the Solaris people
found a legitimate need for it.

src/cmd/ksh93/bltins/cd_pwd.c: b_cd():
- When determining the old PWD before 'cd', do not trust shp->pwd
  but get and validate the current PWD using path_pwd().
This commit is contained in:
Martijn Dekker 2021-01-08 22:31:16 +00:00
parent 1de20d65a8
commit 5d7e00a109

View file

@ -80,7 +80,7 @@ int b_cd(int argc, char *argv[],Shbltin_t *context)
dir = argv[0];
if(error_info.errors>0 || argc >2)
errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
oldpwd = (char*)shp->pwd;
oldpwd = path_pwd(shp,0);
opwdnod = (shp->subshell?sh_assignok(OLDPWDNOD,1):OLDPWDNOD);
pwdnod = (shp->subshell?sh_assignok(PWDNOD,1):PWDNOD);
if(argc==2)