+2005-01-26 Miklos Szeredi <miklos@szeredi.hu>
+
+ * Fix bug in link() operation which caused the wrong path to be
+ passed as the first argument. Found by Anton Altaparmakov
+
2005-01-21 Miklos Szeredi <miklos@szeredi.hu>
* LIB: fix double reply in readdir operation
return -ERESTARTNOINTR;
memset(&inarg, 0, sizeof(inarg));
- inarg.newdir = get_node_id(newdir);
+ inarg.oldnodeid = get_node_id(inode);
req->in.h.opcode = FUSE_LINK;
- req->inode2 = newdir;
+ req->inode2 = inode;
req->in.numargs = 2;
req->in.args[0].size = sizeof(inarg);
req->in.args[0].value = &inarg;
struct fuse_entry_out outarg;
res = -ENOENT;
- oldpath = get_path(f, in->nodeid);
+ oldpath = get_path(f, arg->oldnodeid);
if (oldpath != NULL) {
- newpath = get_path_name(f, arg->newdir, name);
+ newpath = get_path_name(f, in->nodeid, name);
if (newpath != NULL) {
if (f->flags & FUSE_DEBUG) {
printf("LINK %s\n", newpath);
if (f->op.link && f->op.getattr) {
res = f->op.link(oldpath, newpath);
if (res == 0)
- res = lookup_path(f, arg->newdir, in->unique, name,
+ res = lookup_path(f, in->nodeid, in->unique, name,
newpath, &outarg);
}
free(newpath);