Skip to content

Commit 0b43e0c

Browse files
author
longalong
committed
fix permission 0 err, use 0644 for temporary
1 parent 6e9a345 commit 0b43e0c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Diff for: scp.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,6 @@ func CopyFromLocal(ctx context.Context, s *ssh.Session, localPath string, remote
123123
f, _ := os.Open(localPath)
124124
defer f.Close()
125125

126-
permissions := fmt.Sprintf("%04d", info.Mode())
127-
128126
stdout, err := s.StdoutPipe()
129127
if err != nil {
130128
return errors.Wrap(err, "get stdout pipe fail")
@@ -145,7 +143,7 @@ func CopyFromLocal(ctx context.Context, s *ssh.Session, localPath string, remote
145143

146144
defer w.Close()
147145

148-
_, err = fmt.Fprintln(w, "C"+permissions, info.Size(), filepath.Base(remotePath))
146+
_, err = fmt.Fprintln(w, "C0644", info.Size(), filepath.Base(remotePath))
149147
if err != nil {
150148
errCh <- errors.Wrap(err, "write command fail")
151149
return

0 commit comments

Comments
 (0)