Re: [PATCH v8 4/7] ima: define a new template field named 'd-ngv2' and templates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2022-04-29 at 11:09 -0400, Stefan Berger wrote:
> > -     if (hash_algo < HASH_ALGO__LAST) {
> > +     if (digest_type < DIGEST_TYPE__LAST && hash_algo < HASH_ALGO__LAST) {
> > +             fmt = DATA_FMT_DIGEST_WITH_TYPE_AND_ALGO;
> > +             offset += 1 + sprintf(buffer, "%*s:%*s:",
> > +                                   (int)strlen(digest_type_name[digest_type]),
> > +                                   digest_type_name[digest_type],
> > +                                   (int)strlen(hash_algo_name[hash_algo]),
> > +                                   hash_algo_name[hash_algo]);
> 
> '%*s' seems to be for right-alignment but only makes sense if the length 
> indicator is different than then following string. sprintf(buffer, 
> "|%*s|",5,"test") prints | test|. Otherwise it seems to behave like 
> plain '%s' in this case... ?

Re-testing now, it works properly without the length.

thanks,

Mimi




[Index of Archives]     [linux Cryptography]     [Asterisk App Development]     [PJ SIP]     [Gnu Gatekeeper]     [IETF Sipping]     [Info Cyrus]     [ALSA User]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite News]     [Deep Creek Hot Springs]     [Yosemite Campsites]     [ISDN Cause Codes]

  Powered by Linux