selinux_child.c revision f3a25949de81f80c136bb073e4a8f504b080c20c
/*
SSSD
IPA back end -- set SELinux context in a child module
Authors:
Jakub Hrozek <jhrozek@redhat.com>
Copyright (C) 2014 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <unistd.h>
#include <popt.h>
#include "util/child_common.h"
#include "providers/dp_backend.h"
struct input_buffer {
const char *seuser;
const char *mls_range;
const char *username;
};
struct input_buffer *ibuf)
{
size_t p = 0;
/* seuser */
if (len == 0) {
return EINVAL;
} else {
p += len;
}
/* MLS range */
if (len == 0) {
return EINVAL;
} else {
p += len;
}
/* username */
if (len == 0) {
return EINVAL;
} else {
p += len;
}
return EOK;
}
{
size_t p = 0;
/* A buffer with the following structure must be created:
* uint32_t status of the request (required)
*/
return ENOMEM;
}
/* result */
return EOK;
}
int result,
{
int ret;
if (r == NULL) {
return ENOMEM;
}
r->size = 0;
return ret;
}
*rsp = r;
return EOK;
}
{
int opt;
int debug_fd = -1;
struct poptOption long_options[] = {
_("Debug level"), NULL},
_("Add debug timestamps"), NULL},
_("Show timestamps with microseconds"), NULL},
_("An open file descriptor for the debug logs"), NULL},
&debug_to_stderr, 0,
_("Send the debug output to stderr directly."), NULL },
};
/* Set debug level to invalid value so we can decide if -d 0 was used. */
switch(opt) {
default:
_exit(-1);
}
}
if (debug_prg_name == NULL) {
goto fail;
}
if (debug_fd != -1) {
}
}
goto fail;
}
goto fail;
}
goto fail;
}
errno = 0;
if (len == -1) {
goto fail;
}
goto fail;
}
errno = 0;
if (written == -1) {
goto fail;
}
goto fail;
}
return EXIT_SUCCESS;
fail:
return EXIT_FAILURE;
}