Compare commits

..

No commits in common. "6742148cf4a8415a9c51fdeb11d8c3ea716c2e14" and "41828c4180fb921df7992a5405f5ff05d2ac2fff" have entirely different histories.

10 changed files with 12 additions and 41 deletions

View file

@ -44,13 +44,8 @@ boption(BUILD_TESTING "Build tests (dev)" OFF)
boption(ASAN "ASAN (dev)" OFF) # note: better output with gcc than clang
boption(FRAME_POINTERS "Keep Frame Pointers (dev)" ${ASAN})
if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
boption(CRASH_REPORTER "Crash Handling" OFF)
boption(USE_JEMALLOC "Use jemalloc" OFF)
else()
boption(CRASH_REPORTER "Crash Handling" ON)
boption(USE_JEMALLOC "Use jemalloc" ON)
endif()
boption(SOCKETS "Unix Sockets" ON)
boption(WAYLAND "Wayland" ON)
boption(WAYLAND_WLR_LAYERSHELL " Wlroots Layer-Shell" ON REQUIRES WAYLAND)

View file

@ -21,7 +21,6 @@ set shell id.
## Other Changes
- FreeBSD is now partially supported.
- IPC operations filter available instances to the current display connection by default.
## Bug Fixes

View file

@ -27,7 +27,7 @@
#include <qtmetamacros.h>
#include <qtypes.h>
#include <sys/mman.h>
#include <unistd.h>
#include <sys/sendfile.h>
#include "instanceinfo.hpp"
#include "logcat.hpp"
@ -392,7 +392,7 @@ void ThreadLogging::initFs() {
delete detailedFile;
detailedFile = nullptr;
} else {
struct flock lock = {
auto lock = flock {
.l_type = F_WRLCK,
.l_whence = SEEK_SET,
.l_start = 0,
@ -414,7 +414,7 @@ void ThreadLogging::initFs() {
auto* oldFile = this->file;
if (oldFile) {
oldFile->seek(0);
copy_file_range(oldFile->handle(), nullptr, file->handle(), nullptr, oldFile->size(), 0);
sendfile(file->handle(), oldFile->handle(), nullptr, oldFile->size());
}
this->file = file;
@ -426,14 +426,7 @@ void ThreadLogging::initFs() {
auto* oldFile = this->detailedFile;
if (oldFile) {
oldFile->seek(0);
copy_file_range(
oldFile->handle(),
nullptr,
detailedFile->handle(),
nullptr,
oldFile->size(),
0
);
sendfile(detailedFile->handle(), oldFile->handle(), nullptr, oldFile->size());
}
crash::CrashInfo::INSTANCE.logFd = detailedFile->handle();
@ -896,7 +889,7 @@ bool LogReader::continueReading() {
}
void LogFollower::FcntlWaitThread::run() {
struct flock lock = {
auto lock = flock {
.l_type = F_RDLCK, // won't block other read locks when we take it
.l_whence = SEEK_SET,
.l_start = 0,

View file

@ -361,7 +361,7 @@ void QsPaths::createLock() {
return;
}
struct flock lock = {
auto lock = flock {
.l_type = F_WRLCK,
.l_whence = SEEK_SET,
.l_start = 0,
@ -389,7 +389,7 @@ bool QsPaths::checkLock(const QString& path, InstanceLockInfo* info, bool allowD
auto file = QFile(QDir(path).filePath("instance.lock"));
if (!file.open(QFile::ReadOnly)) return false;
struct flock lock = {
auto lock = flock {
.l_type = F_WRLCK,
.l_whence = SEEK_SET,
.l_start = 0,

View file

@ -54,7 +54,7 @@ bool QmlToolingSupport::lockTooling() {
return false;
}
struct flock lock = {
auto lock = flock {
.l_type = F_WRLCK,
.l_whence = SEEK_SET, // NOLINT (fcntl.h??)
.l_start = 0,

View file

@ -102,7 +102,7 @@ class Process: public PostReloadHook {
/// If the process is already running changing this property will affect the next
/// started process. If the property has been changed after starting a process it will
/// return the new value, not the one for the currently running process.
Q_PROPERTY(QVariantHash environment READ environment WRITE setEnvironment NOTIFY environmentChanged);
Q_PROPERTY(QHash<QString, QVariant> environment READ environment WRITE setEnvironment NOTIFY environmentChanged);
/// If the process's environment should be cleared prior to applying @@environment.
/// Defaults to false.
///

View file

@ -13,7 +13,7 @@ namespace qs::io::process {
class ProcessContext {
Q_PROPERTY(QList<QString> command MEMBER command WRITE setCommand);
Q_PROPERTY(QVariantHash environment MEMBER environment WRITE setEnvironment);
Q_PROPERTY(QHash<QString, QVariant> environment MEMBER environment WRITE setEnvironment);
Q_PROPERTY(bool clearEnvironment MEMBER clearEnvironment WRITE setClearEnvironment);
Q_PROPERTY(QString workingDirectory MEMBER workingDirectory WRITE setWorkingDirectory);
Q_PROPERTY(bool unbindStdout MEMBER unbindStdout WRITE setUnbindStdout);

View file

@ -6,8 +6,6 @@
#include <qsocketnotifier.h>
#include <qstring.h>
#include <qtmetamacros.h>
#include <csignal>
#include <sys/signal.h>
#include <sys/wait.h>
#include "../../core/logcat.hpp"

View file

@ -6,11 +6,7 @@
#include <qtclasshelpermacros.h>
#include <qthread.h>
#include <qtmetamacros.h>
#ifdef __FreeBSD__
#include <security/pam_types.h>
#else
#include <security/_pam_types.h>
#endif
#include <security/pam_appl.h>
#include "conversation.hpp"
@ -39,8 +35,6 @@ class PamContext
///
/// The configuration directory is resolved relative to the current file if not an absolute path.
///
/// On FreeBSD this property is ignored as the pam configuration directory cannot be changed.
///
/// This property may not be set while @@active is true.
Q_PROPERTY(QString configDirectory READ configDirectory WRITE setConfigDirectory NOTIFY configDirectoryChanged);
/// The user to authenticate as. If unset the current user will be used.

View file

@ -7,11 +7,7 @@
#include <qloggingcategory.h>
#include <qstring.h>
#include <sched.h>
#ifdef __FreeBSD__
#include <security/pam_types.h>
#else
#include <security/_pam_types.h>
#endif
#include <security/pam_appl.h>
#include <unistd.h>
@ -87,11 +83,7 @@ PamIpcExitCode PamSubprocess::exec(const char* configDir, const char* config, co
logIf(this->log) << "Starting pam session for user \"" << user << "\" with config \"" << config
<< "\" in dir \"" << configDir << "\"" << std::endl;
#ifdef __FreeBSD__
auto result = pam_start(config, user, &conv, &handle);
#else
auto result = pam_start_confdir(config, user, &conv, configDir, &handle);
#endif
if (result != PAM_SUCCESS) {
logIf(true) << "Unable to start pam conversation with error \"" << pam_strerror(handle, result)