aboutsummaryrefslogtreecommitdiffstats
path: root/CRT.h
diff options
context:
space:
mode:
authorGraham Inggs <ginggs@debian.org>2018-02-05 14:48:51 +0200
committerGraham Inggs <ginggs@debian.org>2018-02-05 14:48:51 +0200
commit2ee50d030178cede83eb9d0005fbc19f819d30fe (patch)
tree67d75c0a7c47e15bed9d0735ecf12abec4f8157b /CRT.h
parent31b71b67011fa52f091df6fe536a11d6d0bfb256 (diff)
downloaddebian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.tar.gz
debian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.tar.bz2
debian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.zip
Imported Upstream version 2.1.0upstream/2.1.0
Diffstat (limited to 'CRT.h')
-rw-r--r--CRT.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/CRT.h b/CRT.h
index fb82413..590fff6 100644
--- a/CRT.h
+++ b/CRT.h
@@ -9,7 +9,12 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)
+#if HAVE_SETUID_ENABLED
+#endif
+
+#define ColorIndex(i,j) ((7-i)*8+j)
+
+#define ColorPair(i,j) COLOR_PAIR(ColorIndex(i,j))
#define Black COLOR_BLACK
#define Red COLOR_RED
@@ -20,6 +25,8 @@ in the source distribution for its full text.
#define Cyan COLOR_CYAN
#define White COLOR_WHITE
+#define ColorPairGrayBlack ColorPair(Magenta,Magenta)
+
#define KEY_WHEELUP KEY_F(20)
#define KEY_WHEELDOWN KEY_F(21)
#define KEY_RECLICK KEY_F(22)
@@ -150,6 +157,25 @@ extern int CRT_colorScheme;
void *backtraceArray[128];
+#if HAVE_SETUID_ENABLED
+
+#define DIE(msg) do { CRT_done(); fprintf(stderr, msg); exit(1); } while(0)
+
+void CRT_dropPrivileges();
+
+void CRT_restorePrivileges();
+
+#else
+
+/* Turn setuid operations into NOPs */
+
+#ifndef CRT_dropPrivileges
+#define CRT_dropPrivileges()
+#define CRT_restorePrivileges()
+#endif
+
+#endif
+
// TODO: pass an instance of Settings instead.
void CRT_init(int delay, int colorScheme);

© 2014-2024 Faster IT GmbH | imprint | privacy policy