Accepting request 228751 from home:vitezslav_cizek:branches:Base:System

- return error when nomissingok is specified and the log path
  doesn't exist (bnc#871217)
  * added logrotate-fail_if_ENOENT_and_nomissingok.patch

OBS-URL: https://build.opensuse.org/request/show/228751
OBS-URL: https://build.opensuse.org/package/show/Base:System/logrotate?expand=0&rev=34
This commit is contained in:
Cristian Rodríguez 2014-04-03 00:23:52 +00:00 committed by Git OBS Bridge
parent a5182a2eb4
commit b7eabb9739
3 changed files with 25 additions and 1 deletions

View File

@ -0,0 +1,15 @@
Index: logrotate-3.8.7/logrotate.c
===================================================================
--- logrotate-3.8.7.orig/logrotate.c 2014-04-01 18:39:14.294635014 +0200
+++ logrotate-3.8.7/logrotate.c 2014-04-01 18:40:29.613496763 +0200
@@ -795,8 +795,9 @@ int findNeedRotating(struct logInfo *log
char *ld = ourDirName(log->files[logNum]);
if (stat(ld, &sb)) {
/* If parent directory doesn't exist, it's not real error
+ (unless nomissingok is specified)
and rotation is not needed */
- if (errno != ENOENT) {
+ if (errno != ENOENT || (errno == ENOENT && (log->flags & LOG_FLAG_MISSINGOK) == 0)) {
message(MESS_ERROR, "stat of %s failed: %s\n", ld,
strerror(errno));
free(ld);

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Apr 1 15:11:22 UTC 2014 - vcizek@suse.com
- return error when nomissingok is specified and the log path
doesn't exist (bnc#871217)
* added logrotate-fail_if_ENOENT_and_nomissingok.patch
-------------------------------------------------------------------
Thu Nov 7 21:57:31 UTC 2013 - sweet_f_a@gmx.de

View File

@ -1,7 +1,7 @@
#
# spec file for package logrotate
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -32,6 +32,7 @@ Patch2: logrotate-3.7.8-autoext.patch
Patch3: logrotate-3.7.8-addextension.patch
Patch4: logrotate-3.7.8-mess_err.patch
Patch5: logrotate-manpage_config_clarification.patch
Patch6: logrotate-fail_if_ENOENT_and_nomissingok.patch
BuildRequires: acl
BuildRequires: libacl-devel
BuildRequires: libselinux-devel
@ -59,6 +60,7 @@ daily cron job.
%patch3
%patch4
%patch5 -p1
%patch6 -p1
%build
make %{?_smp_mflags} CC="%__cc" RPM_OPT_FLAGS="%{optflags}" \