summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure209
-rw-r--r--configure.in44
-rw-r--r--quotacheck.c60
-rw-r--r--quotaio.c10
-rw-r--r--quotasys.c9
5 files changed, 192 insertions, 140 deletions
diff --git a/configure b/configure
index e329c8f..761f507 100755
--- a/configure
+++ b/configure
@@ -12,6 +12,8 @@ ac_help=
ac_default_prefix=/usr/local
# Any additions from configure.in:
ac_help="$ac_help
+ --with-ext2direct=[yes/no/try] Enable alternative format used by edquota [default=try]."
+ac_help="$ac_help
--enable-altformat=[yes/no] Enable alternative format used by edquota [default=yes]."
ac_help="$ac_help
--enable-rpc=[yes/no] Enable RPC support [default=yes]."
@@ -533,7 +535,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:537: checking for $ac_word" >&5
+echo "configure:539: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -563,7 +565,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:567: checking for $ac_word" >&5
+echo "configure:569: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -614,7 +616,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:618: checking for $ac_word" >&5
+echo "configure:620: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -646,7 +648,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:650: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:652: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -657,12 +659,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 661 "configure"
+#line 663 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -688,12 +690,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:692: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:694: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:697: checking whether we are using GNU C" >&5
+echo "configure:699: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -702,7 +704,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:706: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:708: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -721,7 +723,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:725: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:727: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -753,7 +755,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:757: checking how to run the C preprocessor" >&5
+echo "configure:759: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -768,13 +770,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 772 "configure"
+#line 774 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -785,13 +787,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 789 "configure"
+#line 791 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -802,13 +804,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 806 "configure"
+#line 808 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -833,12 +835,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:837: checking for ANSI C header files" >&5
+echo "configure:839: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 842 "configure"
+#line 844 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -846,7 +848,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:852: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -863,7 +865,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 867 "configure"
+#line 869 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -881,7 +883,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 885 "configure"
+#line 887 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -902,7 +904,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 906 "configure"
+#line 908 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -913,7 +915,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -967,7 +969,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:971: checking for a BSD compatible install" >&5
+echo "configure:973: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1020,8 +1022,17 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-echo $ac_n "checking for com_err in -lcom_err""... $ac_c" 1>&6
-echo "configure:1025: checking for com_err in -lcom_err" >&5
+# Check whether --with-ext2direct or --without-ext2direct was given.
+if test "${with_ext2direct+set}" = set; then
+ withval="$with_ext2direct"
+ :
+else
+ with_ext2direct="try"
+fi
+
+if test "x$with_ext2direct" != "xno"; then
+ echo $ac_n "checking for com_err in -lcom_err""... $ac_c" 1>&6
+echo "configure:1036: checking for com_err in -lcom_err" >&5
ac_lib_var=`echo com_err'_'com_err | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1029,7 +1040,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lcom_err $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1033 "configure"
+#line 1044 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1040,7 +1051,7 @@ int main() {
com_err()
; return 0; }
EOF
-if { (eval echo configure:1044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1067,8 +1078,8 @@ else
echo "$ac_t""no" 1>&6
fi
-echo $ac_n "checking for ext2fs_initialize in -lext2fs""... $ac_c" 1>&6
-echo "configure:1072: checking for ext2fs_initialize in -lext2fs" >&5
+ echo $ac_n "checking for ext2fs_initialize in -lext2fs""... $ac_c" 1>&6
+echo "configure:1083: checking for ext2fs_initialize in -lext2fs" >&5
ac_lib_var=`echo ext2fs'_'ext2fs_initialize | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1076,7 +1087,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lext2fs $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1080 "configure"
+#line 1091 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1087,7 +1098,7 @@ int main() {
ext2fs_initialize()
; return 0; }
EOF
-if { (eval echo configure:1091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1114,12 +1125,69 @@ else
echo "$ac_t""no" 1>&6
fi
+ if test "${ac_cv_lib_com_err_com_err}" != "yes" -o "${ac_cv_lib_ext2fs_ext2fs_initialize}" != "yes"; then
+ if test "x$with_ext2direct" = "xyes"; then
+ { echo "configure: error: Ext2 direct support required but libraries not found." 1>&2; exit 1; }
+ else
+ echo "configure: warning: Ext2 direct support won't be compiled. Libraries not found." 1>&2
+ fi
+ with_ext2direct="no"
+ else
+ ac_safe=`echo "ext2fs/ext2fs.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for ext2fs/ext2fs.h""... $ac_c" 1>&6
+echo "configure:1139: checking for ext2fs/ext2fs.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1144 "configure"
+#include "confdefs.h"
+#include <ext2fs/ext2fs.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ext2fshead="yes"
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+ if test "x$ext2fshead" != "xyes"; then
+ if test "x$with_ext2direct" = "xyes"; then
+ { echo "configure: error: Ext2 direct support required but header files not found." 1>&2; exit 1; }
+ else
+ echo "configure: warning: Ext2 direct support won't be compiled. Header files not found." 1>&2
+ fi
+ with_ext2direct="no"
+ else
+ with_ext2direct="yes"
+ fi
+ fi
+ if test "x$with_ext2direct" = "xyes"; then
+ EXT2_DIRECT="-DEXT2_DIRECT"
+
+ fi
+fi
EXT2LIBS=${LIBS}
LIBS=""
echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:1123: checking for main in -lnsl" >&5
+echo "configure:1191: checking for main in -lnsl" >&5
ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1127,14 +1195,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1131 "configure"
+#line 1199 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:1138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1162,7 +1230,7 @@ else
fi
echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
-echo "configure:1166: checking for main in -lwrap" >&5
+echo "configure:1234: checking for main in -lwrap" >&5
ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1170,14 +1238,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lwrap $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1174 "configure"
+#line 1242 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:1181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1205,63 +1273,20 @@ else
fi
-if test ${ac_cv_lib_com_err_com_err} = yes &&
- test ${ac_cv_lib_ext2fs_ext2fs_initialize} = yes; then
- ac_safe=`echo "ext2fs/ext2fs.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for ext2fs/ext2fs.h""... $ac_c" 1>&6
-echo "configure:1213: checking for ext2fs/ext2fs.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1218 "configure"
-#include "confdefs.h"
-#include <ext2fs/ext2fs.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1223: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-
- echo 'ERROR: could not find ext2fs/ext2fs.h - missing ext2 package'
- exit 1
-
-fi
-
- EXT2_DIRECT="-DEXT2_DIRECT"
-
-fi
-
if test ${ac_cv_lib_wrap_main} = yes; then
ac_safe=`echo "tcpd.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for tcpd.h""... $ac_c" 1>&6
-echo "configure:1255: checking for tcpd.h" >&5
+echo "configure:1280: checking for tcpd.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1260 "configure"
+#line 1285 "configure"
#include "confdefs.h"
#include <tcpd.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1291,12 +1316,12 @@ fi
fi
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1295: checking for working const" >&5
+echo "configure:1320: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1300 "configure"
+#line 1325 "configure"
#include "confdefs.h"
int main() {
@@ -1345,7 +1370,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1374: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1366,21 +1391,21 @@ EOF
fi
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1370: checking for inline" >&5
+echo "configure:1395: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 1377 "configure"
+#line 1402 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1384: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1409: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1603,8 +1628,8 @@ s%@CPP@%$CPP%g
s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@EXT2LIBS@%$EXT2LIBS%g
s%@EXT2_DIRECT@%$EXT2_DIRECT%g
+s%@EXT2LIBS@%$EXT2LIBS%g
s%@HOSTS_ACCESS@%$HOSTS_ACCESS%g
s%@LIBMALLOC@%$LIBMALLOC%g
diff --git a/configure.in b/configure.in
index bcabb3a..84606f3 100644
--- a/configure.in
+++ b/configure.in
@@ -7,8 +7,38 @@ AC_HEADER_STDC
AC_PROG_INSTALL
dnl Checks for libraries.
-AC_CHECK_LIB(com_err, com_err)
-AC_CHECK_LIB(ext2fs, ext2fs_initialize)
+AC_ARG_WITH(ext2direct,
+ [ --with-ext2direct=[yes/no/try] Enable alternative format used by edquota [default=try].],
+ ,
+ with_ext2direct="try")
+if test "x$with_ext2direct" != "xno"; then
+ AC_CHECK_LIB(com_err, com_err)
+ AC_CHECK_LIB(ext2fs, ext2fs_initialize)
+ if test "${ac_cv_lib_com_err_com_err}" != "yes" -o "${ac_cv_lib_ext2fs_ext2fs_initialize}" != "yes"; then
+ if test "x$with_ext2direct" = "xyes"; then
+ AC_MSG_ERROR([Ext2 direct support required but libraries not found.])
+ else
+ AC_MSG_WARN([Ext2 direct support won't be compiled. Libraries not found.])
+ fi
+ with_ext2direct="no"
+ else
+ AC_CHECK_HEADER(ext2fs/ext2fs.h,ext2fshead="yes")
+ if test "x$ext2fshead" != "xyes"; then
+ if test "x$with_ext2direct" = "xyes"; then
+ AC_MSG_ERROR([Ext2 direct support required but header files not found.])
+ else
+ AC_MSG_WARN([Ext2 direct support won't be compiled. Header files not found.])
+ fi
+ with_ext2direct="no"
+ else
+ with_ext2direct="yes"
+ fi
+ fi
+ if test "x$with_ext2direct" = "xyes"; then
+ EXT2_DIRECT="-DEXT2_DIRECT"
+ AC_SUBST(EXT2_DIRECT)
+ fi
+fi
EXT2LIBS=${LIBS}
AC_SUBST(EXT2LIBS)
LIBS=""
@@ -16,16 +46,6 @@ LIBS=""
AC_CHECK_LIB(nsl, main)
AC_CHECK_LIB(wrap, main)
-if test ${ac_cv_lib_com_err_com_err} = yes &&
- test ${ac_cv_lib_ext2fs_ext2fs_initialize} = yes; then
- AC_CHECK_HEADER(ext2fs/ext2fs.h,, [
- echo 'ERROR: could not find ext2fs/ext2fs.h - missing ext2 package'
- exit 1
- ])
- EXT2_DIRECT="-DEXT2_DIRECT"
- AC_SUBST(EXT2_DIRECT)
-fi
-
if test ${ac_cv_lib_wrap_main} = yes; then
AC_CHECK_HEADER(tcpd.h,, [
echo 'ERROR: could not find tcpd.h - missing TCP wrappers package'
diff --git a/quotacheck.c b/quotacheck.c
index 3f9aeaf..0e7ba70 100644
--- a/quotacheck.c
+++ b/quotacheck.c
@@ -8,7 +8,7 @@
* New quota format implementation - Jan Kara <jack@suse.cz> - Sponsored by SuSE CR
*/
-#ident "$Id: quotacheck.c,v 1.2 2001/04/04 10:42:12 jkar8572 Exp $"
+#ident "$Id: quotacheck.c,v 1.3 2001/04/05 08:26:56 jkar8572 Exp $"
#include <dirent.h>
#include <stdio.h>
@@ -538,8 +538,8 @@ int ask_yn(char *q, int def)
/* Do checks and buffer quota file into memory */
static int process_file(char *mnt_fsname, struct mntent *mnt, int type)
{
- char *qfname;
- int fd, ret;
+ char *qfname = NULL;
+ int fd = -1, ret;
debug(FL_DEBUG | FL_VERBOSE, _("Going to check %s quota file of %s\n"), type2name(type),
mnt->mnt_dir);
@@ -547,9 +547,7 @@ static int process_file(char *mnt_fsname, struct mntent *mnt, int type)
if (kern_quota_on(mnt_fsname, type, (1 << cfmt)) > 0) { /* Is quota enabled? */
if (!(flags & FL_FORCE)) {
if (flags & FL_INTERACTIVE) {
- printf(_
- ("Quota for %ss is enabled on mountpoint %s so quotacheck might damage the file.\n"),
-type2name(type), mnt->mnt_dir);
+ printf(_("Quota for %ss is enabled on mountpoint %s so quotacheck might damage the file.\n"), type2name(type), mnt->mnt_dir);
if (!ask_yn(_("Should I continue"), 0)) {
printf(_("As you wish... Canceling check of this file.\n"));
return -1;
@@ -567,33 +565,37 @@ Please turn quotas off or use -f to force checking.\n"),
die(4, _("Error while syncing quotas: %s\n"), strerror(errno));
}
- qfname = get_qf_name(mnt, type, cfmt);
- if (!qfname) {
- fprintf(stderr, _("Cannot get quotafile name for %s\n"), mnt_fsname);
- return -1;
- }
- if ((fd = open(qfname, O_RDONLY)) < 0) {
- fprintf(stderr, _("Cannot open quotafile %s: %s\n"), qfname, strerror(errno));
- free(qfname);
- return -1;
+ if (!(flags & FL_NEWFILE)) { /* Need to really buffer file? */
+ qfname = get_qf_name(mnt, type, cfmt);
+ if (!qfname) {
+ fprintf(stderr, _("Cannot get quotafile name for %s\n"), mnt_fsname);
+ return -1;
+ }
+ if ((fd = open(qfname, O_RDONLY)) < 0) {
+ fprintf(stderr, _("Cannot open quotafile %s: %s\n"), qfname, strerror(errno));
+ free(qfname);
+ return -1;
+ }
}
- memset(old_info + type, 0, sizeof(old_info[type]));
ret = 0;
+ memset(old_info + type, 0, sizeof(old_info[type]));
switch (cfmt) {
- case QF_TOONEW:
- fprintf(stderr, _("Too new quotafile format on %s\n"), mnt_fsname);
- ret = -1;
- break;
- case QF_VFSOLD:
- ret = v1_buffer_file(qfname, fd, type);
- break;
- case QF_VFSV0:
- ret = v2_buffer_file(qfname, fd, type);
- break;
- }
- free(qfname);
- close(fd);
+ case QF_TOONEW:
+ fprintf(stderr, _("Too new quotafile format on %s\n"), mnt_fsname);
+ ret = -1;
+ break;
+ case QF_VFSOLD:
+ ret = v1_buffer_file(qfname, fd, type);
+ break;
+ case QF_VFSV0:
+ ret = v2_buffer_file(qfname, fd, type);
+ break;
+ }
+ if (!(flags & FL_NEWFILE)) {
+ free(qfname);
+ close(fd);
+ }
return ret;
}
diff --git a/quotaio.c b/quotaio.c
index f790887..f1b36c7 100644
--- a/quotaio.c
+++ b/quotaio.c
@@ -85,7 +85,11 @@ struct quota_handle *init_io(struct mntent *mnt, int type, int fmt)
#endif
}
- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) {
+ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem? */
+ if (fmt != -1 && fmt != QF_XFS) { /* User wanted some other format? */
+ fprintf(stderr, _("Only XFS quota format is allowed on XFS filesystem.\n"));
+ goto out_handle;
+ }
h->qh_fd = -1;
h->qh_fmt = QF_XFS;
h->qh_ops = &quotafile_ops_xfs;
@@ -122,9 +126,7 @@ struct quota_handle *init_io(struct mntent *mnt, int type, int fmt)
goto out_lock;
}
if (fmt != -1 && h->qh_fmt != fmt) {
- fprintf(stderr,
- _
- ("Quotafile format detected differs from the specified one (or the one kernel uses on the file).\n"));
+ fprintf(stderr, _("Quotafile format detected differs from the specified one (or the one kernel uses on the file).\n"));
goto out_handle;
}
}
diff --git a/quotasys.c b/quotasys.c
index 224ac95..ab05d50 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -34,7 +34,8 @@
(!strcmp(type, MNTTYPE_UFS)) || \
(!strcmp(type, MNTTYPE_UDF)) || \
(!strcmp(type, MNTTYPE_REISER)) || \
-(!strcmp(type, MNTTYPE_XFS)))
+(!strcmp(type, MNTTYPE_XFS)) || \
+(!strcmp(type, MNTTYPE_NFS)))
static char extensions[MAXQUOTAS + 2][20] = INITQFNAMES;
static char *basenames[] = INITQFBASENAMES;
@@ -253,6 +254,8 @@ int hasquota(struct mntent *mnt, int type)
if (!strcmp(mnt->mnt_type, MNTTYPE_XFS))
return hasxfsquota(mnt, type);
+ if (!strcmp(mnt->mnt_type, MNTTYPE_NFS)) /* NFS always has quota or better there is no good way how to detect it */
+ return 1;
if ((type == USRQUOTA) && (option = hasmntopt(mnt, MNTOPT_USRQUOTA)))
return 1;
@@ -366,12 +369,12 @@ struct quota_handle **create_handle_list(int count, char **mntpoints, int type,
continue;
gotmnt++;
}
- else if (!local_only) { /* Use NFS? */
+ else if (!local_only && (fmt == -1 || fmt == QF_RPC)) { /* Use NFS? */
#ifdef RPC
if (gotmnt == MAXMNTPOINTS)
die(3, _("Too many mountpoints. Please report to: %s\n"),
MY_EMAIL);
- if (!(hlist[gotmnt] = init_io(mnt, type, 0)))
+ if (!(hlist[gotmnt] = init_io(mnt, type, fmt)))
continue;
gotmnt++;
#endif