[PATCH] use current working directory instead of share path in cephwrap_realpath
Robert Sander
r.sander at heinlein-support.de
Fri Apr 26 20:36:24 UTC 2019
Hi,
reading symbolic links from a CephFS via vfs_ceph does not always work.
It looks like the CWD instead of the share path should be used to
construct the real path.
Attached is a patch that changes this. Please review.
Kindest Regards
--
Robert Sander
Heinlein Support GmbH
Schwedter Str. 8/9b, 10119 Berlin
http://www.heinlein-support.de
Tel: 030 / 405051-43
Fax: 030 / 405051-19
Zwangsangaben lt. §35a GmbHG:
HRB 93818 B / Amtsgericht Berlin-Charlottenburg,
Geschäftsführer: Peer Heinlein -- Sitz: Berlin
-------------- next part --------------
From 8e5c2d08781ce638f261a866f1098675d8d3331d Mon Sep 17 00:00:00 2001
From: Robert Sander <r.sander at heinlein-support.de>
Date: Fri, 26 Apr 2019 17:52:58 +0200
Subject: [PATCH] use current working directory instead of share path
---
source3/modules/vfs_ceph.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c
index cf45fb4c919..57de8bc891a 100644
--- a/source3/modules/vfs_ceph.c
+++ b/source3/modules/vfs_ceph.c
@@ -1206,14 +1206,14 @@ static struct smb_filename *cephwrap_realpath(struct vfs_handle_struct *handle,
} else if ((len >= 2) && (path[0] == '.') && (path[1] == '/')) {
if (len == 2) {
r = asprintf(&result, "%s",
- handle->conn->connectpath);
+ handle->conn->cwd_fname->base_name);
} else {
r = asprintf(&result, "%s/%s",
- handle->conn->connectpath, &path[2]);
+ handle->conn->cwd_fname->base_name, &path[2]);
}
} else {
r = asprintf(&result, "%s/%s",
- handle->conn->connectpath, path);
+ handle->conn->cwd_fname->base_name, path);
}
if (r < 0) {
--
2.17.1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20190426/0e6d3513/signature.sig>
More information about the samba-technical
mailing list