#include "xmalloc.h"
#include "xlog.h"
#include "xio.h"
+#include "pseudoflavors.h"
#define EXPORT_DEFAULT_FLAGS \
(NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
+struct flav_info flav_map[] = {
+ { "krb5", RPC_AUTH_GSS_KRB5 },
+ { "krb5i", RPC_AUTH_GSS_KRB5I },
+ { "krb5p", RPC_AUTH_GSS_KRB5P },
+ { "lipkey", RPC_AUTH_GSS_LKEY },
+ { "lipkey-i", RPC_AUTH_GSS_LKEYI },
+ { "lipkey-p", RPC_AUTH_GSS_LKEYP },
+ { "spkm3", RPC_AUTH_GSS_SPKM },
+ { "spkm3i", RPC_AUTH_GSS_SPKMI },
+ { "spkm3p", RPC_AUTH_GSS_SPKMP },
+ { "unix", AUTH_UNIX },
+ { "sys", AUTH_SYS },
+ { "null", AUTH_NULL },
+ { "none", AUTH_NONE },
+};
+
+const int flav_map_size = sizeof(flav_map)/sizeof(flav_map[0]);
+
int export_errno;
static char *efname = NULL;
#define NFS4_MOUNT_UNSHARED 0x8000 /* 5 */
#define NFS4_MOUNT_FLAGMASK 0xFFFF
-/* pseudoflavors: */
-
-#define RPC_AUTH_GSS_KRB5 390003
-#define RPC_AUTH_GSS_KRB5I 390004
-#define RPC_AUTH_GSS_KRB5P 390005
-#define RPC_AUTH_GSS_LKEY 390006
-#define RPC_AUTH_GSS_LKEYI 390007
-#define RPC_AUTH_GSS_LKEYP 390008
-#define RPC_AUTH_GSS_SPKM 390009
-#define RPC_AUTH_GSS_SPKMI 390010
-#define RPC_AUTH_GSS_SPKMP 390011
-
int nfs4mount(const char *, const char *, int *, char **,
char **, int);
#define nfsstat nfs_stat
#endif
+#include "pseudoflavors.h"
#include "nls.h"
#include "conn.h"
#include "xcommon.h"
#define NFS_PORT 2049
#endif
-struct {
- char *flavour;
- int fnum;
-} flav_map[] = {
- { "krb5", RPC_AUTH_GSS_KRB5 },
- { "krb5i", RPC_AUTH_GSS_KRB5I },
- { "krb5p", RPC_AUTH_GSS_KRB5P },
- { "lipkey", RPC_AUTH_GSS_LKEY },
- { "lipkey-i", RPC_AUTH_GSS_LKEYI },
- { "lipkey-p", RPC_AUTH_GSS_LKEYP },
- { "spkm3", RPC_AUTH_GSS_SPKM },
- { "spkm3i", RPC_AUTH_GSS_SPKMI },
- { "spkm3p", RPC_AUTH_GSS_SPKMP },
- { "unix", AUTH_UNIX },
- { "sys", AUTH_SYS },
- { "null", AUTH_NULL },
- { "none", AUTH_NONE },
-};
-
-#define FMAPSIZE (sizeof(flav_map)/sizeof(flav_map[0]))
#define MAX_USER_FLAVOUR 16
static int parse_sec(char *sec, int *pseudoflavour)
"exceeded\n"));
return 0;
}
- for (i = 0; i < FMAPSIZE; i++) {
+ for (i = 0; i < flav_map_size; i++) {
if (strcmp(sec, flav_map[i].flavour) == 0) {
pseudoflavour[num_flavour++] = flav_map[i].fnum;
break;
}
}
- if (i == FMAPSIZE) {
+ if (i == flav_map_size) {
fprintf(stderr,
_("mount: unknown security type %s\n"), sec);
return 0;
printf("sec = ");
for (pf_cnt = 0; pf_cnt < num_flavour; pf_cnt++) {
- for (i = 0; i < FMAPSIZE; i++) {
+ for (i = 0; i < flav_map_size; i++) {
if (flav_map[i].fnum == pseudoflavour[pf_cnt]) {
printf("%s", flav_map[i].flavour);
break;