diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-05-25 22:21:55 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-05-25 22:21:55 -0500 |
commit | 9068fffdf82dc9cf60e83639b3a9b397761304cd (patch) | |
tree | f020c203254e592de74da69c46a7a37a7021029d /tdecore/ktempfile.cpp | |
parent | 41ea89f79d28c456b296e8ddcce0a12c21e13f94 (diff) | |
download | tdelibs-9068fffdf82dc9cf60e83639b3a9b397761304cd.tar.gz tdelibs-9068fffdf82dc9cf60e83639b3a9b397761304cd.zip |
Fix KTempFile not obeying special bits on file creation
This closes Bug 349
Add modem category to TDE hardware manager
Diffstat (limited to 'tdecore/ktempfile.cpp')
-rw-r--r-- | tdecore/ktempfile.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tdecore/ktempfile.cpp b/tdecore/ktempfile.cpp index 2c7b56e79..4632f0053 100644 --- a/tdecore/ktempfile.cpp +++ b/tdecore/ktempfile.cpp @@ -117,8 +117,12 @@ KTempFile::create(const TQString &filePrefix, const TQString &fileExtension, // Success! bOpen = true; - // Set uid/gid (necessary for SUID programs) - fchown(mFd, getuid(), getgid()); + uid_t uid = getuid(); + uid_t euid = geteuid(); + if (uid != euid) { + // Set uid/gid (necessary for SUID programs) + fchown(mFd, getuid(), getgid()); + } // Set close on exec fcntl(mFd, F_SETFD, FD_CLOEXEC); |