Skip to content

Conversation

patrick96
Copy link
Member

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

Description

If two users start a bar with IPC and don't have XDG_RUNTIME_DIR set,
polybar will create the fallback directory /tmp/polybar.
However, that directory is only accessible by the user that created it
and so polybar running under the second user will fail to open its
socket there.

We add the UID to the fallback directory to prevent this.

Related Issues & Documents

Fixes #2683

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

The concrete locations of the sockets are not documented on purpose.

@patrick96 patrick96 added this to the 3.6.3 milestone Apr 7, 2022
@codecov
Copy link

codecov bot commented Apr 7, 2022

Codecov Report

Merging #2684 (56b3f32) into hotfix/3.6.3 (7d9227c) will increase coverage by 0.00%.
The diff coverage is 66.66%.

@@              Coverage Diff              @@
##           hotfix/3.6.3    #2684   +/-   ##
=============================================
  Coverage         13.77%   13.77%           
=============================================
  Files               153      153           
  Lines             11284    11286    +2     
=============================================
+ Hits               1554     1555    +1     
- Misses             9730     9731    +1     
Flag Coverage Δ
unittests 13.77% <66.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
include/ipc/ipc.hpp 0.00% <ø> (ø)
src/components/controller.cpp 0.00% <ø> (ø)
src/ipc/util.cpp 73.07% <66.66%> (-1.93%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d9227c...56b3f32. Read the comment docs.

If two users start a bar with IPC and don't have XDG_RUNTIME_DIR set,
polybar will create the fallback directory `/tmp/polybar`.
However, that directory is only accessible by the user that created it
and so polybar running under the second user will fail to open its
socket there.

We add the UID to the fallback directory to prevent this.

Fixes polybar#2683
@patrick96 patrick96 merged commit 146c1ac into polybar:hotfix/3.6.3 Apr 7, 2022
@patrick96 patrick96 deleted the 2683-ipc-tmp branch April 7, 2022 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant