This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/15763] shm_open/unlink let you write outside SHMDIR


http://sourceware.org/bugzilla/show_bug.cgi?id=15763

--- Comment #2 from Andrea Corbellini <corbellini.andrea at gmail dot com> ---
There should be a third constraint: no directories. Consider:

  shm_open (".", O_RDONLY, 0666);

It contains no slashes, it's lower than NAME_MAX but is still an invalid name.
errno should be EINVAL in this case.

Also consider this code:

  mkdir ("/dev/shm/some-name", 0666);
  shm_open ("some-name", O_RDONLY, 0666);

Currently it works. If you specify O_WRONLY and O_RDWR you get EINVAL from
open(2).
In my opinion, errno should be EISDIR in any case (O_RDONLY, O_WRONLY and
O_RDWR).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]