]> git.pld-linux.org Git - packages/pure-ftpd.git/commitdiff
- rel 2; upstream pureftpd ignores config file if cmd line options are passed which... auto/th/pure-ftpd-1.0.46-2
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 16 Oct 2017 09:32:44 +0000 (11:32 +0200)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 16 Oct 2017 09:32:44 +0000 (11:32 +0200)
0003-Allow-having-both-options-and-config-file-on-command.patch [new file with mode: 0644]
pure-ftpd.spec

diff --git a/0003-Allow-having-both-options-and-config-file-on-command.patch b/0003-Allow-having-both-options-and-config-file-on-command.patch
new file mode 100644 (file)
index 0000000..7eb99b2
--- /dev/null
@@ -0,0 +1,68 @@
+From f5617a4de54c313580fe39562f0d32e5c95f5212 Mon Sep 17 00:00:00 2001
+From: rpm-build <rpm-build>
+Date: Thu, 14 Sep 2017 01:05:53 +0200
+Subject: [PATCH] Allow having both options and config file on command line
+
+---
+ src/ftpd.c       |  2 +-
+ src/simpleconf.c | 23 +++++++++++++++++++++--
+ 2 files changed, 22 insertions(+), 3 deletions(-)
+
+diff --git a/src/ftpd.c b/src/ftpd.c
+index c5edac5..b13afc0 100644
+--- a/src/ftpd.c
++++ b/src/ftpd.c
+@@ -5589,7 +5589,7 @@ int pureftpd_start(int argc, char *argv[], const char *home_directory_)
+ #endif
+ #ifndef MINIMAL
+-    if (argc == 2 && *argv[1] != '-' &&
++    if (argc >= 2 && *argv[1] != '-' &&
+         sc_build_command_line_from_file(argv[1], NULL, simpleconf_options,
+                                         (sizeof simpleconf_options) /
+                                         (sizeof simpleconf_options[0]),
+diff --git a/src/simpleconf.c b/src/simpleconf.c
+index f296f54..505aee1 100644
+--- a/src/simpleconf.c
++++ b/src/simpleconf.c
+@@ -674,9 +674,10 @@ sc_build_command_line_from_file(const char *file_name,
+ {
+     char **argv = NULL;
+     int    argc = 0;
++    char **argv_tmp = NULL;
++    char *arg = NULL;
++    int i;
+-    *argc_p = 0;
+-    *argv_p = NULL;
+     if ((argv = malloc(sizeof *argv)) == NULL ||
+         (app_name = strdup(app_name)) == NULL) {
+         sc_argv_free(argc, argv);
+@@ -689,6 +690,24 @@ sc_build_command_line_from_file(const char *file_name,
+         sc_argv_free(argc, argv);
+         return -1;
+     }
++
++    for (i = 2; i < *argc_p; ++i) {
++        ++argc;
++        arg = strdup((*argv_p)[i]);
++        if (arg == NULL) {
++            return -1;
++        }
++        if ((argv_tmp = realloc(argv, (sizeof arg) *
++            ((size_t) argc + 1))) == NULL) {
++            return -1;
++        }
++        argv = argv_tmp;
++        argv[argc - 1] = arg;
++    }
++    if (*argc_p > 2) {
++        argv[argc] = NULL;
++    }
++
+     *argc_p = argc;
+     *argv_p = argv;
+-- 
+2.9.5
+
index 4e040801ddfed5b76f6c2910bf106769e3d4696c..68c47497c50cc9afc88ce6033a39e8d91b600c02 100644 (file)
@@ -9,7 +9,7 @@
 %bcond_without tls             # disable SSL/TLS support
 %bcond_without cap             # disable capabilities
 
-%define        rel     1
+%define        rel     2
 Summary:       Small, fast and secure FTP server
 Summary(pl.UTF-8):     Mały, szybki i bezpieczny serwer FTP
 Name:          pure-ftpd
@@ -30,6 +30,8 @@ Patch0:               %{name}-config.patch
 Patch1:                %{name}-allauth.patch
 Patch2:                %{name}-pure-pw_passwd.patch
 Patch3:                %{name}-mysql_config.patch
+# from Fedora
+Patch4:                0003-Allow-having-both-options-and-config-file-on-command.patch
 
 Patch7:                audit_cap.patch
 Patch8:                %{name}-apparmor.patch
@@ -108,6 +110,7 @@ Ten pakiet zawiera schemat Pure-FTPd pureftpd.schema dla openldapa.
 %patch0 -p0
 %patch1 -p1
 %patch3 -p1
+%patch4 -p1
 
 %patch7 -p1
 %patch8 -p1
This page took 0.1073 seconds and 4 git commands to generate.