/*
SSSD
NSS Responder Interface for ID-SID mappings
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2013 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 <stdlib.h>
#include <errno.h>
#include <nss.h>
#include "sss_client/sss_cli.h"
#include "sss_client/idmap/sss_nss_idmap.h"
#include "util/strtonum.h"
union input {
const char *str;
};
struct output {
union {
char *str;
} d;
};
switch (nret) {
case NSS_STATUS_TRYAGAIN:
return EAGAIN;
case NSS_STATUS_SUCCESS:
return EOK;
case NSS_STATUS_UNAVAIL:
default:
return ENOENT;
}
return EINVAL;
}
{
size_t c;
}
}
}
struct sss_nss_kv **kv_list)
{
size_t c;
uint8_t *p;
int ret;
for (c = 0; c < buf_len; c++) {
if (buf[c] == '\0') {
count++;
}
}
if ((count % 2) != 0) {
return EINVAL;
}
count /= 2;
return ENOMEM;
}
p = buf;
for (c = 0; c < count; c++) {
goto done;
}
if (p == NULL) {
goto done;
}
p++;
goto done;
}
if (p == NULL) {
goto done;
}
p++;
}
done:
}
return ret;
}
{
int ret;
int errnop;
uint32_t c;
switch (cmd) {
case SSS_NSS_GETSIDBYNAME:
case SSS_NSS_GETNAMEBYSID:
case SSS_NSS_GETIDBYSID:
case SSS_NSS_GETORIGBYNAME:
case SSS_NSS_GETNAMEBYCERT:
return EINVAL;
}
break;
case SSS_NSS_GETSIDBYID:
break;
default:
return EINVAL;
}
sss_nss_lock();
if (nret != NSS_STATUS_SUCCESS) {
goto done;
}
if (replen < 8) {
goto done;
}
if (num_results == 0) {
goto done;
} else if (num_results > 1) {
goto done;
}
/* Skip first two 32 bit values (number of results and
* reserved padding) */
switch(cmd) {
case SSS_NSS_GETSIDBYID:
case SSS_NSS_GETSIDBYNAME:
case SSS_NSS_GETNAMEBYSID:
case SSS_NSS_GETNAMEBYCERT:
goto done;
}
goto done;
}
break;
case SSS_NSS_GETIDBYSID:
goto done;
}
break;
case SSS_NSS_GETORIGBYNAME:
goto done;
}
break;
default:
goto done;
}
done:
}
return ret;
}
enum sss_id_type *type)
{
int ret;
return EINVAL;
}
}
return ret;
}
{
int ret;
return EINVAL;
}
}
return ret;
}
enum sss_id_type *type)
{
int ret;
return EINVAL;
}
}
return ret;
}
{
int ret;
return EINVAL;
}
}
return ret;
}
enum sss_id_type *type)
{
int ret;
return EINVAL;
}
}
return ret;
}
enum sss_id_type *type)
{
int ret;
return EINVAL;
}
}
return ret;
}