/*
SSSD
Copyright (C) Jakub Hrozek <jhrozek@redhat.com> 2010
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 "config.h"
#include <stdio.h>
#include <talloc.h>
#include <stdlib.h>
#include "tools/tools_util.h"
#ifndef NSCD_RELOAD_ARG
#endif
{
const char *service;
switch(flush_db) {
case NSCD_DB_PASSWD:
service = "passwd";
break;
case NSCD_DB_GROUP:
service = "group";
break;
default:
goto done;
}
switch (nscd_pid) {
case 0:
/* if this returns it is an error */
case -1:
break;
default:
do {
errno = 0;
if (ret > 0) {
if (ret > 0) {
/* The flush fails if nscd is not running, so do not care
* about the return code */
"Error flushing cache, is nscd running?\n");
}
}
} else {
"Failed to wait for children %d\n", nscd_pid);
}
}
done:
return ret;
}
#else /* defined(NSCD_PATH) && defined(HAVE_NSCD) */
{
return EOK;
}
#endif
/* NSCD config file parse and check */
{
struct sss_nscd_db {
const char *svc_type_name;
unsigned int nscd_service_flag;
};
int i;
unsigned int ret = 0;
{ "passwd", 0x0001 },
{ "group", 0x0010 },
{ "netgroup", 0x0100 },
{ "services", 0x1000 },
{ NULL, 0 }
};
return ret;
}
break;
}
}
return ret;
}
{
unsigned int occurred = 0;
"file [%s]\n", NSCD_CONF_PATH);
return ENOENT;
}
*pad = '\0';
}
entry++;
}
pad++;
}
service++;
}
*pad = '\0';
pad++;
}
enabled++;
}
*pad = '\0';
pad++;
}
*pad = '\0';
}
};
if (ret) {
"ended with failure [%d]: %s.\n",
goto done;
}
if (occurred != 0) {
goto done;
}
done:
return ret;
}