RPM Community Forums

Mailing List Message of <rpm-devel>

Re: rpm infinite recursions using manifests

From: Alexey Tourbin <at@altlinux.ru>
Date: Mon 08 Sep 2008 - 07:00:52 CEST
Message-ID: <20080908050051.GR6477@altlinux.org>
On Sun, Sep 07, 2008 at 02:32:57PM -0400, Jeff Johnson wrote:
> On Sep 7, 2008, at 2:28 PM, Alexey Tourbin wrote:
> >On Sun, Sep 07, 2008 at 02:22:26PM -0400, Jeff Johnson wrote:
> >>>Forbid manifest files from within manifests.
> >>Forbid manifests entirely is a similarly Draconian solution.
> >
> >I expect manifests to have <list> semanitcs, not #include semantics.
> Sure manifests have list semantics.

List semantics means that we have basic type rpm, and manifests are
of type list<rpm>.  Include semantics has a bit more vague notion of
basic type: [ <code_snippet> | <cpp_include_instruction> ]+, the latter
is recurisve and should be reduced to terminal code_snippets.  cpp(1)
provides a device to prevent infinite recursion, which is

#ifndef FOO_H
#define FOO_H
[ <code_snippet> | <cpp_include_instruction> ]+

and otherwise has no special way to handle recursion, except for
nesting limit.

$ cat foo.h
#include "foo.h"
$ cpp -I. -E foo.h 2>&1 >/dev/null |tail
                 from foo.h:1,
                 from foo.h:1,
                 from foo.h:1,
                 from foo.h:1,
                 from foo.h:1,
                 from foo.h:1,
                 from foo.h:1,
                 from foo.h:1,
                 from foo.h:1:
foo.h:1:17: error: #include nested too deeply

So, right, the best thing you can do is set up nesting limit.  However,
to me, the fact that manifests can include manifests is not the least
surprising thing.

  • application/pgp-signature attachment: stored
Received on Mon Sep 8 07:00:53 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.