Skip to content

Commit e29e776

Browse files
oxziflashcode
authored andcommitted
openbsd_privdrop.py 0.1.2: add fattr to pledge_promises
Since WeeChat 4.3.0, the return value of chmod is being checked[0]. This revealed a too strict pledge promise, missing fattr. As an additional change, the level of documentation was increased, including a remainder why read permissions on /home are necessary. [0]: weechat/weechat@2423fdb#diff-b08b83cf9b86fa0f5c4ca579554a7ba593a892fd143526210844a05701e57058
1 parent 81d35ff commit e29e776

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

python/openbsd_privdrop.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2022 Alvar Penning <[email protected]>
1+
# Copyright (c) 2022, 2024 Alvar Penning <[email protected]>
22
#
33
# Permission to use, copy, modify, and distribute this software for any
44
# purpose with or without fee is hereby granted, provided that the above
@@ -27,9 +27,17 @@
2727
#
2828
# - https://man.openbsd.org/pledge.2
2929
# - 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
3035

3136
# History:
3237
#
38+
# 2024-08-19, Alvar Penning <[email protected]>
39+
# version 0.1.2: add fattr to pledge_promises and a bit more documentation
40+
#
3341
# 2022-11-09, Alvar Penning <[email protected]>
3442
# version 0.1.1: sane defaults for unveil
3543
#
@@ -45,13 +53,13 @@
4553

4654
SCRIPT_NAME = "openbsd_privdrop"
4755
SCRIPT_AUTHOR = "Alvar Penning <[email protected]>"
48-
SCRIPT_VERSION = "0.1.1"
56+
SCRIPT_VERSION = "0.1.2"
4957
SCRIPT_LICENSE = "ISC"
5058
SCRIPT_DESC = "Drop WeeChat's privileges through OpenBSD's pledge(2) and unveil(2)."
5159

5260
SETTINGS = {
5361
"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",
5563
"List of promises for pledge(2).",
5664
),
5765
"pledge_execpromises": (
@@ -64,7 +72,8 @@
6472
# This may be tightened, especially if WeeChat is not run as a separate user.
6573
"~:rwc",
6674
# 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.
6877
"/home:r",
6978
# Other scripts might load some library or a third-party Python modules later.
7079
"/usr/local/lib:r",

0 commit comments

Comments
 (0)