summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2001-07-12 22:12:48 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2001-07-12 22:12:48 +0000
commit6c59edb1043eb0b241f0ca654afd3bab5e2c6c02 (patch)
tree06ac4557c9e6c5ac283e8081cf90acab6613a62b
parent4b822ceb5b488a51f4b1c7d40f7a89207778ea87 (diff)
downloadATCD-6c59edb1043eb0b241f0ca654afd3bab5e2c6c02.tar.gz
ChangeLogTag:Thu Jul 12 15:10:52 2001 Ossama Othman <ossama@uci.edu>
-rw-r--r--TAO/ChangeLogs/ChangeLog-02a7
-rw-r--r--TAO/TAO_IDL/driver/drv_preproc.cpp8
2 files changed, 14 insertions, 1 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a
index 09228ac0d79..41976a5cd06 100644
--- a/TAO/ChangeLogs/ChangeLog-02a
+++ b/TAO/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,10 @@
+Thu Jul 12 15:10:52 2001 Ossama Othman <ossama@uci.edu>
+
+ * TAO_IDL/driver/drv_preproc.cpp (DRV_pre_proc):
+
+ Open the temporary file with the O_EXCL flag to close a symbolic
+ link attack vulnerability.
+
Thu Jul 12 13:31:25 2001 Ossama Othman <ossama@uci.edu>
* orbsvcs/orbsvcs/Security/EstablishTrustPolicy.h:
diff --git a/TAO/TAO_IDL/driver/drv_preproc.cpp b/TAO/TAO_IDL/driver/drv_preproc.cpp
index 50df446333a..506d948bccf 100644
--- a/TAO/TAO_IDL/driver/drv_preproc.cpp
+++ b/TAO/TAO_IDL/driver/drv_preproc.cpp
@@ -483,8 +483,14 @@ DRV_pre_proc (const char *myfile)
cpp_options.command_line (arglist);
+ /// Remove any existing output file.
+ (void) ACE_OS::unlink (tmp_file);
+
+ // If the following open() fails, then we're either being hit with a
+ // symbolic link attack, or another process opened the file before
+ // us.
ACE_HANDLE fd = ACE_OS::open (tmp_file,
- O_WRONLY | O_CREAT | O_TRUNC,
+ O_WRONLY | O_CREAT | O_EXCL,
ACE_DEFAULT_FILE_PERMS);
if (fd == ACE_INVALID_HANDLE)