Ticket #4830: libs_libmyth_util.cpp-umask-before-mkstemp.patch

File libs_libmyth_util.cpp-umask-before-mkstemp.patch, 610 bytes (added by Erik Hovland <erik@…>, 12 years ago)

sets umask before mkstemp and then sets it back

  • libs/libmyth/util.cpp

    When using mkstemp, one should set the umask to make it super effective!
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     libs/libmyth/util.cpp |    2 ++
     1 files changed, 2 insertions(+), 0 deletions(-)
    
    diff --git a/libs/libmyth/util.cpp b/libs/libmyth/util.cpp
    index 13396d5..8f7dbb0 100644
    a b QString createTempFile(QString name_template, bool dir) 
    907907    }
    908908    else
    909909    {
     910        mode_t cur_umask = umask(S_IRWXO | S_IRWXG);
    910911        ret = mkstemp(ctemplate);
     912        umask(cur_umask);
    911913    }
    912914
    913915    QString tmpFileName(ctemplate);