elast0ny / shared_memory

A Rust wrapper around native shared memory for Linux and Windows
380 stars 51 forks source link

MapOpenFailed(2) when SYSTEM user open shared memory created by common user #97

Open 21pages opened 1 year ago

21pages commented 1 year ago

error line

21pages commented 1 year ago

It's created by this crate, but need to set allow_raw=true, maybe not properly. If set, it can work

einar-itm commented 5 months ago

Not sure if this is related, but I got the same error because open_mapping assumes write permissions in the file-system when reusing an existing mapping. I am not sure if this counts as bug report or a feature request.

https://github.com/elast0ny/shared_memory/blob/344a5c410eadb2018f1c4bf5f7c23b8ab2f88089/src/unix.rs#L160

Workaround: chmod u+w /dev/shmem/my_shmem