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 /quota_nld.c | |
parent | 1457645d5dae64bb9edd00fd14a0e2dfc286c824 (diff) |
Quotaon should work only on local mount points (Jan Kara)
Diffstat (limited to 'quota_nld.c')
-rw-r--r-- | quota_nld.c | 9 |
1 files changed, 8 insertions, 1 deletions
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); } } |