sss_autofs.c revision 2cbdd12983eb85eddb90f64cfafb24eae5b448f4
/*
Authors:
Jakub Hrozek <jhrozek@redhat.com>
Copyright (C) 2012 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 <errno.h>
#include <stdlib.h>
#include "sss_client/autofs/sss_autofs_private.h"
#include "sss_client/sss_cli.h"
/* Historically, autofs map and key names were just file names */
#define MAX_AUTOMNTMAPNAME_LEN NAME_MAX
#define MAX_AUTOMNTKEYNAME_LEN NAME_MAX
struct automtent {
char *mapname;
};
{
int errnop;
char *name;
struct sss_cli_req_data rd;
sss_nss_lock();
if (ret != 0) {
goto out;
}
goto out;
}
if (errnop != 0) {
goto out;
}
/* no results if not found */
goto out;
}
if (!ctx) {
goto out;
}
goto out;
}
ret = 0;
out:
return ret;
}
{
int errnop;
struct sss_cli_req_data rd;
uint32_t v;
char *buf;
sss_nss_lock();
if (!ctx) {
goto out;
}
/* Be paranoid in case someone tries to smuggle in a huge map name */
if (ret != 0) {
goto out;
}
sizeof(uint32_t); /* index into the map */
if (!data) {
goto out;
}
v = name_len;
if (errnop != 0) {
goto out;
}
/* Got reply, let's parse it */
rp = 0;
if (len == 0) {
/* End of iteration */
goto out;
}
goto out;
}
if (!buf) {
goto out;
}
goto out;
}
if (!buf) {
goto out;
}
/* Advance the cursor so that we'll fetch the next map
* next time getautomntent is called */
ret = 0;
out:
return ret;
}
{
int errnop;
uint32_t v;
struct sss_cli_req_data rd;
char *buf;
sss_nss_lock();
goto out;
}
/* Be paranoid in case someone tries to smuggle in a huge map name */
if (ret != 0) {
goto out;
}
if (ret != 0) {
goto out;
}
sizeof(uint32_t) + /* keyname len */
if (!data) {
goto out;
}
v = name_len;
v = key_len;
if (errnop != 0) {
goto out;
}
/* Got reply, let's parse it */
rp = 0;
if (len == 0) {
/* No data */
goto out;
}
goto out;
}
if (!buf) {
goto out;
}
ret = 0;
out:
return ret;
}
_sss_endautomntent(void **context)
{
int errnop;
if (!context) return 0;
sss_nss_lock();
if (errnop != 0) {
goto out;
}
ret = 0;
out:
return ret;
}