#include <ctype.h>
#include <linux/lnet/nidstr.h>
#include <linux/lnet/lnetctl.h>
-#include <linux/lustre/lustre_param.h>
+#include <linux/lustre/lustre_user.h>
#include <linux/lustre/lustre_ver.h>
#include "mount_utils.h"
ldd->ldd_flags &= ~LDD_F_NEED_INDEX;
break;
}
- case 'L':
+ case 'L': {
+ const char *tmp;
+ size_t len;
+
+ len = strlen(optarg);
+ if (len < 1 || len > LUSTRE_MAXFSNAME) {
+ fprintf(stderr, "%s: filesystem name must be "
+ "1-%d chars\n", progname, LUSTRE_MAXFSNAME);
+ return 1;
+ }
+
+ for (tmp = optarg; *tmp != '\0'; ++tmp) {
+ if (isalnum(*tmp) || *tmp == '_' || *tmp == '-')
+ continue;
+ else
+ break;
+ }
+ if (*tmp != '\0') {
+ fprintf(stderr, "%s: char '%c' not allowed in "
+ "filesystem name\n", progname, *tmp);
+ return 1;
+ }
strscpy(new_fsname, optarg, sizeof(new_fsname));
break;
+ }
case 'm': {
char *nids = convert_hostnames(optarg);