int type = 0;
int rc;
- if (IS_SERVER(&mop->mo_ldd)) {
- if (IS_MGS(&mop->mo_ldd))
- type |= SK_TYPE_MGS;
- if (IS_MDT(&mop->mo_ldd) || IS_OST(&mop->mo_ldd))
- type |= SK_TYPE_SERVER | SK_TYPE_CLIENT;
- } else {
- type |= SK_TYPE_CLIENT;
- }
-
/* init logging */
sk_init_logging(NULL, 1, 1);
return -errno;
}
+ if (IS_SERVER(&mop->mo_ldd)) {
+ if (IS_MGS(&mop->mo_ldd))
+ type |= SK_TYPE_MGS;
+ if (IS_MDT(&mop->mo_ldd) || IS_OST(&mop->mo_ldd))
+ type |= SK_TYPE_SERVER;
+ } else {
+ type |= SK_TYPE_CLIENT;
+ if (!S_ISREG(sbuf.st_mode)) {
+ fprintf(stderr, "Invalid shared key path, must be a "
+ "file for client mounts: %s\n", path);
+ return -EINVAL;
+ }
+ }
+
/* Load individual keys or a directory of them */
if (S_ISREG(sbuf.st_mode)) {
return sk_load_keyfile(path, type);