RE: [PATCH] libsemanage: free policydb before fork

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stephen Smalley wrote:
> Ok, patch below makes this change.
> 
> Index: trunk/libsemanage/src/semanage_store.c
> ===================================================================
> --- trunk/libsemanage/src/semanage_store.c	(revision 2783)
> +++ trunk/libsemanage/src/semanage_store.c	(working copy)
> @@ -911,14 +911,14 @@
> 
>  	/* no need to use pthread_atfork() -- child will not be using
>  	 * any mutexes. */
> -	if ((forkval = fork()) == -1) {
> +	if ((forkval = vfork()) == -1) {
>  		ERR(sh, "Error while forking process.");
>  		return -1;
>  	} else if (forkval == 0) {
>  		/* child process.  file descriptors will be closed
>  		 * because they were set as close-on-exec. */
>  		execve(e->path, argv, NULL);
> -		exit(EXIT_FAILURE);	/* if execve() failed */
> +		_exit(EXIT_FAILURE);	/* if execve() failed */
>  	} else {
>  		/* parent process.  wait for child to finish */
>  		int status = 0;

That's identical to what I have in my tree.  Works fine here.

Acked-By: Todd C. Miller <tmiller@xxxxxxxxxx>

 - todd


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

[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux