Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1237

DirOpen doesn't allow symlink to a different partition

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Unconfirmed
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Packaging
    • Labels:
      None

      Description

      CFE 3.5.3 starts to complain about an error during package verification:
      <pre>
      Error: Can't open local directory '/symlink_to_rpms/RPMS'. (opendir: Permission denied)
      </pre>
      At the fist place cf-agent checks a link (output from strace):
      <pre>
      lstat("symlink_to_rpms",

      {st_dev=makedev(0, 20), st_ino=2935111, st_mode=S_IFLNK|0777, st_nlink=1, st_uid=99, st_gid=99, st_blksize=65536, st_blocks=0, st_size=7, st_atime=2013/05/15-14:28:06, st_mtime=2013/05/15-14:28:06, st_ctime=2013/05/15-14:28:06}

      ) = 0
      </pre>
      Then a directory, witch is located on a different partition:
      <pre>
      fstat(5,

      {st_dev=makedev(0, 23), st_ino=15996, st_mode=S_IFDIR|0755, st_nlink=20, st_uid=0, st_gid=0, st_blksize=1024, st_blocks=0, st_size=0, st_atime=2014/03/06-14:30:33, st_mtime=2014/03/06-14:29:43, st_ctime=2014/03/04-10:54:36}

      ) = 0
      </pre>

      Both are located on different partitions, so st_dev aren't equal, for this reason function DirOpen returns an error.
      <pre>
      // Make sure we opened the same file descriptor as safe_open did.
      if (safe_stat.st_dev != dir_stat.st_dev || safe_stat.st_ino != dir_stat.st_ino)

      { closedir(ret->dirh); free(ret); errno = EACCES; return NULL; }

      </pre>

      The error has been introduced in the following changeset:
      https://github.com/cfengine/core/commit/19be8b73b5ee94b890ca09ccf7346ea923b36c1c

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              pawel.grzegrzolka Paweł Grzegrzółka
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Summary Panel