setpriv: accept any case in capability names

This should work: setpriv --inh-caps -SyS_ReSOuRCE sh

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2017-08-18 19:11:57 +02:00
parent fec2b1f79d
commit 79747415d6

View File

@ -235,7 +235,7 @@ static void parse_cap(unsigned long *index, const char *cap)
# if ENABLE_FEATURE_SETPRIV_CAPABILITY_NAMES # if ENABLE_FEATURE_SETPRIV_CAPABILITY_NAMES
for (i = 0; i < ARRAY_SIZE(capabilities); i++) { for (i = 0; i < ARRAY_SIZE(capabilities); i++) {
if (strcmp(capabilities[i], cap) != 0) if (strcasecmp(capabilities[i], cap) != 0)
continue; continue;
if (!cap_valid(i)) if (!cap_valid(i))