Skip to content

Commit

Permalink
Fix concatenation to use filepath.Join()
Browse files Browse the repository at this point in the history
Bump version to rc.5
  • Loading branch information
kpjensen committed Nov 9, 2021
1 parent 35be66c commit b00786e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions dxfuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func NewDxfuse(
}

// Create a fresh SQL database
databaseFile := dxfuseBaseDir + "/" + DatabaseFile
databaseFile := filepath.Join(dxfuseBaseDir, DatabaseFile)
fsys.log("Removing old version of the database (%s)", databaseFile)
if err := os.RemoveAll(databaseFile); err != nil {
fsys.log("error removing old database %s", err.Error())
Expand Down Expand Up @@ -595,7 +595,7 @@ func (fsys *Filesys) MkDir(ctx context.Context, op *fuseops.MkDirOp) error {
mode := dirReadWriteMode

// create the directory on dnanexus
folderFullPath := parentDir.ProjFolder + "/" + op.Name
folderFullPath := filepath.Join(parentDir.ProjFolder, op.Name)
err = fsys.ops.DxFolderNew(ctx, oph.httpClient, parentDir.ProjId, folderFullPath)
if err != nil {
fsys.log("Error in creating directory (%s:%s) on dnanexus: %s",
Expand All @@ -615,7 +615,7 @@ func (fsys *Filesys) MkDir(ctx context.Context, op *fuseops.MkDirOp) error {
nowSeconds,
nowSeconds,
mode,
parentDir.FullPath+"/"+op.Name)
filepath.Join(parentDir.FullPath, op.Name))
if err != nil {
fsys.log("database error in MkDir")
return fuse.EIO
Expand Down Expand Up @@ -695,7 +695,7 @@ func (fsys *Filesys) RmDir(ctx context.Context, op *fuseops.RmDirOp) error {
}
if !childDir.faux {
// The directory exists and is empty, we can remove it.
folderFullPath := parentDir.ProjFolder + "/" + op.Name
folderFullPath := filepath.Join(parentDir.ProjFolder, op.Name)
err = fsys.ops.DxFolderRemove(ctx, oph.httpClient, parentDir.ProjId, folderFullPath)
if err != nil {
fsys.log("Error in removing directory (%s:%s) on dnanexus: %s",
Expand Down Expand Up @@ -999,7 +999,7 @@ a rename. You will need to issue a separate remove operation prior to rename.
return syscall.EPERM
}

oldDir := filepath.Clean(oldParentDir.FullPath + "/" + op.OldName)
oldDir := filepath.Clean(filepath.Join(oldParentDir.FullPath, op.OldName))
if oldDir == "/" {
fsys.log("can not move the root directory")
return syscall.EPERM
Expand Down
2 changes: 1 addition & 1 deletion util.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
NumRetriesDefault = 10
InitialUploadPartSize = 16 * MiB
MaxUploadPartSize = 700 * MiB
Version = "v1.0.0-rc.4"
Version = "v1.0.0-rc.5"
)
const (
InodeInvalid = 0
Expand Down

0 comments on commit b00786e

Please sign in to comment.