Mantis Bug Tracker

View Issue Details Jump to Notes ] << ] >> ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000431incronpublic2010-05-21 00:572009-11-01 18:08
Reportervapier 
Assigned Toluk 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusassignedResolutionopen 
PlatformOSOS Version
Summary0000431: incron doesnt process symlinks in /etc/incron.d/
Descriptionthe load_tables() function only processes regular files and ignores symlinks. so if a valid file is at like /etc/foo/ and gets added by:
ln -s /etc/foo/moo /etc/incron.d/moo

the file never gets added
Additional Informationthe error in the code is here:

    while ((pDe = readdir(d)) != NULL) {
      std::string un(pDe->d_name);
      std::string path(IncronCfg::BuildPath(s, pDe->d_name));

      bool ok = pDe->d_type == DT_REG;
      if (pDe->d_type == DT_UNKNOWN) {
        struct stat st;
        if (stat(path.c_str(), &st) == 0)
          ok = S_ISREG(st.st_mode);
      }

      if (ok) {
        syslog(LOG_INFO, "loading table %s", pDe->d_name);

the first ok should be:
      bool ok = pDe->d_type == DT_REG || pDe->d_type == DT_LINK;
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000392)
luk (administrator)
2009-11-01 18:08

Thanks for reporting but the correct code must check whether the link points to a regular file and not anything else (e.g. device file or directory). I will implement it for the next bugfix version.

- Issue History
Date Modified Username Field Change
2009-10-30 22:10 vapier New Issue
2009-11-01 18:04 luk Status new => assigned
2009-11-01 18:04 luk Assigned To => luk
2009-11-01 18:08 luk Note Added: 0000392


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker