79ec7f5834
This is a security update. changes: -fix some unsecure tmpfile writing (CVE-2009-1962) -more bugfixes -symbol library extensions -changed default browser to firefox and default pdf viewer to xpdf -HTML MAP export (fig2dev) produces reference to .png file instead of .gif now -minor UI improvements
50 lines
2 KiB
Text
50 lines
2 KiB
Text
$NetBSD: patch-ac,v 1.7 2009/06/22 18:29:33 drochner Exp $
|
|
|
|
--- f_util.c.orig 2007-01-16 18:58:18.000000000 +0100
|
|
+++ f_util.c
|
|
@@ -119,15 +119,15 @@ change_directory(char *path)
|
|
|
|
int get_directory(char *direct)
|
|
{
|
|
-#if defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE)
|
|
+#if defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(__NetBSD__)
|
|
extern char *getcwd(char *, size_t);
|
|
|
|
#else
|
|
extern char *getwd();
|
|
|
|
-#endif /* defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) */
|
|
+#endif /* defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(__NetBSD__) */
|
|
|
|
-#if defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE)
|
|
+#if defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(__NetBSD__)
|
|
if (getcwd(direct, PATH_MAX) == NULL) { /* get current working dir */
|
|
file_msg("Can't get current directory");
|
|
beep();
|
|
@@ -135,7 +135,7 @@ int get_directory(char *direct)
|
|
if (getwd(direct) == NULL) { /* get current working dir */
|
|
file_msg("%s", direct); /* err msg is in direct var */
|
|
beep();
|
|
-#endif /* defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) */
|
|
+#endif /* defined(SYSV) || defined(SVR4) || defined(_POSIX_SOURCE) || defined(__NetBSD__) */
|
|
*direct = '\0';
|
|
return 0;
|
|
}
|
|
@@ -781,7 +781,7 @@ uncompress_file(char *name)
|
|
else strcpy(dirname, ".");
|
|
|
|
if (access(dirname, W_OK) == 0) { /* OK - the directory is writable */
|
|
- sprintf(unc, "gunzip -q %s", name);
|
|
+ sprintf(unc, "gunzip -q -- %s", name);
|
|
if (system(unc) != 0)
|
|
file_msg("Couldn't uncompress the file: \"%s\"", unc);
|
|
strcpy(name, plainname);
|
|
@@ -792,7 +792,7 @@ uncompress_file(char *name)
|
|
sprintf(tmpfile, "%s%s", TMPDIR, c);
|
|
else
|
|
sprintf(tmpfile, "%s/%s", TMPDIR, plainname);
|
|
- sprintf(unc, "gunzip -q -c %s > %s", name, tmpfile);
|
|
+ sprintf(unc, "gunzip -q -c -- %s > %s", name, tmpfile);
|
|
if (system(unc) != 0)
|
|
file_msg("Couldn't uncompress the file: \"%s\"", unc);
|
|
file_msg ("Uncompressing file %s in %s because it is in a read-only directory",
|