Do not report missing utmp record to syslog

This commit is contained in:
Petr Písař 2011-08-18 08:45:44 +02:00
parent 576e135390
commit 4c13f89776
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,36 @@
From 7d2ac8097d65c6698124abd2dda25bffd8590aa7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 17 Aug 2011 16:16:12 +0200
Subject: [PATCH] Do not report missing utmp record to syslog
If no utmp record can be found there is obviously nobody to read error
message about missing TTY in sytem log in real time. Moreover the log
is usually illegible for normal user. So it's pointless to log this
fact there for user's sake. warnquota can be used instead.
Signed-off-by: Jan Kara <jack@suse.cz>
---
quota_nld.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/quota_nld.c b/quota_nld.c
index de9504e..5a53b7e 100644
--- a/quota_nld.c
+++ b/quota_nld.c
@@ -264,7 +264,12 @@ static void write_console_warning(struct quota_warning *warn)
}
}
if (!max_atime) {
- errstr(_("Failed to find tty of user %llu to report warning to.\n"), (unsigned long long)warn->caused_id);
+ /*
+ * This can happen quite easily so don't spam syslog with
+ * the error
+ */
+ if (flags & FL_NODAEMON)
+ 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);
--
1.7.6

View File

@ -5,7 +5,7 @@ Name: quota
Summary: System administration tools for monitoring users' disk usage
Epoch: 1
Version: 4.00
Release: 0.16.pre1%{?dist}
Release: 0.17.pre1%{?dist}
License: BSD and GPLv2+
URL: http://sourceforge.net/projects/linuxquota/
Group: System Environment/Base
@ -85,6 +85,8 @@ Patch33: quota-4.00_pre1-Make-dirname-static.patch
Patch34: quota-4.00_pre1-Report-quotacheck-failures-by-return-code.patch
# In upstream 4.00_pre2 (SF#3347047), bug #717982
Patch35: quota-4.00_pre1-get_qf_name-does-not-check-quota-file-presence.patch
# In upstream 4.00 (SF#3393151), bug #731622
Patch36: quota-4.00-Do-not-report-missing-utmp-record-to-syslog.patch
%description
@ -191,6 +193,7 @@ Linux/UNIX environment.
%patch33 -p1 -b .static_dirname
%patch34 -p1 -b .report_quotacheck_failures
%patch35 -p1 -b .improve_quotacheck_message
%patch36 -p1 -b .suppress_missing_utmp
# quotactl(2) moved into `man-pages' package (bug #640590)
rm -f quotactl.2
# remove VCS files
@ -302,6 +305,9 @@ fi
%changelog
* Thu Aug 18 2011 Petr Pisar <ppisar@redhat.com> - 1:4.00-0.17.pre1
- Do not report missing utmp record to syslog (bug #731622)
* Fri Jul 15 2011 Petr Pisar <ppisar@redhat.com> - 1:4.00-0.16.pre1
- Report quotacheck failures by return code (bug #717982)
- Improve quotacheck error message (bug #717982)