It appears that this is used only by unfsd, and is obscure enough that
we should be able to just rip it out with no special precautions.
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
if (stat(exp->m_export.m_path, &stb) < 0)
return 0;
if (stat(exp->m_export.m_path, &stb) < 0)
return 0;
- if (exp->m_export.e_maptype != CLE_MAP_IDENT) {
- xlog(L_ERROR, "%s: unsupported mapping; kernel supports only 'identity' (default)",
- exp->m_export.m_path);
- errno = EINVAL;
- return 0;
- }
memset(exparg, 0, sizeof(*exparg));
strncpy(exparg->ex_path, exp->m_export.m_path,
sizeof (exparg->ex_path) - 1);
memset(exparg, 0, sizeof(*exparg));
strncpy(exparg->ex_path, exp->m_export.m_path,
sizeof (exparg->ex_path) - 1);
#define _PATH_PROC_EXPORTS_ALT "/proc/fs/nfsd/exports"
#endif
#define _PATH_PROC_EXPORTS_ALT "/proc/fs/nfsd/exports"
#endif
-enum cle_maptypes {
- CLE_MAP_IDENT = 0,
- CLE_MAP_FILE,
- CLE_MAP_UGIDD,
-};
-
/*
* Data related to a single exports entry as returned by getexportent.
* FIXME: export options should probably be parsed at a later time to
/*
* Data related to a single exports entry as returned by getexportent.
* FIXME: export options should probably be parsed at a later time to
use it for anything else. */
char m_path[NFS_MAXPATHLEN+1];
int e_flags;
use it for anything else. */
char m_path[NFS_MAXPATHLEN+1];
int e_flags;
int e_anonuid;
int e_anongid;
int * e_squids;
int e_anonuid;
int e_anongid;
int * e_squids;
static int parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr);
static int parsesquash(char *list, int **idp, int *lenp, char **ep);
static int parsenum(char **cpp);
static int parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr);
static int parsesquash(char *list, int **idp, int *lenp, char **ep);
static int parsenum(char **cpp);
-static int parsemaptype(char *type);
static void freesquash(void);
static void syntaxerr(char *msg);
static void freesquash(void);
static void syntaxerr(char *msg);
def_ee.e_flags &= ~NFSEXP_ASYNC;
def_ee.e_flags &= ~NFSEXP_GATHERED_WRITES;
}
def_ee.e_flags &= ~NFSEXP_ASYNC;
def_ee.e_flags &= ~NFSEXP_GATHERED_WRITES;
}
- def_ee.e_maptype = CLE_MAP_IDENT;
def_ee.e_anonuid = 65534;
def_ee.e_anongid = 65534;
def_ee.e_squids = NULL;
def_ee.e_anonuid = 65534;
def_ee.e_anongid = 65534;
def_ee.e_squids = NULL;
xlog(L_ERROR, "unknown fsloc method for %s:%s",
ep->e_hostname, ep->e_path);
}
xlog(L_ERROR, "unknown fsloc method for %s:%s",
ep->e_hostname, ep->e_path);
}
- fprintf(fp, "mapping=");
- switch (ep->e_maptype) {
- case CLE_MAP_IDENT:
- fprintf(fp, "identity,");
- break;
- case CLE_MAP_UGIDD:
- fprintf(fp, "ugidd,");
- break;
- case CLE_MAP_FILE:
- fprintf(fp, "file,");
- break;
- default:
- xlog(L_ERROR, "unknown mapping type for %s:%s",
- ep->e_hostname, ep->e_path);
- }
if ((id = ep->e_squids) != NULL) {
fprintf(fp, "squash_uids=");
for (i = 0; i < ep->e_nsquids; i += 2)
if ((id = ep->e_squids) != NULL) {
fprintf(fp, "squash_uids=");
for (i = 0; i < ep->e_nsquids; i += 2)
static struct exportent ee;
ee.e_flags = EXPORT_DEFAULT_FLAGS;
static struct exportent ee;
ee.e_flags = EXPORT_DEFAULT_FLAGS;
- ee.e_maptype = CLE_MAP_IDENT;
ee.e_anonuid = 65534;
ee.e_anongid = 65534;
ee.e_squids = NULL;
ee.e_anonuid = 65534;
ee.e_anongid = 65534;
ee.e_squids = NULL;
ep->e_flags &= ~NFSEXP_NOACL;
else if (strcmp(opt, "no_acl") == 0)
ep->e_flags |= NFSEXP_NOACL;
ep->e_flags &= ~NFSEXP_NOACL;
else if (strcmp(opt, "no_acl") == 0)
ep->e_flags |= NFSEXP_NOACL;
- else if (strncmp(opt, "mapping=", 8) == 0)
- ep->e_maptype = parsemaptype(opt+8);
- else if (strcmp(opt, "map_identity") == 0) /* old style */
- ep->e_maptype = CLE_MAP_IDENT;
- else if (strcmp(opt, "map_daemon") == 0) /* old style */
- ep->e_maptype = CLE_MAP_UGIDD;
else if (strncmp(opt, "anonuid=", 8) == 0) {
char *oe;
ep->e_anonuid = strtol(opt+8, &oe, 10);
else if (strncmp(opt, "anonuid=", 8) == 0) {
char *oe;
ep->e_anonuid = strtol(opt+8, &oe, 10);
-static int
-parsemaptype(char *type)
-{
- if (!strcmp(type, "identity"))
- return CLE_MAP_IDENT;
- if (!strcmp(type, "ugidd"))
- return CLE_MAP_UGIDD;
- if (!strcmp(type, "file"))
- return CLE_MAP_FILE;
- syntaxerr("invalid map type");
- return CLE_MAP_IDENT; /* default */
-}
-
static int
getpath(char *path, int len)
{
static int
getpath(char *path, int len)
{
c = dumpopt(c, "mountpoint%s%s",
ep->e_mountpoint[0]?"=":"",
ep->e_mountpoint);
c = dumpopt(c, "mountpoint%s%s",
ep->e_mountpoint[0]?"=":"",
ep->e_mountpoint);
- if (ep->e_maptype == CLE_MAP_UGIDD)
- c = dumpopt(c, "mapping=ugidd");
- else if (ep->e_maptype == CLE_MAP_FILE)
- c = dumpopt(c, "mapping=file");
if (ep->e_anonuid != 65534)
c = dumpopt(c, "anonuid=%d", ep->e_anonuid);
if (ep->e_anongid != 65534)
if (ep->e_anonuid != 65534)
c = dumpopt(c, "anonuid=%d", ep->e_anonuid);
if (ep->e_anongid != 65534)
- if (exp->m_export.e_maptype != CLE_MAP_IDENT) {
- xlog(L_ERROR, "%s: unsupported mapping; kernel supports only 'identity' (default)",
- exp->m_export.m_path);
- return -1;
- }
-
f = fopen("/proc/net/rpc/auth.unix.ip/channel", "w");
if (!f)
return -1;
f = fopen("/proc/net/rpc/auth.unix.ip/channel", "w");
if (!f)
return -1;