| In CrhomeOS, we want files created by the deamon to not be world accessible. |
| This patch removes the temporary loosening of the umask that causes the |
| BrlAPI socket to be world readable and writable. |
| --- a/Programs/brlapi_server.c |
| +++ b/Programs/brlapi_server.c |
| @@ -1683,7 +1683,6 @@ |
| pid_t pid; |
| int lock,n,done,res; |
| |
| - mode_t oldmode; |
| if ((fd = socket(PF_LOCAL, SOCK_STREAM, 0))==-1) { |
| logSystemError("socket"); |
| goto out; |
| @@ -1694,7 +1693,6 @@ |
| goto outfd; |
| } |
| |
| - oldmode = umask(0); |
| while (mkdir(BRLAPI_SOCKETPATH,01777)<0) { |
| if (errno == EEXIST) |
| break; |
| @@ -1788,7 +1786,6 @@ |
| logMessage(LOG_WARNING,"bind: %s",strerror(errno)); |
| goto outlock; |
| } |
| - umask(oldmode); |
| if (listen(fd,1)<0) { |
| logSystemError("listen"); |
| goto outlock; |
| @@ -1800,7 +1797,6 @@ |
| outtmp: |
| unlink(tmppath); |
| outmode: |
| - umask(oldmode); |
| #endif /* __MINGW32__ */ |
| outfd: |
| closeFileDescriptor(fd); |