Skip to content

Commit

Permalink
Case 5416: don't allow HISTORY to be a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Cotton committed Nov 25, 2013
1 parent e3f0220 commit e893270
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CondorAgent/schedd.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
###### COPYRIGHT NOTICE ########################################################
#
# Copyright (C) 2007-2011, Cycle Computing, LLC.
# Copyright (C) 2007-2013, Cycle Computing, LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You may
Expand Down Expand Up @@ -84,6 +84,9 @@ def getHistory(self, completed_since, jobs):
history_file = util.getCondorConfigVal("HISTORY", "schedd", self.scheddName)
if history_file == None:
raise Exception("History is not enabled on this scheduler")
# Case 5416: HISTORY should be a file, not a directory
if os.path.isdir(history_file) :
raise Exception("The HISTORY setting is a directory")
# Case 5458: Consider an empty string value for HISTORY to be the same as None
# and raise an exception.
if len(history_file.strip()) == 0 :
Expand Down

0 comments on commit e893270

Please sign in to comment.