/*
Winbind client API - SSSD version
Copyright (C) Sumit Bose <sbose@redhat.com> 2014
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Required Headers */
#include <nss.h>
#include <dlfcn.h>
#include <errno.h>
#include "libwbclient.h"
#include "wbc_sssd_internal.h"
struct nss_ops_ctx {
void *dl_handle;
int *errnop);
};
static bool open_libnss_sss(void)
{
return false;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
return true;
fail:
}
return false;
}
{
}
{
return WBC_ERR_NO_MEMORY;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
goto fail;
}
return WBC_ERR_SUCCESS;
fail:
return WBC_ERR_NO_MEMORY;
}
{
switch (status) {
case NSS_STATUS_SUCCESS:
break;
case NSS_STATUS_NOTFOUND:
break;
case NSS_STATUS_UNAVAIL:
break;
default:
}
return wbc_status;
}
/* Fill in a struct passwd* for a domain user based on username */
{
int nss_errno;
return WBC_ERR_NSS_ERROR;
}
return WBC_ERR_INVALID_PARAM;
}
return WBC_ERR_NO_MEMORY;
}
if (WBC_ERROR_IS_OK(wbc_status) == true) {
}
return wbc_status;
}
/* Fill in a struct passwd* for a domain user based on uid */
{
int nss_errno;
return WBC_ERR_NSS_ERROR;
}
return WBC_ERR_INVALID_PARAM;
}
return WBC_ERR_NO_MEMORY;
}
if (WBC_ERROR_IS_OK(wbc_status) == true) {
}
return wbc_status;
}
/* Fill in a struct passwd* for a domain user based on sid */
{
if (!WBC_ERROR_IS_OK(wbc_status)) {
return wbc_status;
}
return wbc_status;
}
{
size_t c;
/* if the array was partly created this can be NULL */
return;
}
}
}
{
size_t c;
return WBC_ERR_NO_MEMORY;
}
goto fail;
}
goto fail;
}
goto fail;
}
for (c = 0; c < members; c++) {
goto fail;
}
}
return WBC_ERR_SUCCESS;
fail:
return WBC_ERR_NO_MEMORY;
}
/* Fill in a struct passwd* for a domain user based on username */
{
int nss_errno;
return WBC_ERR_NSS_ERROR;
}
return WBC_ERR_INVALID_PARAM;
}
do {
buflen *= 2;
return WBC_ERR_NO_MEMORY;
}
if (WBC_ERROR_IS_OK(wbc_status) == true) {
}
&& buflen < MAX_BUFSIZE);
return wbc_status;
}
/* Fill in a struct passwd* for a domain user based on uid */
{
int nss_errno;
return WBC_ERR_NSS_ERROR;
}
return WBC_ERR_INVALID_PARAM;
}
do {
buflen *= 2;
return WBC_ERR_NO_MEMORY;
}
if (WBC_ERROR_IS_OK(wbc_status) == true) {
}
&& buflen < MAX_BUFSIZE);
return wbc_status;
}
/* Reset the passwd iterator */
{
return WBC_ERR_NSS_ERROR;
}
return wbc_status;
}
/* Close the passwd iterator */
{
return WBC_ERR_NSS_ERROR;
}
return wbc_status;
}
/* Return the next struct passwd* entry from the pwent iterator */
{
int nss_errno;
return WBC_ERR_NSS_ERROR;
}
return WBC_ERR_INVALID_PARAM;
}
return WBC_ERR_NO_MEMORY;
}
if (WBC_ERROR_IS_OK(wbc_status) == true) {
}
return wbc_status;
}
/* Reset the group iterator */
{
return WBC_ERR_NSS_ERROR;
}
return wbc_status;
}
/* Close the group iterator */
{
return WBC_ERR_NSS_ERROR;
}
return wbc_status;
}
/* Return the next struct group* entry from the pwent iterator */
{
int nss_errno;
return WBC_ERR_NSS_ERROR;
}
return WBC_ERR_INVALID_PARAM;
}
do {
buflen *= 2;
return WBC_ERR_NO_MEMORY;
}
if (WBC_ERROR_IS_OK(wbc_status) == true) {
}
&& buflen < MAX_BUFSIZE);
return wbc_status;
}
/* Return the next struct group* entry from the pwent iterator */
{
/* Not used anywhere */
}
/* Return the Unix group array belonging to the given user */
{
long int gr_size = 0;
long int start = 0;
int nss_errno;
if (!WBC_ERROR_IS_OK(wbc_status)) {
return wbc_status;
}
goto done;
}
/* nss modules may skip the primary group when we pass it in so always
* add it in advance */
start++;
if (!WBC_ERROR_IS_OK(wbc_status)) {
goto done;
}
*num_groups = start;
done:
if (!WBC_ERROR_IS_OK(wbc_status)) {
}
return wbc_status;
}