Comment 9 for bug 1785207

Revision history for this message
Thadeu Lima de Souza Cascardo (cascardo) wrote :

From glibc:

int
__libc_openat (int fd, const char *file, int oflag, ...)
{
  mode_t mode = 0;
  if (__OPEN_NEEDS_MODE (oflag))
    {
      va_list arg;
      va_start (arg, oflag);
      mode = va_arg (arg, mode_t);
      va_end (arg);
    }

  return SYSCALL_CANCEL (openat, fd, file, oflag, mode);
}

/* Detect if open needs mode as a third argument (or for openat as a fourth
   argument). */
#ifdef __O_TMPFILE
# define __OPEN_NEEDS_MODE(oflag) \
  (((oflag) & O_CREAT) != 0 || ((oflag) & __O_TMPFILE) == __O_TMPFILE)
#else
# define __OPEN_NEEDS_MODE(oflag) (((oflag) & O_CREAT) != 0)
#endif

So, very likely __OPEN_NEEDS_MODE does not support O_TMPFILE on trusty. So, this specific test will always fail on trusty. I wonder if this might cause issues in the real world, and, then, justify a glibc update on trusty ESM.

Cascardo.