[PATCH] Restore execute bits for DUD binaries (#819564)
Martin Sivak
msivak at redhat.com
Tue Sep 4 13:34:11 UTC 2012
I missed the whitespace as I forgot to enable visible whitespaces and python devel mode did this for me automatically.. hups.. I will remove it before pushing.
There is no real possible fallback when chmod fails here and we do not really care (considering we are root).
Martin
----- Original Message -----
> On Tue, Sep 04, 2012 at 12:27:35PM +0200, Martin Sivak wrote:
> > ---
> > loader/rpmextract.c | 19 +++++++++++--------
> > 1 file changed, 11 insertions(+), 8 deletions(-)
> >
> > diff --git a/loader/rpmextract.c b/loader/rpmextract.c
> > index a618fc1..9ad1206 100644
> > --- a/loader/rpmextract.c
> > +++ b/loader/rpmextract.c
> > @@ -1,16 +1,16 @@
> > /* unpack the payload of RPM package to the current directory
> > - *
> > + *
> > * File name: rpmextract.c
> > * Date: 2009/12/18
> > * Author: Martin Sivak <msivak at redhat dot com>
> > - *
> > + *
> > * Copyright (C) 2009 Red Hat, Inc. All rights reserved.
> > - *
> > + *
> > * This program is free software; you can redistribute it and/or
> > * modify it under the terms of the GNU General Public License as
> > * published by the Free Software Foundation; either version 2 of
> > the
> > * License, or (at your option) any later version.
> > - *
> > + *
> > * This program is distributed in the hope that it will be useful,
> > but
> > * WITHOUT ANY WARRANTY; without even the implied warranty of
> > * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> > GNU
> > @@ -85,13 +85,13 @@ const char * headerGetString(Header h, rpmTag
> > tag)
> > }
> >
> > /*
> > - *
> > + *
> > */
> >
> > int matchVersions(const char *version, uint32_t sense, const char
> > *senseversion)
> > {
> > int r = rpmvercmp(version, senseversion);
> > -
> > +
> > if(r<0 && !(sense & RPMSENSE_LESS)) return 1;
> > else if(r==0 && !(sense & RPMSENSE_EQUAL)) return 1;
> > else if(r>0 && !(sense & RPMSENSE_GREATER)) return 1;
> > @@ -220,7 +220,7 @@ int explodeRPM(const char *source,
> > const char *depname;
> > const char *depversion;
> > uint32_t depsense;
> > -
> > +
> > if (!headerGet(h, RPMTAG_PROVIDES, &tddep,
> > HEADERGET_MINMEM))
> > break;
> >
> > @@ -348,7 +348,7 @@ int explodeRPM(const char *source,
> > rc = 33;
> > break;
> > }
> > -
> > +
> > rc = archive_read_data_into_fd(cpio, fileno(fdout));
> > if (rc!=ARCHIVE_OK) {
> > /* XXX We didn't get the file.. well.. */
> > @@ -358,6 +358,9 @@ int explodeRPM(const char *source,
> > }
> >
>
> All of the changes up to this point at unnecessary whitespace
> changes.
>
> > fclose(fdout);
> > +
> > + /* set access rights */
> > + chmod(filename+offset, fstat->st_mode);
> > }
> >
> > /* symlink, we assume that the path contained in symlink
>
> Shouldn't the return value of chmod() be checked and appropriate
> action
> taken on failure?
>
> --
> David Cantrell <dcantrell at redhat.com>
> Supervisor, Installer Engineering Team
> Red Hat, Inc. | Westford, MA | EST5EDT
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
More information about the anaconda-patches
mailing list