[Fedora-directory-commits] adminserver/admserv/cgi-src40 admpw.c, 1.5, 1.6

Noriko Hosoi (nhosoi) fedora-directory-commits at redhat.com
Thu Jun 15 17:05:01 UTC 2006


Author: nhosoi

Update of /cvs/dirsec/adminserver/admserv/cgi-src40
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29109

Modified Files:
	admpw.c 
Log Message:
[191832] Admin Server password always remembers initial password on (part 2)
Removed fclose if the preceding fopen failed.



Index: admpw.c
===================================================================
RCS file: /cvs/dirsec/adminserver/admserv/cgi-src40/admpw.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- admpw.c	31 Mar 2006 22:58:20 -0000	1.5
+++ admpw.c	15 Jun 2006 17:04:58 -0000	1.6
@@ -215,7 +215,6 @@
 	static char inbuf[BIG_LINE];
 
 	if (f==NULL) {
-		fclose(f);
 		rpt_err(SYSTEM_ERROR, i18nMsg(DBT_OPEN_ADMPW, "Can not open admpw file"), NULL, NULL);
 	}
 	if (fgets(inbuf, sizeof(inbuf), f) == NULL) {
@@ -259,7 +258,6 @@
 	logMsg("newuid=%s, newpw=%s\n", newuid ? newuid:"", newpw ? newpw : "");
 
 	if ((f=fopen(filename, "r"))==NULL) {
-		fclose(f);
 		rpt_err(SYSTEM_ERROR, i18nMsg(DBT_OPEN_ADMPW,"Can not open admpw file"), NULL, NULL);
 	}
 	if (fgets(inbuf, sizeof(inbuf), f) == NULL) {
@@ -307,7 +305,6 @@
 
 	f = fopen(filename, "w");
 	if (f==NULL) {
-		fclose(f);
 		rpt_err(SYSTEM_ERROR, i18nMsg(DBT_OPEN_ADMPW_WR, "Can not open admpw file for writing"), NULL, NULL);
 	}
 
@@ -341,7 +338,6 @@
 
 	f = fopen(filename, "r");
 	if (f==NULL) {
-		fclose(f);
 		rpt_err(SYSTEM_ERROR, i18nMsg(DBT_OPEN_ADMCONF_RD, "Can not open adm.conf for reading"), NULL, NULL);
 	}
 
@@ -363,7 +359,6 @@
 
 	f = fopen(filename, "w");
 	if (f==NULL) {
-		fclose(f);
 		rpt_err(SYSTEM_ERROR, i18nMsg(DBT_OPEN_ADMCONF_WR, "Can not open adm.conf for writing"), NULL, NULL);
 	}
 




More information about the Fedora-directory-commits mailing list