[quota/f14] Do not report missing utmp record to syslog
Petr Pisar
ppisar at fedoraproject.org
Thu Aug 18 07:21:15 UTC 2011
commit a6084eaf7f679d13e6d58116e156d508104a0889
Author: Petr Písař <ppisar at redhat.com>
Date: Thu Aug 18 08:45:44 2011 +0200
Do not report missing utmp record to syslog
...-not-report-missing-utmp-record-to-syslog.patch | 36 ++++++++++++++++++++
quota.spec | 8 ++++-
2 files changed, 43 insertions(+), 1 deletions(-)
---
diff --git a/quota-4.00-Do-not-report-missing-utmp-record-to-syslog.patch b/quota-4.00-Do-not-report-missing-utmp-record-to-syslog.patch
new file mode 100644
index 0000000..7381026
--- /dev/null
+++ b/quota-4.00-Do-not-report-missing-utmp-record-to-syslog.patch
@@ -0,0 +1,36 @@
+From 7d2ac8097d65c6698124abd2dda25bffd8590aa7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at 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 at 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
+
diff --git a/quota.spec b/quota.spec
index c0072fd..e6aa543 100644
--- a/quota.spec
+++ b/quota.spec
@@ -5,7 +5,7 @@ Name: quota
Summary: System administration tools for monitoring users' disk usage
Epoch: 1
Version: 3.17
-Release: 17%{?dist}
+Release: 18%{?dist}
License: BSD and GPLv2+
URL: http://sourceforge.net/projects/linuxquota/
Group: System Environment/Base
@@ -37,6 +37,8 @@ Patch12: quota-4.00_pre1-Make-dirname-static.patch
Patch13: quota-3.17-Report-quotacheck-failures-by-return-code.patch
# In upstream 4.00_pre2 (SF#3347047), bug #717982
Patch14: quota-3.17-get_qf_name-does-not-check-quota-file-presence.patch
+# In upstream 4.00 (SF#3393151), bug #731622
+Patch15: quota-4.00-Do-not-report-missing-utmp-record-to-syslog.patch
%description
The quota package contains system administration tools for monitoring
@@ -74,6 +76,7 @@ on remote machines.
%patch12 -p1 -b .static_dirname
%patch13 -p1 -b .report_quotacheck_failures
%patch14 -p1 -b .improve_quotacheck_message
+%patch15 -p1 -b .suppress_missing_utmp
#fix typos/mistakes in localized documentation
for pofile in $(find ./po/*.p*)
@@ -143,6 +146,9 @@ rm -rf %{buildroot}
%attr(0644,root,root) %{_mandir}/man3/*
%changelog
+* Thu Aug 18 2011 Petr Pisar <ppisar at redhat.com> - 1:3.17-18
+- Do not report missing utmp record to syslog (bug #731622)
+
* Fri Jul 15 2011 Petr Pisar <ppisar at redhat.com> - 1:3.17-17
- Report quotacheck failures by return code (bug #717982)
- Improve quotacheck error message (bug #717982)
More information about the scm-commits
mailing list