New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extra bytes prepended to (esp. json) output from santactl fileinfo ... --key <path>
can be dropped?
#112
Milestone
Comments
It isn't? santactl fileinfo --json --key Rule /usr/bin/yes
{
"Rule" : "Blacklisted"
} |
Au contraire mon frère, to my chagrin #!/usr/bin/python
import json
import subprocess
path = "/Applications/WWDC.app"
cmd = ["/usr/local/bin/santactl", "fileinfo", "--cert-index", "1", "--key", "SHA-256", "--json",
path]
output = subprocess.check_output(cmd)
with open("/tmp/jsony_output", 'wb') as outfile:
outfile.write(output) |
Aha: [2K is not a color code, it's the sequence for clear line. It's the only escape sequence I can see that isn't checking for JSON output or the presence of a TTY. Tom's fixing now. |
arubdesu
changed the title
Color codes in (esp. json) output from
extra bytes prepended to (esp. json) output from Oct 11, 2016
santactl fileinfo ... --key <path>
can be dropped?santactl fileinfo ... --key <path>
can be dropped?
tburgin
added a commit
to tburgin/santa
that referenced
this issue
Oct 11, 2016
tburgin
added a commit
to tburgin/santa
that referenced
this issue
Oct 12, 2016
tburgin
added a commit
to tburgin/santa
that referenced
this issue
Oct 12, 2016
tburgin
added a commit
that referenced
this issue
Oct 12, 2016
dskfh
pushed a commit
to dskfh/santa
that referenced
this issue
Jul 17, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I noticed that I'm getting extra bytes in the front of a string outputted from
fileinfo's
--key
flag, and the inimitable @pudquick figured out it was in the color codes embedded in it. It definitely shouldn't be in there forjson
output, but I'd not expect colored output to be particularly useful for values returned with--key
, either - more pressing is trying to use the python json module to.loads
the value wasn't working for me.The text was updated successfully, but these errors were encountered: