Subversion Repositories public

Rev

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

Rev 55 Rev 59
Line 19... Line 19...
19
#include <pwd.h>
19
#include <pwd.h>
20
#include <dirent.h>
20
#include <dirent.h>
21
#include <syslog.h>
21
#include <syslog.h>
22
#include <errno.h>
22
#include <errno.h>
23
#include <sys/poll.h>
23
#include <sys/poll.h>
-
 
24
#include <sys/stat.h>
24
25
25
#include "inotify-cxx.h"
26
#include "inotify-cxx.h"
26
27
27
#include "incron.h"
28
#include "incron.h"
28
#include "incrontab.h"
29
#include "incrontab.h"
Line 98... Line 99...
98
  syslog(LOG_NOTICE, "loading user tables");
99
  syslog(LOG_NOTICE, "loading user tables");
99
   
100
   
100
  struct dirent* pDe = NULL;
101
  struct dirent* pDe = NULL;
101
  while ((pDe = readdir(d)) != NULL) {
102
  while ((pDe = readdir(d)) != NULL) {
102
    std::string un(pDe->d_name);
103
    std::string un(pDe->d_name);
-
 
104
   
-
 
105
    bool ok = pDe->d_type == DT_REG;
103
    if (pDe->d_type == DT_REG && un != "." && un != "..") {
106
    if (pDe->d_type == DT_UNKNOWN) {
-
 
107
      struct stat st;
-
 
108
      if (stat(pDe->d_name, &st) == 0)
-
 
109
        ok = S_ISREG(st.st_mode);
-
 
110
    }
-
 
111
   
-
 
112
    if (ok) {
104
      if (check_user(pDe->d_name)) {
113
      if (check_user(pDe->d_name)) {
105
        syslog(LOG_INFO, "loading table for user %s", pDe->d_name);
114
        syslog(LOG_INFO, "loading table for user %s", pDe->d_name);
106
        UserTable* pUt = new UserTable(pIn, pEd, un);
115
        UserTable* pUt = new UserTable(pIn, pEd, un);
107
        g_ut.insert(SUT_MAP::value_type(un, pUt));
116
        g_ut.insert(SUT_MAP::value_type(un, pUt));
108
        pUt->Load();
117
        pUt->Load();