diff options
author | jkar8572 <jkar8572> | 2007-09-18 12:23:54 +0000 |
---|---|---|
committer | jkar8572 <jkar8572> | 2007-09-18 12:23:54 +0000 |
commit | f4e0799803c2ac5aa10d2589c033e93801b903b9 (patch) | |
tree | 8d103891d6742cedc979a6a7a8dfe1bba2122541 | |
parent | 1457645d5dae64bb9edd00fd14a0e2dfc286c824 (diff) |
Quotaon should work only on local mount points (Jan Kara)
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | quota_nld.c | 9 | ||||
-rw-r--r-- | quotaon.c | 4 |
3 files changed, 11 insertions, 3 deletions
@@ -1,4 +1,5 @@ Changes in quota-tools from 3.15 to 3.16 +* quotaon(8) should work only on local filesystems (Ladislav Michnovic) * made possible to use quota rpc in mixed NFSv3 and NFSv4 environments (Jan Kara) * fixed compilation with openLDAP library versions 2.1 and 2.2 (Jan Kara) * always define allow_severity and deny_severity for older versions of libwrap (Martin Jacobs) diff --git a/quota_nld.c b/quota_nld.c index e730f4d..593278a 100644 --- a/quota_nld.c +++ b/quota_nld.c @@ -137,6 +137,13 @@ static int quota_nl_warn_cmd_parser(struct genl_ops *ops, struct genl_cmd *cmd, { struct quota_warning *warn = (struct quota_warning *)arg; + if (!info->attrs[QUOTA_NL_A_QTYPE] || !info->attrs[QUOTA_NL_A_EXCESS_ID] || + !info->attrs[QUOTA_NL_A_WARNING] || !info->attrs[QUOTA_NL_A_DEV_MAJOR] || + !info->attrs[QUOTA_NL_A_DEV_MAJOR] || !info->attrs[QUOTA_NL_A_DEV_MINOR] || + !info->attrs[QUOTA_NL_A_CAUSED_ID]) { + errstr(_("Unknown format of kernel netlink message!\nMaybe your quota tools are too old?\n")); + return -EINVAL; + } warn->qtype = nla_get_u32(info->attrs[QUOTA_NL_A_QTYPE]); warn->excess_id = nla_get_u64(info->attrs[QUOTA_NL_A_EXCESS_ID]); warn->warntype = nla_get_u32(info->attrs[QUOTA_NL_A_WARNING]); @@ -341,7 +348,7 @@ static void run(struct nl_handle *nhandle, struct DBusConnection *dhandle) write_dbus_warning(dhandle, &warn); } else - errstr(_("Failed parsing netlink command: %s\n"), strerror(errno)); + errstr(_("Failed parsing netlink command: %s\n"), strerror(-ret)); free(buf); } } @@ -34,7 +34,7 @@ #ident "$Copyright: (c) 1980, 1990 Regents of the University of California $" #ident "$Copyright: All rights reserved. $" -#ident "$Id: quotaon.c,v 1.23 2007/02/21 13:51:25 jkar8572 Exp $" +#ident "$Id: quotaon.c,v 1.24 2007/09/18 12:23:54 jkar8572 Exp $" /* * Turn quota on/off for a filesystem. @@ -346,7 +346,7 @@ int main(int argc, char **argv) else if (!kernel_formats) errstr(_("Warning: No quota format detected in the kernel.\n")); - if (init_mounts_scan(mntcnt, mntpoints, MS_XFS_DISABLED) < 0) + if (init_mounts_scan(mntcnt, mntpoints, MS_XFS_DISABLED | MS_LOCALONLY) < 0) return 1; while ((mnt = get_next_mount())) { if (nfs_fstype(mnt->mnt_type)) { |