Project

General

Profile

0001-fix-oidentconfigger-build-under-windows.patch

now with right access permissions - cpuesser, 02/20/2012 02:18 PM

View differences:

src/core/oidentdconfiggenerator.cpp
103 103
}
104 104

  
105 105
bool OidentdConfigGenerator::writeConfig() {
106
  mode_t prev_umask = umask(S_IXUSR | S_IWGRP | S_IXGRP | S_IWOTH | S_IXOTH); // == 0133, rw-r--r--
107
  bool not_open = (!_configFile->isOpen() && !_configFile->open(QIODevice::ReadWrite | QIODevice::Text));
108
  umask(prev_umask);
106
#ifndef Q_OS_WIN32
107
    mode_t prev_umask = umask(S_IXUSR | S_IWGRP | S_IXGRP | S_IWOTH | S_IXOTH); // == 0133, rw-r--r--
108
    bool not_open = (!_configFile->isOpen() && !_configFile->open(QIODevice::ReadWrite | QIODevice::Text));
109
    umask(prev_umask);
110
#else
111
    int prev_umask    = _umask(_S_IEXEC);
112
    bool not_open = (!_configFile->isOpen() && !_configFile->open(QIODevice::ReadWrite | QIODevice::Text));
113
    _umask(prev_umask);
114
#endif /* Q_OS_WIN32 */
109 115

  
110 116
  if (not_open)
111 117
    return false;
src/core/oidentdconfiggenerator.h
29 29
#include <QMutex>
30 30
#include <QByteArray>
31 31

  
32
#ifndef Q_OS_WIN32
33 32
#  include <sys/types.h>
34 33
#  include <sys/stat.h>
34
#ifdef Q_OS_WIN32
35
#  include <io.h>
35 36
#endif /* Q_OS_WIN32 */
36 37

  
37 38
#include "quassel.h"
38
-