Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000836 [1003.1(2013)/Issue7+TC1] System Interfaces Objection Enhancement Request 2014-04-24 13:15 2014-05-01 16:30
Reporter eblake View Status public  
Assigned To
Priority normal Resolution Accepted  
Status Resolved  
Name Eric Blake
Organization Red Hat
User Reference eblake.accept
Section accept
Page Number 563
Line Number 19506
Interp Status ---
Final Accepted Text
Summary 0000836: accept() should not modify address_len on failure
Description The standard states that accept() modifies the address_len parameter on output to record the size of the stored address, but does not state whether this modification occurs even on failure. Thus, an implementation could feasibly set this parameter to 0 on failure, and an application that does:
    addrlen = sizeof(addr);
    do {
        ret = accept(sock, (struct sockaddr *)&addr, &addrlen);
    } while (ret == -1 && errno == EINTR);
risks failure, in comparison to:
    do {
        addrlen = sizeof(addr);
        ret = accept(sock, (struct sockaddr *)&addr, &addrlen);
    } while (ret == -1 && errno == EINTR);


But traditionally, implementations only modify the address_len parameter on success. Guaranteeing this fact will make it so that applications do not have to worry whether their EINTR retry loop has a subtle bug if the input size is set outside of the while loop.
Desired Action At line 19523 [XSH accept() ERRORS], change:

Otherwise, -1 shall be returned and errno set to indicate the error.
to:

Otherwise, -1 shall be returned, errno shall be set to indicate the error, and any object pointed to by address_len shall remain unchanged.
Tags tc2-2008
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2014-04-24 13:15 eblake New Issue
2014-04-24 13:15 eblake Name => Eric Blake
2014-04-24 13:15 eblake Organization => Red Hat
2014-04-24 13:15 eblake User Reference => eblake.accept
2014-04-24 13:15 eblake Section => accept
2014-04-24 13:15 eblake Page Number => 563
2014-04-24 13:15 eblake Line Number => 19506
2014-04-24 13:15 eblake Interp Status => ---
2014-04-24 13:17 eblake Description Updated
2014-04-24 14:07 afaerber Issue Monitored: afaerber
2014-05-01 16:30 msbrown Status New => Resolved
2014-05-01 16:30 msbrown Resolution Open => Accepted
2014-05-01 16:30 msbrown Tag Attached: tc2-2008


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker