Skip to content

setgid on configdirs#2270

Merged
BareosBot merged 5 commits intobareos:masterfrom
bruno-at-bareos:dev/bruno/master/setgid-on-configdirs
May 22, 2025
Merged

setgid on configdirs#2270
BareosBot merged 5 commits intobareos:masterfrom
bruno-at-bareos:dev/bruno/master/setgid-on-configdirs

Conversation

@bruno-at-bareos
Copy link
Contributor

@bruno-at-bareos bruno-at-bareos commented May 12, 2025

Currently when creating a new file/directory in /etc/bareos, it will have its group set to the primary-group of the user that created the file (in case of user "root", that is usually "root").
As a result Bareos might be unable to read the new file.
This is especially true if you cp somefile.conf newfile.conf as the default files have all bits for other cleared (i.e. 0640), but would also impose a problem when you have an umask that denies read-access to other (i.e. 0026).

If /etc/bareos and its children had the setgid bit set, creating new files/directories would inherit the group from the directory and all new files would have their group set to "bareos" automatically.

This PR aims to setgid for configdir

  • cmake install permissions
  • [X rpm %attr
  • deb control
  • freebsd-bareos
    - drwxr-sr-x 5 bareos wheel 512B May 20 08:05 /usr/local/etc/bareos do we want 0750 -> we keep it like this (for traymonitor)
    - [X] fix /usr/local/etc/bareos/bconsole.conf from 0644 -> 0640
  • windows
  • Changelog as Breaking changes
  • no backport decided on May 20th

Thank you for contributing to the Bareos Project!

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Required backport PRs have been created
  • Correct milestone is set
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR

@bruno-at-bareos bruno-at-bareos changed the title dev/bruno/master/setgid on configdirs setgid on configdirs May 12, 2025
@bruno-at-bareos bruno-at-bareos added requires no backport This will not be backported enhancement labels May 12, 2025
@bruno-at-bareos bruno-at-bareos force-pushed the dev/bruno/master/setgid-on-configdirs branch from 14914cc to f2bceb6 Compare May 12, 2025 14:24
@bruno-at-bareos bruno-at-bareos force-pushed the dev/bruno/master/setgid-on-configdirs branch from f2bceb6 to 5913089 Compare May 20, 2025 08:51
@bruno-at-bareos bruno-at-bareos removed enhancement requires no backport This will not be backported labels May 20, 2025
@bruno-at-bareos bruno-at-bareos marked this pull request as ready for review May 20, 2025 08:54
@bruno-at-bareos bruno-at-bareos self-assigned this May 20, 2025
@bruno-at-bareos bruno-at-bareos added this to the 25.0.0 milestone May 20, 2025
@bruno-at-bareos bruno-at-bareos added the requires no backport This will not be backported label May 20, 2025
@bruno-at-bareos bruno-at-bareos force-pushed the dev/bruno/master/setgid-on-configdirs branch 3 times, most recently from 912772f to b9174bf Compare May 21, 2025 13:07
Copy link
Contributor

@florian-at-bareos florian-at-bareos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, nice work!

@BareosBot BareosBot force-pushed the dev/bruno/master/setgid-on-configdirs branch from 01c7337 to 56672b3 Compare May 22, 2025 13:57
@BareosBot BareosBot merged commit 1b374fb into bareos:master May 22, 2025
@bruno-at-bareos bruno-at-bareos deleted the dev/bruno/master/setgid-on-configdirs branch November 26, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires no backport This will not be backported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants