ALT Linux Bugzilla
– Attachment 2103 Details for
Bug 12355
bcc doesn't work because of incorrect $TMPDIR usage
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
fixed -owl-tmp.patch
dev86-0.16.17-owl-tmp.patch (text/plain), 1.70 KB, created by
Peter 'Nidd' Novodvorsky
on 2007-07-17 12:00:32 MSD
(
hide
)
Description:
fixed -owl-tmp.patch
Filename:
MIME Type:
Creator:
Peter 'Nidd' Novodvorsky
Created:
2007-07-17 12:00:32 MSD
Size:
1.70 KB
patch
obsolete
>diff -aur dev86-0.16.17.orig/bcc/bcc.c dev86-0.16.17/bcc/bcc.c >--- dev86-0.16.17.orig/bcc/bcc.c 2006-10-15 04:40:27 +0400 >+++ dev86-0.16.17/bcc/bcc.c 2007-07-17 13:41:50 +0400 >@@ -122,11 +122,7 @@ > int dyn_count = 0; > int error_count = 0; > char * progname = "C"; >-#ifdef MSDOS > char * tmpdir = ""; >-#else >-char * tmpdir = "/tmp/"; >-#endif > > int main P((int argc, char **argv)); > void getargs P((int argc, char **argv)); >@@ -195,6 +191,18 @@ > if ((temp = getenv("BCC_PREFIX")) != 0 ) > localprefix = copystr(temp); > >+#ifndef MSDOS >+ /* XXX: this brings bcc behaviour in sync with the manual page which >+ states that bcc uses TMPDIR for the temporary directory name. >+ However, temporary file handling in this package is totally >+ insecure and I see no easy way how to fix it. :( >+ -- (GM) >+ */ >+ tmpdir = __secure_getenv("TMPDIR"); >+ if (!tmpdir || !*tmpdir) >+ tmpdir = "/tmp"; >+#endif >+ > getargs(argc, argv); > validate_link_opts(); > >@@ -727,9 +735,9 @@ > { > char buf[16]; > #ifdef MSDOS >- sprintf(buf, "$$%05d$", dyn_count++); >+ sprintf(buf, "/$$%05d$", dyn_count++); > #else >- sprintf(buf, "$$%04d%05d", dyn_count++, getpid()); >+ sprintf(buf, "/$$%04d%05d", dyn_count++, getpid()); > #endif > file->file = catstr(tmpdir, buf); > } >@@ -750,9 +758,9 @@ > char buf[16]; > char * p; > #ifdef MSDOS >- sprintf(buf, "$$%05d$", i); >+ sprintf(buf, "/$$%05d$", i); > #else >- sprintf(buf, "$$%04d%05d", i, getpid()); >+ sprintf(buf, "/$$%04d%05d", i, getpid()); > #endif > p = catstr(tmpdir, buf); > if (opt_v>1) >ТолÑко в dev86-0.16.17/bcc: bcc.c~
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 12355
: 2103