libmount: use _exit() in <type> handlers

The originally used exit() is bad idea for the shared library.

Reported-by: Ruediger Meier <sweet_f_a@gmx.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2017-06-29 12:58:57 +02:00
parent 1626ce113e
commit 41d758f82d
2 changed files with 7 additions and 7 deletions

View File

@ -597,10 +597,10 @@ static int exec_helper(struct libmnt_context *cxt)
int i = 0;
if (setgid(getgid()) < 0)
exit(EXIT_FAILURE);
_exit(EXIT_FAILURE);
if (setuid(getuid()) < 0)
exit(EXIT_FAILURE);
_exit(EXIT_FAILURE);
type = mnt_fs_get_fstype(cxt->fs);
@ -632,7 +632,7 @@ static int exec_helper(struct libmnt_context *cxt)
i, args[i]));
DBG_FLUSH;
execv(cxt->helper, (char * const *) args);
exit(EXIT_FAILURE);
_exit(EXIT_FAILURE);
}
default:
{
@ -1244,7 +1244,7 @@ int mnt_context_next_mount(struct libmnt_context *cxt,
if (mnt_context_is_child(cxt)) {
DBG(CXT, ul_debugobj(cxt, "next-mount: child exit [rc=%d]", rc));
DBG_FLUSH;
exit(rc);
_exit(rc);
}
return 0;
}

View File

@ -543,10 +543,10 @@ static int exec_helper(struct libmnt_context *cxt)
int i = 0;
if (setgid(getgid()) < 0)
exit(EXIT_FAILURE);
_exit(EXIT_FAILURE);
if (setuid(getuid()) < 0)
exit(EXIT_FAILURE);
_exit(EXIT_FAILURE);
type = mnt_fs_get_fstype(cxt->fs);
@ -576,7 +576,7 @@ static int exec_helper(struct libmnt_context *cxt)
i, args[i]));
DBG_FLUSH;
execv(cxt->helper, (char * const *) args);
exit(EXIT_FAILURE);
_exit(EXIT_FAILURE);
}
default:
{