Skip to content

Commit

Permalink
just create ref-dir
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode committed Feb 15, 2021
1 parent 5c723ea commit 8e0b23b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pkg/storage/utils/eosfs/eosfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -973,11 +973,6 @@ func (fs *eosfs) CreateDir(ctx context.Context, p string) error {
func (fs *eosfs) CreateReference(ctx context.Context, p string, targetURI *url.URL) error {
// TODO(labkode): for the time being we only allow to create references
// on the virtual share folder to not pollute the nominal user tree.
u, err := getUser(ctx)
if err != nil {
return errors.Wrap(err, "eos: no user in ctx")
}

if !fs.isShareFolder(ctx, p) {
return errtypes.PermissionDenied("eos: cannot create references outside the share folder: share_folder=" + fs.conf.ShareFolder + " path=" + p)
}
Expand All @@ -993,9 +988,10 @@ func (fs *eosfs) CreateReference(ctx context.Context, p string, targetURI *url.U
return nil
}

if err := fs.createUserDir(ctx, u, tmp, false); err != nil {
err = errors.Wrapf(err, "eos: error creating temporary ref file")
return err
err = fs.c.CreateDir(ctx, uid, gid, tmp)
if err != nil {
// EOS will return success on mkdir over an existing directory.
return errors.Wrap(err, "eos: error creating ref-dir")
}

// set xattr on ref
Expand Down

0 comments on commit 8e0b23b

Please sign in to comment.