Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
K
koko
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
koko
Commits
06f18af9
Unverified
Commit
06f18af9
authored
Jan 07, 2020
by
Eric_Lee
Committed by
GitHub
Jan 07, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #194 from jumpserver/dev
Dev
parents
6ce46ff2
25eeae3f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
5 deletions
+15
-5
sftpvolume.go
pkg/httpd/sftpvolume.go
+5
-1
dbparser.go
pkg/proxy/dbparser.go
+3
-2
parser.go
pkg/proxy/parser.go
+3
-2
parsercmd.go
pkg/proxy/parsercmd.go
+4
-0
No files found.
pkg/httpd/sftpvolume.go
View file @
06f18af9
...
...
@@ -28,7 +28,11 @@ func NewUserVolume(user *model.User, addr, hostId string) *UserVolume {
default
:
assets
:=
service
.
GetUserAssetByID
(
user
.
ID
,
hostId
)
if
len
(
assets
)
==
1
{
homename
=
assets
[
0
]
.
Hostname
folderName
:=
assets
[
0
]
.
Hostname
if
strings
.
Contains
(
folderName
,
"/"
)
{
folderName
=
strings
.
ReplaceAll
(
folderName
,
"/"
,
"_"
)
}
homename
=
folderName
basePath
=
filepath
.
Join
(
"/"
,
homename
)
}
userSftp
=
srvconn
.
NewUserSftpConnWithAssets
(
user
,
addr
,
assets
...
)
...
...
pkg/proxy/dbparser.go
View file @
06f18af9
...
...
@@ -65,8 +65,6 @@ func (p *DBParser) ParseStream(userInChan, srvInChan <-chan []byte) (userOut, sr
close
(
p
.
cmdRecordChan
)
close
(
p
.
userOutputChan
)
close
(
p
.
srvOutputChan
)
_
=
p
.
cmdOutputParser
.
Close
()
_
=
p
.
cmdInputParser
.
Close
()
logger
.
Infof
(
"DB Session %s: Parser routine done"
,
p
.
id
)
}()
for
{
...
...
@@ -169,6 +167,9 @@ func (p *DBParser) Close() {
default
:
close
(
p
.
closed
)
}
_
=
p
.
cmdOutputParser
.
Close
()
_
=
p
.
cmdInputParser
.
Close
()
logger
.
Infof
(
"DB Session %s: Parser close"
,
p
.
id
)
}
func
(
p
*
DBParser
)
sendCommandRecord
()
{
...
...
pkg/proxy/parser.go
View file @
06f18af9
...
...
@@ -86,8 +86,6 @@ func (p *Parser) ParseStream(userInChan, srvInChan <-chan []byte) (userOut, srvO
close
(
p
.
cmdRecordChan
)
close
(
p
.
userOutputChan
)
close
(
p
.
srvOutputChan
)
_
=
p
.
cmdOutputParser
.
Close
()
_
=
p
.
cmdInputParser
.
Close
()
logger
.
Infof
(
"Session %s: Parser routine done"
,
p
.
id
)
}()
for
{
...
...
@@ -271,6 +269,9 @@ func (p *Parser) Close() {
close
(
p
.
closed
)
}
_
=
p
.
cmdOutputParser
.
Close
()
_
=
p
.
cmdInputParser
.
Close
()
logger
.
Infof
(
"Session %s: Parser close"
,
p
.
id
)
}
func
(
p
*
Parser
)
sendCommandRecord
()
{
...
...
pkg/proxy/parsercmd.go
View file @
06f18af9
...
...
@@ -87,12 +87,16 @@ func (cp *CmdParser) initial() {
for
{
line
,
err
:=
cp
.
term
.
ReadLine
()
if
err
!=
nil
{
select
{
case
<-
cp
.
closed
:
logger
.
Debugf
(
"Session %s %s term err: %s break loop"
,
cp
.
id
,
cp
.
name
,
err
)
break
loop
default
:
}
logger
.
Debugf
(
"Session %s %s term err: %s,loop continue"
,
cp
.
id
,
cp
.
name
,
err
)
goto
loop
}
cp
.
lock
.
Lock
()
cp
.
currentLength
+=
len
(
line
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment