head 1.7; access; symbols pkgsrc-2013Q2:1.7.0.6 pkgsrc-2013Q2-base:1.7 pkgsrc-2012Q4:1.7.0.4 pkgsrc-2012Q4-base:1.7 pkgsrc-2011Q4:1.7.0.2 pkgsrc-2011Q4-base:1.7 pkgsrc-2011Q2:1.5.0.4 pkgsrc-2011Q2-base:1.5 pkgsrc-2011Q1:1.5.0.2 pkgsrc-2011Q1-base:1.5 pkgsrc-2009Q4:1.3.0.46 pkgsrc-2009Q4-base:1.3 pkgsrc-2008Q4:1.3.0.44 pkgsrc-2008Q4-base:1.3 pkgsrc-2008Q3:1.3.0.42 pkgsrc-2008Q3-base:1.3 cube-native-xorg:1.3.0.40 cube-native-xorg-base:1.3 pkgsrc-2008Q2:1.3.0.38 pkgsrc-2008Q2-base:1.3 pkgsrc-2008Q1:1.3.0.36 pkgsrc-2008Q1-base:1.3 pkgsrc-2007Q4:1.3.0.34 pkgsrc-2007Q4-base:1.3 pkgsrc-2007Q3:1.3.0.32 pkgsrc-2007Q3-base:1.3 pkgsrc-2007Q2:1.3.0.30 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.28 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.3.0.26 pkgsrc-2006Q4-base:1.3 pkgsrc-2006Q3:1.3.0.24 pkgsrc-2006Q3-base:1.3 pkgsrc-2006Q2:1.3.0.22 pkgsrc-2006Q2-base:1.3 pkgsrc-2006Q1:1.3.0.20 pkgsrc-2006Q1-base:1.3 pkgsrc-2005Q4:1.3.0.18 pkgsrc-2005Q4-base:1.3 pkgsrc-2005Q3:1.3.0.16 pkgsrc-2005Q3-base:1.3 pkgsrc-2005Q2:1.3.0.14 pkgsrc-2005Q2-base:1.3 pkgsrc-2005Q1:1.3.0.12 pkgsrc-2005Q1-base:1.3 pkgsrc-2004Q4:1.3.0.10 pkgsrc-2004Q4-base:1.3 pkgsrc-2004Q3:1.3.0.8 pkgsrc-2004Q3-base:1.3 pkgsrc-2004Q2:1.3.0.6 pkgsrc-2004Q2-base:1.3 pkgsrc-2004Q1:1.3.0.4 pkgsrc-2004Q1-base:1.3 pkgsrc-2003Q4:1.3.0.2 pkgsrc-2003Q4-base:1.3 buildlink2:1.2.0.2 buildlink2-base:1.3 netbsd-1-5-PATCH003:1.2 netbsd-1-5-PATCH001:1.2 netbsd-1-5-RELEASE:1.2 netbsd-1-4-PATCH003:1.2 netbsd-1-4-PATCH002:1.2 comdex-fall-1999:1.2 netbsd-1-4-PATCH001:1.1.1.1 netbsd-1-4-RELEASE:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.7 date 2011.09.22.01.20.21; author christos; state dead; branches; next 1.6; 1.6 date 2011.08.30.15.09.23; author bouyer; state Exp; branches; next 1.5; 1.5 date 2011.03.26.18.45.52; author bouyer; state Exp; branches 1.5.4.1; next 1.4; 1.4 date 2011.03.26.13.46.19; author bouyer; state Exp; branches; next 1.3; 1.3 date 2002.05.25.12.55.27; author markd; state dead; branches; next 1.2; 1.2 date 99.08.31.22.09.43; author wrstuden; state Exp; branches 1.2.2.1; next 1.1; 1.1 date 98.12.26.22.09.27; author agc; state Exp; branches 1.1.1.1; next ; 1.5.4.1 date 2011.08.30.17.42.23; author tron; state Exp; branches; next ; 1.2.2.1 date 2002.06.23.18.56.03; author jlam; state dead; branches; next ; 1.1.1.1 date 98.12.26.22.09.27; author agc; state Exp; branches; next ; desc @@ 1.7 log @update to 2.2.1, see: http://netatalk.sourceforge.net/2.2/ReleaseNotes2.2.1.html @ text @$NetBSD: patch-at,v 1.6 2011/08/30 15:09:23 bouyer Exp $ --- etc/afpd/quota.c.orig 2011-03-24 15:43:48.000000000 +0100 +++ etc/afpd/quota.c 2011-03-24 17:56:34.000000000 +0100 @@@@ -47,6 +47,96 @@@@ #include "volume.h" #include "unix.h" +#ifdef HAVE_LIBQUOTA +#include + +static int +getfreespace(struct vol *vol, VolSpace *bfree, VolSpace *btotal, + uid_t ouruid, uid_t quid, const char *classq) +{ + int retq; + struct ufs_quota_entry ufsq[QUOTA_NLIMITS]; + time_t now; + + if (time(&now) == -1) { + LOG(log_info, logtype_afpd, "time(): %s", + strerror(errno)); + return -1; + } + + if ( seteuid( getuid() ) != 0 ) { + LOG(log_info, logtype_afpd, "seteuid(): %s", + strerror(errno)); + return -1; + } + if ((retq = getfsquota(vol->v_path, ufsq, quid, classq)) < 0) { + LOG(log_info, logtype_afpd, "getfsquota(%s, %s): %s", + vol->v_path, classq, strerror(errno)); + } + seteuid( ouruid ); + if (retq < 1) + return retq; + + switch(QL_STATUS(quota_check_limit(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur, 1, + ufsq[QUOTA_LIMIT_BLOCK].ufsqe_softlimit, + ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit, + ufsq[QUOTA_LIMIT_BLOCK].ufsqe_time, now))) { + case QL_S_DENY_HARD: + case QL_S_DENY_GRACE: + *bfree = 0; + *btotal = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur); + break; + default: + *bfree = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit - + ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur); + *btotal = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit); + break; + } + return 1; +} + +int uquota_getvolspace( struct vol *vol, VolSpace *bfree, VolSpace *btotal, const u_int32_t bsize) +{ + int uretq, gretq; + VolSpace ubfree, ubtotal; + VolSpace gbfree, gbtotal; + + uretq = getfreespace(vol, &ubfree, &ubtotal, uuid, + uuid, QUOTADICT_CLASS_USER); + LOG(log_info, logtype_afpd, "getfsquota(%s): %d %d", + vol->v_path, (int)ubfree, (int)ubtotal); + if (ngroups >= 1) { + gretq = getfreespace(vol, &ubfree, &ubtotal, uuid, + groups[0], QUOTADICT_CLASS_GROUP); + } else + gretq = -1; + if (uretq < 1 && gretq < 1) { /* no quota for this fs */ + return AFPERR_PARAM; + } + if (uretq < 1) { + /* use group quotas */ + *bfree = gbfree; + *btotal = gbtotal; + } else if (gretq < 1) { + /* use user quotas */ + *bfree = ubfree; + *btotal = ubtotal; + } else { + /* return smallest remaining space of user and group */ + if (ubfree < gbfree) { + *bfree = ubfree; + *btotal = ubtotal; + } else { + *bfree = gbfree; + *btotal = gbtotal; + } + } + return AFP_OK; + +} + +#else /* HAVE_LIBQUOTA */ + /* #define DEBUG_QUOTA 0 */ @@@@ -739,4 +829,5 @@@@ return( AFP_OK ); } +#endif /* HAVE_LIBQUOTA */ #endif @ 1.6 log @PR pkg/45300 net/netatalk patch-at seems broken Don't seteuid() to a gid. Always pass the uid in addition to the quota id to getfreespace() so we can properly seteuid(). bump PKGREVISION @ text @d1 1 a1 1 $NetBSD: patch-at,v 1.5 2011/03/26 18:45:52 bouyer Exp $ @ 1.5 log @Add CVS Id where missing Fix patch to quota-check.m4 so that the autoconf'ed configure will define HAVE_LIBQUOTA too Use QL_STATUS(quota_check_limit()) instead of quota_check_limit(). This is the only visible change in binaries. Do not bump PKGREVISION as the previous code has been there for only a few hours. @ text @d1 1 a1 1 $NetBSD: patch-aa,v 1.21 2011/03/26 13:46:19 bouyer Exp $ d14 1 a14 1 + uid_t uid, const char *classq) d31 1 a31 1 + if ((retq = getfsquota(vol->v_path, ufsq, uid, classq)) < 0) { d35 1 a35 1 + seteuid( uid ); d63 1 a63 1 + uretq = getfreespace(vol, &ubfree, &ubtotal, d68 1 a68 1 + gretq = getfreespace(vol, &ubfree, &ubtotal, @ 1.5.4.1 log @Pullup ticket #3515 - requested by bouyer net/netatalk: bug fix patch Revisions pulled up: - net/netatalk/Makefile 1.77 - net/netatalk/distinfo 1.40 - net/netatalk/patches/patch-at 1.6 --- Module Name: pkgsrc Committed By: bouyer Date: Tue Aug 30 15:09:23 UTC 2011 Modified Files: pkgsrc/net/netatalk: Makefile distinfo pkgsrc/net/netatalk/patches: patch-at Log Message: PR pkg/45300 net/netatalk patch-at seems broken Don't seteuid() to a gid. Always pass the uid in addition to the quota id to getfreespace() so we can properly seteuid(). bump PKGREVISION @ text @d1 1 a1 1 $NetBSD$ d14 1 a14 1 + uid_t ouruid, uid_t quid, const char *classq) d31 1 a31 1 + if ((retq = getfsquota(vol->v_path, ufsq, quid, classq)) < 0) { d35 1 a35 1 + seteuid( ouruid ); d63 1 a63 1 + uretq = getfreespace(vol, &ubfree, &ubtotal, uuid, d68 1 a68 1 + gretq = getfreespace(vol, &ubfree, &ubtotal, uuid, @ 1.4 log @Make netatalk build again on NetBSD current: check for getfsquota() in libquota. If it's there, use getfsquota() and quota_check_limit() from libquota instead of local getnfsquota or direct calls to quotactl(). Tested on NetBSD-current and NetBSD 5.1. OK agc@@ @ text @d1 2 d39 1 a39 1 + switch(quota_check_limit(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_cur, 1, d42 1 a42 1 + ufsq[QUOTA_LIMIT_BLOCK].ufsqe_time, now)) { @ 1.3 log @Update netatalk to version 1.5.3.1. Update supplied by David Rankin (to version 1.5.2) in pkg/15642 further updated to 1.5.3.1 by me. Changes since the old umich version (and netatalk-asun) are numerous bug fixes, cleanups and new features and its actively being maintained. @ text @d1 105 a105 13 $NetBSD: patch-at,v 1.2 1999/08/31 22:09:43 wrstuden Exp $ --- libatalk/nbp/nbp_rgstr.c Tue Oct 7 14:22:14 1997 +++ libatalk/nbp/nbp_rgstr.c Mon Aug 30 06:47:43 1999 @@@@ -6,7 +6,7 @@@@ #include #include #include -#include +#include #include #include #include @ 1.2 log @Fix two PRs on this package, and make it compile on macppc. Sample files are installed in pkg/share/examples/netatalk, addressing PR 7920 by rnestor@@metronet.com. Now include elf support, addressing PR 8125 by Takahiro Kambe, with slight changes by me. Cleaned up some lint warnings and fixed an unsigned character comparison problem with assistance from cgd@@netbsd.org. Disabled building of libatalk_p.a (profiling libatalk) as not all ports support it which will generate plist errors. @ text @d1 1 a1 1 $NetBSD: $ @ 1.2.2.1 log @Merge from pkgsrc-current to buildlink2 branch. @ text @d1 1 a1 1 $NetBSD: patch-at,v 1.2 1999/08/31 22:09:43 wrstuden Exp $ @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD$ d3 11 a13 20 --- bin/Makefile 1998/10/26 14:11:36 1.1 +++ bin/Makefile 1998/10/26 14:11:55 @@@@ -9,7 +9,7 @@@@ ADDLIBS="${ADDLIBS}" DEFS="${DEFS}" OPTOPTS="${OPTOPTS}" \ SBINDIR="${SBINDIR}" BINDIR="${BINDIR}" RESDIR="${RESDIR}"\ ETCDIR="${ETCDIR}" LIBDIR="${LIBDIR}" INCDIR="${INCDIR}" \ - DESTDIR="${DESTDIR}" + ATALK_DESTDIR="${ATALK_DESTDIR}" FRC: @@@@ -26,7 +26,7 @@@@ ADDLIBS="${ADDLIBS}" DEFS="${DEFS}" OPTOPTS="${OPTOPTS}" \ SBINDIR="${SBINDIR}" BINDIR="${BINDIR}" RESDIR="${RESDIR}" \ ETCDIR="${ETCDIR}" LIBDIR="${LIBDIR}" INCDIR="${INCDIR}" \ - DESTDIR="${DESTDIR}" INSTALL="${INSTALL}" install); \ + ATALK_DESTDIR="${ATALK_DESTDIR}" INSTALL="${INSTALL}" install); \ done clean: @ 1.1.1.1 log @Initial import of the University of Michigan version of Netatalk. (userland tools and utilities for AppleTalk interworking). This is the standard, reference version. Lacks AppleshareIP support. Package done by Bill Studenmund (wrstuden@@netbsd.org), munged about a bit by myself. This is the 19981109 version of the sources. @ text @@