summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/pwmdoc.cpp
Unidiff
Diffstat (limited to 'pwmanager/pwmanager/pwmdoc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwmdoc.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/pwmanager/pwmanager/pwmdoc.cpp b/pwmanager/pwmanager/pwmdoc.cpp
index 86b6273..129bf7b 100644
--- a/pwmanager/pwmanager/pwmdoc.cpp
+++ b/pwmanager/pwmanager/pwmdoc.cpp
@@ -55,9 +55,10 @@
55#include <algorithm> 55#include <algorithm>
56#include <sys/types.h> 56#include <sys/types.h>
57#include <sys/stat.h> 57#include <sys/stat.h>
58#ifndef _WIN32_
58#include <unistd.h> 59#include <unistd.h>
59#include <stdint.h> 60#include <stdint.h>
60 61#endif
61 62
62#ifdef PWM_EMBEDDED 63#ifdef PWM_EMBEDDED
63#ifndef Q_LONG 64#ifndef Q_LONG
@@ -505,10 +506,12 @@ PwMerror PwMDoc::saveDoc(char compress, const QString *file)
505 } 506 }
506 unsetDocStatFlag(DOC_STAT_DISK_DIRTY); 507 unsetDocStatFlag(DOC_STAT_DISK_DIRTY);
507 f.close(); 508 f.close();
509#ifndef _WIN32_
508 if (chmod(filename.latin1(), 510 if (chmod(filename.latin1(),
509 conf()->confGlobFilePermissions())) { 511 conf()->confGlobFilePermissions())) {
510 printWarn(string("chmod failed: ") + strerror(errno)); 512 printWarn(string("chmod failed: ") + strerror(errno));
511 } 513 }
514#endif
512 openDocList.edit(this, getTitle().latin1()); 515 openDocList.edit(this, getTitle().latin1());
513 if (wasDeepLocked) { 516 if (wasDeepLocked) {
514 /* Do _not_ save the data with the deepLock() 517 /* Do _not_ save the data with the deepLock()
@@ -2218,10 +2221,12 @@ bool PwMDoc::execLauncher(const QString &category, unsigned int entryIndex)
2218 2221
2219bool PwMDoc::execLauncher(unsigned int category, unsigned int entryIndex) 2222bool PwMDoc::execLauncher(unsigned int category, unsigned int entryIndex)
2220{ 2223{
2224#ifndef _WIN32_
2221 if (geteuid() == 0) { 2225 if (geteuid() == 0) {
2222 rootAlertMsgBox(); 2226 rootAlertMsgBox();
2223 return false; 2227 return false;
2224 } 2228 }
2229#endif
2225 QString command(dti.dta[category].d[entryIndex].launcher.c_str()); 2230 QString command(dti.dta[category].d[entryIndex].launcher.c_str());
2226 bool wasLocked = isLocked(category, entryIndex); 2231 bool wasLocked = isLocked(category, entryIndex);
2227 2232
@@ -2270,10 +2275,12 @@ bool PwMDoc::goToURL(const QString &category, unsigned int entryIndex)
2270 2275
2271bool PwMDoc::goToURL(unsigned int category, unsigned int entryIndex) 2276bool PwMDoc::goToURL(unsigned int category, unsigned int entryIndex)
2272{ 2277{
2278#ifndef _WIN32_
2273 if (geteuid() == 0) { 2279 if (geteuid() == 0) {
2274 rootAlertMsgBox(); 2280 rootAlertMsgBox();
2275 return false; 2281 return false;
2276 } 2282 }
2283#endif
2277 QString url(dti.dta[category].d[entryIndex].url.c_str()); 2284 QString url(dti.dta[category].d[entryIndex].url.c_str());
2278 if (url.isEmpty()) 2285 if (url.isEmpty())
2279 return false; 2286 return false;