Bug 2113

Summary: S_IWRITE is considered obsolete and should be replaced with S_IWUSR.
Product: Portable OpenSSH Reporter: Nathan Osman <nathan.osman>
Component: Build systemAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: minor CC: dtucker
Priority: P5    
Version: 6.2p1   
Hardware: Other   
OS: Linux   
Bug Depends on:    
Bug Blocks: 2076    
Attachments:
Description Flags
Replaces instances of S_IWRITE with S_IWUSR. none

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