responder_common.c revision 3adb3a4ed740aaeb3013020aa8aa9544669197a0
6N/A Common Responder methods 15N/A Copyright (C) Simo Sorce <ssorce@redhat.com> 2008 6N/A This program is free software; you can redistribute it and/or modify 15N/A it under the terms of the GNU General Public License as published by 6N/A the Free Software Foundation; either version 3 of the License, or 15N/A (at your option) any later version. 6N/A This program is distributed in the hope that it will be useful, 6N/A but WITHOUT ANY WARRANTY; without even the implied warranty of 6N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 6N/A GNU General Public License for more details. 6N/A You should have received a copy of the GNU General Public License 6N/A /* Get the current flags for this file descriptor */ 6N/A /* Set the non-blocking flag on this fd */ 6N/A DEBUG(0, (
"Unable to set fd non-blocking: [%d][%s]\n",
6N/A /* Get the current flags for this file descriptor */ 6N/A /* Set the close-on-exec flags on this fd */ 6N/A DEBUG(0, (
"Unable to set fd close-on-exec: [%d][%s]\n",
15N/A (
"Failed to close fd [%d]: [%s]\n",
15N/A (
"Terminated client [%p][%d]\n",
15N/A DEBUG(
1, (
"getsockopt returned unexpected message size.\n"));
6N/A DEBUG(
9, (
"Client creds: euid[%d] egid[%d] pid[%d].\n",
6N/A /* not all data was sent, loop again */ 6N/A DEBUG(0, (
"Failed to send data, aborting client!\n"));
32N/A DEBUG(0, (
"Failed to alloc request, aborting client!\n"));
32N/A DEBUG(0, (
"Failed to alloc request, aborting client!\n"));
32N/A /* do not read anymore */ 32N/A /* execute command */ 32N/A DEBUG(0, (
"Failed to execute request, aborting client!\n"));
6N/A /* past this point cctx can be freed at any time by callbacks 6N/A * in case of error, do not use it */ 6N/A /* need to read still some data, loop again */ 6N/A DEBUG(
6, (
"Invalid data from client, closing connection!\n"));
6N/A DEBUG(
6, (
"Failed to read request, aborting client!\n"));
6N/A /* accept and attach new event handler */ DEBUG(
1, (
"privileged pipe has an illegal status.\n"));
/* TODO: what is the best response to this condition? Terminate? */ DEBUG(0, (
"Out of memory trying to setup client context%s!\n",
/* accept and close to signal the client we have a problem */ DEBUG(
2, (
"get_client_cred failed, " "client cred may not be available.\n"));
DEBUG(
2, (
"Failed to queue client handler%\n",
DEBUG(
4, (
"Client connected%s!\n",
/* Set up SBUS connection to the monitor */ DEBUG(0, (
"Could not locate DP address.\n"));
DEBUG(0, (
"Failed to connect to monitor services.\n"));
/* Identify ourselves to the DP */ DEBUG(0, (
"Failed to identify to the DP!\n"));
/* create a unix socket and listen to it */ /* Set the umask so that permissions are set right on the socket. * It must be readable and writable by anybody on the system. */ /* make sure we have no old sockets around */ DEBUG(0, (
"Failed to queue handler on pipe\n"));
/* create privileged pipe */ DEBUG(0, (
"Failed to queue handler on privileged pipe\n"));
/* we want default permissions on created files to be very strict, so set our umask to 0177 */ /* we want default permissions on created files to be very strict, so set our umask to 0177 */ DEBUG(0, (
"fatal error initializing resp_ctx\n"));
(
"Cannnot get the default domain timeout [%d]: %s\n",
DEBUG(0, (
"fatal error setting up domain map\n"));
DEBUG(0, (
"fatal error setting up message bus\n"));
/* skip local domain, it doesn't have a backend */ (
"fatal error initializing regex data for domain: %s\n",
DEBUG(0, (
"fatal error setting up backend connector\n"));
DEBUG(0, (
"fatal error initializing resp_ctx\n"));
/* after all initializations we are ready to listen on our socket */ DEBUG(0, (
"fatal error initializing socket\n"));
/* Create DP request table */ (
"Could not create hash table for the request queue\n"));
DEBUG(
1, (
"Responder Initialization complete\n"));
/* Sub-domains may come and go, so we better copy the struct /* FIXME: we might want to return a real error, e.g. if copy_subdomain "possible subdomains!\n",
domain));
/* First, let's see if we have permission to just set (
"Maximum file descriptors set to [%d]\n",
/* We couldn't set the soft and hard limits to this * value. Let's see how high we CAN set it. /* Determine the maximum hard limit */ (
"Current fd limit: [%d]\n",
/* Choose the lesser of the requested and the hard limit */ (
"Maximum file descriptors set to [%d]\n",
(
"Could not set new fd limits. Proceeding with [%d]\n",
(
"Could not determine fd limits. " "Proceeding with system values\n"));