From: Klas Lindfors Date: Fri, 12 Apr 2013 09:51:22 +0000 (+0200) Subject: only look at mode if p->mode is set X-Git-Tag: v1.13.0~52 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a08b8749e2c799b0f7b4714875f5c3d2dab588cb;p=yubikey-personalization only look at mode if p->mode is set --- diff --git a/ykpers.c b/ykpers.c index db76888..48ae8d6 100644 --- a/ykpers.c +++ b/ykpers.c @@ -1005,7 +1005,7 @@ int ykp_write_config(const YKP_CONFIG *cfg, for (p = ticket_flags_map; p->flag; p++) { if ((ycfg.tktFlags & p->flag) == p->flag && p->capability(cfg) - && (mode & p->mode) == mode) { + && (!p->mode || (mode & p->mode) == mode)) { if (*buffer) { strcat(buffer, str_flags_separator); strcat(buffer, p->flag_text); @@ -1027,7 +1027,7 @@ int ykp_write_config(const YKP_CONFIG *cfg, for (p = config_flags_map; p->flag; p++) { if ((t_flags & p->flag) == p->flag && p->capability(cfg) - && (mode & p->mode) == mode) { + && (!p->mode || (mode & p->mode) == mode)) { if (*buffer) { strcat(buffer, str_flags_separator); strcat(buffer, p->flag_text); @@ -1052,7 +1052,7 @@ int ykp_write_config(const YKP_CONFIG *cfg, for (p = extended_flags_map; p->flag; p++) { if ((ycfg.extFlags & p->flag) == p->flag && p->capability(cfg) - && (mode & p->mode) == mode) { + && (!p->mode || (mode & p->mode) == mode)) { if (*buffer) { strcat(buffer, str_flags_separator); strcat(buffer, p->flag_text);