[proftpd-mod-vroot] 01/01: Make module compatible to 1.3.6 API.
Hilmar Preuße
hilmar-guest at moszumanska.debian.org
Fri Mar 9 22:43:04 UTC 2018
This is an automated email from the git hooks/post-receive script.
hilmar-guest pushed a commit to branch master
in repository proftpd-mod-vroot.
commit 5814d64188365fa0ed8fcc950a5ca01b155d2da3
Author: Hilmar Preuße <hille42 at web.de>
Date: Fri Mar 9 23:42:31 2018 +0100
Make module compatible to 1.3.6 API.
---
debian/changelog | 9 +++
debian/patches/proftpd_api_1.3.6_1 | 92 +++++++++++++++++++++++++++++
debian/patches/proftpd_api_1.3.6_2 | 116 +++++++++++++++++++++++++++++++++++++
debian/patches/series | 2 +
4 files changed, 219 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 15c23b3..a5a1355 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+proftpd-mod-vroot (0.9.4-2) UNRELEASED; urgency=medium
+
+ [Hilmar Preuße]
+
+ * 2 patches from upstream to make package compatible to proftp 1.3.6.
+ (Closes: #892371)
+
+ -- Francesco Paolo Lovergine <frankie at debian.org> Fri, 09 Mar 2018 23:36:50 +0100
+
proftpd-mod-vroot (0.9.4-1) unstable; urgency=medium
[ Mahyuddin Susanto ]
diff --git a/debian/patches/proftpd_api_1.3.6_1 b/debian/patches/proftpd_api_1.3.6_1
new file mode 100644
index 0000000..ffd4425
--- /dev/null
+++ b/debian/patches/proftpd_api_1.3.6_1
@@ -0,0 +1,92 @@
+From 8e25cca6cbd04c8c3816e1d426621a215fcea55b Mon Sep 17 00:00:00 2001
+From: TJ Saunders <tj at castaglia.org>
+Date: Tue, 8 Sep 2015 13:25:52 -0700
+Subject: [PATCH] Fix compiling with the latest proftpd source, which uses void
+ * pointers rather than char * pointers in cmd_recs.
+
+---
+ mod_vroot.c | 31 ++++++++++++++++---------------
+ 1 file changed, 16 insertions(+), 15 deletions(-)
+
+diff --git a/mod_vroot.c b/mod_vroot.c
+index b0ce59a..f99a7bf 100644
+--- a/mod_vroot.c
++++ b/mod_vroot.c
+@@ -2,7 +2,7 @@
+ * ProFTPD: mod_vroot -- a module implementing a virtual chroot capability
+ * via the FSIO API
+ *
+- * Copyright (c) 2002-2014 TJ Saunders
++ * Copyright (c) 2002-2015 TJ Saunders
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+@@ -25,8 +25,6 @@
+ *
+ * This is mod_vroot, contrib software for proftpd 1.2 and above.
+ * For more information contact TJ Saunders <tj at castaglia.org>.
+- *
+- * $Id: mod_vroot.c,v 1.24 2011/01/11 02:41:10 tj Exp tj $
+ */
+
+ #include "conf.h"
+@@ -35,8 +33,8 @@
+ #define MOD_VROOT_VERSION "mod_vroot/0.9.4"
+
+ /* Make sure the version of proftpd is as necessary. */
+-#if PROFTPD_VERSION_NUMBER < 0x0001030406
+-# error "ProFTPD 1.3.4b or later required"
++#if PROFTPD_VERSION_NUMBER < 0x0001030602
++# error "ProFTPD 1.3.6rc2 or later required"
+ #endif
+
+ static const char *vroot_log = NULL;
+@@ -1490,22 +1488,25 @@ MODRET set_vrootoptions(cmd_rec *cmd) {
+ MODRET set_vrootserverroot(cmd_rec *cmd) {
+ struct stat st;
+ config_rec *c;
++ char *path;
+ size_t pathlen;
+
+ CHECK_ARGS(cmd, 1);
+ CHECK_CONF(cmd, CONF_ROOT|CONF_VIRTUAL|CONF_GLOBAL);
+
+- if (pr_fs_valid_path(cmd->argv[1]) < 0)
++ path = cmd->argv[1];
++
++ if (pr_fs_valid_path(path) < 0)
+ CONF_ERROR(cmd, "must be an absolute path");
+
+- if (stat(cmd->argv[1], &st) < 0) {
+- CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "error checking '", cmd->argv[1],
+- "': ", strerror(errno), NULL));
++ if (stat(path, &st) < 0) {
++ CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "error checking '", path, "': ",
++ strerror(errno), NULL));
+ }
+
+ if (!S_ISDIR(st.st_mode)) {
+- CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "'", cmd->argv[1],
+- "' is not a directory", NULL));
++ CONF_ERROR(cmd, pstrcat(cmd->tmp_pool, "'", path, "' is not a directory",
++ NULL));
+ }
+
+ c = add_config_param(cmd->argv[0], 1, NULL);
+@@ -1514,12 +1515,12 @@ MODRET set_vrootserverroot(cmd_rec *cmd) {
+ * This is important.
+ */
+
+- pathlen = strlen(cmd->argv[1]);
+- if (cmd->argv[1][pathlen - 1] != '/') {
+- c->argv[0] = pstrcat(c->pool, cmd->argv[1], "/", NULL);
++ pathlen = strlen(path);
++ if (path[pathlen - 1] != '/') {
++ c->argv[0] = pstrcat(c->pool, path, "/", NULL);
+
+ } else {
+- c->argv[0] = pstrdup(c->pool, cmd->argv[1]);
++ c->argv[0] = pstrdup(c->pool, path);
+ }
+
+ return PR_HANDLED(cmd);
diff --git a/debian/patches/proftpd_api_1.3.6_2 b/debian/patches/proftpd_api_1.3.6_2
new file mode 100644
index 0000000..861736f
--- /dev/null
+++ b/debian/patches/proftpd_api_1.3.6_2
@@ -0,0 +1,116 @@
+From 4f46aacece981c3987f46557eec7501e9c6b2581 Mon Sep 17 00:00:00 2001
+From: TJ Saunders <tj at castaglia.org>
+Date: Tue, 10 May 2016 11:06:14 -0700
+Subject: [PATCH] Update mod_vroot for the API changes in the latest ProFTPD.
+
+---
+ mod_vroot.c | 28 +++++++++++++++-------------
+ 1 file changed, 15 insertions(+), 13 deletions(-)
+
+Index: proftpd-mod-vroot/mod_vroot.c
+===================================================================
+--- proftpd-mod-vroot.orig/mod_vroot.c 2018-03-09 23:33:10.000000000 +0100
++++ proftpd-mod-vroot/mod_vroot.c 2018-03-09 23:33:10.000000000 +0100
+@@ -23,7 +23,7 @@
+ * resulting executable, without including the source code for OpenSSL in the
+ * source distribution.
+ *
+- * This is mod_vroot, contrib software for proftpd 1.2 and above.
++ * This is mod_vroot, contrib software for proftpd 1.3.x and above.
+ * For more information contact TJ Saunders <tj at castaglia.org>.
+ */
+
+@@ -40,7 +40,6 @@
+ static const char *vroot_log = NULL;
+ static int vroot_logfd = -1;
+
+-static char vroot_cwd[PR_TUNABLE_PATH_MAX + 1];
+ static char vroot_base[PR_TUNABLE_PATH_MAX + 1];
+ static size_t vroot_baselen = 0;
+ static unsigned char vroot_engine = FALSE;
+@@ -336,7 +335,8 @@
+ if (!(flags & VROOT_LOOKUP_FL_NO_ALIASES)) {
+ /* Check to see if this path is an alias; if so, return the real path. */
+ if (vroot_aliastab != NULL) {
+- char *start_ptr = NULL, *end_ptr = NULL, *src_path = NULL;
++ char *start_ptr = NULL, *end_ptr = NULL;
++ const char *src_path = NULL;
+
+ /* buf is used here for storing the "suffix", to be appended later when
+ * aliases are found.
+@@ -426,8 +426,9 @@
+ tmp_pool = make_sub_pool(session.pool);
+
+ c = find_config(main_server->conf, CONF_PARAM, "VRootAlias", FALSE);
+- while (c) {
+- char src_path[PR_TUNABLE_PATH_MAX+1], dst_path[PR_TUNABLE_PATH_MAX+1], *ptr;
++ while (c != NULL) {
++ char src_path[PR_TUNABLE_PATH_MAX+1], dst_path[PR_TUNABLE_PATH_MAX+1];
++ const char *ptr;
+
+ pr_signals_handle();
+
+@@ -656,6 +657,7 @@
+ return res;
+ }
+
++#if PROFTPD_VERSION_NUMBER < 0x0001030603
+ static int vroot_creat(pr_fh_t *fh, const char *path, mode_t mode) {
+ int res;
+ char vpath[PR_TUNABLE_PATH_MAX + 1];
+@@ -677,6 +679,7 @@
+ res = creat(vpath, mode);
+ return res;
+ }
++#endif /* ProFTPD 1.3.6rc2 or earlier */
+
+ static int vroot_link(pr_fs_t *fs, const char *path1, const char *path2) {
+ int res;
+@@ -955,7 +958,7 @@
+ }
+
+ vroot_baselen = strlen(vroot_base);
+- if (vroot_baselen >= sizeof(vroot_cwd)) {
++ if (vroot_baselen >= PR_TUNABLE_PATH_MAX) {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
+@@ -1067,7 +1070,7 @@
+ static int vroot_dir_idx = -1;
+
+ static int vroot_alias_dirscan(const void *key_data, size_t key_datasz,
+- void *value_data, size_t value_datasz, void *user_data) {
++ const void *value_data, size_t value_datasz, void *user_data) {
+ const char *alias_path = NULL, *dir_path = NULL, *real_path = NULL;
+ char *ptr = NULL;
+ size_t dir_pathlen;
+@@ -1530,8 +1533,7 @@
+ */
+
+ MODRET vroot_log_retr(cmd_rec *cmd) {
+- const char *key;
+- char *path;
++ const char *key, *path;
+
+ if (vroot_engine == FALSE ||
+ session.chroot_path == NULL) {
+@@ -1559,8 +1561,7 @@
+ }
+
+ MODRET vroot_log_stor(cmd_rec *cmd) {
+- const char *key;
+- char *path;
++ const char *key, *path;
+
+ if (vroot_engine == FALSE ||
+ session.chroot_path == NULL) {
+@@ -1649,7 +1650,9 @@
+ fs->rename = vroot_rename;
+ fs->unlink = vroot_unlink;
+ fs->open = vroot_open;
++#if PROFTPD_VERSION_NUMBER < 0x0001030603
+ fs->creat = vroot_creat;
++#endif /* ProFTPD 1.3.6rc2 or earlier */
+ fs->link = vroot_link;
+ fs->readlink = vroot_readlink;
+ fs->symlink = vroot_symlink;
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..c7785b2
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+proftpd_api_1.3.6_1
+proftpd_api_1.3.6_2
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-proftpd/proftpd-mod-vroot.git
More information about the Pkg-proftpd-maintainers
mailing list