| Summary: | /bin/sh pwd bug after cd into restricted directory | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Aragon Gouveia <aragon> |
| Component: | bin | Assignee: | Stefan Farfeleder <stefanf> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 6.1-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Aragon Gouveia
2006-08-03 13:00:34 UTC
Adding a call to updatepwd(NULL) in cd.c seems to fix the problem:
@@ -202,6 +202,7 @@
INTOFF;
if (updatepwd(badstat ? NULL : dest) < 0 || chdir(curdir) < 0) {
+ updatepwd(NULL);
INTON;
return (-1);
}
This may also address PR bin/64990.
Michael MacInnis.
Responsible Changed From-To: freebsd-bugs->stefanf Over to maintainer. stefanf 2008-02-24 16:50:55 UTC
FreeBSD src repository
Modified files:
bin/sh cd.c
Log:
Split updatepwd() into two smaller functions. The first one, findpwd(),
computes the new path and the second one, updatepwd(), updates the variables
PWD, OLDPWD and the path used for the pwd builtin according to the new
directory. For a logical directory change, chdir() is now called between
those two functions, no longer causing wrong values to be stored in PWD etc. if
it fails.
PR: 64990, 101316, 120571
Revision Changes Path
1.36 +45 -38 src/bin/sh/cd.c
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->patched Fixed in HEAD. State Changed From-To: patched->closed Merged to RELENG_6 and RELENG_7. |