Subversion Repositories public

Rev

Rev 45 | Rev 53 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 45 Rev 47
Line 21... Line 21...
21
#include "inotify-cxx.h"
21
#include "inotify-cxx.h"
22
22
23
#include "incrontab.h"
23
#include "incrontab.h"
24
24
25
25
26
-
 
-
 
26
/// Allowed users
27
#define INCRON_ALLOW_PATH "/etc/incron.allow"
27
#define INCRON_ALLOW_PATH "/etc/incron.allow"
-
 
28
-
 
29
/// Denied users
28
#define INCRON_DENY_PATH "/etc/incron.deny"
30
#define INCRON_DENY_PATH "/etc/incron.deny"
29
31
30
32
31
33
32
34
33
InCronTabEntry::InCronTabEntry()
35
InCronTabEntry::InCronTabEntry()
34
: m_uMask(0)
36
: m_uMask(0),
-
 
37
  m_fNoLoop(false)
35
{
38
{
36
 
39
 
37
}
40
}
38
41
39
InCronTabEntry::InCronTabEntry(const std::string& rPath, uint32_t uMask, const std::string& rCmd)
42
InCronTabEntry::InCronTabEntry(const std::string& rPath, uint32_t uMask, const std::string& rCmd)
Line 49... Line 52...
49
  std::ostringstream ss;
52
  std::ostringstream ss;
50
 
53
 
51
  std::string m;
54
  std::string m;
52
 
55
 
53
  InotifyEvent::DumpTypes(m_uMask, m);
56
  InotifyEvent::DumpTypes(m_uMask, m);
54
  if (m.empty())
57
  if (m.empty()) {
-
 
58
    m = m_fNoLoop ? "IN_NO_LOOP" : "0";
-
 
59
  }
55
    m = "0";
60
  else {
-
 
61
    if (m_fNoLoop)
-
 
62
      m.append(",IN_NO_LOOP");
-
 
63
  }
56
 
64
 
57
  ss << m_path << " " << m << " " << m_cmd;
65
  ss << m_path << " " << m << " " << m_cmd;
58
  return ss.str();
66
  return ss.str();
59
}
67
}
60
68
Line 74... Line 82...
74
    rEntry.m_uMask = (uint32_t) u;
82
    rEntry.m_uMask = (uint32_t) u;
75
  }
83
  }
76
  else {
84
  else {
77
    StringTokenizer tok(s2);
85
    StringTokenizer tok(s2);
78
    while (tok.HasMoreTokens()) {
86
    while (tok.HasMoreTokens()) {
-
 
87
      std::string s(tok.GetNextToken());
-
 
88
      if (s == "IN_NO_LOOP")
-
 
89
        rEntry.m_fNoLoop = true;
-
 
90
      else
79
      rEntry.m_uMask |= InotifyEvent::GetMaskByName(tok.GetNextToken());
91
        rEntry.m_uMask |= InotifyEvent::GetMaskByName(s);
80
    }
92
    }
81
  }
93
  }
82
 
94
 
83
  return true;
95
  return true;
84
}
96
}