aboutsummaryrefslogtreecommitdiff
path: root/sway/main.c
AgeCommit message (Collapse)Author
2016-12-17Change how security config is loadedDrew DeVault
2016-12-15Handle malloc failures from read_lineDrew DeVault
2016-12-09Fix build on FreeBSDGreg V
- Make sure CMake always finds absolute paths for Cairo, Pango and GdkPixbuf - Add forgotten json-c include path to swaymsg/CMakeLists.txt - Disable -Werror because of assert warnings - Add correct /proc/pid/file path for FreeBSD - Use libepoll-shim on FreeBSD - Only use Linux capabilities on, well, Linux
2016-12-04Decrement expected_lenDrew DeVault
2016-12-04Drop restart command from sanity checkDrew DeVault
Since we don't actually have one of those
2016-12-02Check for CAP_SYS_PTRACEDrew DeVault
2016-12-02Deal with LD_LIBRARY_PATHDrew DeVault
2016-12-02Unset LD_PRELOAD on startup (before dropping root)Drew DeVault
LD_PRELOAD enables keyloggers to easily be made. This solution isn't perfect - really a secure system wouldn't have LD_PRELOAD at all. It was a stupid idea in the first place.
2016-12-02Flesh out security_sanity_checkDrew DeVault
2016-12-01Shut Clang upDrew DeVault
2016-12-01Write example security config, start on codeDrew DeVault
2016-10-27Log LD_LIBRARY_PATHDrew DeVault
2016-10-27Remove duplicate redhat-release lineDrew DeVault
2016-10-27Log uname -a on startupDrew DeVault
2016-10-27Log contents of distro version filesDrew DeVault
2016-10-27Log important env vars on startupDrew DeVault
2016-10-02moved ipc_init above config file processing.Patrick Sauter
This is necessary because commands in the config file (mode for instance) emit ipc events, and if ipc_init has not been called the ipc_clients_list is not initialized, and we segfault. This fixes that bug.
2016-09-20Split setgid and setuid, add privilege checkD.B
This commit deals with issue #884. I consulted the following sources: https://www.securecoding.cert.org/confluence/display/c/POS36-C.+Observe+correct+revocation+order+while+relinquishing+privileges and https://www.securecoding.cert.org/confluence/display/c/POS37-C.+Ensure+that+privilege+relinquishment+is+successful
2016-09-01Reorganize includesDrew DeVault
2016-05-05sway/main.c: simplify free'ing by switching to the helper methodDaniel Lockyer
2016-04-16Update to wlc 0.0.2Drew DeVault
2016-03-26Implement include commandMikkel Oscar Lyderik
The include command (`include <path>`) makes it possible to include sub config files from the main config file (or from within other sub config files). The include command uses the following rules for including config files: * the `path` can be either a full path or a path that is relative to the parent config. Shell expansion is supported, so it's possible to do `include ~/.config/sway.d/*`. * The same config file can only be included once (to prevent include cycles). If a config is included multiple times it will just be ignored after it has been included once. * Including a sub config file is the same as inserting the content of that file into the parent config, thus rules about overwriting bindsyms etc. works the same as for a single config. Implement #542
2016-03-24Gracefully exit when config is not foundMikkel Oscar Lyderik
This makes sure that sway will gracefully exit if the config is not found or sway is unable to read it.
2016-03-24Make the nvidia warning louderDrew DeVault
2016-03-24Don't set WLC_DIM on startupDrew DeVault
2016-03-24Update to new WLC APIDrew DeVault
2016-02-27Free config before exiting sway.Mikkel Oscar Lyderik
Apart from freeing the sway_config struct, this also terminates the swaybars spawned by sway, since they are linked by PID to the bar config structs.
2016-02-26Correctly exit sway on errors.Mikkel Oscar Lyderik
Calling `exit` in sway_terminate prevents sway from correctly shutting down (freeing data, cleanly terminating the ipc server, etc.). A better way is to exit straight away if the failure occurs before `wlc_run` and use sway_abort as usual if it occur when wlc is running.
2016-02-25Fix for when sway_abort doesn't exitYacine Hmito
sway_terminate does an exit in case wlc_terminate doesn't
2016-02-25No options when using sway as IPC clientYacine Hmito
Sway used to attempt sending an IPC command composed of every argument after the first non-option argument encountered. Now, raises an error if an option is encountered before the intended command. Some options such as -h or -v take effect when parsing, so they still apply.
2016-02-25Removed p as a valid CLI optionYacine Hmito
The get-socketpath long option had an undocumented short alternative as `p`. It has been removed. However, the code in the options array is still the 'p' char.
2016-01-22Prevent ipc from crashing swaycrondog
2016-01-19libinputCole Mickens
2016-01-05Init layout before checking configMikkel Oscar Lyderik
2015-12-29Handle SIGTERM sent to swayMikkel Oscar Lyderik
This makes sway handle and gracefully shut down everything when receiving a SIGTERM. Fix #416
2015-12-14Detect proprietary AMD drivers tooStreetwalrus Einstein
2015-12-12Implement invoking `sway` as IPC clientDrew DeVault
As an alternative to invoking swaymsg.
2015-11-29Merge pull request #276 from sce/earlier_loggingDrew DeVault
main: Setup logging before wlc_init.
2015-11-29main: Setup logging before wlc_init.S. Christoffer Eliesen
If `wlc_init` fails the error message will never be logged or printed anywhere.
2015-11-28Fix option parsingChristoph Gysin
Using 'flag' results in duplicate code paths for short and long options. This broke the -q short option in swaymsg, because there was: {"quiet", no_argument, &quiet, 'q'} Which will set quiet to 'q' and return 0, not 'q'.
2015-11-28sway: Add --help option that prints usageChristoph Gysin
2015-11-28sway: Print usage and exit on unknown optionsChristoph Gysin
2015-11-28Use macros for exit valuesChristoph Gysin
2015-11-28sway/main: Move wlc init to after args are handled.S. Christoffer Eliesen
First of all because it's not needed that early, and second of all because there's a bug where calling `sway --get-socketpath` via `popen` causes the child sway process to spin/hang instead of returning EOF. (Specifically `(unset SWAYSOCK; swaymsg)` hangs.) This patch fixes that. (Also note that this patch moves the "detailed review" comment, so I guess this patch requires extra detailed review?)
2015-11-27Move IPC client into common, refactor IPCDrew DeVault
2015-11-18Basic support for extensions in server and clientsDrew DeVault
2015-11-13ipc: Store socketname in SWAYSOCK. Fixes `--get-socketpath`.S. Christoffer Eliesen
After adding pid to the socket path the `--get-socketpath` command broke because it doesn't know the pid of the running instance. Fix this by setting and querying `SWAYSOCK`. Also ignore `SWAYSOCK` upon normal startup if a socket exists at that location (ie. from another sway instance), and don't overwrite `I3SOCK` if it exists either.
2015-10-18main: Implement --get-socketpath switch.S. Christoffer Eliesen
2015-10-08#187, let init handle child processestaiyu
2015-10-08Revert "#187 cleanup zombies properly"Drew DeVault