| Summary: | mv symbolic link cross partition fails | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Jin Guojun <jin> |
| Component: | bin | Assignee: | dwmalone |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Jin Guojun
2000-04-07 19:00:01 UTC
> If every one agree this incorrect, I can trace down the code to
> find a patch.
This sounds like a bug, as it doesn't do the same thing as mving
a symlink on a local partition would. If the file the symlink points
to is a regular file you'll end up getting a copy of that instead
of the symlink.
Digital Unix and Linux also do the same "correct" thing as solaris.
It looks like mv has a stat, which should be an lstat. The included
patch seems to fix it.
BTW - for some strange reason your PR seems to be marked as
confidential on the web site.
David.
--- mv.c Fri Apr 7 20:19:19 2000
+++ mv.c.orig Fri Apr 7 20:19:45 2000
@@ -221,7 +221,7 @@
* it's a regular file, do the copy internally; otherwise, use
* cp and rm.
*/
- if (lstat(from, &sb)) {
+ if (stat(from, &sb)) {
warn("%s", from);
return (1);
}
Yes, following patch fixed the problem.
Shall we apply the patch and close the case?
Thanks,
-Jin
--------- original message ------
> If every one agree this incorrect, I can trace down the code to
> find a patch.
This sounds like a bug, as it doesn't do the same thing as mving
a symlink on a local partition would. If the file the symlink points
to is a regular file you'll end up getting a copy of that instead
of the symlink.
Digital Unix and Linux also do the same "correct" thing as solaris.
It looks like mv has a stat, which should be an lstat. The included
patch seems to fix it.
BTW - for some strange reason your PR seems to be marked as
confidential on the web site.
David.
--- mv.c Fri Apr 7 20:19:19 2000
+++ mv.c.orig Fri Apr 7 20:19:45 2000
@@ -221,7 +221,7 @@
* it's a regular file, do the copy internally; otherwise, use
* cp and rm.
*/
- if (lstat(from, &sb)) {
+ if (stat(from, &sb)) {
warn("%s", from);
return (1);
}
Responsible Changed From-To: freebsd-bugs->dwmalone I'm interested in this one. State Changed
From-To: open->closed
Fix has been committed in RELENG_{3,4} and HEAD.
|