RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  [email protected]
  Module: rpm                              Date:   21-Feb-2009 22:17:24
  Branch: HEAD                             Handle: 2009022121172300

  Modified files:
    rpm/rpmio               rpmz.c

  Log:
    - jbj: rpmz: Fileno(3) does the wrong thing with libio. disable
    Fchown/Fchmod.

  Summary:
    Revision    Changes     Path
    1.31        +5  -0      rpm/rpmio/rpmz.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmz.c
  ============================================================================
  $ cvs diff -u -r1.30 -r1.31 rpmz.c
  --- rpm/rpmio/rpmz.c  21 Feb 2009 21:05:27 -0000      1.30
  +++ rpm/rpmio/rpmz.c  21 Feb 2009 21:17:23 -0000      1.31
  @@ -306,6 +306,7 @@
        // destination file who didn't have permission to access the
        // source file.
   
  +#ifdef       NOTYET          /* XXX Fileno used by Fchmod/Fchown needs work. 
*/
        // Try changing the owner of the file. If we aren't root or the owner
        // isn't already us, fchown() probably doesn't succeed. We warn
        // about failing fchown() only if we are root.
  @@ -339,6 +340,7 @@
                                z->ofn, strerror(errno));
       }
   #endif
  +#endif
   
        // Copy the timestamps. We have several possible ways to do this, of
        // which some are better in both security and precision.
  @@ -390,6 +392,7 @@
        tv[1].tv_sec = z->isb.st_mtime;
        tv[1].tv_nsec = mtime_nsec;
   
  +     /* XXX Fileno onto libio FILE * is -1 so EBADF is returned. */
        (void)futimens(Fileno(z->ofd), tv);
         }
   
  @@ -402,8 +405,10 @@
        tv[1].tv_usec = mtime_nsec / 1000;
   
   #    if defined(HAVE_FUTIMES)
  +     /* XXX Fileno onto libio FILE * is -1 so EBADF is returned. */
        (void)futimes(Fileno(z->ofd), tv);
   #    elif defined(HAVE_FUTIMESAT)
  +     /* XXX Fileno onto libio FILE * is -1 so EBADF is returned. */
        (void)futimesat(Fileno(z->ofd), NULL, tv);
   #    else
        // Argh, no function to use a file descriptor to set the timestamp.
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                [email protected]

Reply via email to