Compare commits

...

4 Commits

Author SHA1 Message Date
Manfred Touron
a125e25b04 Merge pull request #78 from Raerten/dev/moul/support-windows
[FIX] log path and log filename for Windows OS
2018-11-16 09:58:46 +01:00
Дмитрий Шульгачик
07e6344c82 fix log path and log filename for Windows OS 2018-11-16 09:56:33 +01:00
Manfred Touron
d016e674a8 do not use pty on windows for compatiblity (#42) 2018-11-16 09:56:33 +01:00
Manfred Touron
227b64aaac do not use pty on windows for compatiblity (#42) 2018-02-28 17:45:30 +01:00
3 changed files with 17 additions and 2 deletions

View File

@@ -1,3 +1,4 @@
// +build !windows
package main
import (

12
hidden_unsupported.go Normal file
View File

@@ -0,0 +1,12 @@
// +build windows
package main
import (
"fmt"
"github.com/urfave/cli"
)
// testServer is an hidden handler used for integration tests
func testServer(c *cli.Context) error { return fmt.Errorf("not supported on this architecture") }

View File

@@ -5,6 +5,8 @@ import (
"io"
"log"
"os"
"path/filepath"
"strconv"
"strings"
"time"
@@ -124,8 +126,8 @@ func pipe(lreqs, rreqs <-chan *gossh.Request, lch, rch gossh.Channel, logsLocati
errch := make(chan error, 1)
channeltype := newChan.ChannelType()
file_name := strings.Join([]string{logsLocation, "/", user, "-", channeltype, "-", time.Now().Format(time.RFC3339)}, "") // get user
fileNameUnix := strings.Join([]string{logsLocation, "/", user, "-", channeltype, "-", strconv.FormatInt(time.Now().UnixNano(), 10)}, "") // get user
file_name := filepath.FromSlash(fileNameUnix)
f, err := os.OpenFile(file_name, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0640)
defer f.Close()