a2ps/a2ps-4.13-security.patch
cvsdist 67cda08ce5 auto-import changelog data from a2ps-4.13b-13.src.rpm
Wed Feb 28 2001 SATO Satoru <ssato@redhat.com>
- bunzip2-ed all patches except eucjp
Thu Feb 22 2001 SATO Satoru <ssato@redhat.com>
- support Japanese
- bzip2-ed all patches
- replace macros (%makeinstall, %configure) with traditional commands to
    avoid some troubles those macros caused.
Tue Feb 20 2001 Trond Eivind Glomsrød <teg@redhat.com>
- Using letter is as weird as oz, fl. oz, Fahrenheit, lb etc. Add a patch
    for using the glibc media type for giving US letter for en_US (only
    locale with this paper), and A4 for everyone else.
Tue Feb 20 2001 Tim Powers <timp@redhat.com>
- changed default medium back to letter (bug 27794)
Mon Feb 19 2001 Trond Eivind Glomsrød <teg@redhat.com>
- langify
- use %{_tmppath}
Mon Feb 12 2001 Tim Waugh <twaugh@redhat.com>
- Fix tmpfile security patch so that it actually _works_ (bug #27155).
Sun Jan 21 2001 Tim Waugh <twaugh@redhat.com>
- New-style prereq line.
- %post script requires fileutils (mv) and sh-utils (true). This should fix
    bug #24251).
Mon Jan 08 2001 Trond Eivind Glomsrød <teg@redhat.com>
- Add /usr/bin/emacs to BuildRequires
- A4
- specify use of GNU Emacs for building
Fri Jan 05 2001 Preston Brown <pbrown@redhat.com>
- security patch for tmpfile creation from Olaf Kirch <okir@lst.de>
Mon Dec 11 2000 Preston Brown <pbrown@redhat.com>
- obsoleted old a2ps-i18n package (it was tiny) and included those fonts
    directly here.
Thu Dec 07 2000 Tim Powers <timp@redhat.com>
- built for dist-7.1
Mon Aug 07 2000 Tim Powers <timp@redhat.com>
- update to 4.13b to fix some bugs, thanks to czar@acm.org for giving me a
    heads up on this (bug #15679)
Mon Jul 24 2000 Prospector <prospector@redhat.com>
- rebuilt
Mon Jul 10 2000 Tim Powers <timp@redhat.com>
- rebuilt
Fri Jun 23 2000 Tim Powers <timp@redhat.com>
- info pages weren't getting gzipped.
- stdout & stderror redirected to /dev/null in post section
Mon Jun 19 2000 Tim Powers <timp@redhat.com>
- fixed bug 12451 which was a stupid mistake by me.
- quiet the post section
- added patches from michal@ellpspace.math.ualberta.ca and did some spec
    file magic he suggested as well.
Fri Jun 02 2000 Tim Powers <timp@redhat.com>
- fixed bug 5876, was not setting the paper size to Letter again :(
- man pages and info pages to /usr/share, FHS compliant.
- used macros wherever possible
Wed May 31 2000 Tim Powers <timp@rehat.com>
- fixed bug #11078, now requires psutils
Wed Apr 26 2000 Tim Powers <timp@redhat.com>
- updated to 4.13
- compress man pages
Thu Feb 10 2000 Tim Powers <timp@redhat.com>
- gzip man pages
- strip binaries
Mon Jan 24 2000 Tim Powers <timp@redhat.com>
- had to be more specific since the i18n stuff was removed from the
    package. There is a new a2ps-i18n package which treats the
    /usr/share/a2ps/afm/fonts.map file as a config file
Wed Oct 27 1999 Tim Powers <timp@redhat.com>
- added the --with-medium=Letter option to the configure process
Thu Aug 05 1999 Tim Powers <timp@redhat.com>
- fixed problems with missing dirs as reported in bug 3822
- built for powertools
Tue Jul 06 1999 Tim Powers <timp@redhat.com>
- rebuilt for powertools 6.1
Wed May 12 1999 Bill Nottingham <notting@redhat.com>
- add a2ps-site.cfg
Mon Apr 26 1999 Preston Brown <pbrown@redhat.com>
- update to 4.12 for Powertools 6.0
Sat Oct 24 1998 Jeff Johnson <jbj@redhat.com>
- narrower range of %files splats.
- install info correctly.
- new description/summary text.
Tue Oct 06 1998 Michael Maher <mike@redhat.com>
- updated source
Sat Jul 04 1998 Michael Maher <mike@redhat.com>
- built package
2004-09-09 02:51:02 +00:00

65 lines
1.5 KiB
Diff

--- a2ps-4.13/lib/routines.c.security Sat Oct 16 05:46:37 1999
+++ a2ps-4.13/lib/routines.c Mon Feb 12 17:45:15 2001
@@ -242,3 +242,50 @@
/* Don't complain if you can't unlink. Who cares of a tmp file? */
unlink (filename);
}
+
+/*
+ * Securely generate a temp file, and make sure it gets
+ * deleted upon exit.
+ */
+static char ** tempfiles;
+static unsigned ntempfiles;
+
+static void
+cleanup_tempfiles()
+{
+ while (ntempfiles--)
+ unlink(tempfiles[ntempfiles]);
+}
+
+char *
+safe_tempnam(const char *pfx)
+{
+ char *dirname, *filename;
+ int fd;
+
+ if (!(dirname = getenv("TMPDIR")))
+ dirname = "/tmp";
+
+ tempfiles = (char **) realloc(tempfiles,
+ (ntempfiles+1) * sizeof(char *));
+ if (tempfiles == NULL)
+ return NULL;
+
+ filename = malloc(strlen(dirname) + strlen(pfx) + sizeof("/XXXXXX"));
+ if (!filename)
+ return NULL;
+
+ sprintf(filename, "%s/%sXXXXXX", dirname, pfx);
+
+ if ((fd = mkstemp(filename)) < 0) {
+ free(filename);
+ return NULL;
+ }
+ close(fd);
+
+ if (ntempfiles == 0)
+ atexit(cleanup_tempfiles);
+ tempfiles[ntempfiles++] = filename;
+
+ return filename;
+}
--- a2ps-4.13/lib/routines.h.security Mon Oct 18 21:24:41 1999
+++ a2ps-4.13/lib/routines.h Mon Feb 12 17:39:30 2001
@@ -255,7 +255,8 @@
/* If _STR_ is not defined, give it a tempname in _TMPDIR_ */
#define tempname_ensure(Str) \
do { \
- (Str) = (Str) ? (Str) : tempnam (NULL, "a2_"); \
+ (Str) = (Str) ? (Str) : safe_tempnam("a2_"); \
} while (0)
+char * safe_tempnam(const char *);
#endif