[quota] Do not report missing utmp record to syslog
Petr Pisar
ppisar at fedoraproject.org
Thu Aug 18 06:46:40 UTC 2011
commit 4c13f89776015ca3371cfdbaa2a62f7665c065ca
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 ea22a07..08d9ea8 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: 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 at 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 at redhat.com> - 1:4.00-0.16.pre1
- Report quotacheck failures by return code (bug #717982)
- Improve quotacheck error message (bug #717982)
More information about the scm-commits
mailing list