pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/netatalk3



Module Name:    pkgsrc
Committed By:   bouyer
Date:           Tue Apr  4 18:16:06 UTC 2023

Modified Files:
        pkgsrc/net/netatalk3: Makefile distinfo
        pkgsrc/net/netatalk3/patches: patch-etc_afpd_quota.c
Added Files:
        pkgsrc/net/netatalk3/patches: patch-configure

Log Message:
Sync NetBSD's quota support with current state:
- apply patch-macros_quota-check.m4's changes to configure, so that
  it has a chance to enable quota support on NetBSD
- etc/afpd/quota.c: update for new libquota after dholland's changes
  (back in 2012!)

Bump PKGREVISION


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 pkgsrc/net/netatalk3/Makefile
cvs rdiff -u -r1.13 -r1.14 pkgsrc/net/netatalk3/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/net/netatalk3/patches/patch-configure
cvs rdiff -u -r1.3 -r1.4 pkgsrc/net/netatalk3/patches/patch-etc_afpd_quota.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/netatalk3/Makefile
diff -u pkgsrc/net/netatalk3/Makefile:1.52 pkgsrc/net/netatalk3/Makefile:1.53
--- pkgsrc/net/netatalk3/Makefile:1.52  Wed Jan 11 12:25:04 2023
+++ pkgsrc/net/netatalk3/Makefile       Tue Apr  4 18:16:06 2023
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.52 2023/01/11 12:25:04 hauke Exp $
+# $NetBSD: Makefile,v 1.53 2023/04/04 18:16:06 bouyer Exp $
 
 DISTNAME=      netatalk-3.1.14
+PKGREVISION=   1
 PKGNAME=       ${DISTNAME:C/-/3-/}
 CATEGORIES=    net
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=Netatalk/}Netatalk/releases/download/netatalk-3-1-14/

Index: pkgsrc/net/netatalk3/distinfo
diff -u pkgsrc/net/netatalk3/distinfo:1.13 pkgsrc/net/netatalk3/distinfo:1.14
--- pkgsrc/net/netatalk3/distinfo:1.13  Thu Mar  2 10:39:57 2023
+++ pkgsrc/net/netatalk3/distinfo       Tue Apr  4 18:16:06 2023
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.13 2023/03/02 10:39:57 jperkin Exp $
+$NetBSD: distinfo,v 1.14 2023/04/04 18:16:06 bouyer Exp $
 
 BLAKE2s (netatalk-3.1.14.tar.gz) = 39e9ae725f0b3d87f5747c9f6ddabab3c61eb2b51f1ed63a1af362224aa7f8e9
 SHA512 (netatalk-3.1.14.tar.gz) = 2d52ba2df50cc4bedb5c68fa452d9acec80f69e826ff8cb3d0aa85f7031c98f463e502ef35128076c0aa52a36ce9540509ce8c21b915f6a2232ca70c451b89eb
@@ -7,10 +7,11 @@ SHA1 (patch-bin_ad_ad__cp.c) = bd2191a7a
 SHA1 (patch-config.h.in) = bd9e735c6d1c8bb8a1534f6674fa6358b29922c1
 SHA1 (patch-config_Makefile.in) = 81fff584e5cb98537a4fa671fb551ad0258ba092
 SHA1 (patch-config_pam_Makefile.in) = 8f69225c333b327b4c57ef12994666cc521e5c70
+SHA1 (patch-configure) = 7d2ce8e0d06b8de5b2a1ac45f926ee08b6fd5c3b
 SHA1 (patch-distrib_initscripts_Makefile.in) = fbeffa06a051fb61819d09e0396695cbe564780e
 SHA1 (patch-distrib_initscripts_netatalk.xml.tmpl) = dd7591e12eca3c1e7d7bc768cd1e060979dc383e
 SHA1 (patch-etc_afpd_afp__dsi.c) = 024cc7a0935ece2ed43d1ab3142c8d6bb1b376be
-SHA1 (patch-etc_afpd_quota.c) = d7c87086c8eb1ff68e46c5972fcd0b2e18c592e5
+SHA1 (patch-etc_afpd_quota.c) = 2ec8711f5ec9b25497f716cf8f728e354f1eb1c6
 SHA1 (patch-etc_cnid__dbd_cnid__metad.c) = 6c28332ca3e11d11f3b5bb13fa01783dbb94c30f
 SHA1 (patch-etc_cnid__dbd_usockfd.c) = a3b6c498ed73dc449b84d092f2b9e13eeae3dfc5
 SHA1 (patch-etc_netatalk_netatalk.c) = 2bdbfc035e4bea9859cf970cd6b9a6503244185e

Index: pkgsrc/net/netatalk3/patches/patch-etc_afpd_quota.c
diff -u pkgsrc/net/netatalk3/patches/patch-etc_afpd_quota.c:1.3 pkgsrc/net/netatalk3/patches/patch-etc_afpd_quota.c:1.4
--- pkgsrc/net/netatalk3/patches/patch-etc_afpd_quota.c:1.3     Fri Dec 21 09:59:21 2018
+++ pkgsrc/net/netatalk3/patches/patch-etc_afpd_quota.c Tue Apr  4 18:16:06 2023
@@ -1,11 +1,11 @@
-$NetBSD: patch-etc_afpd_quota.c,v 1.3 2018/12/21 09:59:21 hauke Exp $
+$NetBSD: patch-etc_afpd_quota.c,v 1.4 2023/04/04 18:16:06 bouyer Exp $
 
 SunOS derivatives need to explicitely include mntent.h for MNTTYPE_NFS
 
 NetBSD uses a different quota API.
 
---- etc/afpd/quota.c.orig      2018-12-13 21:33:47.000000000 +0000
-+++ etc/afpd/quota.c
+--- etc/afpd/quota.c.orig      2023-01-10 10:49:51.000000000 +0100
++++ etc/afpd/quota.c   2023-03-29 15:54:28.917646712 +0200
 @@ -21,6 +21,10 @@
  #include <unistd.h>
  #include <fcntl.h>
@@ -17,7 +17,12 @@ NetBSD uses a different quota API.
  #include <atalk/logger.h>
  #include <atalk/afp.h>
  #include <atalk/compat.h>
-@@ -36,10 +40,13 @@
+@@ -32,14 +36,17 @@
+ #include "unix.h"
+ 
+ #ifdef HAVE_LIBQUOTA
+-#include <quota/quota.h>
++#include <quota.h>
  
  static int
  getfreespace(const AFPObj *obj, struct vol *vol, VolSpace *bfree, VolSpace *btotal,
@@ -34,7 +39,7 @@ NetBSD uses a different quota API.
        time_t now;
  
        if (time(&now) == -1) {
-@@ -48,64 +55,102 @@ getfreespace(const AFPObj *obj, struct v
+@@ -48,33 +55,64 @@
                return -1;
        }
  
@@ -50,19 +55,6 @@ NetBSD uses a different quota API.
 -      if ((retq = getfsquota(obj, vol, ufsq, uid, classq)) < 0) {
 -              LOG(log_info, logtype_afpd, "getfsquota(%s, %s): %s",
 -                  vol->v_path, classq, strerror(errno));
--      }
--
--    unbecome_root();
--
--      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:
 +      /*
 +       * In a tidier world we might keep the quotahandle open for longer...
 +       */
@@ -95,15 +87,24 @@ NetBSD uses a different quota API.
 +              quota_close(qh);
 +              seteuid( prevuid );
 +              return -1;
-+      }
-+
+       }
+ 
+-    unbecome_root();
 +      quota_close(qh);
 +
 +       seteuid( prevuid );
-+
+ 
+-      if (retq < 1)
+-              return retq;
 +      if (qv.qv_usage >= qv.qv_hardlimit ||
 +            (qv.qv_usage >= qv.qv_softlimit && now > qv.qv_expiretime)) {
-+
+ 
+-      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;
@@ -113,64 +114,29 @@ NetBSD uses a different quota API.
 -              *btotal = dbtob(ufsq[QUOTA_LIMIT_BLOCK].ufsqe_hardlimit);
 -              break;
 +              *btotal = dbtob(qv.qv_usage);
-+      }
+       }
 +      else {
 +              *bfree = dbtob(qv.qv_hardlimit - qv.qv_usage);
 +              *btotal = dbtob(qv.qv_hardlimit);
 +      }
 +
-       }
        return 1;
  }
  
- int uquota_getvolspace(const AFPObj *obj, struct vol *vol, VolSpace *bfree, VolSpace *btotal, const u_int32_t bsize)
- {
--      int uretq, gretq;
-+      int uret, gret;
-       VolSpace ubfree, ubtotal;
+@@ -85,12 +123,12 @@
        VolSpace gbfree, gbtotal;
-+      uret = getfreespace(vol, &ubfree, &ubtotal,
-+          uuid, QUOTA_IDTYPE_USER);
-+      if (uret == 1) {
-+              LOG(log_info, logtype_afpd, "quota_get(%s, user): %d %d",
-+                  vol->v_path, (int)ubfree, (int)ubtotal);
-+      }
  
--      uretq = getfreespace(obj, vol, &ubfree, &ubtotal,
+       uretq = getfreespace(obj, vol, &ubfree, &ubtotal,
 -                           uuid, QUOTADICT_CLASS_USER);
 -      LOG(log_info, logtype_afpd, "getfsquota(%s): %d %d",
--          vol->v_path, (int)ubfree, (int)ubtotal);
++                           obj->uid, QUOTA_IDTYPE_USER);
++      LOG(log_info, logtype_afpd, "getfreespace(%s): %d %d",
+           vol->v_path, (int)ubfree, (int)ubtotal);
        if (obj->ngroups >= 1) {
 -              gretq = getfreespace(vol, &ubfree, &ubtotal,
 -                  obj->groups[0], QUOTADICT_CLASS_GROUP);
-+              gret = getfreespace(vol, &gbfree, &gbtotal,
-+                  groups[0], QUOTA_IDTYPE_GROUP);
-+              if (gret == 1) {
-+                      LOG(log_info, logtype_afpd, "quota_get(%s, group): %d %d",
-+                          vol->v_path, (int)gbfree, (int)gbtotal);
-+              }
++              gretq = getfreespace(obj, vol, &ubfree, &ubtotal,
++                  obj->groups[0], QUOTA_IDTYPE_GROUP);
        } else
--              gretq = -1;
--      if (uretq < 1 && gretq < 1) { /* no quota for this fs */
-+              gret = 0;
-+      if (uret < 1 && gret < 1) { /* no quota for this fs */
-               return AFPERR_PARAM;
-       }
--      if (uretq < 1) {
--              /* use group quotas */
-+      if (uret < 1) {
-+              /* no user quotas, but group quotas; use them */
-               *bfree = gbfree;
-               *btotal = gbtotal;
--      } else if (gretq < 1) {
--              /* use user quotas */
-+      } else if (gret < 1) {
-+              /* no group quotas, but user quotas; use them */
-               *bfree = ubfree;
-               *btotal = ubtotal;
-       } else {
--              /* return smallest remaining space of user and group */
-+              /* both; return smallest remaining space of user and group */
-               if (ubfree < gbfree) {
-                       *bfree = ubfree;
-                       *btotal = ubtotal;
+               gretq = -1;
+       if (uretq < 1 && gretq < 1) { /* no quota for this fs */

Added files:

Index: pkgsrc/net/netatalk3/patches/patch-configure
diff -u /dev/null pkgsrc/net/netatalk3/patches/patch-configure:1.1
--- /dev/null   Tue Apr  4 18:16:06 2023
+++ pkgsrc/net/netatalk3/patches/patch-configure        Tue Apr  4 18:16:06 2023
@@ -0,0 +1,96 @@
+$NetBSD: patch-configure,v 1.1 2023/04/04 18:16:06 bouyer Exp $
+apply changes from patch-macros_quota-check.m4 for NetBSD's quota
+
+--- configure.orig     2023-03-29 15:04:35.180307136 +0200
++++ configure  2023-03-29 15:04:40.662623659 +0200
+@@ -16762,65 +16762,63 @@
+   QUOTA_LIBS="-lrpcsvc"
+ fi
+ 
+-             for ac_header in rpc/rpc.h rpc/pmap_prot.h rpcsvc/rquota.h
+-do :
+-  as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh`
+-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+-if eval test \"x\$"$as_ac_Header"\" = x"yes"
++      ac_fn_c_check_header_compile "$LINENO" "rpc/rpc.h" "ac_cv_header_rpc_rpc_h" "$ac_includes_default"
++if test "x$ac_cv_header_rpc_rpc_h" = xyes
+ then :
+-  cat >>confdefs.h <<_ACEOF
+-#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1
+-_ACEOF
+-
+-else $as_nop
++  printf "%s\n" "#define HAVE_RPC_RPC_H 1" >>confdefs.h
+ 
+-              QUOTA_LIBS=""
+-              netatalk_cv_quotasupport="no"
+-
+-printf "%s\n" "#define NO_QUOTA_SUPPORT 1" >>confdefs.h
++fi
++ac_fn_c_check_header_compile "$LINENO" "rpc/pmap_prot.h" "ac_cv_header_rpc_pmap_prot_h" "$ac_includes_default"
++if test "x$ac_cv_header_rpc_pmap_prot_h" = xyes
++then :
++  printf "%s\n" "#define HAVE_RPC_PMAP_PROT_H 1" >>confdefs.h
+ 
++fi
++ac_fn_c_check_header_compile "$LINENO" "rpcsvc/rquota.h" "ac_cv_header_rpcsvc_rquota_h" "$ac_includes_default"
++if test "x$ac_cv_header_rpcsvc_rquota_h" = xyes
++then :
++  printf "%s\n" "#define HAVE_RPCSVC_RQUOTA_H 1" >>confdefs.h
+ 
+ fi
+ 
+-done
+-      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getfsquota in -lquota" >&5
+-printf %s "checking for getfsquota in -lquota... " >&6; }
+-if test ${ac_cv_lib_quota_getfsquota+y}
++      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for quota_open in -lquota" >&5
++printf %s "checking for quota_open in -lquota... " >&6; }
++if test ${ac_cv_lib_quota_quota_open+y}
+ then :
+   printf %s "(cached) " >&6
+ else $as_nop
+   ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lquota -lprop -lrpcsvc $LIBS"
++LIBS="-lquota -lrpcsvc $LIBS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ /* Override any GCC internal prototype to avoid an error.
+    Use char because int might match the return type of a GCC
+    builtin and then its argument prototype would still apply.  */
+-char getfsquota ();
++char quota_open ();
+ int
+ main (void)
+ {
+-return getfsquota ();
++return quota_open ();
+   ;
+   return 0;
+ }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"
+ then :
+-  ac_cv_lib_quota_getfsquota=yes
++  ac_cv_lib_quota_quota_open=yes
+ else $as_nop
+-  ac_cv_lib_quota_getfsquota=no
++  ac_cv_lib_quota_quota_open=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.beam \
+     conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_quota_getfsquota" >&5
+-printf "%s\n" "$ac_cv_lib_quota_getfsquota" >&6; }
+-if test "x$ac_cv_lib_quota_getfsquota" = xyes
++{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_quota_quota_open" >&5
++printf "%s\n" "$ac_cv_lib_quota_quota_open" >&6; }
++if test "x$ac_cv_lib_quota_quota_open" = xyes
+ then :
+-  QUOTA_LIBS="-lquota -lprop -lrpcsvc"
++  QUOTA_LIBS="-lquota -lrpcsvc"
+ 
+ printf "%s\n" "#define HAVE_LIBQUOTA 1" >>confdefs.h
+ 



Home | Main Index | Thread Index | Old Index