Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Switch back to pkg
  • Loading branch information
LordRalex committed Sep 5, 2018
1 parent 6471bb9 commit 8e47d10
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 38 deletions.
14 changes: 7 additions & 7 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Gopkg.toml
Expand Up @@ -77,10 +77,6 @@
branch = "master"
name = "golang.org/x/crypto"

[[constraint]]
branch = "master"
name = "github.com/pufferpanel/sftp"

[prune]
go-tests = true
unused-packages = true
28 changes: 2 additions & 26 deletions sftp/requestprefix.go
Expand Up @@ -8,7 +8,7 @@ import (
"path/filepath"
"strings"

"github.com/pufferpanel/sftp"
"github.com/pkg/sftp"
utils "github.com/pufferpanel/apufferi/common"
"github.com/pufferpanel/apufferi/logging"
)
Expand All @@ -20,7 +20,7 @@ type requestPrefix struct {
func CreateRequestPrefix(prefix string) sftp.Handlers {
h := requestPrefix{prefix: prefix}

return sftp.Handlers{h, h, h, h, h}
return sftp.Handlers{FileCmd: h, FileGet: h, FileList: h, FilePut: h}
}

func (rp requestPrefix) Fileread(request *sftp.Request) (io.ReaderAt, error) {
Expand Down Expand Up @@ -168,30 +168,6 @@ func (rp requestPrefix) Filelist(request *sftp.Request) (sftp.ListerAt, error) {
}
}

func (rp requestPrefix) Folderopen(request *sftp.Request) error {
logging.Devel("-----------------")
logging.Develf("opendir request [%s]: %s", request.Method, request.Filepath)
logging.Develf("Flags: %v", request.Flags)
logging.Develf("Attributes: %v", request.Attrs)
logging.Develf("Target: %v", request.Target)
logging.Devel("-----------------")
sourceName, err := rp.validate(request.Filepath)
if err != nil {
logging.Devel("pp-sftp internal error: ", err)
return rp.maskError(err)
}

fi, err := os.Stat(sourceName)
if err != nil {
return err
}
if fi.IsDir() {
return nil
} else {
return errors.New("not a directory")
}
}

func (rp requestPrefix) getFile(path string, flags int, mode os.FileMode) (*os.File, error) {
logging.Develf("Requesting path: %s", path)
filePath, err := rp.validate(path)
Expand Down
2 changes: 1 addition & 1 deletion sftp/server.go
Expand Up @@ -33,7 +33,7 @@ import (
"strings"

"github.com/pkg/errors"
"github.com/pufferpanel/sftp"
"github.com/pkg/sftp"
configuration "github.com/pufferpanel/apufferi/config"
"github.com/pufferpanel/apufferi/logging"
"github.com/pufferpanel/pufferd/programs"
Expand Down

0 comments on commit 8e47d10

Please sign in to comment.