kwin/config-kwin.h.cmake
Tobias C. Berner 2ea5feb35b Disallow ptrace on greeter and kwin_wayland process on FreeBSD [... for the future]
Summary:
Similar to[[ https://phabricator.kde.org/D1216 |  D1216 ]] add procctl call to disable ptrace on FreeBSD.

We cannot do the procfs-lookup to check whether the process is already being run inside gdb -- however, on FreeBSD, we could use the P_TRACED flag of the process to figure this out:
> sys/proc.h:#define P_TRACED        0x00800 /* Debugged process being traced. */

And the code would look something similar to

```
    pid_t pid = getpid();
    struct procstat *prstat = procstat_open_sysctl();
    struct kinfo_proc *procinfo;
    unsigned int cnt;
    procinfo = procstat_getprocs(prstat, KERN_PROC_PID, pid, &cnt);
    long p_flags = procinfo->ki_flag;
    int p_traced = p_flags & P_TRACED;
    if (p_traced != P_TRACED) {
        mode = PROC_TRACE_CTL_DISABLE;
        procctl(P_PID, getpid(), PROC_TRACE_CTL, &mode);
    }
    procstat_freeprocs(prstat,procinfo);
    procstat_close(prstat);
```

But as wayland is [far] in the future on FreeBSD, and that check above is a bit lengthy, I think it is enough if we add it once it is needed.

Reviewers: rakuco, graesslin

Reviewed By: graesslin

Subscribers: plasma-devel

Projects: #plasma

Differential Revision: https://phabricator.kde.org/D1425
2016-05-10 08:50:25 +02:00

38 lines
1.3 KiB
CMake

#cmakedefine KWIN_BUILD_DECORATIONS 1
#cmakedefine KWIN_BUILD_TABBOX 1
#cmakedefine KWIN_BUILD_ACTIVITIES 1
#define KWIN_NAME "${KWIN_NAME}"
#define KWIN_INTERNAL_NAME_X11 "${KWIN_INTERNAL_NAME_X11}"
#define KWIN_CONFIG "${KWIN_NAME}rc"
#define KWIN_VERSION_STRING "${PROJECT_VERSION}"
#define XCB_VERSION_STRING "${XCB_VERSION}"
#define KWIN_KILLER_BIN "${CMAKE_INSTALL_FULL_LIBEXECDIR}/kwin_killer_helper"
#define KWIN_RULES_DIALOG_BIN "${CMAKE_INSTALL_FULL_LIBEXECDIR}/kwin_rules_dialog"
#cmakedefine01 HAVE_INPUT
#cmakedefine01 HAVE_X11_XCB
#cmakedefine01 HAVE_X11_XINPUT
#cmakedefine01 HAVE_DRM
#cmakedefine01 HAVE_GBM
#cmakedefine01 HAVE_LIBHYBRIS
#cmakedefine01 HAVE_WAYLAND_EGL
#cmakedefine01 HAVE_SYS_PRCTL_H
#cmakedefine01 HAVE_PR_SET_DUMPABLE
#cmakedefine01 HAVE_SYS_PROCCTL_H
#cmakedefine01 HAVE_PROC_TRACE_CTL
#cmakedefine01 HAVE_BREEZE_DECO
#if HAVE_BREEZE_DECO
#define BREEZE_KDECORATION_PLUGIN_ID "${BREEZE_KDECORATION_PLUGIN_ID}"
#endif
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1
/* Define to 1 if you have the <malloc.h> header file. */
#cmakedefine HAVE_MALLOC_H 1
#cmakedefine XCB_ICCCM_FOUND 1
#ifndef XCB_ICCCM_FOUND
#define XCB_ICCCM_WM_STATE_WITHDRAWN 0
#define XCB_ICCCM_WM_STATE_NORMAL 1
#define XCB_ICCCM_WM_STATE_ICONIC 3
#endif