~ubuntu-branches/ubuntu/vivid/logrotate/vivid

« back to all changes in this revision

Viewing changes to debian/patches/globfix-277652

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2008-11-07 14:57:09 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20081107145709-s8ktufsiktmkuidl
Tags: 3.7.7-1ubuntu1
* Merge with Debian experimental (LP: #64964). Remaining Ubuntu changes:
  - debian/control: Drop mailx to Suggests for Ubuntu; it's only used on
    request, and we don't configure an MTA by default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: logrotate-3.7.1/config.c
2
 
===================================================================
3
 
--- logrotate-3.7.1.orig/config.c       2008-10-08 15:57:39.318679248 +0100
4
 
+++ logrotate-3.7.1/config.c    2008-10-08 16:09:33.203414313 +0100
5
 
@@ -370,6 +370,7 @@
6
 
     int createMode;
7
 
     struct stat sb, sb2;
8
 
     glob_t globResult;
9
 
+    int glob_failed;
10
 
     const char ** argv;
11
 
     int argc, argNum;
12
 
 
13
 
@@ -422,6 +423,7 @@
14
 
 
15
 
     message(MESS_DEBUG, "reading config file %s\n", configFile);
16
 
 
17
 
+    glob_failed = 0;
18
 
     start = buf;
19
 
     while (*start) {
20
 
        while (isblank(*start) && (*start)) start++;
21
 
@@ -968,7 +970,8 @@
22
 
 
23
 
                    message(MESS_ERROR, "%s:%d glob failed for %s\n",
24
 
                            configFile, lineNum, argv[argNum]);
25
 
-                   return 1;
26
 
+                   glob_failed = 1;
27
 
+                   continue;
28
 
                }
29
 
 
30
 
                newlog->files = realloc(newlog->files, sizeof(*newlog->files) * 
31
 
@@ -1011,6 +1014,12 @@
32
 
                message(MESS_ERROR, "%s:%d unxpected }\n", configFile, lineNum);
33
 
                return 1;
34
 
            }
35
 
+          
36
 
+           if (glob_failed && !(newlog->flags & LOG_FLAG_MISSINGOK)) {
37
 
+               message(MESS_ERROR, "%s:%d glob failure without missingok\n",
38
 
+                       configFile, lineNum);
39
 
+               return 1;
40
 
+           }
41
 
 
42
 
            if (newlog->oldDir) {
43
 
                for (i = 0; i < newlog->numFiles; i++) {
44
 
@@ -1046,6 +1055,7 @@
45
 
            }
46
 
 
47
 
            newlog = defConfig;
48
 
+           glob_failed = 0;
49
 
 
50
 
            start++;
51
 
            while (isblank(*start)) start++;