Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 45342 Details for
Bug 71595
dev-util/cscope: Race condition on temporary file
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Debian patch from their cscope_15.5-1.1
debian-CAN-2004-0996.patch (text/plain), 1.39 KB, created by
Matthias Geerdsen (RETIRED)
on 2004-12-05 13:58:17 UTC
(
hide
)
Description:
Debian patch from their cscope_15.5-1.1
Filename:
MIME Type:
Creator:
Matthias Geerdsen (RETIRED)
Created:
2004-12-05 13:58:17 UTC
Size:
1.39 KB
patch
obsolete
>--- cscope-15.5.orig/src/main.c >+++ cscope-15.5/src/main.c >@@ -330,9 +330,31 @@ > } > > /* create the temporary file names */ >- pid = getpid(); >- (void) sprintf(temp1, "%s/cscope%d.1", tmpdir, pid); >- (void) sprintf(temp2, "%s/cscope%d.2", tmpdir, pid); >+ do { >+ char *tempfile = tempnam(tmpdir, "cscope1"); >+ if (!tempfile) { >+ fputs ("Can't create tempfile\n", stderr); >+ exit (1); >+ } >+ if (strlen(tempfile) >= sizeof(temp1)) { >+ fputs ("TMPDIR path is too long\n", stderr); >+ exit(1); >+ } >+ strncpy (temp1, tempfile, sizeof (temp1)); >+ } while (open (temp1, O_CREAT|O_EXCL|O_WRONLY, 0600) < 0); >+ do { >+ char *tempfile = tempnam(tmpdir, "cscope2"); >+ if (!tempfile) { >+ fputs ("Can't create tempfile\n", stderr); >+ exit (1); >+ } >+ if (strlen(tempfile) >= sizeof(temp2)) { >+ fputs ("TMPDIR path is too long\n", stderr); >+ exit(1); >+ } >+ strncpy (temp2, tempfile, sizeof (temp2)); >+ } while (open (temp2, O_CREAT|O_EXCL|O_WRONLY, 0600) < 0); >+ > > /* if running in the foreground */ > if (signal(SIGINT, SIG_IGN) != SIG_IGN) {
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 71595
:
44199
|
44571
|
44698
|
45208
| 45342 |
45463