[PR #4606] [MERGED] libtrace.c: use realpath instead of readlink to avoid PATH_MAX #5204

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

📋 Pull Request Information

Original PR: https://github.com/netblue30/firejail/pull/4606
Author: @kmk3
Created: 10/14/2021
Status: Merged
Merged: 10/17/2021
Merged by: @smitsohu

Base: masterHead: rm-limits-h-libtrace


📝 Commits (1)

  • 8954cb2 libtrace.c: use realpath instead of readlink to avoid PATH_MAX

📊 Changes

1 file changed (+9 additions, -5 deletions)

View changed files

📝 src/libtrace/libtrace.c (+9 -5)

📄 Description

PATH_MAX is not guaranteed to be defined and it may be defined to -1.
Avoid depending on it by getting the result directly from realpath. See
commit 579f856c5 ("firejail.h: add missing linux/limits.h include") /
PR #4583 for details.

Note: This replaces the static char array currently used with a dynamic
one returned from realpath.

Misc: This is a continuation of #4583.


🔄 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/4606 **Author:** [@kmk3](https://github.com/kmk3) **Created:** 10/14/2021 **Status:** ✅ Merged **Merged:** 10/17/2021 **Merged by:** [@smitsohu](https://github.com/smitsohu) **Base:** `master` ← **Head:** `rm-limits-h-libtrace` --- ### 📝 Commits (1) - [`8954cb2`](https://github.com/netblue30/firejail/commit/8954cb2a1f8cf0d1e1101a2d82b3a98ce16f85c7) libtrace.c: use realpath instead of readlink to avoid PATH_MAX ### 📊 Changes **1 file changed** (+9 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/libtrace/libtrace.c` (+9 -5) </details> ### 📄 Description PATH_MAX is not guaranteed to be defined and it may be defined to -1. Avoid depending on it by getting the result directly from realpath. See commit 579f856c5 ("firejail.h: add missing linux/limits.h include") / PR #4583 for details. Note: This replaces the static char array currently used with a dynamic one returned from realpath. Misc: This is a continuation of #4583. --- <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:34:10 -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#5204
No description provided.