greenbone / gvm-tools

Remote control your Greenbone Community Edition or Greenbone Enterprise Appliance
https://greenbone.github.io/gvm-tools/
GNU General Public License v3.0
162 stars 89 forks source link

Unexpected byte and multiple xml in the gvm-cli output #471

Closed hoboristi closed 3 years ago

hoboristi commented 3 years ago

Expected behavior

Do not have 'b' at the cli's response, also only one multiline xml given.

Current behavior

There is an unexpexted byte in the output of gvm-cli (below the 'b' char) Also there is 2 xml (1 per line), compared to older releases

b'<authenticate_response status="200" status_text="OK"><role>Super Admin</role><timezone>UTC</timezone></authenticate_response>'
<get_version_response status="200" status_text="OK"><version>21.4</version></get_version_response>

The error seems to be located at /usr/local/lib/python3.7/dist-packages/gvm/utils.py (gvm-tools installed by pip)

If I remove <authenticate_response, seems to be OK.

Steps to reproduce

  1. pip install gvm-tools
  2. /usr/local/bin/gvm-cli --gmp-username=admin --gmp-password=pass --protocol=GMP socket
  3. Response:
    
    b'<authenticate_response status="200" status_text="OK"><role>Super Admin</role><timezone>UTC</timezone></authenticate_response>'
    <get_version_response status="200" status_text="OK"><version>21.4</version></get_version_response>
### GVM versions
**gsa:** (gsad --version)

**gvm:** (gvmd --version)

**openvas-scanner:** (openvassd --version)

**gvm-libs:**

**gvm-tools:** (gvm-cli --version)
gvm-cli 21.1.0 (API version 21.5.0)

### Environment
**Operating system:**

**Installation method / source:** (packages, source installation)

### Logfiles

<!-- in most cases you'll find the logs in /var/log/gvm/ -->
y0urself commented 3 years ago

I guess I just missed removing a debug print statement in python-gvm.

y0urself commented 3 years ago

Using https://github.com/greenbone/python-gvm/releases/tag/v21.6.0 should fix this. :)