Commit Graph

5 Commits

Author SHA1 Message Date
Daniel J Walsh 3f8c0dc0de
Wrap errors properly with fmt.Errorf
Also returned errors should not begine with a capatalized errors.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-07-12 13:26:10 -04:00
Daniel J Walsh c363e6bd98
ParseIDMap should not ignore nonDigits
This leads to people accidently putting characters into options
and not getting back good errors.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-12 06:37:30 -04:00
Sascha Grunert 92374afb8e
Fix possible integer overflow on 32bit builds
This commit fix a possible integer overflow during U/GID map parsing.
Casting a 32bit unsigned integer to the resulting IDMap will now be
guarded by a simple overflow check. This check does apply only to 32bit
target architectures.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-16 10:36:35 +02:00
Šimon Lukašík ed97cd56f0 Refactor ParseIDMap, allow parsing multiple maps at once
I found that other projects, tend to parse multiple maps at once. So, we may
want to allow the base library to do so in order to decrease complexity in the
upper layers.

This is follow-up on previous refactoring in 7b209d36fd, I didn't got
it right on first try, sry.

Signed-off-by: Šimon Lukašík <isimluk@fedoraproject.org>
2018-11-26 20:11:49 +01:00
Šimon Lukašík 7b209d36fd Refactor: Extract ParseIDMap func to idtools package
where it belongs.

I have noticed that this parsing gets spread across projects. Basically, the
very same method is present in libpod, buildah, and cri-o projects. We better
start re-using this code from single place or soon everyone has its own version.

Signed-off-by: Šimon Lukašík <slukasik@redhat.com>
2018-11-10 17:53:54 +01:00