I'm creating a server and client situation where i want to create a pipe so they can communicate.
I created the pipe in the server code with
mkfifo("fifo",1755);:
- 1 for only user that created and root to be able to delete it or rename it,
- 7 for give read, write and exec to user, and
- 5 for both group and other to only give them read and exec.
The problem is that later in the server code I open the fifo to read from it open("fifo",O_RDONLY); but when i execute it, it shows me an perror that denies me acess to the fifo.
I went to see the permissions of the pipe fifo and it says
p-wx--s--t so:
pstands for pipe,-means the user has no read. I don't know how when I gave it with the 7,sgroup executes has user. I don't how if i gave 1 so supposedly it should give to user and others the ability to only read and execute and others have t that was expected.
Do I have a misunderstanding of the permissions?
mkfifo ("fifo",755);? – Joao Parente Apr 11 '19 at 10:19mkfifo("fifo", 0755)with the leading0;-). – Apr 11 '19 at 10:24prwxr-xr-xbut if i do chmod 0777 fifo after i created fifo i getprwxrwxrwxany idea why it doesnt work when i create it – Joao Parente Apr 11 '19 at 17:09