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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux