Comments (3)
vim 没有权限的文件也会卡死
from jumpserver.
该bug我暂时没有思路修复,原因如下:
1.经过一系列排查,认定不是前端bug,而是后端paramiko对读取gbk字节流产生的bug,暂时还没有实现jumpserver实现的精简重现代码,有如下测试代码说明问题:
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('localhost', port=22, username="liuzheng", key_filename='/Users/liuzheng/.ssh/id_rsa')
stdin, stdout, stderr = ssh.exec_command("cat /Users/liuzheng/Downloads/44.txt")
print stdout.readlines()
其中44.txt
是gbk编码的。
Traceback (most recent call last):
File "bug52show.py", line 7, in <module>
print stdout.readlines()
File "/usr/local/lib/python2.7/site-packages/paramiko/file.py", line 285, in readlines
line = self.readline()
File "/usr/local/lib/python2.7/site-packages/paramiko/file.py", line 270, in readline
return line if self._flags & self.FLAG_BINARY else u(line)
File "/usr/local/lib/python2.7/site-packages/paramiko/py3compat.py", line 53, in u
return s.decode(encoding)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xbf in position 0: invalid start byte
2 . 我自己在webterminal上有异于jumpserver的一套完整的实现方式,无bug,但是由于是使用os.system 和 os.execv ,利用ssh命令进行连接,在Windows会不兼容,不能套用。
故而对此的建议是希望运维人员统一字符编码,猜测如果正常使用下,通过sql 的select语句打印出gbk编码的也会出现死的情况
这里有一个monkey patch https://gist.github.com/smurn/4d45a51b3a571fa0d35d
from jumpserver.
paramiko对gbk读取的bug楼主怎么解决的?
from jumpserver.
Related Issues (20)
- [Bug] [Question] jumpserver v2.28.20 web界面无法连接资产,提示connection websocket closed HOT 2
- 单机部署,清理环境时,提示需要需要卸载docker HOT 3
- 删除资产时,如该资产对应的授权规则只有一个资产可以考虑关联删除资产授权 HOT 1
- [Bug] JumpServer v2.28.20 迁移导入旧库,容器启动就有问题,迁移文档 https://docs.jumpserver.org/zh/v2/install/migration/#_3 HOT 3
- [Bug] 资产授权显示的数量问题 HOT 4
- [Bug] 无法访问ui【已解决】 HOT 23
- [Bug] ssh登录密码口令不能包含英文的单引号和双引号 HOT 1
- [Feature] Add the default language in a config file or by a global setting HOT 4
- Jump版本2.28.8,命令返回Command not allowed,是和默认库有关系吗? HOT 2
- [Bug] V3.7.1 web终端sz下载有时候无文件 HOT 2
- 关于用户审计角色[Feature] HOT 1
- 连接资产时账号选择手动收入,不输入账号密码而去连接,会一直显示连接中,而不会有错误提示[Feature] HOT 7
- [Bug] helm更新到3.10.2后 jms-celery 服务起不来 HOT 7
- [Bug] Jumpserver无法连接11.5.8.0 这个版本的 DB2 HOT 3
- [Feature] 对象存储对接是否可以增加NFS协议实现挂载 HOT 3
- 是否支持或者有没有计划支持使用文件上传的时候在jumpserver服务器上也保留一份文件 HOT 2
- 网络PA设备改密[Feature] HOT 5
- 3.10.3 的core-ce 镜像没有同步吗? HOT 2
- [Question] playbook如何去除dangerous keyword限制 HOT 3
- [Question] Can't upload Files in Windows Machine HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jumpserver.