[quota/f15] Do not report missing utmp record to syslog
Petr Pisar
ppisar at fedoraproject.org
Thu Aug 18 06:52:20 UTC 2011
commit fb07e7cc4d2b015db384fb1ab2c13d300b4f102e
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 a08308b..4a99eff 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.13.pre1%{?dist}
+Release: 0.14.pre1%{?dist}
License: BSD and GPLv2+
URL: http://sourceforge.net/projects/linuxquota/
Group: System Environment/Base
@@ -74,6 +74,8 @@ Patch27: quota-4.00_pre1-Make-dirname-static.patch
Patch28: quota-4.00_pre1-Report-quotacheck-failures-by-return-code.patch
# In upstream 4.00_pre2 (SF#3347047), bug #717982
Patch29: quota-4.00_pre1-get_qf_name-does-not-check-quota-file-presence.patch
+# In upstream 4.00 (SF#3393151), bug #731622
+Patch30: quota-4.00-Do-not-report-missing-utmp-record-to-syslog.patch
%description
@@ -174,6 +176,7 @@ Linux/UNIX environment.
%patch27 -p1 -b .static_dirname
%patch28 -p1 -b .report_quotacheck_failures
%patch29 -p1 -b .improve_quotacheck_message
+%patch30 -p1 -b .suppress_missing_utmp
# quotactl(2) moved into `man-pages' package (bug #640590)
rm -f quotactl.2
# remove VCS files
@@ -296,6 +299,9 @@ rm -rf %{buildroot}
%changelog
+* Thu Aug 18 2011 Petr Pisar <ppisar at redhat.com> - 1:4.00-0.14.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.13.pre1
- Report quotacheck failures by return code (bug #717982)
- Improve quotacheck error message (bug #717982)
More information about the scm-commits
mailing list