pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/net/wu-ftpd Fix quota handling on NetBSD. If the new <...
details: https://anonhg.NetBSD.org/pkgsrc/rev/492ae83513d5
branches: trunk
changeset: 602221:492ae83513d5
user: dholland <dholland%pkgsrc.org@localhost>
date: Sun Apr 08 04:43:51 2012 +0000
description:
Fix quota handling on NetBSD. If the new <quota.h> exists, use it. If
all that exists is the 5.99 proplib quotas, disable quota support.
diffstat:
net/wu-ftpd/distinfo | 9 +-
net/wu-ftpd/patches/patch-ai | 60 ++++++-
net/wu-ftpd/patches/patch-ao | 28 +++-
net/wu-ftpd/patches/patch-ap | 246 ++++++++++++++++++++++++++++++++-
net/wu-ftpd/patches/patch-configure_in | 20 ++
5 files changed, 345 insertions(+), 18 deletions(-)
diffs (truncated from 470 to 300 lines):
diff -r 21ba52c56bf2 -r 492ae83513d5 net/wu-ftpd/distinfo
--- a/net/wu-ftpd/distinfo Sun Apr 08 04:42:47 2012 +0000
+++ b/net/wu-ftpd/distinfo Sun Apr 08 04:43:51 2012 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.17 2011/12/19 05:06:34 dholland Exp $
+$NetBSD: distinfo,v 1.18 2012/04/08 04:43:51 dholland Exp $
SHA1 (wu-ftpd/wu-ftpd-2.6.2.tar.gz) = e39112bd8a67f189b6a8da8dd81ceb00a910e271
RMD160 (wu-ftpd/wu-ftpd-2.6.2.tar.gz) = 0b7451c185f80cf9a345f97b9642853e0323e3bd
@@ -17,12 +17,13 @@
SHA1 (patch-af) = 6f9fe289ea5af19ba4c85f63109e8e47e5b21bca
SHA1 (patch-ag) = 59cc211f4770e5e447b2cd9ca7bd5ab3dc07fc3d
SHA1 (patch-ah) = a5305d6b9f8d3e1145e6951eaf37f0cdd5c98edc
-SHA1 (patch-ai) = 0f90c45b24e370fc87b2028a73b15e483b01fa54
+SHA1 (patch-ai) = c5b95222c0c82ede156b1795153a920546fec345
SHA1 (patch-aj) = 65eef2815b2364aaa243cb93ce4a99fdf2eb9f10
SHA1 (patch-ak) = 8eca121c737498106a5e829cb166746436a87237
SHA1 (patch-al) = b537901ac9e267a13247547d621215acd6595502
SHA1 (patch-am) = 1b1cdf067382fce0cb6aa5e6ff605c15414b26ff
SHA1 (patch-an) = fd1d50bd28b283df717c1ce5fe2f0d6f3eab4967
-SHA1 (patch-ao) = 4b686fce75452665d3b1729a4175b2ba917b7df0
-SHA1 (patch-ap) = 977af5a2fa79360c1a213fa097dc3d6a79a527d5
+SHA1 (patch-ao) = aa109f9d17e76207c3cae6dc33584c8b70f5092b
+SHA1 (patch-ap) = 13067ee5edade37774e406918d48adf1b63c8be2
+SHA1 (patch-configure_in) = 497232480d162f510ef4c2ad1f8cc91416724ffe
SHA1 (patch-src_logwtmp_c) = c52a7950793dfed5a474e0d09a90bfc105a6dd4a
diff -r 21ba52c56bf2 -r 492ae83513d5 net/wu-ftpd/patches/patch-ai
--- a/net/wu-ftpd/patches/patch-ai Sun Apr 08 04:42:47 2012 +0000
+++ b/net/wu-ftpd/patches/patch-ai Sun Apr 08 04:43:51 2012 +0000
@@ -1,6 +1,15 @@
-$NetBSD: patch-ai,v 1.10 2006/09/22 19:44:01 joerg Exp $
+$NetBSD: patch-ai,v 1.11 2012/04/08 04:43:51 dholland Exp $
---- src/ftpd.c.orig 2006-09-22 21:01:34.000000000 +0000
+- support netbsd-6 libquota
+- avoid build failure on netbsd 5.99 proplib quotas
+- support dragonfly quotas
+- support 4.4BSD quotas
+- don't declare own errno
+- prune remote hostnames longer than UT_HOSTSIZE from utmp.h
+- use va_list correctly
+- use snprintf
+
+--- src/ftpd.c.orig 2012-04-08 04:32:17.000000000 +0000
+++ src/ftpd.c
@@ -75,6 +75,7 @@
#include <grp.h>
@@ -10,7 +19,15 @@
#define VA_LOCAL_DECL va_list ap;
#define VA_START(f) va_start(ap, f)
-@@ -85,9 +86,17 @@
+@@ -82,12 +83,29 @@
+
+ #include "proto.h"
+
++#ifdef HAVE_QUOTA_H
++#define HAVE_NETBSD_LIBQUOTA
++#include <quota.h>
++#endif
++
#ifdef HAVE_UFS_QUOTA_H
#include <ufs/quota.h>
#endif
@@ -24,11 +41,15 @@
#endif
+#ifdef HAVE_UFS_UFS_QUOTA_H
+#include <ufs/ufs/quota.h>
++#ifdef UFS_QUOTA_ENTRY_NAMES
++/* netbsd 5.99 proplib quota interface (march 2011-january 2012) - punt */
++#undef QUOTA
++#endif
+#endif
#ifdef HAVE_SYS_SYSLOG_H
#include <sys/syslog.h>
-@@ -214,7 +223,6 @@ int Send(FILE *sockfp, char *format,...)
+@@ -214,7 +232,6 @@ int Send(FILE *sockfp, char *format,...)
/* File containing login names NOT to be used on this machine. Commonly used
* to disallow uucp. */
@@ -36,7 +57,18 @@
extern int pidfd;
extern char *ctime(const time_t *);
-@@ -2370,7 +2378,8 @@ void end_login(void)
+@@ -254,8 +271,10 @@ extern int virtual_ftpaccess;
+ #endif
+
+ #ifdef QUOTA
++#ifndef HAVE_NETBSD_LIBQUOTA
+ extern struct dqblk quota;
+ #endif
++#endif
+
+ int data;
+ jmp_buf errcatch;
+@@ -2370,7 +2389,8 @@ void end_login(void)
(void) seteuid((uid_t) 0);
if (logged_in)
if (wtmp_logging)
@@ -46,7 +78,7 @@
pw = NULL;
#ifdef AFS_AUTH
ktc_ForgetAllTokens();
-@@ -2869,7 +2878,8 @@ void pass(char *passwd)
+@@ -2869,14 +2889,18 @@ void pass(char *passwd)
#ifdef DEBUG
syslog(LOG_DEBUG, "about to call wtmp");
#endif
@@ -56,7 +88,17 @@
}
logged_in = 1;
-@@ -5459,7 +5469,9 @@ void reply(int n, char *fmt,...)
+ expand_id();
+
+ #ifdef QUOTA
++#ifndef HAVE_NETBSD_LIBQUOTA
++ /* the code for the libquota case clears the quotas for us on failure */
+ memset("a, 0, sizeof(quota));
++#endif
+ get_quota(pw->pw_dir, pw->pw_uid);
+ #endif
+
+@@ -5459,7 +5483,9 @@ void reply(int n, char *fmt,...)
*p = '\0';
/* send a line...(note that this overrides dolreplies!) */
@@ -66,7 +108,7 @@
if (p)
ptr = p + 1; /* set to the next line... (\0 is handled in the while) */
-@@ -6083,6 +6095,8 @@ void dologout(int status)
+@@ -6083,6 +6109,8 @@ void dologout(int status)
(void) seteuid((uid_t) 0);
if (wtmp_logging)
wu_logwtmp(ttyline, pw->pw_name, remotehost, 0);
@@ -75,7 +117,7 @@
}
if (logging)
syslog(LOG_INFO, "FTP session closed");
-@@ -7378,7 +7392,7 @@ int SockPrintf(FILE *sockfp, char *forma
+@@ -7378,7 +7406,7 @@ int SockPrintf(FILE *sockfp, char *forma
char buf[32768];
va_start(ap, format);
diff -r 21ba52c56bf2 -r 492ae83513d5 net/wu-ftpd/patches/patch-ao
--- a/net/wu-ftpd/patches/patch-ao Sun Apr 08 04:42:47 2012 +0000
+++ b/net/wu-ftpd/patches/patch-ao Sun Apr 08 04:43:51 2012 +0000
@@ -1,7 +1,31 @@
-$NetBSD: patch-ao,v 1.1 2006/09/22 19:44:01 joerg Exp $
+$NetBSD: patch-ao,v 1.2 2012/04/08 04:43:51 dholland Exp $
+
+- support netbsd-6 libquota API
+- support dragonfly quotas
+
+caution: the dragonfly patch isn't in the configure.in patch; don't regen
+this patch without thinking.
---- configure.orig 2006-09-22 21:18:19.000000000 +0000
+--- configure.orig 2001-11-29 23:54:27.000000000 +0000
+++ configure
+@@ -5223,7 +5223,7 @@ EOF
+ fi
+ if test $quota != no; then
+
+-for ac_header in sys/quota.h sys/fs/ufs_quota.h ufs/quota.h jfs/quota.h ufs/ufs/quota.h linux/quota.h
++for ac_header in quota.h sys/quota.h sys/fs/ufs_quota.h ufs/quota.h jfs/quota.h ufs/ufs/quota.h linux/quota.h
+ do
+ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ echo "$as_me:5229: checking for $ac_header" >&5
+@@ -5271,7 +5271,7 @@ EOF
+ fi
+ done
+
+- if test $ac_cv_header_sys_quota.h = yes -o $ac_cv_header_sys_fs_ufs_quota_h = yes -o $ac_cv_header_ufs_quota_h = yes -o $ac_cv_header_jfs_quota_h = yes -o $ac_cv_header_ufs_ufs_quota_h = yes
-o $ac_cv_header_linux_quota_h = yes; then
++ if test $ac_cv_header_quota.h = yes -o $ac_cv_header_sys_quota.h = yes -o $ac_cv_header_sys_fs_ufs_quota_h = yes -o $ac_cv_header_ufs_quota_h = yes -o $ac_cv_header_jfs_quota_h = yes -o
$ac_cv_header_ufs_ufs_quota_h = yes -o $ac_cv_header_linux_quota_h = yes; then
+ quota=yes
+ else
+ if test $quota = yes; then
@@ -5333,6 +5333,12 @@ echo $ECHO_N "checking whether quota sup
#ifdef HAVE_UFS_UFS_QUOTA_H
#include <ufs/ufs/quota.h>
diff -r 21ba52c56bf2 -r 492ae83513d5 net/wu-ftpd/patches/patch-ap
--- a/net/wu-ftpd/patches/patch-ap Sun Apr 08 04:42:47 2012 +0000
+++ b/net/wu-ftpd/patches/patch-ap Sun Apr 08 04:43:51 2012 +0000
@@ -1,11 +1,31 @@
-$NetBSD: patch-ap,v 1.1 2006/09/22 19:44:01 joerg Exp $
+$NetBSD: patch-ap,v 1.2 2012/04/08 04:43:51 dholland Exp $
+
+- support netbsd-6 libquota API
+- avoid build failure on netbsd 5.99 proplib quotas
+- support dragonfly quotas
---- src/extensions.c.orig 2006-09-22 21:22:18.000000000 +0000
+--- src/extensions.c.orig 2000-07-01 18:17:38.000000000 +0000
+++ src/extensions.c
-@@ -67,6 +67,10 @@
+@@ -55,7 +55,9 @@
+ #include <sys/file.h>
+ #include <sys/param.h>
+
+-#ifdef HAVE_SYS_FS_UFS_QUOTA_H
++#if defined(HAVE_QUOTA_H)
++#include <quota.h>
++#elif defined(HAVE_SYS_FS_UFS_QUOTA_H)
+ #include <sys/fs/ufs_quota.h>
+ #elif defined(HAVE_UFS_UFS_QUOTA_H)
+ #include <ufs/ufs/quota.h>
+@@ -67,6 +69,15 @@
#include <sys/mnttab.h>
#endif
++#ifdef HAVE_QUOTA_H
++/* NetBSD quota_open() API and library */
++#define HAVE_NETBSD_LIBQUOTA
++#endif
++
+#if defined(__DragonFly__) && __DragonFly_version >= 160000
+#define dqblk ufs_dqblk
+#endif
@@ -13,3 +33,223 @@
#if defined(HAVE_STATVFS)
#include <sys/statvfs.h>
#elif defined(HAVE_SYS_VFS)
+@@ -91,8 +102,17 @@
+ #include "support/ftw.h"
+ #endif
+
++#if defined(HAVE_UFS_UFS_QUOTA_H) && defined(UFS_QUOTA_ENTRY_NAMES)
++/* netbsd 5.99 proplib quota interface (march 2011-january 2012) - punt */
++#undef QUOTA
++#endif
++
+ #ifdef QUOTA
++#ifdef HAVE_NETBSD_LIBQUOTA
++struct quotaval quota_blocks, quota_files;
++#else
+ struct dqblk quota;
++#endif
+ char *time_quota(long curstate, long softlimit, long timelimit, char *timeleft);
+ #endif
+
+@@ -252,6 +272,11 @@ void msg_massage(const char *inbuf, char
+ char *outptr = outbuf;
+ #ifdef QUOTA
+ char timeleft[80];
++#ifdef HAVE_NETBSD_LIBQUOTA
++ uint64_t quotaval;
++#else
++ long quotaval;
++#endif
+ #endif
+ char buffer[MAXPATHLEN];
+ time_t curtime;
+@@ -372,67 +397,101 @@ void msg_massage(const char *inbuf, char
+
+ #ifdef QUOTA
+ case 'B':
++#ifdef HAVE_NETBSD_LIBQUOTA
++ quotaval = quota_blocks.qv_hardlimit;
++#else
++ quotaval = quota.dqb_bhardlimit;
++#endif
+ #ifdef QUOTA_BLOCKS /* 1024-blocks instead of 512-blocks */
+ snprintf(outptr, outlen, "%ld", quota.dqb_bhardlimit % 2 ?
+- (long) (quota.dqb_bhardlimit / 2 + 1) : (long) (quota.dqb_bhardlimit / 2));
++ (quotaval / 2 + 1) : (quotaval / 2));
+ #else
+- snprintf(outptr, outlen, "%ld", (long) quota.dqb_bhardlimit);
++ snprintf(outptr, outlen, "%ld", quotaval);
+ #endif
+ break;
+
+ case 'b':
++#ifdef HAVE_NETBSD_LIBQUOTA
++ quotaval = quota_blocks.qv_softlimit;
++#else
++ quotaval = quota.dqb_bsoftlimit;
++#endif
+ #ifdef QUOTA_BLOCKS /* 1024-blocks instead of 512-blocks */
+- snprintf(outptr, outlen, "%ld", quota.dqb_bsoftlimit % 2 ?
+- (long) (quota.dqb_bsoftlimit / 2 + 1) : (long) (quota.dqb_bsoftlimit / 2));
++ snprintf(outptr, outlen, "%ld", quotaval % 2 ?
++ (quotaval / 2 + 1) : (quotaval / 2));
+ #else
+- snprintf(outptr, outlen, "%ld", (long) quota.dqb_bsoftlimit);
++ snprintf(outptr, outlen, "%ld", quotaval);
+ #endif
+ break;
+
+ case 'Q':
++#ifdef HAVE_NETBSD_LIBQUOTA
++ quotaval = quota_blocks.qv_usage;
++#else
++ quotaval = quota.dqb_curblocks;
++#endif
+ #ifdef QUOTA_BLOCKS /* 1024-blocks instead of 512-blocks */
+- snprintf(outptr, outlen, "%ld", quota.dqb_curblocks % 2 ?
Home |
Main Index |
Thread Index |
Old Index