Re: 1.3b2 & file permissions


Subject: Re: 1.3b2 & file permissions
From: wesley.craig@umich.edu
Date: Thu Nov 18 1993 - 15:02:35 EST


> From: Patrick Goebel <patrick@casbs.Stanford.EDU>
> To: wesley.craig@umich.edu

> However, if A copies a file from B's folder Y into her own
> folder X, the resulting permissions on the copied file are 666. This
> means that B can then turn around and make changes to A's copy of the
> file, thereby violating the desired protection.

Nice bug report. Here's a patch which should fix the problem:

--- cut ---
*** netatalk-1.3b2/etc/afpd/file.c- Sat Aug 7 15:28:16 1993
--- netatalk-1.3b2/etc/afpd/file.c Thu Nov 18 14:40:35 1993
***************
*** 573,579 ****
              return( AFPERR_PARAM );
          }
      } else {
! if (( dfd = open( ad_path( dst, 0 ), O_WRONLY|O_CREAT, 0666 )) < 0 ) {
              close( sfd );
              switch ( errno ) {
              case ENOENT :
--- 561,568 ----
              return( AFPERR_PARAM );
          }
      } else {
! if (( dfd = open( ad_path( dst, 0 ), O_WRONLY|O_CREAT,
! ad_mode( ad_path( dst, 0 ), 0666 ))) < 0 ) {
              close( sfd );
              switch ( errno ) {
              case ENOENT :
***************
*** 606,612 ****
              return( AFPERR_PARAM );
          }
      }
! if (( dfd = open( dst, O_WRONLY|O_CREAT, 0666 )) < 0 ) {
          close( sfd );
          switch ( errno ) {
          case ENOENT :
--- 595,601 ----
              return( AFPERR_PARAM );
          }
      }
! if (( dfd = open( dst, O_WRONLY|O_CREAT, ad_mode( dst, 0666 ))) < 0 ) {
          close( sfd );
          switch ( errno ) {
          case ENOENT :
--- cut ---



This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:19:56 EST