Blob Blame History Raw
From 4328fd5142d0f981687a484f4be34333432d27d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com>
Date: Wed, 7 Feb 2018 15:05:25 +0100
Subject: [PATCH 2/2] Complain when both options and config file are given on
 cmdline

---
 src/ftpd.c              | 3 +++
 src/messages_cs_cz.h    | 1 +
 src/messages_da.h       | 1 +
 src/messages_de.h       | 1 +
 src/messages_en.h       | 1 +
 src/messages_es.h       | 1 +
 src/messages_fr.h       | 1 +
 src/messages_fr_funny.h | 1 +
 src/messages_hu.h       | 1 +
 src/messages_it.h       | 1 +
 src/messages_kr.h       | 1 +
 src/messages_nl.h       | 1 +
 src/messages_no.h       | 1 +
 src/messages_pl.h       | 1 +
 src/messages_pt_br.h    | 1 +
 src/messages_ro.h       | 1 +
 src/messages_ru.h       | 1 +
 src/messages_sk.h       | 1 +
 src/messages_sv.h       | 1 +
 src/messages_tr.h       | 1 +
 src/messages_zh_cn.h    | 1 +
 src/messages_zh_tw.h    | 1 +
 22 files changed, 24 insertions(+)

diff --git a/src/ftpd.c b/src/ftpd.c
index 5c77410..3f474d2 100644
--- a/src/ftpd.c
+++ b/src/ftpd.c
@@ -6195,6 +6195,9 @@ int pureftpd_start(int argc, char *argv[], const char *home_directory_)
             die(421, LOG_ERR, MSG_ILLEGAL_OPTION);
         }
     }
+    if (optind < argc) {
+        die(421, LOG_ERR, MSG_INVALID_ARGUMENT, argv[optind]);
+    }
 #ifdef WITH_RFC2640
     if (charset_fs == NULL) {
         charset_fs = (char *) "utf-8";
diff --git a/src/messages_cs_cz.h b/src/messages_cs_cz.h
index ef225ba..e103b37 100644
--- a/src/messages_cs_cz.h
+++ b/src/messages_cs_cz.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Neplatn´┐Ż argument: \"%s\""
diff --git a/src/messages_da.h b/src/messages_da.h
index ed6f77c..c79ad5a 100644
--- a/src/messages_da.h
+++ b/src/messages_da.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_de.h b/src/messages_de.h
index e7ae9a9..cd6bc08 100644
--- a/src/messages_de.h
+++ b/src/messages_de.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_en.h b/src/messages_en.h
index e980131..cb9abf3 100644
--- a/src/messages_en.h
+++ b/src/messages_en.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_es.h b/src/messages_es.h
index 0c27d4f..60ed849 100644
--- a/src/messages_es.h
+++ b/src/messages_es.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_fr.h b/src/messages_fr.h
index 7f41dae..a012c05 100644
--- a/src/messages_fr.h
+++ b/src/messages_fr.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT doit etre precede d'une commande PBSZ reussie"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP n'a pas retourne d'attribut userPassword, verifiez les droits d'acces LDAP."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Methode LDAPAuthMethod invalide dans le fichier de configuration. Ce doit etre 'bind' ou 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_fr_funny.h b/src/messages_fr_funny.h
index c77e5bc..dff760b 100644
--- a/src/messages_fr_funny.h
+++ b/src/messages_fr_funny.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT ca marche qu'apres un PBSZ reussi"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP n'a pas retourne d'attribut userPassword, ptet que les droits d'acces LDAP chient."
 #define MSG_LDAP_INVALID_AUTH_METHOD "LDAPAuthMethod dans le fichier de conf, ca doit etre 'bind' ou 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_hu.h b/src/messages_hu.h
index b3beead..7c5a101 100644
--- a/src/messages_hu.h
+++ b/src/messages_hu.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_it.h b/src/messages_it.h
index 4e6e984..e30f517 100644
--- a/src/messages_it.h
+++ b/src/messages_it.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_kr.h b/src/messages_kr.h
index 14d8300..c9faead 100644
--- a/src/messages_kr.h
+++ b/src/messages_kr.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_nl.h b/src/messages_nl.h
index 77efbb4..5a60d9e 100644
--- a/src/messages_nl.h
+++ b/src/messages_nl.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "Geen userPassword attribuut aangetroffen. Controleer de toegangsrechten."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Onjuiste LDAPAuthMethod in de configuratie. Moet 'bind' of 'password' zijn."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_no.h b/src/messages_no.h
index f0be1b4..4c84405 100644
--- a/src/messages_no.h
+++ b/src/messages_no.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_pl.h b/src/messages_pl.h
index c0be4d8..89d5af1 100644
--- a/src/messages_pl.h
+++ b/src/messages_pl.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_pt_br.h b/src/messages_pt_br.h
index e5557b9..1dcfb64 100644
--- a/src/messages_pt_br.h
+++ b/src/messages_pt_br.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_ro.h b/src/messages_ro.h
index 7bbcefe..da16a49 100644
--- a/src/messages_ro.h
+++ b/src/messages_ro.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_ru.h b/src/messages_ru.h
index e0c1842..f0e4031 100644
--- a/src/messages_ru.h
+++ b/src/messages_ru.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_sk.h b/src/messages_sk.h
index 24eca1b..e0ddd2a 100644
--- a/src/messages_sk.h
+++ b/src/messages_sk.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_sv.h b/src/messages_sv.h
index b55c474..be4bbc1 100644
--- a/src/messages_sv.h
+++ b/src/messages_sv.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_tr.h b/src/messages_tr.h
index 7d6db57..3ee84d2 100644
--- a/src/messages_tr.h
+++ b/src/messages_tr.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_zh_cn.h b/src/messages_zh_cn.h
index a8bfc6c..93844fd 100644
--- a/src/messages_zh_cn.h
+++ b/src/messages_zh_cn.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
diff --git a/src/messages_zh_tw.h b/src/messages_zh_tw.h
index db99719..05581bb 100644
--- a/src/messages_zh_tw.h
+++ b/src/messages_zh_tw.h
@@ -227,3 +227,4 @@
 #define MSG_PROT_BEFORE_PBSZ "PROT must be preceded by a successful PBSZ command"
 #define MSG_WARN_LDAP_USERPASS_EMPTY "LDAP returned no userPassword attribute, check LDAP access rights."
 #define MSG_LDAP_INVALID_AUTH_METHOD "Invalid LDAPAuthMethod in the configuration file. Should be 'bind' or 'password'."
+#define MSG_INVALID_ARGUMENT "Invalid argument: \"%s\""
-- 
2.14.3