All of lore.kernel.org
 help / color / mirror / Atom feed
* libsemanage/src/semanage_store.c:semanage_split_fc
@ 2006-03-06 22:15 Serge E. Hallyn
  2006-03-07  2:03 ` libsemanage/src/semanage_store.c:semanage_split_fc Ivan Gyurdiev
  0 siblings, 1 reply; 4+ messages in thread
From: Serge E. Hallyn @ 2006-03-06 22:15 UTC (permalink / raw)
  To: SELinux

In semanage_split_fc(), linex 887 and 893, the file_con fd is not closed
on error.  Trivial patch follows.

-serge

Index: libsemanage/src/semanage_store.c
===================================================================
--- libsemanage.orig/src/semanage_store.c	2006-02-15 10:47:23.000000000 -0600
+++ libsemanage/src/semanage_store.c	2006-03-06 16:14:48.000000000 -0600
@@ -885,11 +885,13 @@ int semanage_split_fc(semanage_handle_t 
 	fc = open(semanage_path(SEMANAGE_TMP, SEMANAGE_FC), O_WRONLY | O_CREAT | O_TRUNC,  S_IRUSR | S_IWUSR);
 	if (!fc) {
 		ERR(sh, "Could not open %s for writing.", semanage_path(SEMANAGE_TMP, SEMANAGE_FC));
+		fclose(file_con);
 		return -1;
 	}
 	hd = open(semanage_path(SEMANAGE_TMP, SEMANAGE_HOMEDIR_TMPL), O_WRONLY | O_CREAT | O_TRUNC,  S_IRUSR | S_IWUSR);
 	if (!hd) {
 		ERR(sh, "Could not open %s for writing.", semanage_path(SEMANAGE_TMP, SEMANAGE_HOMEDIR_TMPL));
+		fclose(file_con);
 		close(fc);
 		return -1;
 	}

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-03-08 16:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-06 22:15 libsemanage/src/semanage_store.c:semanage_split_fc Serge E. Hallyn
2006-03-07  2:03 ` libsemanage/src/semanage_store.c:semanage_split_fc Ivan Gyurdiev
2006-03-08 15:05   ` libsemanage/src/semanage_store.c:semanage_split_fc Stephen Smalley
2006-03-08 16:23     ` libsemanage/src/semanage_store.c:semanage_split_fc Serge E. Hallyn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.