[sheepdog] [sheepdog/sheepdog] c19170: sheep: Validate -p/--port, -z/--zone and -V/--vnod...

Hitoshi Mitake mitake.hitoshi at gmail.com
Fri Aug 12 06:18:00 CEST 2016


  Branch: refs/heads/master
  Home:   https://github.com/sheepdog/sheepdog
  Commit: c19170a25b0a08997e2786c4e9784d9e1604ed39
      https://github.com/sheepdog/sheepdog/commit/c19170a25b0a08997e2786c4e9784d9e1604ed39
  Author: Takashi Menjo <menjo.takashi at lab.ntt.co.jp>
  Date:   2016-08-05 (Fri, 05 Aug 2016)

  Changed paths:
    M include/util.h
    M lib/util.c
    M sheep/sheep.c

  Log Message:
  -----------
  sheep: Validate -p/--port, -z/--zone and -V/--vnodes values strictly

This commit adds two functions str_to_u32 and str_to_u16 to lib/util.c.
These functions convert a string into a 64-bit integer with strtoll.
Then they check whether a converted value is in the valid range or not and,
if something goes wrong because of an empty string, an invalid character,
a negative value or overflow, sets errno accordingly.

Using them, this enforces strict range validation of -p/--port, -z/--zone
and -V/--vnodes.

Signed-off-by: Takashi Menjo <menjo.takashi at lab.ntt.co.jp>


  Commit: e278874446a65f78d17af4531dc36f6a330f02f0
      https://github.com/sheepdog/sheepdog/commit/e278874446a65f78d17af4531dc36f6a330f02f0
  Author: Takashi Menjo <menjo.takashi at lab.ntt.co.jp>
  Date:   2016-08-05 (Fri, 05 Aug 2016)

  Changed paths:
    M tests/unit/lib/test_util.c

  Log Message:
  -----------
  tests: Add unit tests verifing str_to_u32 and str_to_u16

This commit verifies below:

"sheep: Validate -p/--port, -z/--zone and -V/--vnodes values strictly"

Signed-off-by: Takashi Menjo <menjo.takashi at lab.ntt.co.jp>


  Commit: f5e345973ce643082d7512efc9e73be540353d43
      https://github.com/sheepdog/sheepdog/commit/f5e345973ce643082d7512efc9e73be540353d43
  Author: Takashi Menjo <menjo.takashi at lab.ntt.co.jp>
  Date:   2016-08-08 (Mon, 08 Aug 2016)

  Changed paths:
    A tests/functional/108
    A tests/functional/108.out
    A tests/functional/109
    A tests/functional/109.out
    A tests/functional/110
    A tests/functional/110.out
    M tests/functional/group

  Log Message:
  -----------
  tests: Add functional test 108-110 verifying sheep -p, -z and -V

This commit verifies below:

"sheep: Validate -p/--port, -z/--zone and -V/--vnodes values strictly"

Signed-off-by: Takashi Menjo <menjo.takashi at lab.ntt.co.jp>


  Commit: fb09655c81d651f9550111ecbb08605fe6dee1ed
      https://github.com/sheepdog/sheepdog/commit/fb09655c81d651f9550111ecbb08605fe6dee1ed
  Author: Hitoshi Mitake <mitake.hitoshi at gmail.com>
  Date:   2016-08-12 (Fri, 12 Aug 2016)

  Changed paths:
    M include/util.h
    M lib/util.c
    M sheep/sheep.c
    A tests/functional/108
    A tests/functional/108.out
    A tests/functional/109
    A tests/functional/109.out
    A tests/functional/110
    A tests/functional/110.out
    M tests/functional/group
    M tests/unit/lib/test_util.c

  Log Message:
  -----------
  Merge pull request #297 from tmenjo/fix-sheep-p-z-V-options

sheep: Validate -p/--port, -z/--zone and -V/--vnodes values strictly


Compare: https://github.com/sheepdog/sheepdog/compare/7b0e17ddbdfc...fb09655c81d6


More information about the sheepdog mailing list