Skip to content

Commit 5d7e00a

Browse files
committed
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().
1 parent 1de20d6 commit 5d7e00a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/ksh93/bltins/cd_pwd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ int b_cd(int argc, char *argv[],Shbltin_t *context)
8080
dir = argv[0];
8181
if(error_info.errors>0 || argc >2)
8282
errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
83-
oldpwd = (char*)shp->pwd;
83+
oldpwd = path_pwd(shp,0);
8484
opwdnod = (shp->subshell?sh_assignok(OLDPWDNOD,1):OLDPWDNOD);
8585
pwdnod = (shp->subshell?sh_assignok(PWDNOD,1):PWDNOD);
8686
if(argc==2)

0 commit comments

Comments
 (0)