Skip to content
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

No error when file is not readable #67

Open
Guigoz opened this issue Mar 30, 2018 · 1 comment
Open

No error when file is not readable #67

Guigoz opened this issue Mar 30, 2018 · 1 comment

Comments

@Guigoz
Copy link

Guigoz commented Mar 30, 2018

Hello,

First I would like to thank you for your great work on PacketQ! It's a blazzing fast tool!

Lately I've been surprised to see that PacketQ does not return any error when the file is not readable or does not exists.

$ /usr/local/bin/packetq -s "SELECT * FROM dns" /tmp/thisFileDoesNotExist                                           
[
  {
    "table_name": "result-0",
    "query": "SELECT * FROM dns",
    "head": [
      { "name": "id","type": "int" },
      { "name": "s","type": "int" },
      { "name": "us","type": "int" },
      { "name": "ether_type","type": "int" },
      { "name": "src_port","type": "int" },
      { "name": "dst_port","type": "int" },
      { "name": "src_addr","type": "text" },
      { "name": "dst_addr","type": "text" },
      { "name": "protocol","type": "int" },
      { "name": "ip_ttl","type": "int" },
      { "name": "ip_version","type": "int" },
      { "name": "fragments","type": "int" },
      { "name": "qname","type": "text" },
      { "name": "aname","type": "text" },
      { "name": "msg_id","type": "int" },
      { "name": "msg_size","type": "int" },
      { "name": "opcode","type": "int" },
      { "name": "rcode","type": "int" },
      { "name": "extended_rcode","type": "int" },
      { "name": "edns_version","type": "int" },
      { "name": "z","type": "int" },
      { "name": "udp_size","type": "int" },
      { "name": "qd_count","type": "int" },
      { "name": "an_count","type": "int" },
      { "name": "ns_count","type": "int" },
      { "name": "ar_count","type": "int" },
      { "name": "qtype","type": "int" },
      { "name": "qclass","type": "int" },
      { "name": "atype","type": "int" },
      { "name": "aclass","type": "int" },
      { "name": "attl","type": "int" },
      { "name": "aa","type": "bool" },
      { "name": "tc","type": "bool" },
      { "name": "rd","type": "bool" },
      { "name": "cd","type": "bool" },
      { "name": "ra","type": "bool" },
      { "name": "ad","type": "bool" },
      { "name": "do","type": "bool" },
      { "name": "edns0","type": "bool" },
      { "name": "qr","type": "bool" },
      { "name": "edns0_ecs","type": "bool" },
      { "name": "edns0_ecs_family","type": "int" },
      { "name": "edns0_ecs_source","type": "int" },
      { "name": "edns0_ecs_scope","type": "int" },
      { "name": "edns0_ecs_address","type": "text" }
    ],
    "data": [
    ]
  }
]

I think an error message and return code would be more suitable.
What do you think of this?

Guillaume.

@jelu
Copy link
Member

jelu commented Apr 3, 2018

Yes, that would definitively be more suitable, but it would require a major version bump. Could add an error to the output but that would only work for JSON and XML, hmm...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants