summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2005-09-28 07:16:10 +0000
committerlnu <lnu@f70e237a-67f3-0310-a06c-d2b8a7116972>2005-09-28 07:16:10 +0000
commit2296da8a7783873f80ba97beb7bc512bee44e5c5 (patch)
tree1dba143a6cdbea82fd5301334bf5f9c55716d992 /lib
parent9aa7db265118fabfffddd677d6ad3aa73af2d23a (diff)
downloadfeed2imap-2296da8a7783873f80ba97beb7bc512bee44e5c5.tar.gz
feed2imap-2296da8a7783873f80ba97beb7bc512bee44e5c5.tar.bz2
feed2imap-2296da8a7783873f80ba97beb7bc512bee44e5c5.zip
atom parser fix, issue warning when config file is world-readable
git-svn-id: svn+ssh://svn.gna.org/svn/feed2imap/trunk/feed2imap@69 f70e237a-67f3-0310-a06c-d2b8a7116972
Diffstat (limited to '')
-rw-r--r--lib/feed2imap/channel.rb8
-rw-r--r--lib/feed2imap/feed2imap.rb4
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/feed2imap/channel.rb b/lib/feed2imap/channel.rb
index 9ed3bdc..c43c254 100644
--- a/lib/feed2imap/channel.rb
+++ b/lib/feed2imap/channel.rb
@@ -91,9 +91,10 @@ class Channel
end
# Link
doc.root.each_element('/feed/link') do |e|
- if e.attribute('type').value == 'text/html' or
- e.attribute('type').value == 'application/xhtml' or
- e.attribute('type').value == 'application/xhtml+xml'
+ if e.attribute('type') and (
+ e.attribute('type').value == 'text/html' or
+ e.attribute('type').value == 'application/xhtml' or
+ e.attribute('type').value == 'application/xhtml+xml')
if (h = e.attribute('href')) && h
@link = h.value.rmWhiteSpace!
end
@@ -124,7 +125,6 @@ class Item
attr_accessor :title, :link, :content, :date, :creator, :subject,
:category, :cacheditem
attr_reader :channel
-
def initialize(item = nil, channel = nil)
@channel = channel
@title, @link, @content, @date, @creator, @subject, @category = nil
diff --git a/lib/feed2imap/feed2imap.rb b/lib/feed2imap/feed2imap.rb
index 38046e9..a20eeed 100644
--- a/lib/feed2imap/feed2imap.rb
+++ b/lib/feed2imap/feed2imap.rb
@@ -46,6 +46,10 @@ class Feed2Imap
@logger.fatal("Configuration file #{configfile} not found.")
exit(1)
end
+ if (File::stat(configfile).mode & 044) != 0
+ @logger.warn("Configuration file is readable by other users. It" +
+ "probably contains your password.")
+ end
begin
File::open(configfile) {
|f| @config = F2IConfig::new(f)
.14&id=1f2f723d4f380055e078eb780267ad563158c65d&follow=1'> r621@Devoty: necoro | 2008-01-14 20:21:40 +0100Necoro2-21/+61 2008-01-14 r618@Devoty: necoro | 2008-01-14 20:19:05 +0100Necoro2-35/+57 2008-01-14 r617@Devoty: necoro | 2008-01-14 19:12:59 +0100Necoro2-10/+10 2008-01-14 r609@Devoty: necoro | 2008-01-14 17:04:38 +0100Necoro9-394/+477 2008-01-14 r605@Devoty: necoro | 2008-01-14 11:43:34 +0100Necoro2-26/+129 2008-01-14 r603@Devoty: necoro | 2008-01-14 11:30:26 +0100Necoro4-26/+38 2008-01-11 r598@Devoty: necoro | 2008-01-10 16:36:29 +0100Necoro4-10/+50 2008-01-11 r597@Devoty: necoro | 2008-01-10 14:12:35 +0100Necoro1-3/+3 2008-01-10 r595@Devoty: necoro | 2008-01-10 04:04:15 +0100Necoro1-52/+3 2008-01-09 r586@Devoty: necoro | 2008-01-09 14:54:18 +0100Necoro1-1/+1 2007-12-06 r577@Devoty: necoro | 2007-12-06 20:37:36 +0100Necoro1-1/+1 2007-12-06 r572@Devoty: necoro | 2007-11-28 08:48:15 +0100Necoro1-0/+1 2007-11-27 r570@Devoty: necoro | 2007-11-27 02:08:21 +0100Necoro3-84/+108