Crypt-Sodium-XS

 view release on metacpan or  search on metacpan

inc/memvault.xs  view on Meta::CPAN


      fd = open(path_buf, O_WRONLY|O_CLOEXEC|O_NOCTTY|O_CREAT|O_TRUNC, mode);
      if (fd < 0)
        croak("to_fd: %s: open failed", path_buf);
      if (fstat(fd, &stat_buf) < 0) {
        close(fd);
        croak("to_fd: %s: fstat failed", path_buf);
      }
      if (((stat_buf.st_mode & ~S_IFMT) | mode) ^ mode) {
        /* only caring if file has extra (most likely less-restrictive) modes.
         * it would be invalid to assume that it's safe to fchmod here, as anything
         * else could already have gotten a handle opened. */
        croak("to_fd: %s: invalid modes on already-existing file", path_buf);
      }
      break;
    default:
      fd = SvIV(file);
  }

  self_pm = protmem_get(aTHX_ self, MEMVAULT_CLASS);
  if (protmem_grant(aTHX_ self_pm, PROTMEM_FLAG_MPROTECT_RO) < 0) {



( run in 0.663 second using v1.01-cache-2.11-cpan-c8ce075bde7 )