[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c317858898c7974b5f046f9fb8117d299f0c6504.camel@linux.ibm.com>
Date: Fri, 29 Apr 2022 17:41:04 -0400
From: Mimi Zohar <zohar@...ux.ibm.com>
To: Stefan Berger <stefanb@...ux.ibm.com>,
linux-integrity@...r.kernel.org
Cc: Eric Biggers <ebiggers@...nel.org>, linux-fscrypt@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 4/7] ima: define a new template field named 'd-ngv2'
and templates
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
Powered by blists - more mailing lists