After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781383 - [PATCH] Switch to modern realpath()
[PATCH] Switch to modern realpath()
Status: RESOLVED FIXED
Product: gnome-menus
Classification: Core
Component: libgnome-menu
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gnome-menus dummy account
gnome-menus dummy account
Depends on:
Blocks:
 
 
Reported: 2017-04-16 21:56 UTC by Pino Toscano
Modified: 2018-12-25 15:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Git commit (13.32 KB, patch)
2017-04-16 21:56 UTC, Pino Toscano
none Details | Review

Description Pino Toscano 2017-04-16 21:56:02 UTC
Created attachment 349916 [details] [review]
Git commit

When the canonialize.c code (i.e. menu_canonicalize_file_name()) was introduced, it was 2004 or earlier[1], and there was no non-buggy realpath() (see the "BUGS" section in realpath(3) [2]).  Now that POSIX.1-2007 standardized the resolved_path=NULL feature, and that that is implemented in glibc (years before that, even) and in libc's of other OSes, it is possible to simplify the gnome-menus code a bit.

The proposed patch just switches from menu_canonicalize_file_name() to realpath(), dropping the whole canonicalize.{c,h} code.  The dropped symbol is not part of the exported API & ABI, so this should pose no compatibility issues for the libgnome-menu-3 shared library.

[1] the Git history for it starts at 2004, but the copyright refers to years before that
[2] http://man7.org/linux/man-pages/man3/realpath.3.html
Comment 1 Pino Toscano 2018-12-24 23:17:34 UTC
Forwarded as PR in gitlab:
https://gitlab.gnome.org/GNOME/gnome-menus/merge_requests/4
Comment 2 Jeremy Bicha 2018-12-25 15:39:00 UTC
This problem has been fixed in the unstable development version. The fix will be available in the next major software release.