*/
static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle,
adouble_type_t type);
-static int ad_set(struct adouble *ad, const char *path);
+static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname);
static int ad_fset(struct adouble *ad, files_struct *fsp);
-static int adouble_path(TALLOC_CTX *ctx, const char *path_in, char **path_out);
+static int adouble_path(TALLOC_CTX *ctx,
+ const struct smb_filename *smb_fname__in,
+ struct smb_filename **ppsmb_fname_out);
/**
* Return a pointer to an AppleDouble entry
/**
* Read and parse Netatalk AppleDouble metadata xattr
**/
-static ssize_t ad_read_meta(struct adouble *ad, const char *path)
+static ssize_t ad_read_meta(struct adouble *ad,
+ const struct smb_filename *smb_fname)
{
int rc = 0;
ssize_t ealen;
bool ok;
- DEBUG(10, ("reading meta xattr for %s\n", path));
+ DEBUG(10, ("reading meta xattr for %s\n", smb_fname->base_name));
- ealen = SMB_VFS_GETXATTR(ad->ad_handle->conn, path,
+ ealen = SMB_VFS_GETXATTR(ad->ad_handle->conn, smb_fname->base_name,
AFPINFO_EA_NETATALK, ad->ad_data,
AD_DATASZ_XATTR);
if (ealen == -1) {
}
exit:
- DEBUG(10, ("reading meta xattr for %s, rc: %d\n", path, rc));
+ DEBUG(10, ("reading meta xattr for %s, rc: %d\n",
+ smb_fname->base_name, rc));
if (rc != 0) {
ealen = -1;
if (errno == EINVAL) {
become_root();
- removexattr(path, AFPINFO_EA_NETATALK);
+ removexattr(smb_fname->base_name, AFPINFO_EA_NETATALK);
unbecome_root();
errno = ENOENT;
}
return ealen;
}
-static int ad_open_meta(const char *path, int flags, mode_t mode)
+static int ad_open_meta(const struct smb_filename *smb_fname,
+ int flags,
+ mode_t mode)
{
- return open(path, flags, mode);
+ return open(smb_fname->base_name, flags, mode);
}
-static int ad_open_rsrc_xattr(const char *path, int flags, mode_t mode)
+static int ad_open_rsrc_xattr(const struct smb_filename *smb_fname,
+ int flags,
+ mode_t mode)
{
#ifdef HAVE_ATTROPEN
/* FIXME: direct Solaris xattr syscall */
- return attropen(path, AFPRESOURCE_EA_NETATALK, flags, mode);
+ return attropen(smb_fname->base_name,
+ AFPRESOURCE_EA_NETATALK, flags, mode);
#else
errno = ENOSYS;
return -1;
#endif
}
-static int ad_open_rsrc_adouble(const char *path, int flags, mode_t mode)
+static int ad_open_rsrc_adouble(const struct smb_filename *smb_fname,
+ int flags,
+ mode_t mode)
{
- char *adp = NULL;
int ret;
int fd;
+ struct smb_filename *adp_smb_fname = NULL;
- ret = adouble_path(talloc_tos(), path, &adp);
+ ret = adouble_path(talloc_tos(), smb_fname, &adp_smb_fname);
if (ret != 0) {
return -1;
}
- fd = open(adp, flags, mode);
- TALLOC_FREE(adp);
+ fd = open(adp_smb_fname->base_name, flags, mode);
+ TALLOC_FREE(adp_smb_fname);
return fd;
}
static int ad_open_rsrc(vfs_handle_struct *handle,
- const char *path,
+ const struct smb_filename *smb_fname,
int flags,
mode_t mode)
{
struct fruit_config_data, return -1);
if (config->rsrc == FRUIT_RSRC_XATTR) {
- fd = ad_open_rsrc_xattr(path, flags, mode);
+ fd = ad_open_rsrc_xattr(smb_fname, flags, mode);
} else {
- fd = ad_open_rsrc_adouble(path, flags, mode);
+ fd = ad_open_rsrc_adouble(smb_fname, flags, mode);
}
return fd;
static int ad_open(vfs_handle_struct *handle,
struct adouble *ad,
- const char *path,
+ const struct smb_filename *smb_fname,
adouble_type_t t,
int flags,
mode_t mode)
int fd;
DBG_DEBUG("Path [%s] type [%s]\n",
- path, t == ADOUBLE_META ? "meta" : "rsrc");
+ smb_fname->base_name, t == ADOUBLE_META ? "meta" : "rsrc");
if (t == ADOUBLE_META) {
- fd = ad_open_meta(path, flags, mode);
+ fd = ad_open_meta(smb_fname, flags, mode);
} else {
- fd = ad_open_rsrc(handle, path, flags, mode);
+ fd = ad_open_rsrc(handle, smb_fname, flags, mode);
}
if (fd != -1) {
}
DBG_DEBUG("Path [%s] type [%s] fd [%d]\n",
- path, t == ADOUBLE_META ? "meta" : "rsrc", fd);
+ smb_fname->base_name,
+ t == ADOUBLE_META ? "meta" : "rsrc", fd);
return fd;
}
-static ssize_t ad_read_rsrc_xattr(struct adouble *ad,
- const char *path)
+static ssize_t ad_read_rsrc_xattr(struct adouble *ad)
{
int ret;
SMB_STRUCT_STAT st;
}
static ssize_t ad_read_rsrc_adouble(struct adouble *ad,
- const char *path)
+ const struct smb_filename *smb_fname)
{
struct adouble *meta_ad = NULL;
SMB_STRUCT_STAT sbuf;
len = sys_pread(ad->ad_fd, ad->ad_data, AD_DATASZ_DOT_UND, 0);
if (len != AD_DATASZ_DOT_UND) {
DBG_NOTICE("%s %s: bad size: %zd\n",
- path, strerror(errno), len);
+ smb_fname->base_name, strerror(errno), len);
return -1;
}
/* Now parse entries */
ok = ad_unpack(ad, ADEID_NUM_DOT_UND, sbuf.st_ex_size);
if (!ok) {
- DBG_ERR("invalid AppleDouble resource %s\n", path);
+ DBG_ERR("invalid AppleDouble resource %s\n",
+ smb_fname->base_name);
errno = EINVAL;
return -1;
}
if ((ad_getentryoff(ad, ADEID_FINDERI) != ADEDOFF_FINDERI_DOT_UND)
|| (ad_getentrylen(ad, ADEID_FINDERI) < ADEDLEN_FINDERI)
|| (ad_getentryoff(ad, ADEID_RFORK) < ADEDOFF_RFORK_DOT_UND)) {
- DBG_ERR("invalid AppleDouble resource %s\n", path);
+ DBG_ERR("invalid AppleDouble resource %s\n",
+ smb_fname->base_name);
errno = EINVAL;
return -1;
}
ret = ad_convert(ad, ad->ad_fd);
if (ret != 0) {
- DBG_WARNING("Failed to convert [%s]\n", path);
+ DBG_WARNING("Failed to convert [%s]\n", smb_fname->base_name);
return len;
}
ok = ad_pack(ad);
if (!ok) {
- DBG_WARNING("ad_pack [%s] failed\n", path);
+ DBG_WARNING("ad_pack [%s] failed\n", smb_fname->base_name);
return -1;
}
len = sys_pwrite(ad->ad_fd, ad->ad_data, AD_DATASZ_DOT_UND, 0);
if (len != AD_DATASZ_DOT_UND) {
- DBG_ERR("%s: bad size: %zd\n", path, len);
+ DBG_ERR("%s: bad size: %zd\n", smb_fname->base_name, len);
return -1;
}
memcpy(p_meta_ad, p_ad, ADEDLEN_FINDERI);
- ret = ad_set(meta_ad, path);
+ ret = ad_set(meta_ad, smb_fname);
TALLOC_FREE(meta_ad);
if (ret != 0) {
return -1;
* Read and parse resource fork, either ._ AppleDouble file or xattr
**/
static ssize_t ad_read_rsrc(struct adouble *ad,
- const char *path)
+ const struct smb_filename *smb_fname)
{
struct fruit_config_data *config = NULL;
ssize_t len;
struct fruit_config_data, return -1);
if (config->rsrc == FRUIT_RSRC_XATTR) {
- len = ad_read_rsrc_xattr(ad, path);
+ len = ad_read_rsrc_xattr(ad);
} else {
- len = ad_read_rsrc_adouble(ad, path);
+ len = ad_read_rsrc_adouble(ad, smb_fname);
}
return len;
/**
* Read and unpack an AppleDouble metadata xattr or resource
**/
-static ssize_t ad_read(struct adouble *ad, const char *path)
+static ssize_t ad_read(struct adouble *ad, const struct smb_filename *smb_fname)
{
switch (ad->ad_type) {
case ADOUBLE_META:
- return ad_read_meta(ad, path);
+ return ad_read_meta(ad, smb_fname);
case ADOUBLE_RSRC:
- return ad_read_rsrc(ad, path);
+ return ad_read_rsrc(ad, smb_fname);
default:
return -1;
}
*
* @param[in] ctx talloc context
* @param[in] handle vfs handle
- * @param[in] path pathname to file or directory
+ * @param[in] smb_fname pathname to file or directory
* @param[in] type type of AppleDouble, ADOUBLE_META or ADOUBLE_RSRC
*
* @return talloced struct adouble or NULL on error
**/
static struct adouble *ad_get(TALLOC_CTX *ctx, vfs_handle_struct *handle,
- const char *path, adouble_type_t type)
+ const struct smb_filename *smb_fname,
+ adouble_type_t type)
{
int rc = 0;
ssize_t len;
int mode;
DEBUG(10, ("ad_get(%s) called for %s\n",
- type == ADOUBLE_META ? "meta" : "rsrc", path));
+ type == ADOUBLE_META ? "meta" : "rsrc",
+ smb_fname->base_name));
ad = ad_alloc(ctx, handle, type);
if (ad == NULL) {
/* Try rw first so we can use the fd in ad_convert() */
mode = O_RDWR;
- fd = ad_open(handle, ad, path, ADOUBLE_RSRC, mode, 0);
+ fd = ad_open(handle, ad, smb_fname, ADOUBLE_RSRC, mode, 0);
if (fd == -1 && ((errno == EROFS) || (errno == EACCES))) {
mode = O_RDONLY;
- fd = ad_open(handle, ad, path, ADOUBLE_RSRC, mode, 0);
+ fd = ad_open(handle, ad, smb_fname,
+ ADOUBLE_RSRC, mode, 0);
}
if (fd == -1) {
DBG_DEBUG("ad_open [%s] error [%s]\n",
- path, strerror(errno));
+ smb_fname->base_name, strerror(errno));
rc = -1;
goto exit;
}
}
- len = ad_read(ad, path);
+ len = ad_read(ad, smb_fname);
if (len == -1) {
- DEBUG(10, ("error reading AppleDouble for %s\n", path));
+ DEBUG(10, ("error reading AppleDouble for %s\n",
+ smb_fname->base_name));
rc = -1;
goto exit;
}
exit:
DEBUG(10, ("ad_get(%s) for %s returning %d\n",
- type == ADOUBLE_META ? "meta" : "rsrc", path, rc));
+ type == ADOUBLE_META ? "meta" : "rsrc",
+ smb_fname->base_name, rc));
if (rc != 0) {
TALLOC_FREE(ad);
int rc = 0;
ssize_t len;
struct adouble *ad = NULL;
- char *path = fsp->base_fsp->fsp_name->base_name;
DBG_DEBUG("ad_get(%s) path [%s]\n",
type == ADOUBLE_META ? "meta" : "rsrc",
/* Try rw first so we can use the fd in ad_convert() */
mode = O_RDWR;
- fd = ad_open(handle, ad, path, ADOUBLE_RSRC, mode, 0);
+ fd = ad_open(handle, ad, fsp->base_fsp->fsp_name,
+ ADOUBLE_RSRC, mode, 0);
if (fd == -1 &&
((errno == EROFS) || (errno == EACCES)))
{
mode = O_RDONLY;
- fd = ad_open(handle, ad, path, ADOUBLE_RSRC,
- mode, 0);
+ fd = ad_open(handle, ad,
+ fsp->base_fsp->fsp_name, ADOUBLE_RSRC,
+ mode, 0);
}
if (fd == -1) {
- DBG_DEBUG("error opening AppleDouble for %s\n", path);
+ DBG_DEBUG("error opening AppleDouble for %s\n",
+ fsp_str_dbg(fsp));
rc = -1;
goto exit;
}
}
}
- len = ad_read(ad, path);
+ len = ad_read(ad, fsp->base_fsp->fsp_name);
if (len == -1) {
- DBG_DEBUG("error reading AppleDouble for %s\n", path);
+ DBG_DEBUG("error reading AppleDouble for %s\n",
+ fsp_str_dbg(fsp));
rc = -1;
goto exit;
}
*
* @param[in] ad adouble handle
*
- * @param[in] path pathname to file or directory
+ * @param[in] smb_fname pathname to file or directory
*
* @return status code, 0 means success
**/
-static int ad_set(struct adouble *ad, const char *path)
+static int ad_set(struct adouble *ad, const struct smb_filename *smb_fname)
{
bool ok;
int ret;
- DBG_DEBUG("Path [%s]\n", path);
+ DBG_DEBUG("Path [%s]\n", smb_fname->base_name);
if (ad->ad_type != ADOUBLE_META) {
- DBG_ERR("ad_set on [%s] used with ADOUBLE_RSRC\n", path);
+ DBG_ERR("ad_set on [%s] used with ADOUBLE_RSRC\n",
+ smb_fname->base_name);
return -1;
}
}
ret = SMB_VFS_SETXATTR(ad->ad_handle->conn,
- path,
+ smb_fname->base_name,
AFPINFO_EA_NETATALK,
ad->ad_data,
AD_DATASZ_XATTR, 0);
- DBG_DEBUG("Path [%s] ret [%d]\n", path, ret);
+ DBG_DEBUG("Path [%s] ret [%d]\n", smb_fname->base_name, ret);
return ret;
}
/**
* Prepend "._" to a basename
+ * Return a new struct smb_filename with stream_name == NULL.
**/
-static int adouble_path(TALLOC_CTX *ctx, const char *path_in, char **path_out)
+static int adouble_path(TALLOC_CTX *ctx,
+ const struct smb_filename *smb_fname_in,
+ struct smb_filename **pp_smb_fname_out)
{
char *parent;
const char *base;
+ struct smb_filename *smb_fname = cp_smb_filename(ctx,
+ smb_fname_in);
+
+ if (smb_fname == NULL) {
+ return -1;
+ }
+
+ /* We need streamname to be NULL */
+ TALLOC_FREE(smb_fname->stream_name);
- if (!parent_dirname(ctx, path_in, &parent, &base)) {
+ /* And we're replacing base_name. */
+ TALLOC_FREE(smb_fname->base_name);
+
+ if (!parent_dirname(smb_fname, smb_fname_in->base_name,
+ &parent, &base)) {
+ TALLOC_FREE(smb_fname);
return -1;
}
- *path_out = talloc_asprintf(ctx, "%s/._%s", parent, base);
- if (*path_out == NULL) {
+ smb_fname->base_name = talloc_asprintf(smb_fname,
+ "%s/._%s", parent, base);
+ if (smb_fname->base_name == NULL) {
+ TALLOC_FREE(smb_fname);
return -1;
}
+ *pp_smb_fname_out = smb_fname;
+
return 0;
}
return;
}
- ad = ad_get(talloc_tos(), handle, smb_fname->base_name, ADOUBLE_META);
+ ad = ad_get(talloc_tos(), handle, smb_fname, ADOUBLE_META);
if (ad == NULL) {
return;
}
struct adouble *ad = NULL;
char *p = NULL;
- ad = ad_get(talloc_tos(), handle, smb_fname->base_name, ADOUBLE_META);
+ ad = ad_get(talloc_tos(), handle, smb_fname, ADOUBLE_META);
if (ad == NULL) {
return false;
}
struct adouble *ad = NULL;
uint64_t rfork_size;
- ad = ad_get(talloc_tos(), handle, smb_fname->base_name,
+ ad = ad_get(talloc_tos(), handle, smb_fname,
ADOUBLE_RSRC);
if (ad == NULL) {
return 0;
struct adouble *ad = NULL;
struct smb_filename *smb_fname_base = NULL;
struct fruit_config_data *config = NULL;
- char *adpath = NULL;
int hostfd = -1;
SMB_VFS_HANDLE_GET_DATA(handle, config,
goto exit;
}
- rc = adouble_path(talloc_tos(), smb_fname->base_name, &adpath);
+ rc = adouble_path(talloc_tos(), smb_fname, &smb_fname_base);
if (rc != 0) {
goto exit;
}
- /* Create an smb_filename with stream_name == NULL. */
- smb_fname_base = synthetic_smb_fname(talloc_tos(),
- adpath,
- NULL,
- NULL,
- smb_fname->flags);
- if (smb_fname_base == NULL) {
- errno = ENOMEM;
- rc = -1;
- goto exit;
- }
-
/* Sanitize flags */
if (flags & O_WRONLY) {
/* We always need read access for the metadata header too */
exit:
- TALLOC_FREE(adpath);
TALLOC_FREE(smb_fname_base);
DEBUG(10, ("fruit_open resource fork: rc=%d, fd=%d\n", rc, hostfd));
const struct smb_filename *smb_fname_dst)
{
int rc = -1;
- char *src_adouble_path = NULL;
- char *dst_adouble_path = NULL;
struct fruit_config_data *config = NULL;
struct smb_filename *src_adp_smb_fname = NULL;
struct smb_filename *dst_adp_smb_fname = NULL;
return 0;
}
- rc = adouble_path(talloc_tos(), smb_fname_src->base_name,
- &src_adouble_path);
+ rc = adouble_path(talloc_tos(), smb_fname_src, &src_adp_smb_fname);
if (rc != 0) {
goto done;
}
- src_adp_smb_fname = synthetic_smb_fname(talloc_tos(),
- src_adouble_path,
- NULL, NULL,
- smb_fname_src->flags);
- TALLOC_FREE(src_adouble_path);
- if (src_adp_smb_fname == NULL) {
- rc = -1;
- goto done;
- }
- rc = adouble_path(talloc_tos(), smb_fname_dst->base_name,
- &dst_adouble_path);
+ rc = adouble_path(talloc_tos(), smb_fname_dst, &dst_adp_smb_fname);
if (rc != 0) {
goto done;
}
- dst_adp_smb_fname = synthetic_smb_fname(talloc_tos(),
- dst_adouble_path,
- NULL, NULL,
- smb_fname_dst->flags);
- TALLOC_FREE(dst_adouble_path);
- if (dst_adp_smb_fname == NULL) {
- rc = -1;
- goto done;
- }
DBG_DEBUG("%s -> %s\n",
smb_fname_str_dbg(src_adp_smb_fname),
bool force_unlink)
{
int rc;
- char *adp = NULL;
struct adouble *ad = NULL;
struct smb_filename *adp_smb_fname = NULL;
if (!force_unlink) {
- ad = ad_get(talloc_tos(), handle, smb_fname->base_name,
+ ad = ad_get(talloc_tos(), handle, smb_fname,
ADOUBLE_RSRC);
if (ad == NULL) {
errno = ENOENT;
TALLOC_FREE(ad);
}
- rc = adouble_path(talloc_tos(), smb_fname->base_name, &adp);
+ rc = adouble_path(talloc_tos(), smb_fname, &adp_smb_fname);
if (rc != 0) {
return -1;
}
- adp_smb_fname = synthetic_smb_fname(talloc_tos(), adp,
- NULL, NULL,
- smb_fname->flags);
- TALLOC_FREE(adp);
- if (adp_smb_fname == NULL) {
- return -1;
- }
-
rc = SMB_VFS_NEXT_UNLINK(handle, adp_smb_fname);
TALLOC_FREE(adp_smb_fname);
if ((rc != 0) && (errno == ENOENT) && force_unlink) {
mode_t mode)
{
int rc = -1;
- char *adp = NULL;
struct fruit_config_data *config = NULL;
- const char *path = smb_fname->base_name;
struct smb_filename *smb_fname_adp = NULL;
rc = SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode);
return 0;
}
- rc = adouble_path(talloc_tos(), path, &adp);
+ rc = adouble_path(talloc_tos(), smb_fname, &smb_fname_adp);
if (rc != 0) {
return -1;
}
- DEBUG(10, ("fruit_chmod: %s\n", adp));
-
- smb_fname_adp = synthetic_smb_fname(talloc_tos(),
- adp,
- NULL,
- NULL,
- smb_fname->flags);
- if (smb_fname_adp == NULL) {
- TALLOC_FREE(adp);
- errno = ENOMEM;
- return -1;
- }
+ DEBUG(10, ("fruit_chmod: %s\n", smb_fname_adp->base_name));
rc = SMB_VFS_NEXT_CHMOD(handle, smb_fname_adp, mode);
if (errno == ENOENT) {
}
TALLOC_FREE(smb_fname_adp);
- TALLOC_FREE(adp);
return rc;
}
gid_t gid)
{
int rc = -1;
- char *adp = NULL;
struct fruit_config_data *config = NULL;
struct smb_filename *adp_smb_fname = NULL;
return 0;
}
- rc = adouble_path(talloc_tos(), smb_fname->base_name, &adp);
+ rc = adouble_path(talloc_tos(), smb_fname, &adp_smb_fname);
if (rc != 0) {
goto done;
}
- DEBUG(10, ("fruit_chown: %s\n", adp));
-
- adp_smb_fname = synthetic_smb_fname(talloc_tos(),
- adp,
- NULL,
- NULL,
- smb_fname->flags);
- if (adp_smb_fname == NULL) {
- errno = ENOMEM;
- rc = -1;
- goto done;
- }
+ DEBUG(10, ("fruit_chown: %s\n", adp_smb_fname->base_name));
rc = SMB_VFS_NEXT_CHOWN(handle, adp_smb_fname, uid, gid);
if (errno == ENOENT) {
}
done:
- TALLOC_FREE(adp);
TALLOC_FREE(adp_smb_fname);
return rc;
}
return -1;
}
+ ad_smb_fname = synthetic_smb_fname(talloc_tos(), p,
+ NULL, NULL,
+ smb_fname->flags);
+ TALLOC_FREE(p);
+ if (ad_smb_fname == NULL) {
+ DBG_ERR("synthetic_smb_fname failed\n");
+ return -1;
+ }
+
/*
* Check whether it's a valid AppleDouble file, if
* yes, delete it, ignore it otherwise.
*/
- ad = ad_get(talloc_tos(), handle, p, ADOUBLE_RSRC);
+ ad = ad_get(talloc_tos(), handle, ad_smb_fname, ADOUBLE_RSRC);
if (ad == NULL) {
+ TALLOC_FREE(ad_smb_fname);
TALLOC_FREE(p);
continue;
}
TALLOC_FREE(ad);
- ad_smb_fname = synthetic_smb_fname(talloc_tos(), p,
- NULL, NULL,
- smb_fname->flags);
- TALLOC_FREE(p);
- if (ad_smb_fname == NULL) {
- DBG_ERR("synthetic_smb_fname failed\n");
- return -1;
- }
-
ret = SMB_VFS_NEXT_UNLINK(handle, ad_smb_fname);
TALLOC_FREE(ad_smb_fname);
if (ret != 0) {
{
struct adouble *ad = NULL;
- ad = ad_get(talloc_tos(), handle, smb_fname->base_name, ADOUBLE_META);
+ ad = ad_get(talloc_tos(), handle, smb_fname, ADOUBLE_META);
if (ad == NULL) {
DBG_INFO("fruit_stat_meta %s: %s\n",
smb_fname_str_dbg(smb_fname), strerror(errno));
struct adouble *ad = NULL;
int ret;
- ad = ad_get(talloc_tos(), handle, smb_fname->base_name, ADOUBLE_RSRC);
+ ad = ad_get(talloc_tos(), handle, smb_fname, ADOUBLE_RSRC);
if (ad == NULL) {
errno = ENOENT;
return -1;
}
ad = ad_get(talloc_tos(), handle,
- fsp->base_fsp->fsp_name->base_name,
+ fsp->base_fsp->fsp_name,
ADOUBLE_RSRC);
if (ad == NULL) {
DBG_ERR("ad_get [%s] failed [%s]\n",
}
}
- ad = ad_get(talloc_tos(), handle,
- smb_fname->base_name, ADOUBLE_META);
+ ad = ad_get(talloc_tos(), handle, smb_fname, ADOUBLE_META);
if (ad == NULL) {
return NT_STATUS_OK;
}
}
}
- ad = ad_get(talloc_tos(), handle, smb_fname->base_name,
- ADOUBLE_RSRC);
+ ad = ad_get(talloc_tos(), handle, smb_fname, ADOUBLE_RSRC);
if (ad == NULL) {
return NT_STATUS_OK;
}
DEBUG(10,("set btime for %s to %s\n", smb_fname_str_dbg(smb_fname),
time_to_asc(convert_timespec_to_time_t(ft->create_time))));
- ad = ad_get(talloc_tos(), handle, smb_fname->base_name, ADOUBLE_META);
+ ad = ad_get(talloc_tos(), handle, smb_fname, ADOUBLE_META);
if (ad == NULL) {
goto exit;
}
ad_setdate(ad, AD_DATE_CREATE | AD_DATE_UNIX,
convert_time_t_to_uint32_t(ft->create_time.tv_sec));
- rc = ad_set(ad, smb_fname->base_name);
+ rc = ad_set(ad, smb_fname);
exit: