• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Gallopsled / pwntools / 69ef4f80b8a8488f9718431fc6eb0254d121affc

pending completion
69ef4f80b8a8488f9718431fc6eb0254d121affc

push

github-actions

peace-maker
Fix ssh.process not setting ssh_process.cwd

The cwd wasn't passed to the ssh_process created in ssh.process,
so the ssh_process.cwd attribute was never set.

This passes the cwd along now.
```
s = ssh(..)
io = s.process("pwd", cwd="/tmp")
io.cwd # "."
io.recvall() # b"/tmp\n"
```

3877 of 6363 branches covered (60.93%)

7 of 7 new or added lines in 1 file covered. (100.0%)

12206 of 16597 relevant lines covered (73.54%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.3
/pwnlib/commandline/hex.py
1
#!/usr/bin/env python2
2
from __future__ import absolute_import
1✔
3
from __future__ import division
1✔
4

5
import argparse
1✔
6
import sys
1✔
7

8
from pwnlib.commandline import common
1✔
9
from pwnlib.util.fiddling import enhex
1✔
10

11
parser = common.parser_commands.add_parser(
1✔
12
    'hex',
13
    help = 'Hex-encodes data provided on the command line or stdin',
14
    description = 'Hex-encodes data provided on the command line or stdin')
15

16
parser.add_argument('data', nargs='*',
1✔
17
    help='Data to convert into hex')
18

19
def main(args):
1✔
20
    if not args.data:
1✔
21
        print(enhex(getattr(sys.stdin, 'buffer', sys.stdin).read()))
1✔
22
    else:
23
        data = ' '.join(args.data)
1✔
24
        if not hasattr(data, 'decode'):
1!
25
            data = data.encode('utf-8', 'surrogateescape')
×
26
        print(enhex(data))
1✔
27

28
if __name__ == '__main__':
1✔
29
    common.main(__file__)
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc