return c->conn;
}
+static const char *canonicalize_path(TALLOC_CTX *mem_ctx,
+ struct connection_struct *conn,
+ const char *fname)
+{
+ char *to_free = NULL;
+ char *result = NULL;
+
+ if (fname[0] != '/') {
+ struct smb_filename *cwd = SMB_VFS_GETWD(conn, mem_ctx);
+ if (cwd == NULL) {
+ return NULL;
+ }
+
+ to_free = talloc_asprintf(mem_ctx,
+ "%s/%s",
+ cwd->base_name,
+ fname);
+ TALLOC_FREE(cwd);
+
+ if (to_free == NULL) {
+ return NULL;
+ }
+ fname = to_free;
+ }
+
+ result = canonicalize_absolute_path(mem_ctx, fname);
+ TALLOC_FREE(to_free);
+ return result;
+}
+
static int set_sys_acl_conn(const char *fname,
SMB_ACL_TYPE_T acltype,
SMB_ACL_T theacl, connection_struct *conn)
smb_fname = synthetic_smb_fname_split(
frame,
- canonicalize_absolute_path(talloc_tos(), fname),
+ canonicalize_path(talloc_tos(), conn, fname),
lp_posix_pathnames());
if (smb_fname == NULL) {
TALLOC_FREE(frame);
smb_fname = synthetic_smb_fname_split(
fsp,
- canonicalize_absolute_path(talloc_tos(), fname),
+ canonicalize_path(talloc_tos(), conn, fname),
lp_posix_pathnames());
if (smb_fname == NULL) {
return NT_STATUS_NO_MEMORY;
smb_fname = synthetic_smb_fname_split(
frame,
- canonicalize_absolute_path(talloc_tos(), fname),
+ canonicalize_path(talloc_tos(), conn, fname),
lp_posix_pathnames());
if (smb_fname == NULL) {
smb_fname = synthetic_smb_fname_split(
frame,
- canonicalize_absolute_path(talloc_tos(), fname),
+ canonicalize_path(talloc_tos(), conn, fname),
lp_posix_pathnames());
if (smb_fname == NULL) {
TALLOC_FREE(frame);
smb_fname = synthetic_smb_fname_split(
frame,
- canonicalize_absolute_path(talloc_tos(), fname),
+ canonicalize_path(talloc_tos(), conn, fname),
lp_posix_pathnames());
if (smb_fname == NULL) {
TALLOC_FREE(frame);
smb_fname = synthetic_smb_fname(
talloc_tos(),
- canonicalize_absolute_path(talloc_tos(), fname),
+ canonicalize_path(talloc_tos(), conn, fname),
NULL,
NULL,
0,