Bug 2113 - S_IWRITE is considered obsolete and should be replaced with S_IWUSR.
Summary: S_IWRITE is considered obsolete and should be replaced with S_IWUSR.
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: 6.2p1
Hardware: Other Linux
: P5 minor
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_6_3
  Show dependency treegraph
 
Reported: 2013-06-02 05:57 AEST by Nathan Osman
Modified: 2015-08-11 23:05 AEST (History)
1 user (show)

See Also:


Attachments
Replaces instances of S_IWRITE with S_IWUSR. (694 bytes, patch)
2013-06-02 05:57 AEST, Nathan Osman
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Osman 2013-06-02 05:57:31 AEST
Created attachment 2287 [details]
Replaces instances of S_IWRITE with S_IWUSR.

The constant S_IWRITE is used in a couple of places in the OpenSSH source code. According to the page below, this constant is obsolete:

  http://www.gnu.org/savannah-checkouts/gnu/libc/manual/html_node/Permission-Bits.html

This causes the following errors when cross-compiling for the Android platform:

  scp.c:1071:11: error: 'S_IWRITE' undeclared (first use in this function)
  sftp-client.c:1054:13: error: 'S_IWRITE' undeclared (first use in this function)

The equivalent constant that should be used in its place is 'S_IWUSR'. I have attached a patch that corrects these instances.
Comment 1 Darren Tucker 2013-06-02 06:17:54 AEST
Seems reasonable, it's also consistent with SuSv2: http://pubs.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html

put on the list for 6.3
Comment 2 Darren Tucker 2013-06-02 07:01:03 AEST
Applied, thanks.
Comment 3 Damien Miller 2015-08-11 23:05:32 AEST
Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1