forked from pool/quota
This commit is contained in:
parent
1389c4cb09
commit
46f9e3a59b
@ -1,48 +0,0 @@
|
||||
--- configure.in
|
||||
+++ configure.in
|
||||
@@ -96,23 +96,15 @@
|
||||
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/")
|
||||
+PKG_CHECK_MODULES(DBUS, dbus-1)
|
||||
|
||||
AC_ARG_ENABLE(netlink,
|
||||
[ --enable-netlink=[yes/no/try] Compile daemon receiving quota messages via netlink [default=no].],
|
||||
,
|
||||
enable_netlink="no")
|
||||
if test "x$enable_netlink" != "xno"; then
|
||||
- AC_CHECK_LIB(nl, genl_register, NETLINKLIBS="-lnl $NETLINKLIBS")
|
||||
- AC_CHECK_LIB(dbus-1, dbus_bus_get, NETLINKLIBS="-ldbus-1 $NETLINKLIBS")
|
||||
- if test "${ac_cv_lib_nl_genl_register}" != "yes" -o "${ac_cv_lib_dbus_1_dbus_bus_get}" != "yes"; then
|
||||
+ AC_CHECK_LIB(nl, genl_register, NETLINKLIBS="-lnl $DBUS_LIBS $NETLINKLIBS")
|
||||
+ if test -z "$NETLINKLIBS" -o -z "$DBUS_LIBS" ; then
|
||||
if test "x$enable_netlink" = "xyes"; then
|
||||
AC_MSG_ERROR([Required libraries for quota netlink daemon not found.])
|
||||
else
|
||||
@@ -121,16 +113,13 @@
|
||||
enable_netlink="no"
|
||||
NETLINKLIBS=""
|
||||
else
|
||||
- oldCPPFLAGS="$CPPFLAGS"
|
||||
- CPPFLAGS="-I $DBUS_INCLUDE -I $DBUS_ARCH_INCLUDE $CPPFLAGS"
|
||||
- AC_CHECK_HEADERS(dbus/dbus.h, have_dbus="yes")
|
||||
- if test "x$have_dbus" != "xyes"; then
|
||||
+ CPPFLAGS="$DBUS_CFLAGS $CPPFLAGS"
|
||||
+ if test -z "$DBUS_LIBS" ; then
|
||||
if test "x$enable_netlink" = "xyes"; then
|
||||
AC_MSG_ERROR([Required headers for quota netlink daemon not found.])
|
||||
else
|
||||
AC_MSG_WARN([Quota netlink daemon won't be compiled. Required headers not found.])
|
||||
fi
|
||||
- CPPFLAGS="$oldCPPFLAGS"
|
||||
NETLINKLIBS=""
|
||||
enable_netlink="no"
|
||||
else
|
@ -1,10 +0,0 @@
|
||||
--- quota_nld.c
|
||||
+++ quota_nld.c
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
+#include <limits.h>
|
||||
|
||||
#include <netlink/genl/genl.h>
|
||||
#include <netlink/genl/ctrl.h>
|
@ -1,170 +0,0 @@
|
||||
--- quota.c
|
||||
+++ quota.c
|
||||
@@ -198,7 +198,7 @@
|
||||
}
|
||||
else {
|
||||
if (bover)
|
||||
- sprintf(timebuf, "%Lu", (long long unsigned int)q->dq_dqb.dqb_btime);
|
||||
+ sprintf(timebuf, "%llu", (long long unsigned int)q->dq_dqb.dqb_btime);
|
||||
else
|
||||
strcpy(timebuf, "0");
|
||||
}
|
||||
@@ -216,7 +216,7 @@
|
||||
}
|
||||
else {
|
||||
if (iover)
|
||||
- sprintf(timebuf, "%Lu", (long long unsigned int)q->dq_dqb.dqb_itime);
|
||||
+ sprintf(timebuf, "%llu", (long long unsigned int)q->dq_dqb.dqb_itime);
|
||||
else
|
||||
strcpy(timebuf, "0");
|
||||
}
|
||||
--- quota_nld.c
|
||||
+++ quota_nld.c
|
||||
@@ -237,12 +237,12 @@
|
||||
}
|
||||
}
|
||||
if (!max_atime) {
|
||||
- errstr(_("Failed to find tty of user %Lu to report warning to.\n"), (unsigned long long)warn->caused_id);
|
||||
+ errstr(_("Failed to find tty of user %llu to report warning to.\n"), (unsigned long long)warn->caused_id);
|
||||
return;
|
||||
}
|
||||
fd = open(max_dev, O_WRONLY);
|
||||
if (fd < 0) {
|
||||
- errstr(_("Failed to open tty %s of user %Lu to report warning.\n"), dev, (unsigned long long)warn->caused_id);
|
||||
+ errstr(_("Failed to open tty %s of user %llu to report warning.\n"), dev, (unsigned long long)warn->caused_id);
|
||||
return;
|
||||
}
|
||||
id2name(warn->excess_id, warn->qtype, user);
|
||||
@@ -274,7 +274,7 @@
|
||||
}
|
||||
sprintf(warnbuf, "%s: %s %s %s.\r\n", level, type2name(warn->qtype), user, msg);
|
||||
if (write_all(fd, warnbuf, strlen(warnbuf)) < 0)
|
||||
- errstr(_("Failed to write quota message for user %Lu to %s: %s\n"), (unsigned long long)warn->caused_id, dev, strerror(errno));
|
||||
+ errstr(_("Failed to write quota message for user %llu to %s: %s\n"), (unsigned long long)warn->caused_id, dev, strerror(errno));
|
||||
close(fd);
|
||||
}
|
||||
|
||||
--- quotacheck.c
|
||||
+++ quotacheck.c
|
||||
@@ -553,7 +553,7 @@
|
||||
if (gcheck)
|
||||
add_to_quota(GRPQUOTA, st.st_ino, st.st_uid, st.st_gid, st.st_mode,
|
||||
st.st_nlink, qspace, 1);
|
||||
- debug(FL_DEBUG, _("\tAdding %s size %Ld ino %d links %d uid %u gid %u\n"), de->d_name,
|
||||
+ debug(FL_DEBUG, _("\tAdding %s size %lld ino %d links %d uid %u gid %u\n"), de->d_name,
|
||||
(long long)st.st_size, (int)st.st_ino, (int)st.st_nlink, (int)st.st_uid, (int)st.st_gid);
|
||||
files_done++;
|
||||
}
|
||||
--- quotacheck_v2.c
|
||||
+++ quotacheck_v2.c
|
||||
@@ -158,7 +158,7 @@
|
||||
if (flags & FL_GUESSDQ) {
|
||||
if (!(flags & (FL_DEBUG | FL_VERBOSE)))
|
||||
fputc('\n', stderr);
|
||||
- errstr(_("Found more structures for ID %u. Using values: BHARD: %Ld BSOFT: %Ld IHARD: %Ld ISOFT: %Ld\n"),
|
||||
+ errstr(_("Found more structures for ID %u. Using values: BHARD: %lld BSOFT: %lld IHARD: %lld ISOFT: %lld\n"),
|
||||
(uint) id, (long long)fdq->dqb_bhardlimit, (long long)fdq->dqb_bsoftlimit,
|
||||
(long long)fdq->dqb_ihardlimit, (long long)fdq->dqb_isoftlimit);
|
||||
return 0;
|
||||
@@ -166,7 +166,7 @@
|
||||
else if (flags & FL_INTERACTIVE) {
|
||||
if (!(flags & (FL_DEBUG | FL_VERBOSE)))
|
||||
fputc('\n', stderr);
|
||||
- errstr(_("Found more structures for ID %u. Values: BHARD: %Ld/%Ld BSOFT: %Ld/%Ld IHARD: %Ld/%Ld ISOFT: %Ld/%Ld\n"),
|
||||
+ errstr(_("Found more structures for ID %u. Values: BHARD: %lld/%Ld BSOFT: %lld/%lld IHARD: %lld/%lld ISOFT: %lld/%lld\n"),
|
||||
(uint) id, (long long)fdq->dqb_bhardlimit, (long long)mdq.dqb_bhardlimit,
|
||||
(long long)fdq->dqb_bsoftlimit, (long long)mdq.dqb_bsoftlimit,
|
||||
(long long)fdq->dqb_ihardlimit, (long long)mdq.dqb_ihardlimit,
|
||||
--- quotaio_xfs.c
|
||||
+++ quotaio_xfs.c
|
||||
@@ -274,7 +274,7 @@
|
||||
if (info->qs_uquota.qfs_ino == -1 || info->qs_uquota.qfs_ino == 0)
|
||||
printf(_("Inode: none\n"));
|
||||
else
|
||||
- printf(_("Inode: #%Lu (%Lu blocks, %u extents)\n"),
|
||||
+ printf(_("Inode: #%llu (%llu blocks, %u extents)\n"),
|
||||
(unsigned long long)info->qs_uquota.qfs_ino,
|
||||
(unsigned long long)info->qs_uquota.qfs_nblks,
|
||||
info->qs_uquota.qfs_nextents);
|
||||
@@ -283,7 +283,7 @@
|
||||
if (info->qs_gquota.qfs_ino == -1)
|
||||
printf(_("Inode: none\n"));
|
||||
else
|
||||
- printf(_("Inode: #%Lu (%Lu blocks, %u extents)\n"),
|
||||
+ printf(_("Inode: #%llu (%llu blocks, %u extents)\n"),
|
||||
(unsigned long long)info->qs_gquota.qfs_ino,
|
||||
(unsigned long long)info->qs_gquota.qfs_nblks,
|
||||
info->qs_gquota.qfs_nextents);
|
||||
--- quotaops.c
|
||||
+++ quotaops.c
|
||||
@@ -266,7 +266,7 @@
|
||||
_(" Filesystem blocks soft hard inodes soft hard\n"));
|
||||
|
||||
for (q = qlist; q; q = q->dq_next) {
|
||||
- fprintf(fd, " %-24s %10Lu %10Lu %10Lu %10Lu %8Lu %8Lu\n",
|
||||
+ fprintf(fd, " %-24s %10llu %10llu %10llu %10llu %8llu %8llu\n",
|
||||
q->dq_h->qh_quotadev,
|
||||
(long long)toqb(q->dq_dqb.dqb_curspace),
|
||||
(long long)q->dq_dqb.dqb_bsoftlimit,
|
||||
@@ -344,7 +344,7 @@
|
||||
fgets(line, sizeof(line), fd);
|
||||
|
||||
while (fgets(line, sizeof(line), fd)) {
|
||||
- cnt = sscanf(line, "%s %Lu %Lu %Lu %Lu %Lu %Lu",
|
||||
+ cnt = sscanf(line, "%s %llu %llu %llu %llu %llu %llu",
|
||||
fsp, &blocks, &bsoft, &bhard, &inodes, &isoft, &ihard);
|
||||
|
||||
if (cnt != 7) {
|
||||
@@ -384,7 +384,7 @@
|
||||
return -1;
|
||||
}
|
||||
|
||||
- cnt = sscanf(cp, _("\tinodes in use: %Lu, limits (soft = %Lu, hard = %Lu)"),
|
||||
+ cnt = sscanf(cp, _("\tinodes in use: %llu, limits (soft = %llu, hard = %llu)"),
|
||||
&inodes, &isoft, &ihard);
|
||||
if (cnt != 3) {
|
||||
errstr(_("%s - %s -- bad format\n"),
|
||||
--- quotasys.c
|
||||
+++ quotasys.c
|
||||
@@ -367,10 +367,10 @@
|
||||
if (format)
|
||||
for (i = 3; i > 0; i--)
|
||||
if (space >= (1LL << (QUOTABLOCK_BITS*i))*100) {
|
||||
- sprintf(buf, "%Lu%c", (unsigned long long)(space+(1 << (QUOTABLOCK_BITS*i))-1) >> (QUOTABLOCK_BITS*i), suffix[i]);
|
||||
+ sprintf(buf, "%llu%c", (unsigned long long)(space+(1 << (QUOTABLOCK_BITS*i))-1) >> (QUOTABLOCK_BITS*i), suffix[i]);
|
||||
return;
|
||||
}
|
||||
- sprintf(buf, "%Lu", (unsigned long long)space);
|
||||
+ sprintf(buf, "%llu", (unsigned long long)space);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -385,7 +385,7 @@
|
||||
if (format)
|
||||
for (i = 4, div = 1000000000000LL; i > 0; i--, div /= 1000)
|
||||
if (num >= 100*div) {
|
||||
- sprintf(buf, "%Lu%c", (num+div-1) / div, suffix[i]);
|
||||
+ sprintf(buf, "%llu%c", (num+div-1) / div, suffix[i]);
|
||||
return;
|
||||
}
|
||||
sprintf(buf, "%Lu", num);
|
||||
--- repquota.c
|
||||
+++ repquota.c
|
||||
@@ -181,7 +181,7 @@
|
||||
pname[PRINTNAMELEN] = 0;
|
||||
if (entry->dqb_bsoftlimit && toqb(entry->dqb_curspace) >= entry->dqb_bsoftlimit)
|
||||
if (flags & FL_RAWGRACE)
|
||||
- sprintf(time, "%Lu", (unsigned long long)entry->dqb_btime);
|
||||
+ sprintf(time, "%llu", (unsigned long long)entry->dqb_btime);
|
||||
else
|
||||
difftime2str(entry->dqb_btime, time);
|
||||
else
|
||||
@@ -198,7 +198,7 @@
|
||||
numbuf[0], numbuf[1], numbuf[2], time);
|
||||
if (entry->dqb_isoftlimit && entry->dqb_curinodes >= entry->dqb_isoftlimit)
|
||||
if (flags & FL_RAWGRACE)
|
||||
- sprintf(time, "%Lu", (unsigned long long)entry->dqb_itime);
|
||||
+ sprintf(time, "%llu", (unsigned long long)entry->dqb_itime);
|
||||
else
|
||||
difftime2str(entry->dqb_itime, time);
|
||||
else
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0e91c0f62c203f60e24e79f1fec0b10b651209998d27893177dec5e1cab251b8
|
||||
size 258562
|
@ -1,6 +1,6 @@
|
||||
--- warnquota.conf
|
||||
+++ warnquota.conf
|
||||
@@ -1,53 +1,111 @@
|
||||
--- ./warnquota.conf
|
||||
+++ ./warnquota.conf
|
||||
@@ -1,55 +1,116 @@
|
||||
-# this is an example warnquota.conf
|
||||
+###################################################################
|
||||
+# Configuration file for the warnquota utility
|
||||
@ -91,14 +91,7 @@
|
||||
+#
|
||||
GROUP_SIGNATURE = See you!| Your admin|
|
||||
+
|
||||
#
|
||||
-#If you are running warnquota on a mail server, and don't want bounces
|
||||
-#because clients cannot receive mail setting this to "any" will cause
|
||||
-#warnquota to not send them mail for all devices. If you set this to the
|
||||
-#device name (for example /dev/hdb1) then they will not be sent mail if they
|
||||
-#are overquota on that device only, and will be sent mail for all other
|
||||
-#devices.
|
||||
-#MAILDEV =
|
||||
+#
|
||||
+# If you are running warnquota on a mail server, and don't want bounces
|
||||
+# because clients can not receive mail setting this to "any" will cause
|
||||
+# warnquota to not send them mail for all devices. If you set this to the
|
||||
@ -106,8 +99,20 @@
|
||||
+# are overquota on that device only, and will be sent mail for all other
|
||||
+# devices.
|
||||
#
|
||||
-#If you are running warnquota on a mail server, and don't want bounces
|
||||
-#because clients cannot receive mail setting this to "any" will cause
|
||||
-#warnquota to not send them mail for all devices. If you set this to the
|
||||
-#device name (for example /dev/hdb1) then they will not be sent mail if they
|
||||
-#are overquota on that device only, and will be sent mail for all other
|
||||
-#devices.
|
||||
#MAILDEV =
|
||||
+
|
||||
+#
|
||||
+# Here you can set a charset for emails sent by warnquota (e.g. UTF-8)
|
||||
#
|
||||
-#Here you can set a charset for emails sent by warnquota (e.g. UTF-8)
|
||||
#CHARSET =
|
||||
-# If you are using LDAP mail lookups.
|
||||
+#MAILDEV =
|
||||
+
|
||||
+##############################################################
|
||||
+# Configuration for LDAP (if you are using LDAP mail lookups)
|
||||
@ -143,7 +148,7 @@
|
||||
# if binddn and bindpw are blank or left out, an anonymous bind is used
|
||||
#
|
||||
# LDAP_MAIL = false # or false if you don't want to use it
|
||||
@@ -59,6 +117,5 @@
|
||||
@@ -64,6 +125,5 @@
|
||||
# LDAP_SEARCH_ATTRIBUTE = uid
|
||||
# LDAP_MAIL_ATTRIBUTE = mailLocalAddress
|
||||
# LDAP_DEFAULT_MAIL_DOMAIN = YourDefaultMailDomain.com
|
3
quota-3.17.tar.bz2
Normal file
3
quota-3.17.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4f384ab78356b028bfdd71dfc3fbafc83fe55b38003657e0303e908e2851ffcd
|
||||
size 275641
|
@ -1,288 +0,0 @@
|
||||
--- quota-tools/Changelog
|
||||
+++ quota-tools/Changelog
|
||||
@@ -1,3 +1,6 @@
|
||||
+* fixed bug in error reporting when quota reading fails (Jan Kara)
|
||||
+* added support for quota formats with hidden quota files (Jan Kara)
|
||||
+
|
||||
Changes in quota-tools from 3.15 to 3.16
|
||||
* added information message about journaled quota to quotacheck (Jan Kara, Alex Tomas)
|
||||
* added pointers to quota_nld and warnquota to some manpages (Jan Kara)
|
||||
--- quota-tools/Makefile.in
|
||||
+++ quota-tools/Makefile.in
|
||||
@@ -1,5 +1,5 @@
|
||||
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_xfs.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
|
||||
+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_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.16\"
|
||||
CFLAGS = @CFLAGS@ @EXT2_DIRECT@ -D_GNU_SOURCE -Wall -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 $(VERSIONDEF) -DCOMPILE_OPTS="\"@COMPILE_OPTS@\""
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
@@ -39,7 +39,7 @@
|
||||
sysconfdir = @sysconfdir@
|
||||
|
||||
RPCCLNTOBJS = rquota_xdr.o rquota_client.o rquota_clnt.o
|
||||
-IOOBJS = quotaio.o quotaio_v1.o quotaio_v2.o quotaio_rpc.o quotaio_xfs.o quotaio_generic.o
|
||||
+IOOBJS = quotaio.o quotaio_v1.o quotaio_v2.o quotaio_rpc.o quotaio_xfs.o quotaio_meta.o quotaio_generic.o
|
||||
IOOBJS += $(RPCCLNTOBJS)
|
||||
LIBOBJS = bylabel.o common.o quotasys.o pot.o $(IOOBJS)
|
||||
LIBOBJS += @LIBMALLOC@
|
||||
--- quota-tools/mntopt.h
|
||||
+++ quota-tools/mntopt.h
|
||||
@@ -16,6 +16,7 @@
|
||||
#define MNTTYPE_JFS "jfs" /* JFS file system */
|
||||
#define MNTTYPE_NFS4 "nfs4" /* NFSv4 filesystem */
|
||||
#define MNTTYPE_MPFS "mpfs" /* EMC Celerra MPFS filesystem */
|
||||
+#define MNTTYPE_OCFS2 "ocfs2" /* Oracle Cluster filesystem */
|
||||
|
||||
/* mount options */
|
||||
#define MNTOPT_NOQUOTA "noquota" /* don't enforce quota */
|
||||
--- quota-tools/quota.h
|
||||
+++ quota-tools/quota.h
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef u_int32_t qid_t; /* Type in which we store ids in memory */
|
||||
-typedef u_int64_t qsize_t; /* Type in which we store size limitations */
|
||||
+typedef int64_t qsize_t; /* Type in which we store size limitations */
|
||||
|
||||
#define MAXQUOTAS 2
|
||||
#define USRQUOTA 0 /* element used for user quotas */
|
||||
@@ -135,6 +135,7 @@
|
||||
/* Quota format identifiers */
|
||||
#define QFMT_VFS_OLD 1
|
||||
#define QFMT_VFS_V0 2
|
||||
+#define QFMT_OCFS2 3
|
||||
|
||||
/* Flags supported by kernel */
|
||||
#define V1_DQF_RSQUASH 1
|
||||
--- quota-tools/quotacheck.c
|
||||
+++ quota-tools/quotacheck.c
|
||||
@@ -1036,7 +1036,8 @@
|
||||
while ((mnt = get_next_mount())) {
|
||||
if (flags & FL_ALL && flags & FL_NOROOT && !strcmp(mnt->mnt_dir, "/"))
|
||||
continue;
|
||||
- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) || nfs_fstype(mnt->mnt_type)) {
|
||||
+ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) || nfs_fstype(mnt->mnt_type) ||
|
||||
+ meta_qf_fstype(mnt->mnt_type)) {
|
||||
debug(FL_DEBUG | FL_VERBOSE, _("Skipping %s [%s]\n"), mnt->mnt_fsname, mnt->mnt_dir);
|
||||
continue;
|
||||
}
|
||||
--- quota-tools/quotaio.c
|
||||
+++ quota-tools/quotaio.c
|
||||
@@ -97,8 +97,26 @@
|
||||
fmt = kernfmt; /* Default is kernel used format */
|
||||
}
|
||||
}
|
||||
- if ((fmt = get_qf_name(mnt, type, (fmt == -1) ? ((1 << QF_VFSOLD) | (1 << QF_VFSV0)) : (1 << fmt),
|
||||
- (!QIO_ENABLED(h) || flags & IOI_OPENFILE) ? NF_FORMAT : 0, &qfname)) < 0) {
|
||||
+
|
||||
+ if (meta_qf_fstype(mnt->mnt_type)) {
|
||||
+ if (!QIO_ENABLED(h)) {
|
||||
+ errstr(_("Quota not supported by the filesystem.\n"));
|
||||
+ goto out_handle;
|
||||
+ }
|
||||
+ if (flags & IOI_OPENFILE) {
|
||||
+ errstr(_("Operation not supported for filesystems with hidden quota files!\n"));
|
||||
+ goto out_handle;
|
||||
+ }
|
||||
+ h->qh_fd = -1;
|
||||
+ h->qh_fmt = fmt;
|
||||
+ goto set_ops;
|
||||
+ }
|
||||
+
|
||||
+ fmt = get_qf_name(mnt, type,
|
||||
+ (fmt == -1) ? ((1 << QF_VFSOLD) | (1 << QF_VFSV0)) : (1 << fmt),
|
||||
+ (!QIO_ENABLED(h) || flags & IOI_OPENFILE) ? NF_FORMAT : 0,
|
||||
+ &qfname);
|
||||
+ if (fmt < 0) {
|
||||
errstr(_("Quota file not found or has wrong format.\n"));
|
||||
goto out_handle;
|
||||
}
|
||||
@@ -121,10 +139,13 @@
|
||||
free(qfname); /* We don't need it anymore */
|
||||
qfname = NULL;
|
||||
|
||||
+set_ops:
|
||||
if (h->qh_fmt == QF_VFSOLD)
|
||||
h->qh_ops = "afile_ops_1;
|
||||
else if (h->qh_fmt == QF_VFSV0)
|
||||
h->qh_ops = "afile_ops_2;
|
||||
+ else if (h->qh_fmt == QF_META)
|
||||
+ h->qh_ops = "afile_ops_meta;
|
||||
memset(&h->qh_info, 0, sizeof(h->qh_info));
|
||||
|
||||
if (h->qh_ops->init_io && h->qh_ops->init_io(h) < 0) {
|
||||
@@ -155,7 +176,7 @@
|
||||
|
||||
if (fmt == -1)
|
||||
fmt = QF_VFSV0; /* Use the newest format */
|
||||
- else if (fmt == QF_RPC || fmt == QF_XFS) {
|
||||
+ else if (fmt == QF_RPC || fmt == QF_XFS || meta_qf_fstype(mnt->mnt_type)) {
|
||||
errstr(_("Creation of %s quota format is not supported.\n"),
|
||||
fmt == QF_RPC ? "RPC" : "XFS");
|
||||
return NULL;
|
||||
--- quota-tools/quotaio.h
|
||||
+++ quota-tools/quotaio.h
|
||||
@@ -50,6 +50,7 @@
|
||||
#define QF_VFSV0 1 /* New quota format - version 0 */
|
||||
#define QF_RPC 2 /* RPC should be used on given filesystem */
|
||||
#define QF_XFS 3 /* XFS quota format */
|
||||
+#define QF_META 4 /* Quota files are hidden, we don't care about the format */
|
||||
|
||||
/*
|
||||
* Definitions for disk quotas imposed on the average user
|
||||
@@ -153,6 +154,9 @@
|
||||
int (*report) (struct quota_handle * h, int verbose); /* Function called after 'repquota' to print format specific file information */
|
||||
};
|
||||
|
||||
+/* This might go into a special header file but that sounds a bit silly... */
|
||||
+extern struct quotafile_ops quotafile_ops_meta;
|
||||
+
|
||||
static inline void mark_quotafile_info_dirty(struct quota_handle *h)
|
||||
{
|
||||
h->qh_io_flags |= IOFL_INFODIRTY;
|
||||
--- quota-tools/quotaio_meta.c
|
||||
+++ quota-tools/quotaio_meta.c
|
||||
@@ -0,0 +1,58 @@
|
||||
+/*
|
||||
+ * Implementation of handling of quotafiles which are hidden
|
||||
+ *
|
||||
+ * Jan Kara <jack@suse.cz>
|
||||
+ */
|
||||
+#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+#include <sys/types.h>
|
||||
+
|
||||
+#include "pot.h"
|
||||
+#include "common.h"
|
||||
+#include "quotasys.h"
|
||||
+#include "quotaio_generic.h"
|
||||
+
|
||||
+static int meta_init_io(struct quota_handle *h)
|
||||
+{
|
||||
+ if (!QIO_ENABLED(h)) {
|
||||
+ errstr(_("Metadata init_io called when kernel support is not enabled.\n"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if (kernel_iface != IFACE_GENERIC) {
|
||||
+ errstr(_("Metadata init_io called when kernel does not support generic quota interface!\n"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ return vfs_get_info(h);
|
||||
+}
|
||||
+
|
||||
+static int meta_write_info(struct quota_handle *h)
|
||||
+{
|
||||
+ return vfs_set_info(h, IIF_BGRACE | IIF_IGRACE);
|
||||
+}
|
||||
+
|
||||
+static struct dquot *meta_read_dquot(struct quota_handle *h, qid_t id)
|
||||
+{
|
||||
+ struct dquot *dquot = get_empty_dquot();
|
||||
+
|
||||
+ dquot->dq_id = id;
|
||||
+ dquot->dq_h = h;
|
||||
+ memset(&dquot->dq_dqb, 0, sizeof(struct util_dqblk));
|
||||
+ if (vfs_get_dquot(dquot) < 0) {
|
||||
+ free(dquot);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ return dquot;
|
||||
+}
|
||||
+
|
||||
+static int meta_commit_dquot(struct dquot *dquot, int flags)
|
||||
+{
|
||||
+ return vfs_set_dquot(dquot, flags);
|
||||
+}
|
||||
+
|
||||
+struct quotafile_ops quotafile_ops_meta = {
|
||||
+init_io: meta_init_io,
|
||||
+write_info: meta_write_info,
|
||||
+read_dquot: meta_read_dquot,
|
||||
+commit_dquot: meta_commit_dquot,
|
||||
+};
|
||||
--- quota-tools/quotaon.c
|
||||
+++ quota-tools/quotaon.c
|
||||
@@ -173,6 +173,12 @@
|
||||
|| (!(flags & FL_OFF) && kern_quota_on(mnt->mnt_fsname, type, 1 << QF_XFS))))
|
||||
ret = xfs_newstate(mnt, type, extra, sflags);
|
||||
}
|
||||
+ else if (meta_qf_fstype(mnt->mnt_type)) {
|
||||
+ if (!hasquota(mnt, type, 0))
|
||||
+ return 0;
|
||||
+ /* Must be non-empty because empty path is always invalid. */
|
||||
+ ret = v2_newstate(mnt, type, ".", sflags);
|
||||
+ }
|
||||
else {
|
||||
if (!hasquota(mnt, type, 0))
|
||||
return 0;
|
||||
--- quota-tools/quotaops.c
|
||||
+++ quota-tools/quotaops.c
|
||||
@@ -154,9 +154,11 @@
|
||||
if (!(q = handles[i]->qh_ops->read_dquot(handles[i], id))) {
|
||||
/* If rpc.rquotad is not running filesystem might be just without quotas... */
|
||||
if (errno != ENOENT && (errno != ECONNREFUSED || !quiet)) {
|
||||
+ int olderrno = errno;
|
||||
+
|
||||
id2name(id, handles[i]->qh_type, name);
|
||||
errstr(_("error while getting quota from %s for %s (id %u): %s\n"),
|
||||
- handles[i]->qh_quotadev, name, id, strerror(errno));
|
||||
+ handles[i]->qh_quotadev, name, id, strerror(olderrno));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
--- quota-tools/quotasys.c
|
||||
+++ quota-tools/quotasys.c
|
||||
@@ -48,6 +48,15 @@
|
||||
}
|
||||
|
||||
/*
|
||||
+ * Check whether filesystem has hidden quota files which is handles
|
||||
+ * as metadata (and thus always tracks usage).
|
||||
+ */
|
||||
+int meta_qf_fstype(char *type)
|
||||
+{
|
||||
+ return !strcmp(type, MNTTYPE_OCFS2);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* Check whether give filesystem type is supported
|
||||
*/
|
||||
|
||||
@@ -71,6 +80,7 @@
|
||||
!strcmp(type, MNTTYPE_XFS) ||
|
||||
!strcmp(type, MNTTYPE_NFS) ||
|
||||
!strcmp(type, MNTTYPE_NFS4) ||
|
||||
+ !strcmp(type, MNTTYPE_OCFS2) ||
|
||||
!strcmp(type, MNTTYPE_MPFS)) {
|
||||
free(mtype);
|
||||
return 1;
|
||||
@@ -267,6 +277,8 @@
|
||||
return QF_VFSOLD;
|
||||
case QFMT_VFS_V0:
|
||||
return QF_VFSV0;
|
||||
+ case QFMT_OCFS2:
|
||||
+ return QF_META;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -700,7 +712,7 @@
|
||||
/* Detect new kernel interface; Assume generic interface unless we can prove there is not one... */
|
||||
if (!stat("/proc/sys/fs/quota", &st) || errno != ENOENT) {
|
||||
kernel_iface = IFACE_GENERIC;
|
||||
- kernel_formats |= (1 << QF_VFSOLD) | (1 << QF_VFSV0);
|
||||
+ kernel_formats |= (1 << QF_VFSOLD) | (1 << QF_VFSV0) | (1 << QF_META);
|
||||
}
|
||||
else {
|
||||
struct v2_dqstats v2_stats;
|
||||
--- quota-tools/quotasys.h
|
||||
+++ quota-tools/quotasys.h
|
||||
@@ -41,6 +41,8 @@
|
||||
*/
|
||||
/* Check whether type is one of the NFS filesystems */
|
||||
int nfs_fstype(char *);
|
||||
+/* Quota file is treated as metadata? */
|
||||
+int meta_qf_fstype(char *type);
|
||||
|
||||
/* Convert quota type to written form */
|
||||
char *type2name(int);
|
@ -1,3 +1,28 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 9 15:03:46 CET 2009 - mseben@suse.cz
|
||||
|
||||
- update to version 3.17
|
||||
- changes in quota-tools from 3.16 to 3.17
|
||||
* do not allow setting of user's grace time when softlimit is not exceeded (Jan Kara)
|
||||
* fix reference to rpc manpage (anonymous reporter)
|
||||
* add EXT4 (not only EXT4DEV) to the list of supported filesystems (Mingming Cao)
|
||||
* fix setting of more than 31-bit block and inode limits (Gui Xiaohua)
|
||||
* fixed bug in error reporting when quota reading fails (Jan Kara)
|
||||
* added support for quota formats with hidden quota files (Jan Kara)
|
||||
* remove IMMUTABLE flag from quota file in quotacheck (Jan Kara)
|
||||
* fix bug in warnquota which could result in bogus hostname and domainname (anonymous reporter)
|
||||
* implemented writing of messages that user got below hard/soft limits to quota_nld (Jan Kara)
|
||||
* use PKG_CHECK_MODULES to check for DBUS (Ladislav Michnovic)
|
||||
* Implement setting of charset for emails sent by warnquota (Michael Meskes)
|
||||
* Added quota_nld to the list of installed programs (Jan Kara)
|
||||
* some typos fixes (Matthew Boyle)
|
||||
* fixed possible segfault when unpriviledged user run edquota (Matthew Boyle)
|
||||
* fixed format strings to use "%llu" and "%lld" instead of "%Lu" and "%Ld" (Ladislav Michnovic)
|
||||
* removed ssl, resolv, lber from the list of LDAP libraries since we don't need them directly (Jan Kara)
|
||||
* added limits.h include to quota_nld (Jan Kara)
|
||||
* fixed repquota to work with limits over 4 TB (Jan Kara, Michael Meier)
|
||||
- deprecated *-dbus_header_check.patch, *-glibc2_8.patch, *-type.patch, quota-tools-meta.diff
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 11 13:42:23 CET 2008 - nadvornik@suse.cz
|
||||
|
||||
|
38
quota.spec
38
quota.spec
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package quota (Version 3.16)
|
||||
# spec file for package quota (Version 3.17)
|
||||
#
|
||||
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -20,8 +20,8 @@
|
||||
|
||||
Name: quota
|
||||
BuildRequires: dbus-1-devel e2fsprogs-devel libnl-devel pkg-config tcpd-devel
|
||||
Version: 3.16
|
||||
Release: 50
|
||||
Version: 3.17
|
||||
Release: 1
|
||||
PreReq: %insserv_prereq %fillup_prereq
|
||||
AutoReqProv: on
|
||||
Group: System/Filesystems
|
||||
@ -33,11 +33,7 @@ Source1: %{name}-SUSE.tar.bz2
|
||||
Patch1: %{name}-%{version}-makefile.patch
|
||||
Patch2: %{name}-%{version}-man.patch
|
||||
Patch3: %{name}-%{version}-warnquota.patch
|
||||
Patch4: %{name}-%{version}-type.patch
|
||||
Patch5: %{name}-%{version}-dbus_header_check.patch
|
||||
Patch6: %{name}-%{version}-glibc2_8.patch
|
||||
Patch7: %{name}-%{version}-install_nld.patch
|
||||
Patch8: quota-tools-meta.diff
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
|
||||
%description
|
||||
@ -83,11 +79,7 @@ Authors:
|
||||
%patch1
|
||||
%patch2
|
||||
%patch3
|
||||
%patch4
|
||||
%patch5
|
||||
%patch6
|
||||
%patch7
|
||||
%patch8 -p1
|
||||
find -type d -name CVS -exec rm -rf {} \; -prune
|
||||
find -type d | xargs chmod 755
|
||||
|
||||
@ -159,6 +151,28 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%exclude /usr/include/rpcsvc/*
|
||||
|
||||
%changelog
|
||||
* Fri Jan 09 2009 mseben@suse.cz
|
||||
- update to version 3.17
|
||||
- changes in quota-tools from 3.16 to 3.17
|
||||
* do not allow setting of user's grace time when softlimit is not exceeded (Jan Kara)
|
||||
* fix reference to rpc manpage (anonymous reporter)
|
||||
* add EXT4 (not only EXT4DEV) to the list of supported filesystems (Mingming Cao)
|
||||
* fix setting of more than 31-bit block and inode limits (Gui Xiaohua)
|
||||
* fixed bug in error reporting when quota reading fails (Jan Kara)
|
||||
* added support for quota formats with hidden quota files (Jan Kara)
|
||||
* remove IMMUTABLE flag from quota file in quotacheck (Jan Kara)
|
||||
* fix bug in warnquota which could result in bogus hostname and domainname (anonymous reporter)
|
||||
* implemented writing of messages that user got below hard/soft limits to quota_nld (Jan Kara)
|
||||
* use PKG_CHECK_MODULES to check for DBUS (Ladislav Michnovic)
|
||||
* Implement setting of charset for emails sent by warnquota (Michael Meskes)
|
||||
* Added quota_nld to the list of installed programs (Jan Kara)
|
||||
* some typos fixes (Matthew Boyle)
|
||||
* fixed possible segfault when unpriviledged user run edquota (Matthew Boyle)
|
||||
* fixed format strings to use "%%llu" and "%%lld" instead of "%%Lu" and "%%Ld" (Ladislav Michnovic)
|
||||
* removed ssl, resolv, lber from the list of LDAP libraries since we don't need them directly (Jan Kara)
|
||||
* added limits.h include to quota_nld (Jan Kara)
|
||||
* fixed repquota to work with limits over 4 TB (Jan Kara, Michael Meier)
|
||||
- deprecated *-dbus_header_check.patch, *-glibc2_8.patch, *-type.patch, quota-tools-meta.diff
|
||||
* Tue Nov 11 2008 nadvornik@suse.cz
|
||||
- requires nfs-kernel-server [bnc#431212]
|
||||
* Mon Oct 20 2008 nadvornik@suse.cz
|
||||
|
Loading…
Reference in New Issue
Block a user