Menu

#133 File save saves files as rw for owner, no permissions otherwise

v1.0.26
open
nobody
None
5
2017-03-18
2016-11-20
Anonymous
No

When opening, creating, and then saving any .txt or .html file in GG, it saves the file with 0600 permissions. Corresponding .bin files are saved with the OS assigned permissions as per the umask settings (0664 or rw rw r for my system).

I have had this issue for a long time but never actually looked at what permissions were assigned by GG to the text or html files, only recognizing that the files needed to be "world readable" by PG during uploads.

I have Fedora 24 with all of the OS updates as of 2016-11-20. (Another user has the same issue with Ubuntu.)

My GG version is the latest download of version 1.0.25 from sourceforge. Last Update: 2016-07-16

Discussion

  • Wayne Hammond

    Wayne Hammond - 2016-11-26

    I am not a perl programmer, but perl debug reports a syntax error at line 737 in the FileMenu.pm. Is there supposed to be a sub something between the curly braces there?

     
  • Wayne Hammond

    Wayne Hammond - 2017-03-18

    I have found a solution for this bug,

    [code]
    original text beginning at line 101 in file TextUnicode.pm

    $progress->withdraw if defined $progress;
    close $tempfh;
    if ( -e $filename ) {
    chmod 0777, $filename;
    unlink $filename;
    }
    if ( rename( $tempfilename, $filename ) ) {
    #$w->ResetUndo; #serves no purpose to reset undo
    $w->FileName($filename);
    return 1;
    } else {

    Changed text:
    $progress->withdraw if defined $progress;
    close $tempfh;
    if ( -e $filename ) {
    #chmod 0777, $filename; #this has no effect as next line deletes the file
    unlink $filename;
    }
    if ( rename( $tempfilename, $filename ) ) {
    #$w->ResetUndo; #serves no purpose to reset undo
    $w->FileName($filename);
    chmod 0664, $filename; #This statement sets the file permissions fpr the new file (original deleted above)
    return 1;
    } else {
    [/code]

     

    Last edit: Wayne Hammond 2017-03-18

Anonymous
Anonymous

Add attachments
Cancel