]> arthur.barton.de Git - netatalk.git/commitdiff
This patch fixes "broken" handling of dbtob (converting diskblocks to
authorsamnoble <samnoble>
Thu, 29 Mar 2001 06:02:58 +0000 (06:02 +0000)
committersamnoble <samnoble>
Thu, 29 Mar 2001 06:02:58 +0000 (06:02 +0000)
actual bytes) on Linux (every version I've used).  Basically if you mount
a filesystem that uses diskblocks with a size other than 1024 bytes/block
netatalk just assumes that you've got 1024 byte blocks anyway and reports
incorrect quota information.  define HAVE_BROKEN_DBTOB in configure.in to
enable this fix on other platforms.

configure.in
etc/afpd/quota.c

index 416215776abf5e04f10c529bbdf5cc9f06c52e94..ed1ff8f059aaa1c5664d310ab6a0135710bf28d1 100644 (file)
@@ -11,7 +11,7 @@ AM_CONFIG_HEADER(config.h)
 AM_PROG_LIBTOOL
 
 dnl Reset locations to proper places
-AC_PREFIX_DEFAULT(/usr)
+AC_PREFIX_DEFAULT(/usr/local)
 
 dnl Checks for programs.
 AC_PROG_AWK
@@ -164,9 +164,9 @@ AC_ARG_WITH(auth-printing-dir,
 )
 
 AC_ARG_WITH(config-dir,
-       [  --with-config-dir=path  path to config files [default=/etc/atalk]],
+       [  --with-config-dir=path  path to config files [default=$ac_default_prefix/etc]],
                config_dir="$withval",
-               config_dir="/etc/atalk"
+               config_dir="${prefix}/etc"
 )
 
 AC_ARG_WITH(cracklib,
@@ -242,13 +242,13 @@ AC_ARG_ENABLE(lastdid,
 
 msg_dir=""
 AC_ARG_WITH(message-dir,
-       [  --with-msg-dir=path     path to message files [default=/etc/atalk/msg]],
+       [  --with-msg-dir=path     path to message files [default=$ac_default_prefix/etc/msg]],
                msg_dir="$withval"
                if test x"$msg_dir" = "x"; then
-                       msg_dir="$CONFIG_DIR/msg"
+                       msg_dir="${prefix}/etc/msg"
                fi
                AC_DEFINE_UNQUOTED(SERVERTEXT, "$msg_dir",
-                       [path to message dir [default=$CONFIG_DIR/msg]])
+                       [path to message dir [default=$ac_default_prefix/etc/msg]])
                SERVERTEXT="$msg_dir"
                AC_SUBST(SERVERTEXT)
 )
@@ -318,9 +318,9 @@ AC_ARG_ENABLE(cobalt,
 )
 
 AC_ARG_WITH(uams-path,
-       [  --with-uams-path=path   path to UAMs [default=/etc/atalk/uams]],
+       [  --with-uams-path=path   path to UAMs [default=$ac_default_prefix/etc/uams]],
        uams_path="$withval",
-       uams_path="$config_dir/uams"
+       uams_path="${config_dir}/uams"
 )
 
 dnl --------------------------------------------------------------------------
@@ -344,16 +344,16 @@ dnl post-FHS substitutions, etc
 dnl --------------------------------------------------------------------------
 
 dnl ***** CONFIG_DIR
-AC_DEFINE_UNQUOTED(CONFIG_DIR, "$config_dir",
-       [path to config dir [default=/etc/atalk]])
-CONFIG_DIR="$config_dir"
+AC_DEFINE_UNQUOTED(CONFIG_DIR, "${config_dir}",
+       [path to config dir [default=$ac_default_prefix/etc]])
+CONFIG_DIR="${config_dir}"
 AC_SUBST(CONFIG_DIR)
 AC_MSG_RESULT([setting configuration files location to $CONFIG_DIR])
 
-dnl ***** UAMS_PATH
-AC_DEFINE_UNQUOTED(UAMS_PATH, "$uams_path",
-       [path to UAMs [default=/etc/atalk/uams]])
-UAMS_PATH="$uams_path"
+***** UAMS_PATH
+AC_DEFINE_UNQUOTED(UAMS_PATH, "${uams_path}",
+       [path to UAMs [default=$ac_default_prefix/etc/uams]])
+UAMS_PATH="${uams_path}"
 AC_SUBST(UAMS_PATH)
 
 dnl --------------------------------------------------------------------------
@@ -411,6 +411,11 @@ if test x"$this_os" = "xlinux"; then
                AC_DEFINE(NEED_QUOTACTL_WRAPPER)
        )
 
+       dnl ----- as far as I can tell, dbtob always does the wrong thing
+       dnl ----- on every single version of linux I've ever played with.
+       dnl ----- see etc/afpd/quota.c
+       AC_DEFINE(HAVE_BROKEN_DBTOB)
+
        dnl --- added by Yoshinobu Ishizaki (2001.03.13) ---
        dnl ----- check if version is newer than 2.2.x
        changequote(<<,>>)
index 913e01556d36ae27a5b6d3c10369f4a3cb2451f9..6a68d6a29f87265dc06f236c697463ec1bc08c3c 100644 (file)
@@ -329,6 +329,19 @@ static int overquota( dqblk )
     return( 1 );
 }
 
+/*
+ * This next bit is basically for linux -- everything is fine
+ * if you use 1k blocks... but if you try (for example) to mount
+ * a volume via nfs from a netapp (which might use 4k blocks) everything
+ * gets reported improperly.  I have no idea about dbtob on other
+ * platforms.
+ */
+
+#ifdef HAVE_BROKEN_DBTOB
+#undef dbtob
+#define dbtob(a, b)    ((VolSpace)((VolSpace)(a) * (VolSpace)(b)))
+#define HAVE_2ARG_DBTOB
+#endif
 
 #ifndef dbtob
 #define dbtob(a)       ((a) << 10)