diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2005-12-09 03:06:18 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2005-12-09 03:06:18 +0000 |
commit | 6bb9fc6357377882076bfcb135a6d56c47f60bb2 (patch) | |
tree | 7d9dc30d7dff335a2ef2fe438d9eeb35fa556c5c /src/lib/Client/Toolset.py | |
parent | fde7e7c7d8a3f98ab9b7025a87dd60c22b194ea0 (diff) | |
download | bcfg2-6bb9fc6357377882076bfcb135a6d56c47f60bb2.tar.gz bcfg2-6bb9fc6357377882076bfcb135a6d56c47f60bb2.tar.bz2 bcfg2-6bb9fc6357377882076bfcb135a6d56c47f60bb2.zip |
begin client hardening
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1617 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Toolset.py')
-rw-r--r-- | src/lib/Client/Toolset.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/Client/Toolset.py b/src/lib/Client/Toolset.py index dd1c17be4..32deea99b 100644 --- a/src/lib/Client/Toolset.py +++ b/src/lib/Client/Toolset.py @@ -366,7 +366,10 @@ class Toolset(object): except OSError: return False except OSError: - mkdir(current) + try: + mkdir(current) + except OSError: + return False # If we get here, then the parent directory should exist try: @@ -386,8 +389,11 @@ class Toolset(object): system("cp %s /var/cache/bcfg2/%s" % (entry.get('name'))) rename(newfile.name, entry.get('name')) return True - except (OSError, IOError), errmsg: - print errmsg + except (OSError, IOError), err: + if err.errno == 13: + self.CondPrint('verbose', "Failed to open %s for writing" % (entry.get('name'))) + else: + print err return False def VerifyPackage(self, entry, modlist): |