diff options
-rw-r--r-- | Changelog | 5 | ||||
-rw-r--r-- | Makefile.in | 9 | ||||
-rw-r--r-- | bylabel.c | 2 | ||||
-rw-r--r-- | bylabel.h | 6 | ||||
-rw-r--r-- | common.c | 4 | ||||
-rw-r--r-- | common.h | 6 | ||||
-rw-r--r-- | configure.in | 56 | ||||
-rw-r--r-- | convertquota.c | 2 | ||||
-rw-r--r-- | dqblk_rpc.h | 4 | ||||
-rw-r--r-- | dqblk_xfs.h | 4 | ||||
-rw-r--r-- | edquota.c | 2 | ||||
-rw-r--r-- | mntopt.h | 4 | ||||
-rw-r--r-- | pot.c | 3 | ||||
-rw-r--r-- | pot.h | 6 | ||||
-rw-r--r-- | quot.c | 2 | ||||
-rw-r--r-- | quota.c | 2 | ||||
-rw-r--r-- | quota.h | 12 | ||||
-rw-r--r-- | quota_nld.8 | 4 | ||||
-rw-r--r-- | quota_nld.c | 2 | ||||
-rw-r--r-- | quota_tree.h | 4 | ||||
-rw-r--r-- | quotacheck.c | 2 | ||||
-rw-r--r-- | quotacheck.h | 4 | ||||
-rw-r--r-- | quotacheck_v1.c | 2 | ||||
-rw-r--r-- | quotacheck_v2.c | 8 | ||||
-rw-r--r-- | quotaio.c | 2 | ||||
-rw-r--r-- | quotaio.h | 6 | ||||
-rw-r--r-- | quotaio_generic.c | 2 | ||||
-rw-r--r-- | quotaio_generic.h | 4 | ||||
-rw-r--r-- | quotaio_meta.c | 3 | ||||
-rw-r--r-- | quotaio_rpc.c | 2 | ||||
-rw-r--r-- | quotaio_tree.c | 2 | ||||
-rw-r--r-- | quotaio_v1.c | 2 | ||||
-rw-r--r-- | quotaio_v1.h | 2 | ||||
-rw-r--r-- | quotaio_v2.c | 2 | ||||
-rw-r--r-- | quotaio_xfs.c | 1 | ||||
-rw-r--r-- | quotaio_xfs.h | 6 | ||||
-rw-r--r-- | quotaon.c | 2 | ||||
-rw-r--r-- | quotaon_xfs.c | 2 | ||||
-rw-r--r-- | quotaops.c | 2 | ||||
-rw-r--r-- | quotaops.h | 6 | ||||
-rw-r--r-- | quotastats.c | 4 | ||||
-rw-r--r-- | quotasys.c | 25 | ||||
-rw-r--r-- | quotasys.h | 6 | ||||
-rw-r--r-- | repquota.c | 2 | ||||
-rw-r--r-- | rquota_client.c | 5 | ||||
-rw-r--r-- | rquota_client.h | 4 | ||||
-rw-r--r-- | rquota_server.c | 5 | ||||
-rw-r--r-- | rquota_svc.c | 4 | ||||
-rw-r--r-- | set_limits_example.c | 2 | ||||
-rw-r--r-- | setquota.c | 3 | ||||
-rw-r--r-- | svc_socket.c | 2 | ||||
-rw-r--r-- | warnquota.c | 4 | ||||
-rw-r--r-- | xqmstats.c | 1 |
53 files changed, 171 insertions, 97 deletions
@@ -1,5 +1,8 @@ Changes in quota-tools from 3.17 to 4.00-pre1 -* Improved manpage of quota_nld (Eddie) +* Rewritten configuration script to create config.h (Jan Kara) +* Use /proc/mounts for mountpoint scanning (Jan Kara) +* Removed use of reserved identifiers (Jan Kara) +* Improved manpage of quota_nld (Eddie Eyles) * Fixed long option handling of quota_nld (Jan Kara) * Fixed error reporting when rpc format specified on command line (Jan Kara) * Convert quota limits using rq_bsize from RPC request (Jan Kara) diff --git a/Makefile.in b/Makefile.in index e2928d1..7794a6d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,6 @@ PROGS = quotacheck quotaon quota quot repquota warnquota quotastats xqmstats edquota setquota convertquota rpc.rquotad @QUOTA_NETLINK_PROG@ SOURCES = bylabel.c common.c convertquota.c edquota.c pot.c quot.c quota.c quotacheck.c quotacheck_v1.c quotacheck_v2.c quotaio.c quotaio_rpc.c quotaio_v1.c quotaio_v2.c quotaio_tree.c quotaio_xfs.c quotaio_meta.c quotaio_generic.c quotaon.c quotaon_xfs.c quotaops.c quotastats.c quotasys.c repquota.c rquota_client.c rquota_server.c rquota_svc.c setquota.c warnquota.c xqmstats.c svc_socket.c -VERSIONDEF = -DQUOTA_VERSION=\"3.17\" -CFLAGS = @CFLAGS@ @EXT2_DIRECT@ -D_GNU_SOURCE -Wall -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(VERSIONDEF) -DCOMPILE_OPTS="\"@COMPILE_OPTS@\"" +CFLAGS = @CFLAGS@ -D_GNU_SOURCE -Wall -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 CPPFLAGS = @CPPFLAGS@ EXT2LIBS = @EXT2LIBS@ NETLINKLIBS = @NETLINKLIBS@ @@ -10,11 +9,6 @@ LIBS = @LIBS@ LDFLAGS = @LDFLAGS@ LDAPLIBS = @LDAPLIBS@ -# Add lines to /etc/hosts.allow and /etc/hosts.deny -# like: "rquotad: ALL@ALL except my.host.i.want.com" in hosts.deny means -# only the host designated can get info from rquotad -CFLAGS += @HOSTS_ACCESS@ - INSTALL = @INSTALL@ STRIP = -s LN = ln -sf @@ -37,6 +31,7 @@ mandir = @mandir@ includedir = $(prefix)/include locale_dir = $(prefix)/share/locale sysconfdir = @sysconfdir@ +datarootdir = @datarootdir@ RPCCLNTOBJS = rquota_xdr.o rquota_client.o rquota_clnt.o IOOBJS = quotaio.o quotaio_v1.o quotaio_v2.o quotaio_tree.o quotaio_rpc.o quotaio_xfs.o quotaio_meta.o quotaio_generic.o @@ -12,6 +12,8 @@ * - Added XFS support */ +#include "config.h" + #include <stdio.h> #include <sys/param.h> #include <string.h> @@ -1,4 +1,4 @@ -#ifndef _BYLABEL_H_ -#define _BYLABEL_H_ +#ifndef BYLABEL_H_ +#define BYLABEL_H_ const char *get_device_name(const char *item); -#endif /* _BYLABEL_H_ */ +#endif /* BYLABEL_H_ */ @@ -7,6 +7,8 @@ * Jani Jaakkola <jjaakkol@cs.helsinki.fi> - syslog support */ +#include "config.h" + #include <stdio.h> #include <stdlib.h> #include <stdarg.h> @@ -119,7 +121,7 @@ char *sstrdup(const char *s) void version(void) { - printf(_("Quota utilities version %s.\n"), QUOTA_VERSION); + printf(_("Quota utilities version %s.\n"), PACKAGE_VERSION); printf(_("Compiled with:%s\n"), COMPILE_OPTS); printf(_("Bugs to %s\n"), MY_EMAIL); } @@ -4,8 +4,8 @@ * */ -#ifndef _COMMON_H -#define _COMMON_H +#ifndef COMMON_H +#define COMMON_H #ifndef __attribute__ # if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ @@ -46,4 +46,4 @@ char *sstrdup(const char *s); /* Print version string */ void version(void); -#endif /* _COMMON_H */ +#endif /* COMMON_H */ diff --git a/configure.in b/configure.in index c119c6c..7d1986a 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,6 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(quota.c) +AC_CONFIG_HEADERS([config.h]) dnl Checks for programs. AC_PROG_CC @@ -31,11 +32,13 @@ if test "x$enable_ldapmail" != "xno"; then AC_CHECK_LIB(ldap, ldap_initialize, have_new_ldap="yes", AC_CHECK_LIB(ldap, ldap_init, have_old_ldap="yes")) if test "x$have_new_ldap" != "xno" -o "x$have_old_ldap" != "xno"; then LDAPLIBS="-L/usr/lib -lldap" - CFLAGS="$CFLAGS -DUSE_LDAP_MAIL_LOOKUP" + AC_DEFINE([USE_LDAP_MAIL_LOOKUP], 1, [Lookup email address using LDAP]) COMPILE_OPTS="$COMPILE_OPTS USE_LDAP_MAIL_LOOKUP" if test "x$have_new_ldap" = "xyes"; then - CFLAGS="$CFLAGS -DUSE_LDAP_23" - AC_CHECK_DECL(ldap_perror, , CFLAGS="$CFLAGS -DNEED_LDAP_PERROR", [#include <ldap.h>]) + AC_DEFINE([USE_LDAP_23], 1, [LDAP 2.3 or newer installed]) + AC_CHECK_DECL(ldap_perror, , + AC_DEFINE([NEED_LDAP_PERROR], 1, [ldap_perror function not declared]), + [#include <ldap.h>]) fi else if test "x$enable_ldapmail" = "xyes"; then @@ -48,7 +51,7 @@ AC_SUBST(LDAPLIBS) AC_CHECK_HEADER(ext2fs/ext2fs.h,ext2fshead="yes") if test "x$ext2fshead" = "xyes"; then - CFLAGS="-DHAVE_EXT2_INCLUDE $CFLAGS" + AC_DEFINE([HAVE_EXT2_INCLUDE], 1, [Header files for e2fslib]) AC_MSG_CHECKING([for ext2_ino_t]) have_ext2_ino_t="no" AC_EGREP_HEADER(ext2_ino_t, ext2fs/ext2fs.h, have_ext2_ino_t="yes") @@ -56,7 +59,7 @@ if test "x$ext2fshead" = "xyes"; then AC_MSG_RESULT([not found]) else AC_MSG_RESULT([found]) - CFLAGS="-DHAVE_EXT2_INO_T $CFLAGS" + AC_DEFINE([HAVE_EXT2_INO_T], 1, [ext2fs.h defines ext2_ino_t]) fi fi @@ -89,22 +92,12 @@ if test "x$enable_ext2direct" != "xno"; then fi fi if test "x$enable_ext2direct" = "xyes"; then - EXT2_DIRECT="-DEXT2_DIRECT" + AC_DEFINE([EXT2_DIRECT], 1, [Scanning of ext? filesystems using e2fslib]) COMPILE_OPTS="$COMPILE_OPTS EXT2_DIRECT" - AC_SUBST(EXT2_DIRECT) fi fi AC_SUBST(EXT2LIBS) -#AC_ARG_WITH(dbus_include, -# [ --with-dbus_include=path Path to directory with dbus include directory [default=/usr/include/dbus-1.0/]], -# DBUS_INCLUDE="$with_dbus_include", -# DBUS_INCLUDE="/usr/include/dbus-1.0/") -#AC_ARG_WITH(dbus_arch_include, -# [ --with-dbus_arch_include=path Path to directory with dbus arch-dependent include directory [default=/usr/lib/dbus-1.0/include/]], -# DBUS_ARCH_INCLUDE="$with_dbus_arch_include", -# DBUS_ARCH_INCLUDE="/usr/lib/dbus-1.0/include/") - AC_ARG_ENABLE(netlink, [ --enable-netlink=[yes/no/try] Compile daemon receiving quota messages via netlink [default=no].], , @@ -163,9 +156,8 @@ if test ${ac_cv_lib_wrap_main} = yes; then exit 1 ]) LIBS="$LIBS -lwrap" - HOSTS_ACCESS="-DHOSTS_ACCESS" - COMPILE_OPTS="$COMPILE_OPTS HOST_ACCESS" - AC_SUBST(HOSTS_ACCESS) + AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad]) + COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS" fi dnl Checks for typedefs, structures, and compiler characteristics. @@ -198,47 +190,57 @@ AC_ARG_ENABLE(libefence, enable_libefence="no") AC_ARG_ENABLE(nls, - [ --enable-nls=[yes/no] Enable gettext [dafault=yes].], + [ --enable-nls=[yes/no] Enable gettext [default=yes].], , enable_nls="yes") AC_ARG_ENABLE(rootsbin, [ --enable-rootsbin=[yes/no] Use /sbin for some important binaries regardless $prefix [default=no].], , enable_rootsbin="no") +AC_ARG_ENABLE(proc-mounts, + [ --enable-proc-mounts=[path] Use alternate file instead of /etc/mtab [default=/proc/mounts].], + , + enable_proc_mounts="/proc/mounts") if test "$enable_altformat" = "yes" ; then - CFLAGS="-DALT_FORMAT $CFLAGS" + AC_DEFINE([ALT_FORMAT], 1, [Alternative file format of edquota]) COMPILE_OPTS="$COMPILE_OPTS ALT_FORMAT" fi if test "$enable_rpc" = "yes" ; then - CFLAGS="-DRPC $CFLAGS" + AC_DEFINE([RPC], 1, [Support for RPC]) COMPILE_OPTS="$COMPILE_OPTS RPC" fi if test "$enable_rpcsetquota" = "yes" ; then - CFLAGS="-DRPC_SETQUOTA $CFLAGS" + AC_DEFINE([RPC_SETQUOTA], 1, [Allow setting of quotas over RPC]) COMPILE_OPTS="$COMPILE_OPTS RPC_SETQUOTA" fi if test "$enable_xfs_roothack" = "yes" ; then - CFLAGS="-DXFS_ROOTHACK $CFLAGS" + AC_DEFINE([XFS_ROOTHACK], 1, [Assume quota mount options for root filesystem]) COMPILE_OPTS="$COMPILE_OPTS XFS_ROOTHACK" fi if test "$enable_bsd_behaviour" = "yes" ; then - CFLAGS="-DBSD_BEHAVIOUR $CFLAGS" + AC_DEFINE([BSD_BEHAVIOUR], 1, [Check rights to query / set quotas before calling quotactl]) COMPILE_OPTS="$COMPILE_OPTS BSD_BEHAVIOUR" fi if test "$enable_libefence" = "yes" ; then LIBMALLOC="/usr/lib/libefence.a" fi if test "$enable_nls" = "yes" ; then - CFLAGS="-D__GETTEXT__ $CFLAGS" + AC_DEFINE([USE_GETTEXT], 1, [Use gettext to translate messages]) INSTMO="inst_mo" fi +if test -n "$enable_proc_mounts" ; then + AC_DEFINE_UNQUOTED([ALT_MTAB], ["$enable_proc_mounts"], [File with mounted filesystems]) +fi if test "$enable_rootsbin" = "yes" ; then ROOTSBIN="/sbin" else ROOTSBIN='$(prefix)/sbin' fi -AC_SUBST(COMPILE_OPTS) + +AC_DEFINE_UNQUOTED([COMPILE_OPTS], ["$COMPILE_OPTS"], [Configuration options]) +AC_DEFINE([PACKAGE_VERSION], ["4.00-pre1"], [Version of quota tools]) + AC_SUBST(LIBMALLOC) AC_SUBST(INSTMO) AC_SUBST(ROOTSBIN) diff --git a/convertquota.c b/convertquota.c index 6cfd430..ab16193 100644 --- a/convertquota.c +++ b/convertquota.c @@ -5,6 +5,8 @@ * Sponsored by SuSE CR */ +#include "config.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/dqblk_rpc.h b/dqblk_rpc.h index f5a666a..ff2b0b4 100644 --- a/dqblk_rpc.h +++ b/dqblk_rpc.h @@ -2,8 +2,8 @@ * Headerfile for rpc quotafile format */ -#ifndef _DQBLK_RPC_H -#define _DQBLK_RPC_H +#ifndef DQBLK_RPC_H +#define DQBLK_RPC_H /* Values used for communication through network */ #define Q_RPC_GETQUOTA 0x0300 /* get limits and usage */ diff --git a/dqblk_xfs.h b/dqblk_xfs.h index 8b03d98..6d5418e 100644 --- a/dqblk_xfs.h +++ b/dqblk_xfs.h @@ -2,8 +2,8 @@ * Headerfile for XFS quota format */ -#ifndef _DQBLK_XFS_H -#define _DQBLK_XFS_H +#ifndef DQBLK_XFS_H +#define DQBLK_XFS_H #include "quotaio_xfs.h" @@ -32,6 +32,8 @@ * SUCH DAMAGE. */ +#include "config.h" + /* * Disk quota editor. */ @@ -1,5 +1,5 @@ -#ifndef _MNTOPT_H -#define _MNTOPT_H +#ifndef MNTOPT_H +#define MNTOPT_H #include <mntent.h> @@ -1,3 +1,4 @@ +#include "config.h" #include "pot.h" #include <locale.h> @@ -7,7 +8,7 @@ void gettexton(void) { -#ifdef __GETTEXT__ +#ifdef USE_GETTEXT setlocale(LC_ALL, ""); bindtextdomain("quota", "/usr/share/locale"); textdomain("quota"); @@ -1,7 +1,7 @@ -#ifndef _POT_H -#define _POT_H +#ifndef POT_H +#define POT_H -#ifdef __GETTEXT__ +#ifdef USE_GETTEXT #include <libintl.h> @@ -32,6 +32,8 @@ * SUCH DAMAGE. */ +#include "config.h" + #include <sys/stat.h> #include <sys/param.h> #include <sys/ioctl.h> @@ -32,6 +32,8 @@ * SUCH DAMAGE. */ +#include "config.h" + /* * Disk quota reporting program. */ @@ -1,5 +1,5 @@ -#ifndef _QUOTA_H -#define _QUOTA_H +#ifndef QUOTA_H +#define QUOTA_H #include <sys/types.h> @@ -120,9 +120,9 @@ struct if_dqinfo { enum { QUOTA_NL_C_UNSPEC, QUOTA_NL_C_WARNING, - __QUOTA_NL_C_MAX, + ENUM_QUOTA_NL_C_MAX, }; -#define QUOTA_NL_C_MAX (__QUOTA_NL_C_MAX - 1) +#define QUOTA_NL_C_MAX (ENUM_QUOTA_NL_C_MAX - 1) enum { QUOTA_NL_A_UNSPEC, @@ -132,9 +132,9 @@ enum { QUOTA_NL_A_DEV_MAJOR, QUOTA_NL_A_DEV_MINOR, QUOTA_NL_A_CAUSED_ID, - __QUOTA_NL_A_MAX, + ENUM_QUOTA_NL_A_MAX, }; -#define QUOTA_NL_A_MAX (__QUOTA_NL_A_MAX - 1) +#define QUOTA_NL_A_MAX (ENUM_QUOTA_NL_A_MAX - 1) /* Quota format identifiers */ #define QFMT_VFS_OLD 1 diff --git a/quota_nld.8 b/quota_nld.8 index bd85407..9eb7214 100644 --- a/quota_nld.8 +++ b/quota_nld.8 @@ -37,10 +37,10 @@ messages over netlink (in Filesystems->Quota menu). .SH OPTIONS .TP .B \-V, \-\-version -Shows version of quota tools and exit. +Show version of quota tools and exit. .TP .B \-h, \-\-help -Show a usage message and exit +Show a usage message and exit. .TP .B \-D, \-\-no-dbus Do not forward quota warnings to DBUS. diff --git a/quota_nld.c b/quota_nld.c index a8c8d34..538702d 100644 --- a/quota_nld.c +++ b/quota_nld.c @@ -15,6 +15,8 @@ * */ +#include "config.h" + #include <stdio.h> #include <unistd.h> #include <getopt.h> diff --git a/quota_tree.h b/quota_tree.h index 9dd1b8b..ed04520 100644 --- a/quota_tree.h +++ b/quota_tree.h @@ -1,5 +1,5 @@ -#ifndef _QUOTA_TREE_H -#define _QUOTA_TREE_H +#ifndef QUOTA_TREE_H +#define QUOTA_TREE_H #include <sys/types.h> #include "quota.h" diff --git a/quotacheck.c b/quotacheck.c index 0a43188..183b99c 100644 --- a/quotacheck.c +++ b/quotacheck.c @@ -8,6 +8,8 @@ * New quota format implementation - Jan Kara <jack@suse.cz> - Sponsored by SuSE CR */ +#include "config.h" + #include <dirent.h> #include <stdio.h> #include <string.h> diff --git a/quotacheck.h b/quotacheck.h index e7faad1..351310b 100644 --- a/quotacheck.h +++ b/quotacheck.h @@ -4,8 +4,8 @@ * */ -#ifndef _QUOTACHECK_H -#define _QUOTACHECK_H +#ifndef QUOTACHECK_H +#define QUOTACHECK_H #include <sys/types.h> diff --git a/quotacheck_v1.c b/quotacheck_v1.c index 017e692..d0ed3d5 100644 --- a/quotacheck_v1.c +++ b/quotacheck_v1.c @@ -4,6 +4,8 @@ * */ +#include "config.h" + #include <stdio.h> #include <unistd.h> #include <string.h> diff --git a/quotacheck_v2.c b/quotacheck_v2.c index b6a2d7f..77afde3 100644 --- a/quotacheck_v2.c +++ b/quotacheck_v2.c @@ -4,6 +4,8 @@ * */ +#include "config.h" + #include <stdio.h> #include <unistd.h> #include <string.h> @@ -317,6 +319,7 @@ int v2_detect_version(char *filename, int fd, int type) { struct v2_disk_dqheader head; int err; + int ver; lseek(fd, 0, SEEK_SET); err = read(fd, &head, sizeof(head)); @@ -328,7 +331,10 @@ int v2_detect_version(char *filename, int fd, int type) filename); return -1; } - return __le32_to_cpu(head.dqh_version); + ver = __le32_to_cpu(head.dqh_version); + if (ver == 0) + return QF_VFSV0; + return QF_VFSV1; } /* Check basic header */ @@ -5,6 +5,8 @@ * Jan Kara <jack@suse.cz> - sponsored by SuSE CR */ +#include "config.h" + #include <stdio.h> #include <errno.h> #include <string.h> @@ -4,8 +4,8 @@ * */ -#ifndef _QUOTAIO_H -#define _QUOTAIO_H +#ifndef QUOTAIO_H +#define QUOTAIO_H #include <limits.h> #include <sys/types.h> @@ -170,4 +170,4 @@ int end_io(struct quota_handle *h); /* Get empty quota structure */ struct dquot *get_empty_dquot(void); -#endif /* _QUOTAIO_H */ +#endif /* QUOTAIO_H */ diff --git a/quotaio_generic.c b/quotaio_generic.c index 35f458e..e5df683 100644 --- a/quotaio_generic.c +++ b/quotaio_generic.c @@ -4,6 +4,8 @@ * Jan Kara <jack@suse.cz> - sponsored by SuSE CR */ +#include "config.h" + #include <errno.h> #include <string.h> #include <sys/types.h> diff --git a/quotaio_generic.h b/quotaio_generic.h index 47d36a8..c739449 100644 --- a/quotaio_generic.h +++ b/quotaio_generic.h @@ -4,8 +4,8 @@ * */ -#ifndef _QUOTAIO_GENERIC_H -#define _QUOTAIO_GENERIC_H +#ifndef QUOTAIO_GENERIC_H +#define QUOTAIO_GENERIC_H #include "quotaio.h" diff --git a/quotaio_meta.c b/quotaio_meta.c index 516ef22..f1f714f 100644 --- a/quotaio_meta.c +++ b/quotaio_meta.c @@ -3,6 +3,9 @@ * * Jan Kara <jack@suse.cz> */ + +#include "config.h" + #include <string.h> #include <stdlib.h> diff --git a/quotaio_rpc.c b/quotaio_rpc.c index ce9dace..14fe410 100644 --- a/quotaio_rpc.c +++ b/quotaio_rpc.c @@ -2,6 +2,8 @@ * quotaio_rpc.c - quota IO operations for RPC (just wrappers for RPC calls) */ +#include "config.h" + #include <stdio.h> #include <errno.h> #include <stdlib.h> diff --git a/quotaio_tree.c b/quotaio_tree.c index deef04e..cdc0e8f 100644 --- a/quotaio_tree.c +++ b/quotaio_tree.c @@ -4,6 +4,8 @@ * Jan Kara <jack@suse.cz> - sponsored by SuSE CR */ +#include "config.h" + #include <sys/types.h> #include <errno.h> #include <stdio.h> diff --git a/quotaio_v1.c b/quotaio_v1.c index 2cd70b2..0edbc16 100644 --- a/quotaio_v1.c +++ b/quotaio_v1.c @@ -32,6 +32,8 @@ * SUCH DAMAGE. */ +#include "config.h" + #include <unistd.h> #include <errno.h> #include <string.h> diff --git a/quotaio_v1.h b/quotaio_v1.h index aa9448e..fd4475e 100644 --- a/quotaio_v1.h +++ b/quotaio_v1.h @@ -10,7 +10,7 @@ #define V1_DQBLK_SIZE_BITS 10 #define V1_DQBLK_SIZE (1 << V1_DQBLK_SIZE_BITS) /* Size of one quota block in bytes in old format */ -#define V1_DQOFF(__id) ((loff_t) ((__id) * sizeof(struct v1_disk_dqblk))) +#define V1_DQOFF(id) ((loff_t) ((id) * sizeof(struct v1_disk_dqblk))) /* Structure of quota on disk */ struct v1_disk_dqblk { diff --git a/quotaio_v2.c b/quotaio_v2.c index 669fda3..2e3c725 100644 --- a/quotaio_v2.c +++ b/quotaio_v2.c @@ -4,6 +4,8 @@ * Jan Kara <jack@suse.cz> - sponsored by SuSE CR */ +#include "config.h" + #include <sys/types.h> #include <errno.h> #include <stdio.h> diff --git a/quotaio_xfs.c b/quotaio_xfs.c index 02f49f0..4729317 100644 --- a/quotaio_xfs.c +++ b/quotaio_xfs.c @@ -3,6 +3,7 @@ * Copyright (c) 2001 Silicon Graphics, Inc. */ +#include "config.h" #include <stdio.h> #include <unistd.h> diff --git a/quotaio_xfs.h b/quotaio_xfs.h index e7b7e14..ac84d8d 100644 --- a/quotaio_xfs.h +++ b/quotaio_xfs.h @@ -29,8 +29,8 @@ * * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ -#ifndef _QUOTAIO_XFS_H -#define _QUOTAIO_XFS_H +#ifndef QUOTAIO_XFS_H +#define QUOTAIO_XFS_H #include <asm/types.h> @@ -147,4 +147,4 @@ typedef struct fs_quota_stat { __u16 qs_iwarnlimit; /* limit for num warnings */ } fs_quota_stat_t; -#endif /* _QUOTAIO_XFS_H */ +#endif /* QUOTAIO_XFS_H */ @@ -32,6 +32,8 @@ * SUCH DAMAGE. */ +#include "config.h" + /* * Turn quota on/off for a filesystem. */ diff --git a/quotaon_xfs.c b/quotaon_xfs.c index 0820c8a..a2c9f5e 100644 --- a/quotaon_xfs.c +++ b/quotaon_xfs.c @@ -3,6 +3,8 @@ * Copyright (c) 2001 Silicon Graphics, Inc. */ +#include "config.h" + #include <stdio.h> #include <unistd.h> #include <stdlib.h> @@ -32,6 +32,8 @@ * SUCH DAMAGE. */ +#include "config.h" + #include <rpc/rpc.h> #include <sys/types.h> #include <sys/stat.h> @@ -1,5 +1,5 @@ -#ifndef _QUOTAOPS_H -#define _QUOTAOPS_H +#ifndef QUOTAOPS_H +#define QUOTAOPS_H #include "quotaio.h" @@ -15,4 +15,4 @@ int readtimes(struct quota_handle ** handles, int infd); void freeprivs(struct dquot * qlist); void update_grace_times(struct dquot *q); -#endif /* _QUOTAOPS_H */ +#endif /* QUOTAOPS_H */ diff --git a/quotastats.c b/quotastats.c index 7aaf8c9..1ec2137 100644 --- a/quotastats.c +++ b/quotastats.c @@ -10,7 +10,7 @@ * * Author: Marco van Wieringen <mvw@planets.elm.net> * - * Version: $Id: quotastats.c,v 1.11 2005/11/21 22:30:23 jkar8572 Exp $ + * Version: $Id: quotastats.c,v 1.12 2010/01/05 16:04:57 jkar8572 Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -18,6 +18,8 @@ * the License, or (at your option) any later version. */ +#include "config.h" + #include <sys/types.h> #include <stdio.h> #include <unistd.h> @@ -5,6 +5,8 @@ * Jan Kara <jack@suse.cz> - sponsored by SuSE CR */ +#include "config.h" + #include <stdio.h> #include <errno.h> #include <string.h> @@ -913,17 +915,20 @@ static int cache_mnt_table(int flags) int autofsdircnt = 0; char autofsdir[AUTOFS_DIR_MAX][PATH_MAX]; - if (!(mntf = setmntent(_PATH_MOUNTED, "r"))) { - if (errno != ENOENT) { - errstr(_("Cannot open %s: %s\n"), _PATH_MOUNTED, strerror(errno)); - return -1; - } - else /* Fallback on fstab when mtab not available */ - if (!(mntf = setmntent(_PATH_MNTTAB, "r"))) { - errstr(_("Cannot open %s: %s\n"), _PATH_MNTTAB, strerror(errno)); - return -1; - } +#ifdef ALT_MTAB + mntf = setmntent(ALT_MTAB, "r"); + if (mntf) + goto alloc; +#endif + mntf = setmntent(_PATH_MOUNTED, "r"); + if (mntf) + goto alloc; + /* Fallback to fstab when mtab not available */ + if (!(mntf = setmntent(_PATH_MNTTAB, "r"))) { + errstr(_("Cannot open any file with mount points.\n")); + return -1; } +alloc: mnt_entries = smalloc(sizeof(struct mount_entry) * ALLOC_ENTRIES_NUM); mnt_entries_cnt = 0; allocated += ALLOC_ENTRIES_NUM; @@ -4,8 +4,8 @@ * */ -#ifndef _QUOTASYS_H -#define _QUOTASYS_H +#ifndef QUOTASYS_H +#define QUOTASYS_H #include <sys/types.h> #include "mntopt.h" @@ -146,4 +146,4 @@ struct mntent *get_next_mount(void); /* Free all structures associated with mountpoints scan */ void end_mounts_scan(void); -#endif /* _QUOTASYS_H */ +#endif /* QUOTASYS_H */ @@ -6,6 +6,8 @@ * Jan Kara <jack@suse.cz> - Sponsored by SuSE CZ */ +#include "config.h" + #include <stdio.h> #include <stdlib.h> #include <unistd.h> diff --git a/rquota_client.c b/rquota_client.c index c2e3ed3..d4c68b7 100644 --- a/rquota_client.c +++ b/rquota_client.c @@ -9,7 +9,7 @@ * * This part does the rpc-communication with the rquotad. * - * Version: $Id: rquota_client.c,v 1.12 2009/12/14 22:27:33 jkar8572 Exp $ + * Version: $Id: rquota_client.c,v 1.13 2010/01/05 16:04:57 jkar8572 Exp $ * * Author: Marco van Wieringen <mvw@planets.elm.net> * @@ -18,6 +18,9 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ + +#include "config.h" + #include <rpc/rpc.h> #include <sys/types.h> #include <sys/param.h> diff --git a/rquota_client.h b/rquota_client.h index 5753585..292af19 100644 --- a/rquota_client.h +++ b/rquota_client.h @@ -4,8 +4,8 @@ * */ -#ifndef _RQUOTA_CLIENT_H -#define _RQUOTA_CLIENT_H +#ifndef RQUOTA_CLIENT_H +#define RQUOTA_CLIENT_H #include "quotaio.h" diff --git a/rquota_server.c b/rquota_server.c index 21d3176..cb3c44d 100644 --- a/rquota_server.c +++ b/rquota_server.c @@ -9,7 +9,7 @@ * * This part does the lookup of the info. * - * Version: $Id: rquota_server.c,v 1.21 2009/12/14 22:27:33 jkar8572 Exp $ + * Version: $Id: rquota_server.c,v 1.22 2010/01/05 16:04:57 jkar8572 Exp $ * * Author: Marco van Wieringen <mvw@planets.elm.net> * @@ -18,6 +18,9 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ + +#include "config.h" + #include <rpc/rpc.h> #include <arpa/inet.h> #include <paths.h> diff --git a/rquota_svc.c b/rquota_svc.c index e5cd8e1..c0f7efe 100644 --- a/rquota_svc.c +++ b/rquota_svc.c @@ -12,7 +12,7 @@ * changes for new utilities by Jan Kara <jack@suse.cz> * patches by Jani Jaakkola <jjaakkol@cs.helsinki.fi> * - * Version: $Id: rquota_svc.c,v 1.21 2009/04/28 15:36:22 jkar8572 Exp $ + * Version: $Id: rquota_svc.c,v 1.22 2010/01/05 16:04:57 jkar8572 Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -20,6 +20,8 @@ * the License, or (at your option) any later version. */ +#include "config.h" + #include <rpc/rpc.h> #include <sys/socket.h> #include <netinet/in.h> diff --git a/set_limits_example.c b/set_limits_example.c index d437604..755fb2f 100644 --- a/set_limits_example.c +++ b/set_limits_example.c @@ -1,3 +1,5 @@ +#include "config.h" + #include <sys/types.h> #include <sys/quota.h> #include <errno.h> @@ -4,6 +4,9 @@ * * Jan Kara <jack@suse.cz> - sponsored by SuSE CR */ + +#include "config.h" + #include <rpc/rpc.h> #include <sys/types.h> #include <errno.h> diff --git a/svc_socket.c b/svc_socket.c index 67b786e..927b2ea 100644 --- a/svc_socket.c +++ b/svc_socket.c @@ -16,6 +16,8 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include "config.h" + #include <stdio.h> #include <string.h> #include <unistd.h> diff --git a/warnquota.c b/warnquota.c index 92af237..e46b601 100644 --- a/warnquota.c +++ b/warnquota.c @@ -10,7 +10,7 @@ * * Author: Marco van Wieringen <mvw@planets.elm.net> * - * Version: $Id: warnquota.c,v 1.32 2008/08/13 15:52:17 jkar8572 Exp $ + * Version: $Id: warnquota.c,v 1.33 2010/01/05 16:04:57 jkar8572 Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -18,6 +18,8 @@ * the License, or (at your option) any later version. */ +#include "config.h" + #include <stdio.h> #include <fcntl.h> #include <unistd.h> @@ -3,6 +3,7 @@ * Copyright (c) 2001-2003 Silicon Graphics, Inc. */ +#include "config.h" #include <stdio.h> #include <unistd.h> |