885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose Unix SMB/CIFS implementation.
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose Winbind client API
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose Copyright (C) Gerald (Jerry) Carter 2007
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose This library is free software; you can redistribute it and/or
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose modify it under the terms of the GNU Lesser General Public
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose License as published by the Free Software Foundation; either
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose version 3 of the License, or (at your option) any later version.
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose This library is distributed in the hope that it will be useful,
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose but WITHOUT ANY WARRANTY; without even the implied warranty of
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose Library General Public License for more details.
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose You should have received a copy of the GNU Lesser General Public License
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose along with this program. If not, see <http://www.gnu.org/licenses/>.
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/* Required Headers */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/** @brief Translate an error value into a string
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose * @param error
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose * @return a pointer to a static string
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_SUCCESS";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_NOT_IMPLEMENTED";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_UNKNOWN_FAILURE";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_NO_MEMORY";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_INVALID_SID";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_INVALID_PARAM";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_WINBIND_NOT_AVAILABLE";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_DOMAIN_NOT_FOUND";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_INVALID_RESPONSE";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_NSS_ERROR";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_UNKNOWN_USER";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_UNKNOWN_GROUP";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_AUTH_ERROR";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "WBC_ERR_PWD_CHANGE_FAILED";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return "unknown wbcErr value";
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bosestatic struct wbcMemPrefix *wbcMemToPrefix(void *ptr)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return (struct wbcMemPrefix *)((void *)(((char *)ptr) - wbcPrefixLen()));
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bosevoid *wbcAllocateMemory(size_t nelem, size_t elsize,
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose /* basic protection against integer wrap */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose/* Free library allocated memory */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose /* paranoid check to ensure we don't double free */
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose result = (char *)wbcAllocateMemory(len+1, sizeof(char), NULL);
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose char **p = (char **)ptr;
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose while (*p != NULL) {
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Boseconst char **wbcAllocateStringArray(int num_strings)
885386b7e3f1c3e74b354576b98a092b0835d64eSumit Bose return (const char **)wbcAllocateMemory(
885386b7e3f1c3e74b354576b98a092b0835d64eSumit BosewbcErr wbcLibraryDetails(struct wbcLibraryDetails **_details)