]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: cleanup UID and GIR parsing, add tests
authorKarel Zak <kzak@redhat.com>
Thu, 21 Apr 2022 09:41:00 +0000 (11:41 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 21 Apr 2022 09:57:56 +0000 (11:57 +0200)
commit24e896c1400c2328b8bdffde674a3d74429acdf1
tree39e903a8d0e542fcf7aac29ec58b9d0416252ea2
parent47f851e15eefc34c03620c367e585a198d12b279
libmount: cleanup UID and GIR parsing, add tests

* parse_uid_numeric() and parse_gid_numeric() assumes zero terminated
  strings, so do not require size. The function ul_strtou64() already
  checks that the number is terminated by \0

* use rc from ul_strtou64()

* always set errno if necessary

* return -errno or -EINVAL rather than generic -1

* add --parse-{uid,gid,mode} to test_mount_utils

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/utils.c