return _symlink(dir.get(), name.c_str(), target, perms);
}
-int Client::readlink(const char *relpath, char *buf, loff_t size)
+int Client::readlink(const char *relpath, char *buf, loff_t size, const UserPerm& perms)
{
Mutex::Locker lock(client_lock);
tout(cct) << "readlink" << std::endl;
filepath path(relpath);
InodeRef in;
- int r = path_walk(path, &in, false);
+ int r = path_walk(path, &in, perms, false);
if (r < 0)
return r;
int rmdir(const char *path);
// symlinks
- int readlink(const char *path, char *buf, loff_t size);
+ int readlink(const char *path, char *buf, loff_t size, const UserPerm& perms);
int symlink(const char *existing, const char *newname);
} else if (strcmp(op, "readlink") == 0) {
const char *a = t.get_string(buf, p);
char buf[100];
- client->readlink(a, buf, 100);
+ client->readlink(a, buf, 100, perms);
} else if (strcmp(op, "lstat") == 0) {
struct stat st;
const char *a = t.get_string(buf, p);
{
if (!cmount->is_mounted())
return -ENOTCONN;
- return cmount->get_client()->readlink(path, buf, size);
+ UserPerm perms = cmount->get_client()->pick_my_perms();
+ return cmount->get_client()->readlink(path, buf, size, perms);
}
extern "C" int ceph_symlink(struct ceph_mount_info *cmount, const char *existing,