summaryrefslogtreecommitdiff
blob: 5f27e46f5a84e7170c041451bf999117b54a062d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
diff -Nuar cfengine-2.1.22.orig/src/cfenvd.c cfengine-2.1.22/src/cfenvd.c
--- cfengine-2.1.22.orig/src/cfenvd.c	2007-01-07 14:15:42.000000000 +0000
+++ cfengine-2.1.22/src/cfenvd.c	2010-01-26 10:58:20.328601944 +0000
@@ -69,8 +69,8 @@
 
 char BATCHFILE[CF_BUFSIZE];
 char STATELOG[CF_BUFSIZE];
-char ENV_NEW[CF_BUFSIZE];
-char ENV[CF_BUFSIZE];
+char CF_ENV_NEW[CF_BUFSIZE];
+char CF_ENV[CF_BUFSIZE];
 
 short TCPDUMP = false;
 short TCPPAUSE = false;
@@ -284,8 +284,8 @@
  
 snprintf(AVDB,CF_MAXVARSIZE,"%s/state/%s",CFWORKDIR,CF_AVDB_FILE);
 snprintf(STATELOG,CF_BUFSIZE,"%s/state/%s",CFWORKDIR,CF_STATELOG_FILE);
-snprintf(ENV_NEW,CF_BUFSIZE,"%s/state/%s",CFWORKDIR,CF_ENVNEW_FILE);
-snprintf(ENV,CF_BUFSIZE,"%s/state/%s",CFWORKDIR,CF_ENV_FILE);
+snprintf(CF_ENV_NEW,CF_BUFSIZE,"%s/state/%s",CFWORKDIR,CF_ENVNEW_FILE);
+snprintf(CF_ENV,CF_BUFSIZE,"%s/state/%s",CFWORKDIR,CF_ENV_FILE);
 
 if (!BATCH_MODE)
    {
@@ -1070,9 +1070,9 @@
 
 /* Publish class list */
 
-unlink(ENV_NEW);
+unlink(CF_ENV_NEW);
  
-if ((fp = fopen(ENV_NEW,"a")) == NULL)
+if ((fp = fopen(CF_ENV_NEW,"a")) == NULL)
    {
    DeleteItemList(PREVIOUS_STATE);
    PREVIOUS_STATE = classlist;
@@ -1095,7 +1095,7 @@
 DeleteItemList(ENTROPIES); 
 fclose(fp);
 
-rename(ENV_NEW,ENV);
+rename(CF_ENV_NEW,CF_ENV);
 }
 
 /*********************************************************************/
diff -Nuar cfengine-2.1.22.orig/src/cfetool.c cfengine-2.1.22/src/cfetool.c
--- cfengine-2.1.22.orig/src/cfetool.c	2006-01-29 15:34:23.000000000 +0000
+++ cfengine-2.1.22/src/cfetool.c	2010-01-26 10:58:13.145262988 +0000
@@ -157,8 +157,8 @@
 int time_to_update = false;
 int DEBUGGING = false;
 int DEBUGGING2 = false;
-char ENV_NEW[CF_BUFSIZE];
-char ENV[CF_BUFSIZE];
+char CF_ENV_NEW[CF_BUFSIZE];
+char CF_ENV[CF_BUFSIZE];
 
 #define Debugging if(DEBUGGING) printf
 #define Debugging2 if(DEBUGGING2) printf
@@ -267,8 +267,8 @@
   }
   strncpy(VLOCKDIR,WORKDIR,CF_BUFSIZE-1);
   strncpy(VLOGDIR,WORKDIR,CF_BUFSIZE-1);
-  snprintf(ENV_NEW,CF_BUFSIZE,"%s/state/%s",WORKDIR,CF_ENVNEW_FILE);
-  snprintf(ENV,CF_BUFSIZE,"%s/state/%s",WORKDIR,CF_ENV_FILE);
+  snprintf(CF_ENV_NEW,CF_BUFSIZE,"%s/state/%s",WORKDIR,CF_ENVNEW_FILE);
+  snprintf(CF_ENV,CF_BUFSIZE,"%s/state/%s",WORKDIR,CF_ENV_FILE);
   argv += 2;
   argc -= 2;
   if (strcmp(command, "create") == 0)
@@ -2437,7 +2437,7 @@
 
   if(cfenvd_compatible)
   {
-    unlink(ENV_NEW);
+    unlink(CF_ENV_NEW);
     strcpy(temp1, NAME);
     strcat(temp1, "_");
     temp2[0] = '_';
@@ -2452,12 +2452,12 @@
       lock.l_whence = SEEK_SET;
       lock.l_len = 0;
  
-      if ((newfp = fopen(ENV_NEW,"a")) == NULL)
+      if ((newfp = fopen(CF_ENV_NEW,"a")) == NULL)
       {
         DeleteItemList(classlist);
         return code; 
       }
-      if ((oldfp = fopen(ENV, "r")) != NULL)
+      if ((oldfp = fopen(CF_ENV, "r")) != NULL)
       {
         if(fcntl(fileno(oldfp), F_SETLK, &lock) == -1)
         {
@@ -2481,7 +2481,7 @@
  
       fclose(newfp);
 
-      rename(ENV_NEW,ENV);
+      rename(CF_ENV_NEW,CF_ENV);
       break;
     }
   }