View Issue Details

IDProjectCategoryView StatusLast Update
00006351003.1(2008)/Issue 7Shell and Utilitiespublic2019-06-10 08:55
Reportergeoffclare Assigned Toajosey  
PrioritynormalSeverityObjectionTypeClarification Requested
Status ClosedResolutionAccepted 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Sectionuudecode
Page Number3291
Line Number109831
Interp StatusApproved
Final Accepted TextSee 0000635:0001433
Summary0000635: Clarify that uudecode ignores chmod() errors
DescriptionThe description of uudecode states:

    If the pathname of the file to be produced exists, and the user
    does not have write permission on that file, uudecode shall
    terminate with an error. If the pathname of the file to be
    produced exists, and the user has write permission on that file,
    the existing file shall be overwritten.

I think the intention is that this is meant to override the general
rules about error conditions, so that if the file exists and has
a different owner, but is writable, uudecode should still overwrite
the file (and exit with status zero), even though it can't change
the permissions. This is long-standing existing practice.

It would be better if the standard were to state explicitly that if
uudecode can't change the permissions it is not an error.

A minor editorial correction should also be made to "If the pathname of
the file to be produced exists", since strictly speaking the pathname
itself always exists; the condition should be on whether the pathname
resolves to an existing file.
Desired ActionChange:

    If the pathname of the file to be produced exists, and the user
    does not have write permission on that file, uudecode shall
    terminate with an error. If the pathname of the file to be
    produced exists, and the user has write permission on that file,
    the existing file shall be overwritten.

to:

    If the pathname of the file resolves to an existing file and the
    user does not have write permission on that file, uudecode shall
    terminate with an error. If the pathname of the file resolves to
    an existing file and the user has write permission on that file,
    the existing file shall be overwritten and, if possible, the mode
    bits of the file (other than standard output) shall be set as
    described above; if the mode bits cannot be set, uudecode shall
    not treat this as an error.
Tagstc2-2008

Activities

Don Cragun

2012-12-20 16:21

manager   bugnote:0001433

Interpretation response
------------------------
The standard states that an error has to be raised if the mode change fails, and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor.

Rationale:
-------------
The current standard does not match existing (and desired) behavior.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
Make the suggested changes.

brkorb

2012-12-20 21:04

reporter   bugnote:0001436

Last edited: 2012-12-20 21:11

GNU shar's script will complain, but continue and exit based on any following conditions.

> chmod 0644 'shar-1.in'
> if test $? -ne 0
> then ${echo} "restore of shar-1.in failed"
> fi

Leastwise for scripts. The uudecode program itself, on the other hand *WILL* die

  if (UU_CHMOD(outname, fileno (fp), mode) != 0)
    {
      error (0, errno, _("chmod of %s"), outname);
      return EXIT_FAILURE;
    }

the output file is truncated and no data are written. This has been so for a long time.

ajosey

2013-03-29 08:04

manager   bugnote:0001517

Interpretation Proposed 29 Mar 2013

ajosey

2013-05-03 12:20

manager   bugnote:0001579

Interpretation approved 3 May 2013

Issue History

Date Modified Username Field Change
2012-12-13 10:36 geoffclare New Issue
2012-12-13 10:36 geoffclare Status New => Under Review
2012-12-13 10:36 geoffclare Assigned To => ajosey
2012-12-13 10:36 geoffclare Name => Geoff Clare
2012-12-13 10:36 geoffclare Organization => The Open Group
2012-12-13 10:36 geoffclare Section => uudecode
2012-12-13 10:36 geoffclare Page Number => 3291
2012-12-13 10:36 geoffclare Line Number => 109831
2012-12-13 10:36 geoffclare Interp Status => ---
2012-12-20 16:21 Don Cragun Interp Status --- => Pending
2012-12-20 16:21 Don Cragun Note Added: 0001433
2012-12-20 16:21 Don Cragun Status Under Review => Interpretation Required
2012-12-20 16:21 Don Cragun Resolution Open => Accepted
2012-12-20 16:22 Don Cragun Final Accepted Text => See 0000635:0001433
2012-12-20 16:22 Don Cragun Tag Attached: tc2-2008
2012-12-20 21:04 brkorb Note Added: 0001436
2012-12-20 21:11 brkorb Note Edited: 0001436
2013-03-29 08:04 ajosey Interp Status Pending => Proposed
2013-03-29 08:04 ajosey Note Added: 0001517
2013-05-03 12:20 ajosey Interp Status Proposed => Approved
2013-05-03 12:20 ajosey Note Added: 0001579
2019-06-10 08:55 agadmin Status Interpretation Required => Closed