Changeset 922 for dasscm/trunk/usr/bin


Ignore:
Timestamp:
Jul 29, 2010, 6:46:20 PM (14 years ago)
Author:
joergs
Message:

bugfix: error when user have not enough permission to update plugin result files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dasscm/trunk/usr/bin/dasscm

    r918 r922  
    201201my $DASSCM_CHECKOUT_USERNAME;
    202202my $DASSCM_CHECKOUT_PASSWORD;
     203my $DASSCM_GID;
    203204my @DASSCM_ADDITIONAL_FILES;
    204205
     
    414415
    415416    #$svnOptions .= " --username $DASSCM_USERNAME "
     417   
     418    #
     419    # prepare file permissions
     420    # (read-write access for group "dasscm",
     421    # if this group exists)
     422    #
     423    (my $gname, my $gpw, $DASSCM_GID, my $members) = getgrnam( "dasscm" );
     424    if( $DASSCM_GID ) {
     425        umask 0007
     426    }
    416427}
    417428
     
    736747    my @array    = @_;
    737748
     749    if ( -e $filename && !-w $filename ) {
     750        warning( "failed to write to $filename:", "permission denied" );
     751        return;
     752    }
     753
    738754    if ( !-w dirname($filename) ) {
    739         warning( "failed to write to $filename", "directory does not exist" );
     755        warning( "failed to write to $filename:", "directory does not exist" );
    740756        return;
    741757    }
     
    751767    }
    752768    close(OUTFILE);
     769
     770    # if group dasscm exists,
     771    # create plugin results with group membership dasscm
     772    if( $DASSCM_GID ) {
     773        chown( -1, $DASSCM_GID, $filename );
     774    }
    753775
    754776    return 1;
Note: See TracChangeset for help on using the changeset viewer.