Why doesn't mkfifo with a mode of 1755 grant read permissions and sticky bit to the user? The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsIs there a way to execute a native binary from a pipe?Execute vs Read bit. How do directory permissions in Linux work?vsftpd virtual user read permissionsNot allowed to read a file with correct group permissions? ACL?Give full permissions to the owner and only one other userGiven the permissions, owner and group of a file, what's the algorithm that determines whether a given user can read/write/execute a file?File created with root and given other read permissions not even visible by userWhy can't I list a directory with read permissions?How do file permissions work for the “root” user?Mounting volume/partition with permissions for userPermissions Based on Lowest Level

Can withdrawing asylum be illegal?

Word for: a synonym with a positive connotation?

60's-70's movie: home appliances revolting against the owners

Keeping a retro style to sci-fi spaceships?

The following signatures were invalid: EXPKEYSIG 1397BC53640DB551

Can the DM override racial traits?

Does Parliament hold absolute power in the UK?

US Healthcare consultation for visitors

How did the audience guess the pentatonic scale in Bobby McFerrin's presentation?

Is this wall load bearing? Blueprints and photos attached

Huge performance difference of the command find with and without using %M option to show permissions

should truth entail possible truth

Do working physicists consider Newtonian mechanics to be "falsified"?

Is 'stolen' appropriate word?

Why can't wing-mounted spoilers be used to steepen approaches?

Why not take a picture of a closer black hole?

Python - Fishing Simulator

Do warforged have souls?

Example of compact Riemannian manifold with only one geodesic.

Do I have Disadvantage attacking with an off-hand weapon?

Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?

Why did Peik Lin say, "I'm not an animal"?

Store Dynamic-accessible hidden metadata in a cell

Intergalactic human space ship encounters another ship, character gets shunted off beyond known universe, reality starts collapsing



Why doesn't mkfifo with a mode of 1755 grant read permissions and sticky bit to the user?



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election ResultsIs there a way to execute a native binary from a pipe?Execute vs Read bit. How do directory permissions in Linux work?vsftpd virtual user read permissionsNot allowed to read a file with correct group permissions? ACL?Give full permissions to the owner and only one other userGiven the permissions, owner and group of a file, what's the algorithm that determines whether a given user can read/write/execute a file?File created with root and given other read permissions not even visible by userWhy can't I list a directory with read permissions?How do file permissions work for the “root” user?Mounting volume/partition with permissions for userPermissions Based on Lowest Level



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








6















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:




  • p stands for pipe,


  • - means the user has no read. I don't know how when I gave it with the 7,


  • s group 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?










share|improve this question









New contributor




Joao Parente is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.


























    6















    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:




    • p stands for pipe,


    • - means the user has no read. I don't know how when I gave it with the 7,


    • s group 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?










    share|improve this question









    New contributor




    Joao Parente is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      6












      6








      6








      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:




      • p stands for pipe,


      • - means the user has no read. I don't know how when I gave it with the 7,


      • s group 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?










      share|improve this question









      New contributor




      Joao Parente is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      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:




      • p stands for pipe,


      • - means the user has no read. I don't know how when I gave it with the 7,


      • s group 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?







      permissions c mkfifo






      share|improve this question









      New contributor




      Joao Parente is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Joao Parente is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited yesterday









      mosvy

      9,91211236




      9,91211236






      New contributor




      Joao Parente is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked yesterday









      Joao ParenteJoao Parente

      333




      333




      New contributor




      Joao Parente is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Joao Parente is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Joao Parente is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes


















          13














          You cannot simply exec a binary from a pipe: Is there a way to execute a native binary from a pipe?. Also I don't think the sticky bit on executables is worth anything on modern systems.




          I created the pipe in the server code with mkfifo("fifo",1755);



          I went to see the permissions of the pipe fifo and it says p-wx--s--t so:




          Your error is to have written the 1755 permission without the leading 0, which means that 1755 has been treated as a decimal instead of octal (1755 & ~022 = 03311 = p-wx--s--t; where 022 is your umask)






          share|improve this answer

























          • So a better solution would be create a dir and chmod 1755 the dir then create the pipe in that dir with ``` mkfifo ("fifo",755); ``` ?

            – Joao Parente
            yesterday







          • 3





            The sticky bit has different semantics for files and directories: for directories it prevents users from removing or renaming files they don't own; for regular files it doesn't mean much nowadays. Read the chmod(2) manpage for all the details. Also, mkfifo("fifo", 0755) with the leading 0 ;-).

            – mosvy
            yesterday











          • thanks very much :P

            – Joao Parente
            yesterday











          • i tried mkfifo("fifo",0777); but i only got prwxr-xr-xbut if i do chmod 0777 fifo after i created fifo i get prwxrwxrwxany idea why it doesnt work when i create it

            – Joao Parente
            yesterday











          • Because of the umask -- the umask which is 022 will mask out the write permissions from group (020) and other (002) anytime a file is created with open(2), mkfifo(2), etc. Read the umask(2) manpage. The umask doesn't affect the chmod syscall or command.

            – mosvy
            yesterday











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );






          Joao Parente is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511874%2fwhy-doesnt-mkfifo-with-a-mode-of-1755-grant-read-permissions-and-sticky-bit-to%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          13














          You cannot simply exec a binary from a pipe: Is there a way to execute a native binary from a pipe?. Also I don't think the sticky bit on executables is worth anything on modern systems.




          I created the pipe in the server code with mkfifo("fifo",1755);



          I went to see the permissions of the pipe fifo and it says p-wx--s--t so:




          Your error is to have written the 1755 permission without the leading 0, which means that 1755 has been treated as a decimal instead of octal (1755 & ~022 = 03311 = p-wx--s--t; where 022 is your umask)






          share|improve this answer

























          • So a better solution would be create a dir and chmod 1755 the dir then create the pipe in that dir with ``` mkfifo ("fifo",755); ``` ?

            – Joao Parente
            yesterday







          • 3





            The sticky bit has different semantics for files and directories: for directories it prevents users from removing or renaming files they don't own; for regular files it doesn't mean much nowadays. Read the chmod(2) manpage for all the details. Also, mkfifo("fifo", 0755) with the leading 0 ;-).

            – mosvy
            yesterday











          • thanks very much :P

            – Joao Parente
            yesterday











          • i tried mkfifo("fifo",0777); but i only got prwxr-xr-xbut if i do chmod 0777 fifo after i created fifo i get prwxrwxrwxany idea why it doesnt work when i create it

            – Joao Parente
            yesterday











          • Because of the umask -- the umask which is 022 will mask out the write permissions from group (020) and other (002) anytime a file is created with open(2), mkfifo(2), etc. Read the umask(2) manpage. The umask doesn't affect the chmod syscall or command.

            – mosvy
            yesterday















          13














          You cannot simply exec a binary from a pipe: Is there a way to execute a native binary from a pipe?. Also I don't think the sticky bit on executables is worth anything on modern systems.




          I created the pipe in the server code with mkfifo("fifo",1755);



          I went to see the permissions of the pipe fifo and it says p-wx--s--t so:




          Your error is to have written the 1755 permission without the leading 0, which means that 1755 has been treated as a decimal instead of octal (1755 & ~022 = 03311 = p-wx--s--t; where 022 is your umask)






          share|improve this answer

























          • So a better solution would be create a dir and chmod 1755 the dir then create the pipe in that dir with ``` mkfifo ("fifo",755); ``` ?

            – Joao Parente
            yesterday







          • 3





            The sticky bit has different semantics for files and directories: for directories it prevents users from removing or renaming files they don't own; for regular files it doesn't mean much nowadays. Read the chmod(2) manpage for all the details. Also, mkfifo("fifo", 0755) with the leading 0 ;-).

            – mosvy
            yesterday











          • thanks very much :P

            – Joao Parente
            yesterday











          • i tried mkfifo("fifo",0777); but i only got prwxr-xr-xbut if i do chmod 0777 fifo after i created fifo i get prwxrwxrwxany idea why it doesnt work when i create it

            – Joao Parente
            yesterday











          • Because of the umask -- the umask which is 022 will mask out the write permissions from group (020) and other (002) anytime a file is created with open(2), mkfifo(2), etc. Read the umask(2) manpage. The umask doesn't affect the chmod syscall or command.

            – mosvy
            yesterday













          13












          13








          13







          You cannot simply exec a binary from a pipe: Is there a way to execute a native binary from a pipe?. Also I don't think the sticky bit on executables is worth anything on modern systems.




          I created the pipe in the server code with mkfifo("fifo",1755);



          I went to see the permissions of the pipe fifo and it says p-wx--s--t so:




          Your error is to have written the 1755 permission without the leading 0, which means that 1755 has been treated as a decimal instead of octal (1755 & ~022 = 03311 = p-wx--s--t; where 022 is your umask)






          share|improve this answer















          You cannot simply exec a binary from a pipe: Is there a way to execute a native binary from a pipe?. Also I don't think the sticky bit on executables is worth anything on modern systems.




          I created the pipe in the server code with mkfifo("fifo",1755);



          I went to see the permissions of the pipe fifo and it says p-wx--s--t so:




          Your error is to have written the 1755 permission without the leading 0, which means that 1755 has been treated as a decimal instead of octal (1755 & ~022 = 03311 = p-wx--s--t; where 022 is your umask)







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited yesterday

























          answered yesterday









          mosvymosvy

          9,91211236




          9,91211236












          • So a better solution would be create a dir and chmod 1755 the dir then create the pipe in that dir with ``` mkfifo ("fifo",755); ``` ?

            – Joao Parente
            yesterday







          • 3





            The sticky bit has different semantics for files and directories: for directories it prevents users from removing or renaming files they don't own; for regular files it doesn't mean much nowadays. Read the chmod(2) manpage for all the details. Also, mkfifo("fifo", 0755) with the leading 0 ;-).

            – mosvy
            yesterday











          • thanks very much :P

            – Joao Parente
            yesterday











          • i tried mkfifo("fifo",0777); but i only got prwxr-xr-xbut if i do chmod 0777 fifo after i created fifo i get prwxrwxrwxany idea why it doesnt work when i create it

            – Joao Parente
            yesterday











          • Because of the umask -- the umask which is 022 will mask out the write permissions from group (020) and other (002) anytime a file is created with open(2), mkfifo(2), etc. Read the umask(2) manpage. The umask doesn't affect the chmod syscall or command.

            – mosvy
            yesterday

















          • So a better solution would be create a dir and chmod 1755 the dir then create the pipe in that dir with ``` mkfifo ("fifo",755); ``` ?

            – Joao Parente
            yesterday







          • 3





            The sticky bit has different semantics for files and directories: for directories it prevents users from removing or renaming files they don't own; for regular files it doesn't mean much nowadays. Read the chmod(2) manpage for all the details. Also, mkfifo("fifo", 0755) with the leading 0 ;-).

            – mosvy
            yesterday











          • thanks very much :P

            – Joao Parente
            yesterday











          • i tried mkfifo("fifo",0777); but i only got prwxr-xr-xbut if i do chmod 0777 fifo after i created fifo i get prwxrwxrwxany idea why it doesnt work when i create it

            – Joao Parente
            yesterday











          • Because of the umask -- the umask which is 022 will mask out the write permissions from group (020) and other (002) anytime a file is created with open(2), mkfifo(2), etc. Read the umask(2) manpage. The umask doesn't affect the chmod syscall or command.

            – mosvy
            yesterday
















          So a better solution would be create a dir and chmod 1755 the dir then create the pipe in that dir with ``` mkfifo ("fifo",755); ``` ?

          – Joao Parente
          yesterday






          So a better solution would be create a dir and chmod 1755 the dir then create the pipe in that dir with ``` mkfifo ("fifo",755); ``` ?

          – Joao Parente
          yesterday





          3




          3





          The sticky bit has different semantics for files and directories: for directories it prevents users from removing or renaming files they don't own; for regular files it doesn't mean much nowadays. Read the chmod(2) manpage for all the details. Also, mkfifo("fifo", 0755) with the leading 0 ;-).

          – mosvy
          yesterday





          The sticky bit has different semantics for files and directories: for directories it prevents users from removing or renaming files they don't own; for regular files it doesn't mean much nowadays. Read the chmod(2) manpage for all the details. Also, mkfifo("fifo", 0755) with the leading 0 ;-).

          – mosvy
          yesterday













          thanks very much :P

          – Joao Parente
          yesterday





          thanks very much :P

          – Joao Parente
          yesterday













          i tried mkfifo("fifo",0777); but i only got prwxr-xr-xbut if i do chmod 0777 fifo after i created fifo i get prwxrwxrwxany idea why it doesnt work when i create it

          – Joao Parente
          yesterday





          i tried mkfifo("fifo",0777); but i only got prwxr-xr-xbut if i do chmod 0777 fifo after i created fifo i get prwxrwxrwxany idea why it doesnt work when i create it

          – Joao Parente
          yesterday













          Because of the umask -- the umask which is 022 will mask out the write permissions from group (020) and other (002) anytime a file is created with open(2), mkfifo(2), etc. Read the umask(2) manpage. The umask doesn't affect the chmod syscall or command.

          – mosvy
          yesterday





          Because of the umask -- the umask which is 022 will mask out the write permissions from group (020) and other (002) anytime a file is created with open(2), mkfifo(2), etc. Read the umask(2) manpage. The umask doesn't affect the chmod syscall or command.

          – mosvy
          yesterday










          Joao Parente is a new contributor. Be nice, and check out our Code of Conduct.









          draft saved

          draft discarded


















          Joao Parente is a new contributor. Be nice, and check out our Code of Conduct.












          Joao Parente is a new contributor. Be nice, and check out our Code of Conduct.











          Joao Parente is a new contributor. Be nice, and check out our Code of Conduct.














          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511874%2fwhy-doesnt-mkfifo-with-a-mode-of-1755-grant-read-permissions-and-sticky-bit-to%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          -c++, mkfifo, permissions

          Popular posts from this blog

          Frič See also Navigation menuinternal link

          Identify plant with long narrow paired leaves and reddish stems Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?What is this plant with long sharp leaves? Is it a weed?What is this 3ft high, stalky plant, with mid sized narrow leaves?What is this young shrub with opposite ovate, crenate leaves and reddish stems?What is this plant with large broad serrated leaves?Identify this upright branching weed with long leaves and reddish stemsPlease help me identify this bulbous plant with long, broad leaves and white flowersWhat is this small annual with narrow gray/green leaves and rust colored daisy-type flowers?What is this chilli plant?Does anyone know what type of chilli plant this is?Help identify this plant

          fontconfig warning: “/etc/fonts/fonts.conf”, line 100: unknown “element blank” The 2019 Stack Overflow Developer Survey Results Are In“tar: unrecognized option --warning” during 'apt-get install'How to fix Fontconfig errorHow do I figure out which font file is chosen for a system generic font alias?Why are some apt-get-installed fonts being ignored by fc-list, xfontsel, etc?Reload settings in /etc/fonts/conf.dTaking 30 seconds longer to boot after upgrade from jessie to stretchHow to match multiple font names with a single <match> element?Adding a custom font to fontconfigRemoving fonts from fontconfig <match> resultsBroken fonts after upgrading Firefox ESR to latest Firefox