diff --git a/.gitignore b/.gitignore index 00829a0..1eaea8e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ quota-3.17.tar.gz +/quota-4.00-pre1.tar.gz diff --git a/quota-3.17-add-gfs2-support.patch b/quota-3.17-add-gfs2-support.patch deleted file mode 100644 index 16f83c4..0000000 --- a/quota-3.17-add-gfs2-support.patch +++ /dev/null @@ -1,95 +0,0 @@ -Backport of patch from #547748 that is already in upstream. -Original patch adds some GFS checks to XFS checks in create_handle_list(), -but current RHEL-6 does not contain the checks for fro XFS. So ommiting them. - -diff --git a/mntopt.h b/mntopt.h -index ee375c4..1730340 100644 ---- a/mntopt.h -+++ b/mntopt.h -@@ -18,6 +18,7 @@ - #define MNTTYPE_NFS4 "nfs4" /* NFSv4 filesystem */ - #define MNTTYPE_MPFS "mpfs" /* EMC Celerra MPFS filesystem */ - #define MNTTYPE_OCFS2 "ocfs2" /* Oracle Cluster filesystem */ -+#define MNTTYPE_GFS2 "gfs2" /* Red Hat Global filesystem 2 */ - - /* mount options */ - #define MNTOPT_NOQUOTA "noquota" /* don't enforce quota */ -diff --git a/quotacheck.c b/quotacheck.c -index b5f7e2e..3c56eee 100644 ---- a/quotacheck.c -+++ b/quotacheck.c -@@ -1048,7 +1048,9 @@ static void check_all(void) - 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) || -+ !strcmp(mnt->mnt_type, MNTTYPE_GFS2) || -+ 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; -diff --git a/quotaio.c b/quotaio.c -index d74a37d..0dd8324 100644 ---- a/quotaio.c -+++ b/quotaio.c -@@ -73,7 +73,8 @@ struct quota_handle *init_io(struct mntent *mnt, int type, int fmt, int flags) - #endif - } - -- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem? */ -+ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) || /* XFS filesystem? */ -+ !strcmp(mnt->mnt_type, MNTTYPE_GFS2)) { /* XFS filesystem? */ - if (fmt != -1 && fmt != QF_XFS) { /* User wanted some other format? */ - errstr(_("Only XFS quota format is allowed on XFS filesystem.\n")); - goto out_handle; -diff --git a/quotaon.c b/quotaon.c -index eafadef..0e6e363 100644 ---- a/quotaon.c -+++ b/quotaon.c -@@ -163,7 +163,10 @@ static int newstate(struct mntent *mnt, int type, char *extra) - if (flags & FL_ALL) - sflags |= STATEFLAG_ALL; - -- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem has special handling... */ -+ if (!strcmp(mnt->mnt_type, MNTTYPE_GFS2)) { -+ errstr(_("Cannot change state of GFS2 quota.\n")); -+ return 1; -+ } else if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem has special handling... */ - if (!(kernel_formats & (1 << QF_XFS))) { - errstr(_("Cannot change state of XFS quota. It's not compiled in kernel.\n")); - return 1; -@@ -200,7 +203,8 @@ static int print_state(struct mntent *mnt, int type) - { - int on = 0; - -- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { -+ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) || -+ !strcmp(mnt->mnt_type, MNTTYPE_GFS2)) { - if (kernel_formats & (1 << QF_XFS)) - on = kern_quota_on(mnt->mnt_fsname, type, 1 << QF_XFS) != -1; - } -diff --git a/quotasys.c b/quotasys.c -index 9a7f440..2ec23c4 100644 ---- a/quotasys.c -+++ b/quotasys.c -@@ -82,7 +82,8 @@ static int correct_fstype(char *type) - !strcmp(type, MNTTYPE_NFS) || - !strcmp(type, MNTTYPE_NFS4) || - !strcmp(type, MNTTYPE_OCFS2) || -- !strcmp(type, MNTTYPE_MPFS)) { -+ !strcmp(type, MNTTYPE_MPFS) || -+ !strcmp(type, MNTTYPE_GFS2)) { - free(mtype); - return 1; - } -@@ -481,7 +482,8 @@ int hasquota(struct mntent *mnt, int type, int flags) - if (!correct_fstype(mnt->mnt_type) || hasmntopt(mnt, MNTOPT_NOQUOTA)) - return 0; - -- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) -+ if (!strcmp(mnt->mnt_type, MNTTYPE_GFS2) || -+ !strcmp(mnt->mnt_type, MNTTYPE_XFS)) - return hasxfsquota(mnt, type, flags); - if (nfs_fstype(mnt->mnt_type)) /* NFS always has quota or better there is no good way how to detect it */ - return 1; diff --git a/quota-3.17-quotactl_null_corruption.patch b/quota-3.17-quotactl_null_corruption.patch deleted file mode 100644 index 3deaf9f..0000000 --- a/quota-3.17-quotactl_null_corruption.patch +++ /dev/null @@ -1,25 +0,0 @@ -Avoid memory corruption of NULL address. - -Backport of - -and n+2nd CVS commit. - -diff --git a/quotasys.c b/quotasys.c -index 9a7f440..0a4a609 100644 ---- a/quotasys.c -+++ b/quotasys.c -@@ -707,9 +707,12 @@ void init_kernel_interface(void) - kernel_formats = 0; - if (!stat("/proc/fs/xfs/stat", &st)) - kernel_formats |= (1 << QF_XFS); -- else -- if (!quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, NULL) || (errno != EINVAL && errno != ENOSYS)) -+ else { -+ fs_quota_stat_t dummy; -+ -+ if (!quotactl(QCMD(Q_XGETQSTAT, 0), "/dev/root", 0, (void *)&dummy) || (errno != EINVAL && errno != ENOSYS)) - kernel_formats |= (1 << QF_XFS); -+ } - /* 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; diff --git a/quota-4.00_pre1-add-gfs2-support.patch b/quota-4.00_pre1-add-gfs2-support.patch new file mode 100644 index 0000000..c3f509b --- /dev/null +++ b/quota-4.00_pre1-add-gfs2-support.patch @@ -0,0 +1,153 @@ +From 7f17e02d34e8157009d2603bfcea3bc619709eee Mon Sep 17 00:00:00 2001 +From: jkar8572 +Date: Wed, 5 May 2010 15:17:09 +0000 +Subject: [PATCH 1/2] GFS2 implements the XFS interface for setting and reporting the quota + information, and only allows state changes via remount. (Christoph Hellwig) + +Petr Pisar: Changelog lines removed. +--- + mntopt.h | 1 + + quotacheck.c | 4 +++- + quotaio.c | 3 ++- + quotaon.c | 8 ++++++-- + quotasys.c | 12 +++++++++--- + +diff --git a/mntopt.h b/mntopt.h +index 90673fc..5117033 100644 +--- a/mntopt.h ++++ b/mntopt.h +@@ -18,6 +18,7 @@ + #define MNTTYPE_NFS4 "nfs4" /* NFSv4 filesystem */ + #define MNTTYPE_MPFS "mpfs" /* EMC Celerra MPFS filesystem */ + #define MNTTYPE_OCFS2 "ocfs2" /* Oracle Cluster filesystem */ ++#define MNTTYPE_GFS2 "gfs2" /* Red Hat Global filesystem 2 */ + + /* mount options */ + #define MNTOPT_NOQUOTA "noquota" /* don't enforce quota */ +diff --git a/quotacheck.c b/quotacheck.c +index 41901f1..0e9bac9 100644 +--- a/quotacheck.c ++++ b/quotacheck.c +@@ -1049,7 +1049,9 @@ static void check_all(void) + 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) || ++ !strcmp(mnt->mnt_type, MNTTYPE_GFS2) || ++ 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; +diff --git a/quotaio.c b/quotaio.c +index e857328..533b631 100644 +--- a/quotaio.c ++++ b/quotaio.c +@@ -78,7 +78,8 @@ struct quota_handle *init_io(struct mntent *mnt, int type, int fmt, int flags) + goto out_handle; + } + +- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem? */ ++ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) || /* XFS filesystem? */ ++ !strcmp(mnt->mnt_type, MNTTYPE_GFS2)) { /* XFS filesystem? */ + if (fmt != -1 && fmt != QF_XFS) { /* User wanted some other format? */ + errstr(_("Only XFS quota format is allowed on XFS filesystem.\n")); + goto out_handle; +diff --git a/quotaon.c b/quotaon.c +index 813c021..1d1187b 100644 +--- a/quotaon.c ++++ b/quotaon.c +@@ -273,7 +273,10 @@ static int newstate(struct mntent *mnt, int type, char *extra) + if (flags & FL_ALL) + sflags |= STATEFLAG_ALL; + +- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem has special handling... */ ++ if (!strcmp(mnt->mnt_type, MNTTYPE_GFS2)) { ++ errstr(_("Cannot change state of GFS2 quota.\n")); ++ return 1; ++ } else if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { /* XFS filesystem has special handling... */ + if (!kern_qfmt_supp(QF_XFS)) { + errstr(_("Cannot change state of XFS quota. It's not compiled in kernel.\n")); + return 1; +@@ -329,7 +332,8 @@ static int print_state(struct mntent *mnt, int type) + { + int on = 0; + +- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { ++ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) || ++ !strcmp(mnt->mnt_type, MNTTYPE_GFS2)) { + if (kern_qfmt_supp(QF_XFS)) + on = kern_quota_on(mnt->mnt_fsname, type, QF_XFS) != -1; + } +diff --git a/quotasys.c b/quotasys.c +index cce5787..0cc008c 100644 +--- a/quotasys.c ++++ b/quotasys.c +@@ -91,7 +91,8 @@ static int correct_fstype(char *type) + !strcmp(type, MNTTYPE_NFS) || + !strcmp(type, MNTTYPE_NFS4) || + !strcmp(type, MNTTYPE_OCFS2) || +- !strcmp(type, MNTTYPE_MPFS)) { ++ !strcmp(type, MNTTYPE_MPFS) || ++ !strcmp(type, MNTTYPE_GFS2)) { + free(mtype); + return 1; + } +@@ -495,6 +496,8 @@ int hasquota(struct mntent *mnt, int type, int flags) + if (!correct_fstype(mnt->mnt_type) || hasmntopt(mnt, MNTOPT_NOQUOTA)) + return 0; + ++ if (!strcmp(mnt->mnt_type, MNTTYPE_GFS2)) ++ return 1; + if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) + return hasxfsquota(mnt, type, flags); + if (nfs_fstype(mnt->mnt_type)) /* NFS always has quota or better there is no good way how to detect it */ +@@ -652,11 +655,14 @@ add_entry: + goto add_entry; + break; + case QF_XFS: +- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) ++ if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) || ++ !strcmp(mnt->mnt_type, MNTTYPE_GFS2)) + goto add_entry; + break; + default: +- if (strcmp(mnt->mnt_type, MNTTYPE_XFS) && !nfs_fstype(mnt->mnt_type)) ++ if (strcmp(mnt->mnt_type, MNTTYPE_XFS) && ++ strcmp(mnt->mnt_type, MNTTYPE_GFS2) && ++ !nfs_fstype(mnt->mnt_type)) + goto add_entry; + break; + } +-- +1.7.3.2 + +From f3553cfee6701f98e27a30318f8b759bcbbca370 Mon Sep 17 00:00:00 2001 +From: jkar8572 +Date: Fri, 7 May 2010 15:45:52 +0000 +Subject: [PATCH 2/2] Previous GFS2 patch was missing a hunk to properly detect whether + a GFS2 filesystem has quotas enabled. (Christoph Hellwig) + +--- + quotasys.c | 5 ++--- + 1 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/quotasys.c b/quotasys.c +index 0cc008c..307a359 100644 +--- a/quotasys.c ++++ b/quotasys.c +@@ -496,9 +496,8 @@ int hasquota(struct mntent *mnt, int type, int flags) + if (!correct_fstype(mnt->mnt_type) || hasmntopt(mnt, MNTOPT_NOQUOTA)) + return 0; + +- if (!strcmp(mnt->mnt_type, MNTTYPE_GFS2)) +- return 1; +- if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) ++ if (!strcmp(mnt->mnt_type, MNTTYPE_GFS2) || ++ !strcmp(mnt->mnt_type, MNTTYPE_XFS)) + return hasxfsquota(mnt, type, flags); + if (nfs_fstype(mnt->mnt_type)) /* NFS always has quota or better there is no good way how to detect it */ + return 1; +-- +1.7.3.2 + diff --git a/quota-4.00_pre1-quotactl_null_corruption.patch b/quota-4.00_pre1-quotactl_null_corruption.patch new file mode 100644 index 0000000..3e84863 --- /dev/null +++ b/quota-4.00_pre1-quotactl_null_corruption.patch @@ -0,0 +1,29 @@ +From 940aecfcffe12b565ff0e06d1b6c838a86dfbdd0 Mon Sep 17 00:00:00 2001 +From: jkar8572 +Date: Tue, 4 May 2010 12:37:39 +0000 +Subject: [PATCH] * avoid memory corruption of NULL address (Petr Pisar) + +Petr Pisar: Upstream patch without Changelog lines. + +diff --git a/quotasys.c b/quotasys.c +index 8df5e3b..cce5787 100644 +--- a/quotasys.c ++++ b/quotasys.c +@@ -746,9 +746,12 @@ void init_kernel_interface(void) + kernel_qfmt_num = 0; + if (!stat("/proc/fs/xfs/stat", &st)) + kernel_qfmt[kernel_qfmt_num++] = QF_XFS; +- else +- if (!quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, NULL) || (errno != EINVAL && errno != ENOSYS)) ++ else { ++ fs_quota_stat_t dummy; ++ ++ if (!quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, (void *)&dummy) || (errno != EINVAL && errno != ENOSYS)) + kernel_qfmt[kernel_qfmt_num++] = QF_XFS; ++ } + /* 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; +-- +1.7.3.2 + diff --git a/quota.spec b/quota.spec index c075b00..acdeee4 100644 --- a/quota.spec +++ b/quota.spec @@ -4,8 +4,8 @@ Name: quota Summary: System administration tools for monitoring users' disk usage Epoch: 1 -Version: 3.17 -Release: 18%{?dist} +Version: 4.00 +Release: 0.1.pre1%{?dist} License: BSD and GPLv2+ URL: http://sourceforge.net/projects/linuxquota/ Group: System Environment/Base @@ -14,7 +14,7 @@ Requires: initscripts >= 6.38 tcp_wrappers Conflicts: kernel < 2.4 BuildRequires: e2fsprogs-devel gettext tcp_wrappers-devel nss-devel BuildRequires: openldap-devel openssl-devel dbus-devel libnl-devel -Source0: http://downloads.sourceforge.net/linuxquota/%{name}-%{version}.tar.gz +Source0: http://downloads.sourceforge.net/linuxquota/%{name}-%{version}-pre1.tar.gz Source1: quota_nld.init Source2: quota_nld.sysconfig Patch0: quota-3.06-warnquota.patch @@ -26,9 +26,9 @@ Patch5: quota-3.16-helpoption.patch Patch6: quota-3.16-quotaoffhelp.patch Patch8: quota-3.17-ftbfs.patch # Bug #528581, remove in upstream 4.00 -Patch9: quota-3.17-quotactl_null_corruption.patch +Patch9: quota-4.00_pre1-quotactl_null_corruption.patch # Included in upstream 4.00_pre2 -Patch10: quota-3.17-add-gfs2-support.patch +Patch10: quota-4.00_pre1-add-gfs2-support.patch %description The quota package contains system administration tools for monitoring @@ -211,6 +211,9 @@ rm -rf %{buildroot} %changelog +* Tue Nov 16 2010 Petr Pisar - 1:4.00-0.1.pre1 +- 4.00-pre1 bump + * Mon Nov 15 2010 Petr Pisar - 1:3.17-18 - Break warnquota dependency on main package diff --git a/sources b/sources index 8ddedeb..1c8b5e5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -cb3e98a039c0cf98e7c1ad4b50a5bda7 quota-3.17.tar.gz +ef9d66e8a968ecffd2d9df648fa8ada2 quota-4.00-pre1.tar.gz