source: clfs-sysroot/patches/gzip-1.3.5-security_fixes-1.patch @ ffd1587

Last change on this file since ffd1587 was 8f3d581, checked in by Joe Ciccone <jciccone@…>, 17 years ago

Add all of the patches needed for clfs-sysroot.

  • Property mode set to 100644
File size: 2.0 KB
  • gzip-1.3.5

    Submitted By: Matthew Burgess (matthew at linuxfromscratch dot org)
    Origin: http://security.ubuntu.com/ubuntu/pool/main/g/gzip/gzip_1.3.5-9ubuntu3.1.diff.gz
    Date: 2005-05-12
    Initial package version: 1.3.5
    Description: Fix two security vulnerabilities in gzip: A path traversal
    bug when using the -N option (CAN-2005-1228) and a race condition in the
    file permission restore code (CAN-2005-0998).
    
    diff -Naur gzip-1.3.5.orig/gzip.c gzip-1.3.5/gzip.c
    old new  
    875875    }
    876876
    877877    close(ifd);
    878     if (!to_stdout && close(ofd)) {
    879         write_error();
     878    if (!to_stdout) {
     879         /* Copy modes, times, ownership, and remove the input file */
     880         copy_stat(&istat);
     881         if (close(ofd))
     882            write_error();
    880883    }
    881884    if (method == -1) {
    882885        if (!to_stdout) xunlink (ofname);
     
    896899        }
    897900        fprintf(stderr, "\n");
    898901    }
    899     /* Copy modes, times, ownership, and remove the input file */
    900     if (!to_stdout) {
    901         copy_stat(&istat);
    902     }
    903902}
    904903
    905904/* ========================================================================
     
    13241323                        error("corrupted input -- file name too large");
    13251324                    }
    13261325                }
     1326                char *base2 = base_name (base);
     1327                strcpy(base, base2);
    13271328                /* If necessary, adapt the name to local OS conventions: */
    13281329                if (!list) {
    13291330                   MAKE_LEGAL_NAME(base);
     
    17251726    reset_times(ofname, ifstat);
    17261727#endif
    17271728    /* Copy the protection modes */
    1728     if (chmod(ofname, ifstat->st_mode & 07777)) {
     1729    if (fchmod(ofd, ifstat->st_mode & 07777)) {
    17291730        int e = errno;
    17301731        WARN((stderr, "%s: ", progname));
    17311732        if (!quiet) {
     
    17341735        }
    17351736    }
    17361737#ifndef NO_CHOWN
    1737     chown(ofname, ifstat->st_uid, ifstat->st_gid);  /* Copy ownership */
     1738    fchown(ofd, ifstat->st_uid, ifstat->st_gid);  /* Copy ownership */
    17381739#endif
    17391740    remove_ofname = 0;
    17401741    /* It's now safe to remove the input file: */
Note: See TracBrowser for help on using the repository browser.