This file is indexed.

/usr/share/hyphy/TemplateBatchFiles/WebUpdate.bf is in hyphy-common 2.2.7+dfsg-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
availableFiles = {};
pIndex = "path";
dIndex = "description";

/* -------------------------------------------------------------------------------------- */

function CompareGMTDates (date1, date2)
{
	for (dateComp = 0; dateComp < 5; dateComp = dateComp + 1)
	{
		dateComp2 = date1[dateComp]-date2[dateComp];
		if (dateComp2)
		{
			return dateComp2/Abs(dateComp2);
		}
	}
	return 0;
}

/* -------------------------------------------------------------------------------------- */

function SplitGMTDate (aDate, splitDate&)
{
	chopPoints = aDate || "[^/\\ :]+";
	if (Rows(chopPoints)==10)
	{
		parts = {5,1};
		for (chopPart = 0; chopPart < 10; chopPart = chopPart + 2)
		{
			startOffset = chopPoints[chopPart];
			endOffset	= chopPoints[chopPart+1];
			parts[chopPart/2] = aDate[startOffset][endOffset];
		}
		chopPoints =  parts[0] $ "^[0-9]{4}$";
		if (chopPoints[0]>=0)
		{
			for (chopPart = 1; chopPart < 5; chopPart = chopPart + 1)
			{
				chopPoints =  parts[chopPart] $ "^[0-9][0-9]?$";
				if (chopPoints[0]<0)
				{
					return 0;
				}
			}
			splitDate = {5,1};
			for (chopPart = 0; chopPart < 5; chopPart = chopPart + 1)
			{
				splitDate[chopPart] = 0 + parts[chopPart];
			}
			return 1;
		}
	}
	return 0;
}

/* -------------------------------------------------------------------------------------- */

function SplitInput (fileList)
{
	chopPoints = fileList || "[^\\$]+";
	if  (chopPoints[0]>=0)
	{
		for (entryIndex = 0; entryIndex < Abs(chopPoints); entryIndex = entryIndex + 2)
		{
			startOffset = chopPoints[entryIndex];
			endOffset	= chopPoints[entryIndex+1];
			anEntry 	= fileList[startOffset][endOffset];
			
			splitEntry  = anEntry || "[^\\|]+";
			
			if (Rows(splitEntry) == 8) 
			{
				splitEntryStrings = {4,1};
				for (entryIndex2 = 0; entryIndex2 < 8; entryIndex2 = entryIndex2 + 2)
				{
					startOffset = splitEntry[entryIndex2];
					endOffset	= splitEntry[entryIndex2+1];
					splitEntryStrings[entryIndex2/2] = anEntry[startOffset][endOffset];
				}
				
				entryDate = 0;
				
				if (SplitGMTDate (splitEntryStrings[0],"entryDate"))
				{
					if (CompareGMTDates (lastUpdate, entryDate) < 0)
					{
						newFile = {};
						newFile [pIndex] 		= splitEntryStrings[1];
						newFile [dIndex] = splitEntryStrings[2];
						newFile ["text"]		= ((splitEntryStrings[3]&&1) == "TEXT");
						availableFiles [Abs(availableFiles)] = newFile;
					}
				}
			}
		} 
	}
	return Abs (availableFiles);
}

downloadURLs = {};
downloadURLs [0] = "http://homepage.mac.com/sergeilkp/HyPhy_Distro/HYPHY.dmg";
downloadURLs [1] = "http://homepage.mac.com/sergeilkp/HyPhy_Distro/HYPHY_Win32.zip";
downloadURLs [2] = "http://homepage.mac.com/sergeilkp/HyPhy_Distro/HYPHY_Source.tgz";
downloadURLs [3] = "http://homepage.mac.com/sergeilkp/HyPhy_Distro/HYPHY_UB.dmg";
downloadTargets = {};
downloadTargets [0] = "HYPHY.dmg";
downloadTargets [1] = "HYPHY_Win32.zip";
downloadTargets [2] = "HYPHY_Source.tgz";
downloadTargets [3] = "HYPHY_UB.dmg";

/* -------------------------------------------------------------------------------------- */

fscanf ("last.date","String",lastDate);

if (SplitGMTDate (lastDate, "lastUpdate"))
{
	fprintf (stdout, "\nStarting HyPhy update\n");
	GetString (versionString, HYPHY_VERSION, 2);
	dateComp = versionString$"Macintosh.+";
	if (dateComp[0]>=0)
	{
		versionString = "Macintosh";
		if ((versionString$"Universal")[0]>=0)
		{
			systemKind = 3;		
		}
		else
		{
			systemKind = 0;
		}
	}
	else
	{
		dateComp = versionString$"Windows.+";
		if (dateComp[0]>=0)
		{
			versionString = "Windows";
			systemKind = 1;
		}
		else
		{
			versionString = "Unix";
			systemKind = 2;
		}
	}
	versionString = "http://www.hyphy.org/updates/"+versionString+"/";
	
	GetURL (updateIndex, versionString+"version");
	
	GetString (versionStringS, HYPHY_VERSION, 0);
	
	updateIndex 	= 0+updateIndex;
	versionStringS  = 0+versionStringS;
	
	
	if (versionStringS<updateIndex)
	{
		fprintf (stdout, "\nA newer version of HyPhy(",updateIndex,")  is available for your platform.");
		DEFAULT_FILE_SAVE_NAME = downloadTargets[systemKind];
		SetDialogPrompt ("Download a newer version of HyPhy to:");
		fprintf (PROMPT_FOR_FILE,CLEAR_FILE);
		GetURL (LAST_FILE_PATH,downloadURLs[systemKind],SAVE_TO_FILE);
		fprintf (stdout, "\nA newer version of HyPhy has been downloaded.\nPlease quit HyPhy and install the update.\n");
		return 0;
	}
	else
	{
		fprintf (stdout, "\nYour version of HyPhy is current.\nChecking for individual file updates...\n");	
	}
	
	/* first check the version */
	
	GetURL (updateIndex, versionString+"updates");
	
	
	if (SplitInput (updateIndex))
	{
		for (chopPart = 0; chopPart < Abs(availableFiles); chopPart = chopPart + 1)
		{
			entryData = availableFiles[chopPart];
			filePath = HYPHY_LIB_DIRECTORY+entryData[pIndex]^{{"/"}{DIRECTORY_SEPARATOR}};
			if (entryData["text"])
			{
				fprintf (stdout, "Updating file:", entryData[pIndex], 
							   "\n-------------\n",
							   "\nNotes:", 
							   "\n-----\n", entryData[dIndex], "\n");
				GetURL (theFile,versionString+entryData[pIndex]);
				fprintf (filePath, CLEAR_FILE, theFile);
				fprintf (stdout, "Update Successful\n");
			}
			else
			{
				fprintf (stdout, "Saving file:", entryData[pIndex], 
							   "\n------------\n",
							   "\nNotes:", 
							   "\n-----\n", entryData[dIndex], "\n");
				GetURL (filePath,versionString+availableFiles[pIndex],SAVE_TO_FILE);
				fprintf (stdout, "Download Successful\n");				
			}
		}
	}
	else
	{
		fprintf (stdout, "\nYour distribution seems to be up-to-date\n");
	}
	GetString (gmtString,  TIME_STAMP, 0);
	fprintf ("last.date",CLEAR_FILE,gmtString);
}
else
{
	fprintf (stdout, "\nInternal error : could not read valid date from last.date file\n");
}