|
1 | | -# Copyright (c) 2022 Alvar Penning <[email protected]> |
| 1 | +# Copyright (c) 2022, 2024 Alvar Penning <[email protected]> |
2 | 2 | # |
3 | 3 | # Permission to use, copy, modify, and distribute this software for any |
4 | 4 | # purpose with or without fee is hereby granted, provided that the above |
|
27 | 27 | # |
28 | 28 | # - https://man.openbsd.org/pledge.2 |
29 | 29 | # - https://man.openbsd.org/unveil.2 |
| 30 | +# |
| 31 | +# The config options for the SETTINGS below are: |
| 32 | +# - plugins.var.python.openbsd_privdrop.pledge_promises |
| 33 | +# - plugins.var.python.openbsd_privdrop.pledge_execpromises |
| 34 | +# - plugins.var.python.openbsd_privdrop.unveil |
30 | 35 |
|
31 | 36 | # History: |
32 | 37 | # |
| 38 | +# 2024-08-19, Alvar Penning <[email protected]> |
| 39 | +# version 0.1.2: add fattr to pledge_promises and a bit more documentation |
| 40 | +# |
33 | 41 | # 2022-11-09, Alvar Penning <[email protected]> |
34 | 42 | # version 0.1.1: sane defaults for unveil |
35 | 43 | # |
|
45 | 53 |
|
46 | 54 | SCRIPT_NAME = "openbsd_privdrop" |
47 | 55 | SCRIPT_AUTHOR = "Alvar Penning <[email protected]>" |
48 | | -SCRIPT_VERSION = "0.1.1" |
| 56 | +SCRIPT_VERSION = "0.1.2" |
49 | 57 | SCRIPT_LICENSE = "ISC" |
50 | 58 | SCRIPT_DESC = "Drop WeeChat's privileges through OpenBSD's pledge(2) and unveil(2)." |
51 | 59 |
|
52 | 60 | SETTINGS = { |
53 | 61 | "pledge_promises": ( |
54 | | - "stdio rpath wpath cpath dpath inet flock unix dns sendfd recvfd tty proc error", |
| 62 | + "stdio rpath wpath cpath dpath inet fattr flock unix dns sendfd recvfd tty proc error", |
55 | 63 | "List of promises for pledge(2).", |
56 | 64 | ), |
57 | 65 | "pledge_execpromises": ( |
|
64 | 72 | # This may be tightened, especially if WeeChat is not run as a separate user. |
65 | 73 | "~:rwc", |
66 | 74 | # WeeChat `stat`s /home while building the path to /home/$USER/... |
67 | | - # Might be changed if the home directory lies somehwere else. |
| 75 | + # Might be changed if the home directory lies somewhere else. |
| 76 | + # This happens by weechat_mkdir_parents calls, e.g., from logger_create_directory. |
68 | 77 | "/home:r", |
69 | 78 | # Other scripts might load some library or a third-party Python modules later. |
70 | 79 | "/usr/local/lib:r", |
|
0 commit comments