From: Andrew McNab Date: Fri, 24 Jul 2009 10:25:42 +0000 (+0000) Subject: open(...O_CREAT...) fix X-Git-Tag: gridsite-core_R_1_7_4~4 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=13d75f1b9d59a791847550bb2fdb80cbdc194e99;p=jra1mw.git open(...O_CREAT...) fix --- diff --git a/org.gridsite.core/CHANGES b/org.gridsite.core/CHANGES index ba55deb..0a85ae9 100644 --- a/org.gridsite.core/CHANGES +++ b/org.gridsite.core/CHANGES @@ -3,6 +3,8 @@ use most permissive time range they provide - Change (GRSTerrorLogFunc) to return int, to allow if-less C macro using && instead. +- Remove 2 argument open(...O_CREAT...) instance in + grst_admin_file.c * Fri Jul 03 2009 Andrew McNab - ==== GridSite version 1.7.4 ==== * Thu Jul 02 2009 Andrew McNab diff --git a/org.gridsite.core/src/grst_admin_file.c b/org.gridsite.core/src/grst_admin_file.c index 66fd13b..58f6ff2 100644 --- a/org.gridsite.core/src/grst_admin_file.c +++ b/org.gridsite.core/src/grst_admin_file.c @@ -300,13 +300,14 @@ void deletefileaction(char *dn, GRSTgaclPerm perm, char *help_uri, char *dir_path, char *file, char *dir_uri, char *admin_file) { - int fd, numfiles; + int numfiles; char *dir_path_file, *dir_path_vfile, *p, *vfile, *dnlistsuri, *fulluri, *server_name, *realfile; struct stat statbuf; GRSThttpBody bp; struct dirent *subdirfile_ent; DIR *subDIR; + FILE *fp; if( verifypasscode()==0 ){ @@ -375,8 +376,8 @@ void deletefileaction(char *dn, GRSTgaclPerm perm, char *help_uri, strcat(dir_path_file, "/"); strcat(dir_path_file, vfile); - fd = open(dir_path_file, O_WRONLY | O_CREAT); - if (fd != -1) close(fd); + fp = fopen(dir_path_file, "w"); + if (fp != NULL) fclose(fp); } printf("Status: 302 Moved Temporarily\nContent-Length: 0\n"