Whamcloud - gitweb
LU-6245 libcfs: replace IS_PO2 with is_power_of_2 in server code
[fs/lustre-release.git] / lustre / utils / gss / gssd.c
index 6650648..004db2c 100644 (file)
@@ -9,6 +9,8 @@
   Copyright (c) 2002 Marius Aamodt Eriksen <marius@UMICH.EDU>.
   All rights reserved, all wrongs reversed.
 
+  Copyright (c) 2014, Intel Corporation.
+
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:
@@ -52,6 +54,8 @@
 #include <string.h>
 #include <signal.h>
 #include <errno.h>
+#include <libcfs/util/string.h>
+
 #include "gssd.h"
 #include "err_util.h"
 #include "gss_util.h"
@@ -192,17 +196,17 @@ main(int argc, char *argv[])
                                verbosity++;
                                break;
                        case 'p':
-                               strncpy(pipefs_dir, optarg, sizeof(pipefs_dir));
+                               strlcpy(pipefs_dir, optarg, sizeof(pipefs_dir));
                                if (pipefs_dir[sizeof(pipefs_dir)-1] != '\0')
                                        errx(1, "pipefs path name too long");
                                break;
                        case 'k':
-                               strncpy(keytabfile, optarg, sizeof(keytabfile));
+                               strlcpy(keytabfile, optarg, sizeof(keytabfile));
                                if (keytabfile[sizeof(keytabfile)-1] != '\0')
                                        errx(1, "keytab path name too long");
                                break;
                        case 'd':
-                               strncpy(ccachedir, optarg, sizeof(ccachedir));
+                               strlcpy(ccachedir, optarg, sizeof(ccachedir));
                                if (ccachedir[sizeof(ccachedir)-1] != '\0')
                                        errx(1, "ccachedir path name too long");
                                break;
@@ -243,11 +247,6 @@ main(int argc, char *argv[])
        signal(SIGTERM, sig_die);
        signal(SIGHUP, sig_hup);
 
-#if 0
-       /* Determine Kerberos information from the kernel */
-       gssd_obtain_kernel_krb5_info();
-#endif
-
        lgssd_init_mutexs();
 
        printerr(0, "lgssd initialized and ready to serve\n");