[Pvfs2-cvs] commit by nlmills in pvfs2/src/apps/admin: pvfs2-gencred.c pvfs2-migrate-collection.c

CVS commit program cvs at parl.clemson.edu
Tue Jun 8 11:55:07 EDT 2010


Update of /projects/cvsroot/pvfs2/src/apps/admin
In directory parlweb1:/tmp/cvs-serv8308/src/apps/admin

Modified Files:
      Tag: cu-security-branch
	pvfs2-gencred.c pvfs2-migrate-collection.c 
Log Message:
more work to allow robust security to be disabled


Index: pvfs2-gencred.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/Attic/pvfs2-gencred.c,v
diff -p -u -r1.1.2.4 -r1.1.2.5
--- pvfs2-gencred.c	2 Jun 2010 18:50:49 -0000	1.1.2.4
+++ pvfs2-gencred.c	8 Jun 2010 15:55:07 -0000	1.1.2.5
@@ -17,9 +17,11 @@
 #include <grp.h>
 #include <unistd.h>
 
+#ifdef ENABLE_SECURITY
 #include <openssl/err.h>
 #include <openssl/evp.h>
 #include <openssl/pem.h>
+#endif
 
 #define __PINT_REQPROTO_ENCODE_FUNCS_C
 #include "pvfs2-types.h"
@@ -131,6 +133,8 @@ static int create_credential(const struc
     return EXIT_SUCCESS;
 }
 
+#ifdef ENABLE_SECURITY
+
 static int sign_credential(PVFS_credential *cred, time_t timeout,
     const char *keypath)
 {
@@ -221,6 +225,20 @@ static int sign_credential(PVFS_credenti
     return EXIT_SUCCESS;
 }
 
+#else /* !ENABLE_SECURITY */
+
+static int sign_credential(PVFS_credential *cred, time_t timeout,
+    const char *keypath)
+{
+    cred->timeout = (PVFS_time)(time(NULL) + timeout);
+    cred->sig_size = 0;
+    cred->signature = NULL;
+
+    return 0;
+}
+
+#endif /* ENABLE_SECURITY */
+
 static int write_credential(const PVFS_credential *cred, 
     const struct passwd *pwd)
 {
@@ -260,8 +278,10 @@ int main(int argc, char **argv)
         return ret;
     }
     
+#ifdef ENABLE_SECURITY
     OpenSSL_add_all_algorithms();
     ERR_load_crypto_strings();
+#endif
     
     pwd = opts.user ? getpwnam(opts.user) : getpwuid(getuid());
     if (pwd == NULL)

Index: pvfs2-migrate-collection.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/admin/pvfs2-migrate-collection.c,v
diff -p -u -r1.20.8.2 -r1.20.8.3
--- pvfs2-migrate-collection.c	25 Aug 2009 17:55:48 -0000	1.20.8.2
+++ pvfs2-migrate-collection.c	8 Jun 2010 15:55:07 -0000	1.20.8.3
@@ -173,6 +173,7 @@ int main(int argc, char **argv)
         server_alias = PINT_util_guess_alias();
     }
 
+    memset(&server_config, 0, sizeof(server_config));
     ret = PINT_parse_config(&server_config, opts.fs_conf, server_alias);
     if(ret < 0)
     {



More information about the Pvfs2-cvs mailing list