lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 19 Feb 2018 17:58:35 +0300
From:   Viktor Prutyanov <viktor.prutyanov@...tuozzo.com>
To:     linux-ext4@...r.kernel.org
Cc:     Theodore Ts'o <tytso@....edu>,
        Dmitry Monakhov <dmonakhov@...nvz.org>,
        Viktor Prutyanov <viktor.prutyanov@...tuozzo.com>
Subject: [PATCH v2 0/5] dumpe2fs: add JSON output format

This collection of patches adds support of JSON format.
First patch adds helpers for creating structured objects and printing such objects in JSON format.
Others use these helpers for all info from existing operation modes.

After these patches, for example, using jq utility, we can easily print "blocks" field from specific group:

dumpe2fs /dev/sdb2 -j | jq -r '.desc[] | select(.num == "5") | {blocks:.blocks}'

{
  "blocks": {
    "first": "163840",
    "last": "196607"
  }
}

Helpers can later be easily extended to support new output formats (not only JSON).

Viktor Prutyanov (5):
  libsupport: add JSON output helpers
  dumpe2fs: add JSON output of block groups
  dumpe2fs: add JSON output of superblock
  dumpe2fs: add JSON output of journal
  dumpe2fs: add JSON output of bad blocks

 debugfs/Makefile.in     |   4 +-
 lib/e2p/e2p.h           |   8 ++
 lib/e2p/ljs.c           |  57 ++++++++
 lib/e2p/ls.c            | 362 ++++++++++++++++++++++++++++++++++++++++++++++++
 lib/e2p/pe.c            |  18 +++
 lib/e2p/ps.c            |  10 ++
 lib/support/Makefile.in |   7 +-
 lib/support/json-out.c  | 326 +++++++++++++++++++++++++++++++++++++++++++
 lib/support/json-out.h  |  69 +++++++++
 misc/Makefile.in        |   8 +-
 misc/dumpe2fs.8.in      |   3 +
 misc/dumpe2fs.c         | 323 ++++++++++++++++++++++++++++++++++++++++--
 12 files changed, 1173 insertions(+), 22 deletions(-)
 create mode 100644 lib/support/json-out.c
 create mode 100644 lib/support/json-out.h

-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ