Do not output a false positive for a config/ticket flag if only
some bits match.
Without this patch, a configuration with the single cfgflag
STRONG_PW2 was shown as
STRONG_PW2|OATH_FIXED_MODHEX2|OATH_FIXED_MODHEX
since there are some bits matching STRONG_PW2 (0x40) in
OATH_FIXED_MODHEX (0x50). With this patch, single cfgflag
STRONG_PW2 is shown as
STRONG_PW2|OATH_FIXED_MODHEX2
OATH_FIXED_MODHEX2 is also shown as it shares the value of 0x40,
and the outputting is not context aware (yet).
buffer[0] = '\0';
for (p = ticket_flags_map; p->flag; p++) {
- if (cfg->ykcore_config.tktFlags & p->flag
+ if ((cfg->ykcore_config.tktFlags & p->flag) == p->flag
&& p->vcheck(cfg)) {
if (*buffer) {
strcat(buffer, str_flags_separator);
buffer[0] = '\0';
for (p = config_flags_map; p->flag; p++) {
- if (cfg->ykcore_config.cfgFlags & p->flag
+ if ((cfg->ykcore_config.cfgFlags & p->flag) == p->flag
&& p->vcheck(cfg)) {
if (*buffer) {
strcat(buffer, str_flags_separator);