head 1.2; access; symbols pkgsrc-2022Q4:1.1.0.92 pkgsrc-2022Q4-base:1.1 pkgsrc-2022Q3:1.1.0.90 pkgsrc-2022Q3-base:1.1 pkgsrc-2022Q2:1.1.0.88 pkgsrc-2022Q2-base:1.1 pkgsrc-2022Q1:1.1.0.86 pkgsrc-2022Q1-base:1.1 pkgsrc-2021Q4:1.1.0.84 pkgsrc-2021Q4-base:1.1 pkgsrc-2021Q3:1.1.0.82 pkgsrc-2021Q3-base:1.1 pkgsrc-2021Q2:1.1.0.80 pkgsrc-2021Q2-base:1.1 pkgsrc-2021Q1:1.1.0.78 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.76 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.74 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.70 pkgsrc-2020Q2-base:1.1 pkgsrc-2020Q1:1.1.0.50 pkgsrc-2020Q1-base:1.1 pkgsrc-2019Q4:1.1.0.72 pkgsrc-2019Q4-base:1.1 pkgsrc-2019Q3:1.1.0.68 pkgsrc-2019Q3-base:1.1 pkgsrc-2019Q2:1.1.0.66 pkgsrc-2019Q2-base:1.1 pkgsrc-2019Q1:1.1.0.64 pkgsrc-2019Q1-base:1.1 pkgsrc-2018Q4:1.1.0.62 pkgsrc-2018Q4-base:1.1 pkgsrc-2018Q3:1.1.0.60 pkgsrc-2018Q3-base:1.1 pkgsrc-2018Q2:1.1.0.58 pkgsrc-2018Q2-base:1.1 pkgsrc-2018Q1:1.1.0.56 pkgsrc-2018Q1-base:1.1 pkgsrc-2017Q4:1.1.0.54 pkgsrc-2017Q4-base:1.1 pkgsrc-2017Q3:1.1.0.52 pkgsrc-2017Q3-base:1.1 pkgsrc-2017Q2:1.1.0.48 pkgsrc-2017Q2-base:1.1 pkgsrc-2017Q1:1.1.0.46 pkgsrc-2017Q1-base:1.1 pkgsrc-2016Q4:1.1.0.44 pkgsrc-2016Q4-base:1.1 pkgsrc-2016Q3:1.1.0.42 pkgsrc-2016Q3-base:1.1 pkgsrc-2016Q2:1.1.0.40 pkgsrc-2016Q2-base:1.1 pkgsrc-2016Q1:1.1.0.38 pkgsrc-2016Q1-base:1.1 pkgsrc-2015Q4:1.1.0.36 pkgsrc-2015Q4-base:1.1 pkgsrc-2015Q3:1.1.0.34 pkgsrc-2015Q3-base:1.1 pkgsrc-2015Q2:1.1.0.32 pkgsrc-2015Q2-base:1.1 pkgsrc-2015Q1:1.1.0.30 pkgsrc-2015Q1-base:1.1 pkgsrc-2014Q4:1.1.0.28 pkgsrc-2014Q4-base:1.1 pkgsrc-2014Q3:1.1.0.26 pkgsrc-2014Q3-base:1.1 pkgsrc-2014Q2:1.1.0.24 pkgsrc-2014Q2-base:1.1 pkgsrc-2014Q1:1.1.0.22 pkgsrc-2014Q1-base:1.1 pkgsrc-2013Q4:1.1.0.20 pkgsrc-2013Q4-base:1.1 pkgsrc-2013Q3:1.1.0.18 pkgsrc-2013Q3-base:1.1 pkgsrc-2013Q2:1.1.0.16 pkgsrc-2013Q2-base:1.1 pkgsrc-2013Q1:1.1.0.14 pkgsrc-2013Q1-base:1.1 pkgsrc-2012Q4:1.1.0.12 pkgsrc-2012Q4-base:1.1 pkgsrc-2012Q3:1.1.0.10 pkgsrc-2012Q3-base:1.1 pkgsrc-2012Q2:1.1.0.8 pkgsrc-2012Q2-base:1.1 pkgsrc-2012Q1:1.1.0.6 pkgsrc-2012Q1-base:1.1 pkgsrc-2011Q4:1.1.0.4 pkgsrc-2011Q4-base:1.1 pkgsrc-2011Q3:1.1.0.2; locks; strict; comment @# @; 1.2 date 2023.02.25.17.55.24; author ryoon; state dead; branches; next 1.1; commitid sbQ9CwSPQ7QJWVeE; 1.1 date 2011.11.08.12.41.30; author dholland; state Exp; branches 1.1.2.1; next ; 1.1.2.1 date 2011.11.08.12.41.30; author tron; state dead; branches; next 1.1.2.2; 1.1.2.2 date 2011.11.08.21.58.07; author tron; state Exp; branches; next ; desc @@ 1.2 log @moscow_ml: Update to 2.10.1 * Changelog is too long, including many bugfixes and SML Basic Library improvements. * Update MASTER_SITES and HOMEPAGE. @ text @$NetBSD: patch-mosmlyac_main_c,v 1.1 2011/11/08 12:41:30 dholland Exp $ Avoid insecure use of mktemp(). --- mosmlyac/main.c.orig 2000-04-28 09:38:45.000000000 +0000 +++ mosmlyac/main.c @@@@ -1,6 +1,9 @@@@ #include #ifdef ANSI #include +#include +#else +extern char *getenv(); #endif #include "defs.h" @@@@ -33,6 +36,11 @@@@ char *text_file_name; char *union_file_name; char *verbose_file_name; +static int action_fd = -1; +static int entry_fd = -1; +static int text_fd = -1; +static int union_fd = -1; + FILE *action_file; /* a temp file, used to save actions associated */ /* with rules until the parser is written */ FILE *entry_file; @@@@ -71,9 +79,6 @@@@ char *rassoc; short **derives; char *nullable; -extern char *mktemp(); -extern char *getenv(); - void done(int k) { @@@@ -276,12 +281,21 @@@@ void create_file_names(void) union_file_name[len + 5] = 'u'; #ifndef NO_UNIX - mktemp(action_file_name); - mktemp(entry_file_name); - mktemp(text_file_name); - mktemp(union_file_name); + action_fd = mkstemp(action_file_name); + entry_fd = mkstemp(entry_file_name); + text_fd = mkstemp(text_file_name); + union_fd = mkstemp(union_file_name); #endif + if (action_fd < 0) + open_error(action_file_name); + if (entry_fd < 0) + open_error(entry_file_name); + if (text_fd < 0) + open_error(text_file_name); + if (union_fd < 0) + open_error(union_file_name); + len = strlen(file_prefix); output_file_name = MALLOC(len + 7); @@@@ -321,15 +335,15 @@@@ void open_files(void) open_error(input_file_name); } - action_file = fopen(action_file_name, "w"); + action_file = fdopen(action_fd, "w"); if (action_file == 0) open_error(action_file_name); - entry_file = fopen(entry_file_name, "w"); + entry_file = fdopen(entry_fd, "w"); if (entry_file == 0) open_error(entry_file_name); - text_file = fopen(text_file_name, "w"); + text_file = fdopen(text_fd, "w"); if (text_file == 0) open_error(text_file_name); @@@@ -345,7 +359,7 @@@@ void open_files(void) defines_file = fopen(defines_file_name, "w"); if (defines_file == 0) open_error(defines_file_name); - union_file = fopen(union_file_name, "w"); + union_file = fdopen(union_fd, "w"); if (union_file == 0) open_error(union_file_name); } @ 1.1 log @Fix PR 45558 (aka CVE-2011-4119) which also turns out to affect Moscow ML. Credit to Florian Weimer for noticing this. @ text @d1 1 a1 1 $NetBSD$ @ 1.1.2.1 log @file patch-mosmlyac_main_c was added on branch pkgsrc-2011Q3 on 2011-11-08 21:58:07 +0000 @ text @d1 92 @ 1.1.2.2 log @Pullup ticket #3594 - requested by dholland lang/moscow_ml: security patch Revisions pulled up: - lang/moscow_ml/Makefile 1.29 - lang/moscow_ml/distinfo 1.6 - lang/moscow_ml/patches/patch-mosmlyac_main_c 1.1 --- Module Name: pkgsrc Committed By: dholland Date: Tue Nov 8 12:41:30 UTC 2011 Modified Files: pkgsrc/lang/moscow_ml: Makefile distinfo Added Files: pkgsrc/lang/moscow_ml/patches: patch-mosmlyac_main_c Log Message: Fix PR 45558 (aka CVE-2011-4119) which also turns out to affect Moscow ML. Credit to Florian Weimer for noticing this. @ text @a0 92 $NetBSD$ Avoid insecure use of mktemp(). --- mosmlyac/main.c.orig 2000-04-28 09:38:45.000000000 +0000 +++ mosmlyac/main.c @@@@ -1,6 +1,9 @@@@ #include #ifdef ANSI #include +#include +#else +extern char *getenv(); #endif #include "defs.h" @@@@ -33,6 +36,11 @@@@ char *text_file_name; char *union_file_name; char *verbose_file_name; +static int action_fd = -1; +static int entry_fd = -1; +static int text_fd = -1; +static int union_fd = -1; + FILE *action_file; /* a temp file, used to save actions associated */ /* with rules until the parser is written */ FILE *entry_file; @@@@ -71,9 +79,6 @@@@ char *rassoc; short **derives; char *nullable; -extern char *mktemp(); -extern char *getenv(); - void done(int k) { @@@@ -276,12 +281,21 @@@@ void create_file_names(void) union_file_name[len + 5] = 'u'; #ifndef NO_UNIX - mktemp(action_file_name); - mktemp(entry_file_name); - mktemp(text_file_name); - mktemp(union_file_name); + action_fd = mkstemp(action_file_name); + entry_fd = mkstemp(entry_file_name); + text_fd = mkstemp(text_file_name); + union_fd = mkstemp(union_file_name); #endif + if (action_fd < 0) + open_error(action_file_name); + if (entry_fd < 0) + open_error(entry_file_name); + if (text_fd < 0) + open_error(text_file_name); + if (union_fd < 0) + open_error(union_file_name); + len = strlen(file_prefix); output_file_name = MALLOC(len + 7); @@@@ -321,15 +335,15 @@@@ void open_files(void) open_error(input_file_name); } - action_file = fopen(action_file_name, "w"); + action_file = fdopen(action_fd, "w"); if (action_file == 0) open_error(action_file_name); - entry_file = fopen(entry_file_name, "w"); + entry_file = fdopen(entry_fd, "w"); if (entry_file == 0) open_error(entry_file_name); - text_file = fopen(text_file_name, "w"); + text_file = fdopen(text_fd, "w"); if (text_file == 0) open_error(text_file_name); @@@@ -345,7 +359,7 @@@@ void open_files(void) defines_file = fopen(defines_file_name, "w"); if (defines_file == 0) open_error(defines_file_name); - union_file = fopen(union_file_name, "w"); + union_file = fdopen(union_fd, "w"); if (union_file == 0) open_error(union_file_name); } @