cluster: RHEL4 - Revert "ccsd: Fix bug 49898 - symlink attack vulnerabilities"
Lon Hohberger
lon at fedoraproject.org
Fri Oct 22 19:40:15 UTC 2010
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a08257ab9823ecc97da56439398eb0240c98cd0b
Commit: a08257ab9823ecc97da56439398eb0240c98cd0b
Parent: fa19791a85c5f46fe223827d37d3ff59a6134f31
Author: Lon Hohberger <lhh at redhat.com>
AuthorDate: Fri Oct 22 15:34:11 2010 -0400
Committer: Lon Hohberger <lhh at redhat.com>
CommitterDate: Fri Oct 22 15:34:11 2010 -0400
Revert "ccsd: Fix bug 49898 - symlink attack vulnerabilities"
This reverts commit bba9068b91f737b8f88cd26581eed5884f443bae.
---
ccs/ccs_tool/upgrade.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/ccs/ccs_tool/upgrade.c b/ccs/ccs_tool/upgrade.c
index cb844b9..b085407 100644
--- a/ccs/ccs_tool/upgrade.c
+++ b/ccs/ccs_tool/upgrade.c
@@ -193,7 +193,7 @@ static void ccs_dh_in(ccs_dh_t *dh, char *buf){
static int upgrade_device_archive(char *location){
int error = 0;
int dev_fd=-1, tmp_fd=-1;
- char tmp_file[128];
+ char tmp_file[64];
char *buffer = NULL;
ccs_dh_t dev_header;
@@ -229,10 +229,9 @@ static int upgrade_device_archive(char *location){
goto fail;
}
- memset(tmp_file, 0, 128);
- sprintf(tmp_file, "/tmp/ccs_tool_tmp_XXXXXX");
+ sprintf(tmp_file, "/tmp/tmp_%d", getpid());
- tmp_fd = mkostemp(tmp_file, O_RDWR | O_CREAT |O_TRUNC);
+ tmp_fd = open(tmp_file, O_RDWR | O_CREAT |O_TRUNC, S_IRUSR|S_IWUSR);
if(tmp_fd < 0){
fprintf(stderr, "Unable to create temporary archive: %s\n", strerror(errno));
error = -errno;
More information about the cluster-commits
mailing list