mirror of https://github.com/fail2ban/fail2ban
BF: ensure dangling symlink error message is reachable
$ ls -la /tmp/f2b-tempq0ipGY/f2 lrwxrwxrwx. 1 dan dan 11 Dec 12 08:42 /tmp/f2b-tempq0ipGY/f2 -> nonexisting In [3]: os.path.exists('/tmp/f2b-tempq0ipGY/f2') Out[3]: False In [4]: os.path.lexists('/tmp/f2b-tempq0ipGY/f2') Out[4]: Truepull/484/head
parent
f2c58e74c1
commit
970fd5d289
|
@ -65,9 +65,10 @@ class JailReader(ConfigReader):
|
||||||
pathList = []
|
pathList = []
|
||||||
for p in glob.glob(path):
|
for p in glob.glob(path):
|
||||||
if not os.path.exists(p):
|
if not os.path.exists(p):
|
||||||
logSys.warning("File %s doesn't even exist, thus cannot be monitored" % p)
|
if os.path.lexists(p):
|
||||||
elif not os.path.lexists(p):
|
|
||||||
logSys.warning("File %s is a dangling link, thus cannot be monitored" % p)
|
logSys.warning("File %s is a dangling link, thus cannot be monitored" % p)
|
||||||
|
else:
|
||||||
|
logSys.warning("File %s doesn't even exist, thus cannot be monitored" % p)
|
||||||
else:
|
else:
|
||||||
pathList.append(p)
|
pathList.append(p)
|
||||||
return pathList
|
return pathList
|
||||||
|
|
Loading…
Reference in New Issue