path: root/ports
diff options
authorPeter Seebach <peter.seebach@windriver.com>2013-02-12 15:42:49 -0600
committerPeter Seebach <peter.seebach@windriver.com>2013-02-12 15:42:49 -0600
commit363a94bb851046f62648d7c96c749e899bd0648e (patch)
tree1342fd5d4766974a2c3749616ba3b5ec1f43b7a8 /ports
parenta01d7884e5f3acba1460cf6b500d28390e7af9f8 (diff)
Fix link() to work when chrootedpseudo-1.4.4PSEUDO_1_4_4
The automatic path fixups invoked for names which end in the string "path" was still applying to link(), which then called linkat(), which would do the same path fixups; if you were chrooted, this would produce bogus paths. On systems which actually have linkat(), this would produce the even more mysterious behavior that the link would succeed, but the following stat would fail. Solution: Change the wrapfuncs prototypes for link() so it doesn't invoke automatic path name fixups.
Diffstat (limited to 'ports')
2 files changed, 4 insertions, 4 deletions
diff --git a/ports/unix/guts/link.c b/ports/unix/guts/link.c
index cabcdf4..3b340ee 100644
--- a/ports/unix/guts/link.c
+++ b/ports/unix/guts/link.c
@@ -1,9 +1,9 @@
- * Copyright (c) 2008-2010, 2012 Wind River Systems; see
+ * Copyright (c) 2008-2010, 2012, 2013 Wind River Systems; see
* guts/COPYRIGHT for information.
* static int
- * wrap_link(const char *oldpath, const char *newpath) {
+ * wrap_link(const char *oldname, const char *newname) {
* int rc = -1;
/* since 2.6.18 or so, linkat supports AT_SYMLINK_FOLLOW, which
@@ -12,7 +12,7 @@
* does NOT support AT_SYMLINK_NOFOLLOW! So define this in
* your port's portdefs.h or hope the default works for you.
- rc = wrap_linkat(AT_FDCWD, oldpath, AT_FDCWD, newpath,
+ rc = wrap_linkat(AT_FDCWD, oldname, AT_FDCWD, newname,
/* return rc;
diff --git a/ports/unix/wrapfuncs.in b/ports/unix/wrapfuncs.in
index f6a2cd1..7e205f0 100644
--- a/ports/unix/wrapfuncs.in
+++ b/ports/unix/wrapfuncs.in
@@ -37,7 +37,7 @@ int chmod(const char *path, mode_t mode);
int chown(const char *path, uid_t owner, gid_t group);
int fchmodat(int dirfd, const char *path, mode_t mode, int flags);
int fchownat(int dirfd, const char *path, uid_t owner, gid_t group, int flags);
-int link(const char *oldpath, const char *newpath); /* flags=AT_SYMLINK_NOFOLLOW */
+int link(const char *oldname, const char *newname); /* flags=AT_SYMLINK_NOFOLLOW */
int linkat(int olddirfd, const char *oldname, int newdirfd, const char *newname, int flags);
int mkdir(const char *path, mode_t mode); /* flags=AT_SYMLINK_NOFOLLOW */
int mkdirat(int dirfd, const char *path, mode_t mode); /* flags=AT_SYMLINK_NOFOLLOW */