Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / sec / sec.c
index f7e832d..40f892a 100644 (file)
@@ -419,7 +419,8 @@ static struct ptlrpc_cred *get_cred(struct ptlrpc_sec *sec)
 
         LASSERT(sec);
 
-        if (sec->ps_flags & (PTLRPC_SEC_FL_MDS | PTLRPC_SEC_FL_REVERSE)) {
+        if (sec->ps_flags &
+            (PTLRPC_SEC_FL_MDS | PTLRPC_SEC_FL_OSS | PTLRPC_SEC_FL_REVERSE)) {
                 vcred.vc_pag = 0;
                 vcred.vc_uid = 0;
         } else {
@@ -1036,10 +1037,9 @@ int ptlrpcs_import_get_sec(struct obd_import *imp)
                 RETURN(0);
 
         /* find actual flavor for client obd. right now server side
-         * obd (reverse imp, etc) will simply use NULL.
-         */
-        if (!strcmp(imp->imp_obd->obd_type->typ_name, "mdc") ||
-            !strcmp(imp->imp_obd->obd_type->typ_name, "osc")) {
+         * obd (reverse imp, etc) will simply use NULL. */
+        if (!strcmp(imp->imp_obd->obd_type->typ_name, OBD_MDC_DEVICENAME) ||
+            !strcmp(imp->imp_obd->obd_type->typ_name, OBD_OSC_DEVICENAME)) {
                 struct client_obd *cli = &imp->imp_obd->u.cli;
 
                 switch (SEC_FLAVOR_MAJOR(cli->cl_sec_flavor)) {
@@ -1057,7 +1057,8 @@ int ptlrpcs_import_get_sec(struct obd_import *imp)
                         pipedir = imp->imp_obd->obd_name;
                         break;
                 default:
-                        CWARN("unknown security flavor for %s(%s), use null\n",
+                        CWARN("unknown security flavor for %s(%s), "
+                              "use null\n",
                               imp->imp_obd->obd_type->typ_name,
                               imp->imp_obd->obd_name);
                 }
@@ -1112,12 +1113,13 @@ int __init ptlrpc_sec_init(void)
         return 0;
 }
 
+#if defined __KERNEL__ && defined ENABLE_GSS
 static void __exit ptlrpc_sec_exit(void)
 {
         svcsec_null_exit();
         ptlrpcs_null_exit();
 }
-
+#endif
 
 EXPORT_SYMBOL(ptlrpcs_register);
 EXPORT_SYMBOL(ptlrpcs_unregister);