Re: Subject: Server can't write to the TCP socket it has created
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Re: Subject: Server can't write to the TCP socket it has created




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: Subject: Server can't write to the TCP socket it has created  
Fletcher Glenn


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-20-04 05:35 PM



Sunny Suen wrote:
> Hi all,
> Don't know if these are the results of a standard security mechanism
> or configurable option in FreeBSD 4.6. Here are the findings:
>
> * A server process can bind, listen, accept and even read from a TCP
> socket, created by socket(AF_INET, SOCK_STREAM, 0).
>
> * But it is not permitted to write to the socket as the system call
> returns errno = EACCES/13, quoting "Permission denied".
>
> * The error occurs only when the client runs on a remote host. It
> works fine for local TCP clients.
>
> * The server process is run as non-root. fstat() reveals that the
> socket has the owner's write permission bit (S_IWUSR) enabled.
>
> * mSQL 2.0.4 daemon and a home-grown TCP/IP echo program are used as
> examples of the said server process.
>
> * No shutdown() call is ever invoked by the mSQL daemon (according to
> ktrace) or my echo program to make the socket read-only.
>
> Can someone tell me if such observations are expected from a hardened
> FreeBSD 4.6 system, or they are rather symptoms of a ill-behaved
> environment? If the latter is the case, any workaround or fix
> available?
>
> Thanx

Why would you ever write to a listen socket?  Who would be the receiver
of the message?  When you do an accept(), you get a communications
endpoint that is connected to another program.  A bound listen socket
is connected to no one.

--

Fletcher Glenn






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:57 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register