[PR #6893] [MERGED] modif: rlimit: improve error messages #6223

Closed
opened 2026-05-05 10:53:01 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/6893
Author: @kmk3
Created: 9/8/2025
Status: Merged
Merged: 9/9/2025
Merged by: @kmk3

Base: masterHead: rlimit-improve-err-messages


📝 Commits (1)

  • e756c98 modif: rlimit: improve error messages

📊 Changes

5 files changed (+25 additions, -21 deletions)

View changed files

📝 src/firejail/main.c (+8 -6)
📝 src/firejail/profile.c (+8 -6)
📝 src/firejail/util.c (+1 -1)
📝 test/environment/rlimit-bad-profile.exp (+4 -4)
📝 test/environment/rlimit-bad.exp (+4 -4)

📄 Description

Changes:

  • Remove unrelated strerror output from some error messages
  • Remove periods from some error messages
  • Ensure that the invalid value is in the error message
  • Ensure that the full command name is in the error message (instead of
    just rlimit in some cases)
  • Standardize output
  • tests: Expect the full command name (and argument in some cases)

Examples:

Before:

$ firejail --quiet --noprofile --rlimit-cpu=-1 /bin/true
Error: invalid rlimit -1
$ firejail --quiet --noprofile --rlimit-nproc=-1 /bin/true
Error: invalid rlimit -1
$ firejail --quiet --noprofile --rlimit-as=-1 /bin/true
Error: invalid rlimit-as. Only use positive numbers and K, M or G suffix.: No such file or directory

After:

$ firejail --quiet --noprofile --rlimit-cpu=-1 /bin/true
Error: invalid rlimit-cpu: -1
$ firejail --quiet --noprofile --rlimit-nproc=-1 /bin/true
Error: invalid rlimit-nproc: -1
$ firejail --quiet --noprofile --rlimit-as=-1 /bin/true
Error: invalid rlimit-as: -1; use only positive numbers and K, M or G suffix

This is a follow-up to #6891.

Relates to #4315.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netblue30/firejail/pull/6893 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 9/8/2025 **Status:** ✅ Merged **Merged:** 9/9/2025 **Merged by:** [@kmk3](https://github.com/kmk3) **Base:** `master` ← **Head:** `rlimit-improve-err-messages` --- ### 📝 Commits (1) - [`e756c98`](https://github.com/netblue30/firejail/commit/e756c98fc7e2827b8d96c9774c449ba0780bf9a2) modif: rlimit: improve error messages ### 📊 Changes **5 files changed** (+25 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `src/firejail/main.c` (+8 -6) 📝 `src/firejail/profile.c` (+8 -6) 📝 `src/firejail/util.c` (+1 -1) 📝 `test/environment/rlimit-bad-profile.exp` (+4 -4) 📝 `test/environment/rlimit-bad.exp` (+4 -4) </details> ### 📄 Description Changes: * Remove unrelated `strerror` output from some error messages * Remove periods from some error messages * Ensure that the invalid value is in the error message * Ensure that the full command name is in the error message (instead of just `rlimit` in some cases) * Standardize output * tests: Expect the full command name (and argument in some cases) Examples: Before: $ firejail --quiet --noprofile --rlimit-cpu=-1 /bin/true Error: invalid rlimit -1 $ firejail --quiet --noprofile --rlimit-nproc=-1 /bin/true Error: invalid rlimit -1 $ firejail --quiet --noprofile --rlimit-as=-1 /bin/true Error: invalid rlimit-as. Only use positive numbers and K, M or G suffix.: No such file or directory After: $ firejail --quiet --noprofile --rlimit-cpu=-1 /bin/true Error: invalid rlimit-cpu: -1 $ firejail --quiet --noprofile --rlimit-nproc=-1 /bin/true Error: invalid rlimit-nproc: -1 $ firejail --quiet --noprofile --rlimit-as=-1 /bin/true Error: invalid rlimit-as: -1; use only positive numbers and K, M or G suffix This is a follow-up to #6891. Relates to #4315. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 10:53:01 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#6223
No description provided.