linux-ftpd-ssl (0.17.33+0.3-1) 560-set_default_key_and_cert.diff

Summary

 ftpd/ftpd.c |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

    
download this patch

Patch contents

Description: Set default SSL key/cert file to /etc/ftpd-ssl/ftpd.pem
Author: Ian Beckwith <ianb@debian.org>

Index: linux-ftpd-ssl/ftpd/ftpd.c
===================================================================
--- linux-ftpd-ssl.orig/ftpd/ftpd.c	2010-06-14 01:34:02.000000000 +0100
+++ linux-ftpd-ssl/ftpd/ftpd.c	2010-06-14 01:34:02.000000000 +0100
@@ -175,6 +175,7 @@
 /* for the moment this is a compile time option only --tjh */
 int ssl_encrypt_data=1;
 
+#define DEFAULT_SSL_FILE "/etc/ftpd-ssl/ftpd.pem"
 char ssl_file_path[1024];    /* don't look at that nasty value to the left */
 
 X509 *ssl_public_cert;
@@ -613,10 +614,8 @@
 	    cin=stdin;
 	    cout=stderr;
 
-	    /* do things the "default" way */
 	    if (my_ssl_cert_file==NULL) {
-		sprintf(ssl_file_path,"%s/%s",X509_get_default_cert_dir(),
-			    "ftpd.pem");
+		strcpy(ssl_file_path,DEFAULT_SSL_FILE);
 		ssl_cert_file=ssl_file_path;
 	    } else {
 	    	ssl_cert_file=my_ssl_cert_file;
@@ -689,8 +688,7 @@
                         "ftpd.cert");
 #endif
 
-            sprintf(ssl_file_path,"%s/%s",X509_get_default_cert_dir(),
-                        "ftpd.pem");
+	    strcpy(ssl_file_path,DEFAULT_SSL_FILE);
 
 	    filename=my_ssl_cert_file==NULL?ssl_file_path:my_ssl_cert_file;
 	    fp=fopen(filename,"r");
@@ -719,8 +717,7 @@
                         "ftpd.key");
 #endif
 
-            sprintf(ssl_file_path,"%s/%s",X509_get_default_cert_dir(),
-                        "ftpd.pem");
+	    strcpy(ssl_file_path,DEFAULT_SSL_FILE);
 
 	    filename=my_ssl_key_file==NULL?ssl_file_path:my_ssl_key_file;
 	    fp=fopen(filename,"r");