GNU bug report logs -
#71732
30.0.50; [FR] xdg: provide an ability to create XDG directory, if it does not exist
Previous Next
Reported by: Ihor Radchenko <yantar92 <at> posteo.net>
Date: Sun, 23 Jun 2024 09:40:02 UTC
Severity: normal
Found in version 30.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 71732 in the body.
You can then email your comments to 71732 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
eliz <at> gnu.org, bjorn.bidar <at> thaodan.de, bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Sun, 23 Jun 2024 09:40:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ihor Radchenko <yantar92 <at> posteo.net>
:
New bug report received and forwarded. Copy sent to
eliz <at> gnu.org, bjorn.bidar <at> thaodan.de, bug-gnu-emacs <at> gnu.org
.
(Sun, 23 Jun 2024 09:40:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Follow-up from "Please document the caching and its user options"
https://yhetil.org/emacs-devel/86le35rwyp.fsf <at> gnu.org/
Currently `xdg-cache-home`, and other functions in xdg.el only return
the path, but never create any directories.
However, to follow XDG spec, XDG directories must follow certain
rules. In particular:
If, when attempting to write a file, the destination directory is
non-existent an attempt should be made to create it with permission
0700. If the destination directory exists already the permissions
should not be changed.
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
May you please add a functionality to xdg.el to create the directory
with right permissions, so that xdg.el users do not need to know these
technical details of the spec?
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Sun, 23 Jun 2024 10:13:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 71732 <at> debbugs.gnu.org (full text, mbox):
> Cc: Eli Zaretskii <eliz <at> gnu.org>, Björn Bidar <bjorn.bidar <at> thaodan.de>
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Date: Sun, 23 Jun 2024 09:40:49 +0000
>
> Currently `xdg-cache-home`, and other functions in xdg.el only return
> the path, but never create any directories.
Yes, because whether or not to create a missing directory is up to the
calling application. For example, if the application is looking for a
file in several possible locations, then a missing directory means
that particular location doesn't have the file, and the application
should look in the other places.
> However, to follow XDG spec, XDG directories must follow certain
> rules. In particular:
>
> If, when attempting to write a file, the destination directory is
> non-existent an attempt should be made to create it with permission
> 0700. If the destination directory exists already the permissions
> should not be changed.
> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
>
> May you please add a functionality to xdg.el to create the directory
> with right permissions, so that xdg.el users do not need to know these
> technical details of the spec?
xdg.el is not about creating directories, it is about returning their
names.
The ability to create a directory with arbitrary permissions already
exists, and Emacs uses that in umpteen places. So I'm not sure what
is missing here. Not every two-liner needs a dedicated named API.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Sun, 23 Jun 2024 10:20:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 71732 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> May you please add a functionality to xdg.el to create the directory
>> with right permissions, so that xdg.el users do not need to know these
>> technical details of the spec?
>
> xdg.el is not about creating directories, it is about returning their
> names.
>
> The ability to create a directory with arbitrary permissions already
> exists, and Emacs uses that in umpteen places. So I'm not sure what
> is missing here. Not every two-liner needs a dedicated named API.
The missing part is creating a directory that follows XDG spec without
having to consult that spec.
For example, I had no clue that applications using XDG are obliged to
create XDG dirs with 0700 persmissions until someone pointed.
I believe that such technical details would fit within xdg.el API.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Sun, 23 Jun 2024 10:25:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 71732 <at> debbugs.gnu.org (full text, mbox):
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: 71732 <at> debbugs.gnu.org, bjorn.bidar <at> thaodan.de
> Date: Sun, 23 Jun 2024 10:20:34 +0000
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> May you please add a functionality to xdg.el to create the directory
> >> with right permissions, so that xdg.el users do not need to know these
> >> technical details of the spec?
> >
> > xdg.el is not about creating directories, it is about returning their
> > names.
> >
> > The ability to create a directory with arbitrary permissions already
> > exists, and Emacs uses that in umpteen places. So I'm not sure what
> > is missing here. Not every two-liner needs a dedicated named API.
>
> The missing part is creating a directory that follows XDG spec without
> having to consult that spec.
>
> For example, I had no clue that applications using XDG are obliged to
> create XDG dirs with 0700 persmissions until someone pointed.
Emacs applications are not obliged to abide by what the XDG spec (or
any spec) says. Whether a directory we create under some XDG
directory should or should not have those permissions is something the
author of the Lisp program should consider and decide.
> I believe that such technical details would fit within xdg.el API.
I disagree, mainly because the details are not part of XDG, they are
part of the design and the implementation of the particular Lisp
program using the XDG directories.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Sun, 23 Jun 2024 10:35:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 71732 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Emacs applications are not obliged to abide by what the XDG spec (or
> any spec) says. Whether a directory we create under some XDG
> directory should or should not have those permissions is something the
> author of the Lisp program should consider and decide.
Let me clarify: I did not mean creating a directory _under_ XDG
directory. I meant creating XDG directory itself - it is regulated by
XDG spec.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Sun, 23 Jun 2024 11:32:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 71732 <at> debbugs.gnu.org (full text, mbox):
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: 71732 <at> debbugs.gnu.org, bjorn.bidar <at> thaodan.de
> Date: Sun, 23 Jun 2024 10:35:59 +0000
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > Emacs applications are not obliged to abide by what the XDG spec (or
> > any spec) says. Whether a directory we create under some XDG
> > directory should or should not have those permissions is something the
> > author of the Lisp program should consider and decide.
>
> Let me clarify: I did not mean creating a directory _under_ XDG
> directory. I meant creating XDG directory itself - it is regulated by
> XDG spec.
Yes, I understood, and my response includes that part as well.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Sun, 23 Jun 2024 11:42:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 71732 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> Let me clarify: I did not mean creating a directory _under_ XDG
>> directory. I meant creating XDG directory itself - it is regulated by
>> XDG spec.
>
> Yes, I understood, and my response includes that part as well.
Then, I do not understand your
>>> ...I disagree, mainly because the details are not part of XDG
According to
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html,
0700 permission is a part of XDG spec.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Sun, 23 Jun 2024 11:54:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 71732 <at> debbugs.gnu.org (full text, mbox):
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: 71732 <at> debbugs.gnu.org, bjorn.bidar <at> thaodan.de
> Date: Sun, 23 Jun 2024 11:42:47 +0000
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> Let me clarify: I did not mean creating a directory _under_ XDG
> >> directory. I meant creating XDG directory itself - it is regulated by
> >> XDG spec.
> >
> > Yes, I understood, and my response includes that part as well.
>
> Then, I do not understand your
>
> >>> ...I disagree, mainly because the details are not part of XDG
>
> According to
> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html,
> 0700 permission is a part of XDG spec.
I already explained that: we don't blindly follow any standards, and
this particular issue is up to the calling Lisp program. xdg.el has
no business forcing permissions on the caller.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Sun, 23 Jun 2024 12:11:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 71732 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> According to
>> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html,
>> 0700 permission is a part of XDG spec.
>
> I already explained that: we don't blindly follow any standards, and
> this particular issue is up to the calling Lisp program. xdg.el has
> no business forcing permissions on the caller.
I do not ask to force the permissions.
I am asking to provide an API function that will create XDG dir with
appropriately assignment permissions. It will be up to the xdg.el caller
to use that API function.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Sun, 23 Jun 2024 12:22:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 71732 <at> debbugs.gnu.org (full text, mbox):
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: 71732 <at> debbugs.gnu.org, bjorn.bidar <at> thaodan.de
> Date: Sun, 23 Jun 2024 12:12:20 +0000
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> According to
> >> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html,
> >> 0700 permission is a part of XDG spec.
> >
> > I already explained that: we don't blindly follow any standards, and
> > this particular issue is up to the calling Lisp program. xdg.el has
> > no business forcing permissions on the caller.
>
> I do not ask to force the permissions.
> I am asking to provide an API function that will create XDG dir with
> appropriately assignment permissions. It will be up to the xdg.el caller
> to use that API function.
Like I said earlier: this is a two-liner:
(with-file-modes 0700
(make-directory DIR t))
where the value 0700 is something the Lisp program should control.
I see no reason to provide an API for such simple code, let alone do
that in xdg.el.
And if you still don't agree, let's at least agree to disagree.
because this argument begins to revisit what was already said.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Sun, 23 Jun 2024 12:28:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 71732 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> I am asking to provide an API function that will create XDG dir with
>> appropriately assignment permissions. It will be up to the xdg.el caller
>> to use that API function.
>
> Like I said earlier: this is a two-liner:
>
> (with-file-modes 0700
> (make-directory DIR t))
>
> where the value 0700 is something the Lisp program should control.
Yes, it is a two-liner, but 0700 requires familiarity with XDG.
> I see no reason to provide an API for such simple code, let alone do
> that in xdg.el.
>
> And if you still don't agree, let's at least agree to disagree.
> because this argument begins to revisit what was already said.
Ok. Then, feel free to close the feature request.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Sun, 23 Jun 2024 12:38:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Ihor Radchenko <yantar92 <at> posteo.net>
:
bug acknowledged by developer.
(Sun, 23 Jun 2024 12:38:02 GMT)
Full text and
rfc822 format available.
Message #40 received at 71732-done <at> debbugs.gnu.org (full text, mbox):
> From: Ihor Radchenko <yantar92 <at> posteo.net>
> Cc: 71732 <at> debbugs.gnu.org, bjorn.bidar <at> thaodan.de
> Date: Sun, 23 Jun 2024 12:28:48 +0000
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> I am asking to provide an API function that will create XDG dir with
> >> appropriately assignment permissions. It will be up to the xdg.el caller
> >> to use that API function.
> >
> > Like I said earlier: this is a two-liner:
> >
> > (with-file-modes 0700
> > (make-directory DIR t))
> >
> > where the value 0700 is something the Lisp program should control.
>
> Yes, it is a two-liner, but 0700 requires familiarity with XDG.
No, it doesn't. It requires the decision which modes to use, which is
independent of what XDG mandates.
>
> > I see no reason to provide an API for such simple code, let alone do
> > that in xdg.el.
> >
> > And if you still don't agree, let's at least agree to disagree.
> > because this argument begins to revisit what was already said.
>
> Ok. Then, feel free to close the feature request.
Done.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Sun, 23 Jun 2024 21:10:01 GMT)
Full text and
rfc822 format available.
Message #43 received at 71732 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Ihor Radchenko <yantar92 <at> posteo.net>
>> Cc: 71732 <at> debbugs.gnu.org, bjorn.bidar <at> thaodan.de
>> Date: Sun, 23 Jun 2024 11:42:47 +0000
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> >> Let me clarify: I did not mean creating a directory _under_ XDG
>> >> directory. I meant creating XDG directory itself - it is regulated by
>> >> XDG spec.
>> >
>> > Yes, I understood, and my response includes that part as well.
>>
>> Then, I do not understand your
>>
>> >>> ...I disagree, mainly because the details are not part of XDG
>>
>> According to
>> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html,
>> 0700 permission is a part of XDG spec.
>
> I already explained that: we don't blindly follow any standards, and
> this particular issue is up to the calling Lisp program. xdg.el has
> no business forcing permissions on the caller.
I guess the point was that the caller should follow XDG or the
respective standard on non-xdg platforms and to at least advice in
following those.
Emacs should integrate into the target platform if possible saving files
into the right directories should be something possible.
"Blindly" following xdg or the respective platform for generic modus
does not sound like a wrong idea to me good defaults are valuable.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Mon, 24 Jun 2024 11:40:02 GMT)
Full text and
rfc822 format available.
Message #46 received at 71732 <at> debbugs.gnu.org (full text, mbox):
> From: Björn Bidar <bjorn.bidar <at> thaodan.de>
> Cc: Ihor Radchenko <yantar92 <at> posteo.net>, 71732 <at> debbugs.gnu.org
> Date: Mon, 24 Jun 2024 00:09:38 +0300
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> From: Ihor Radchenko <yantar92 <at> posteo.net>
> >> Cc: 71732 <at> debbugs.gnu.org, bjorn.bidar <at> thaodan.de
> >> Date: Sun, 23 Jun 2024 11:42:47 +0000
> >>
> >> Eli Zaretskii <eliz <at> gnu.org> writes:
> >>
> >> According to
> >> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html,
> >> 0700 permission is a part of XDG spec.
> >
> > I already explained that: we don't blindly follow any standards, and
> > this particular issue is up to the calling Lisp program. xdg.el has
> > no business forcing permissions on the caller.
>
> I guess the point was that the caller should follow XDG or the
> respective standard on non-xdg platforms and to at least advice in
> following those.
> Emacs should integrate into the target platform if possible saving files
> into the right directories should be something possible.
>
> "Blindly" following xdg or the respective platform for generic modus
> does not sound like a wrong idea to me good defaults are valuable.
The purpose of xdg.el is to represent the XDG directories to Emacs.
It is then the job of the Lisp programs which use xdg.el to decide
whether they create a directory and which permissions to give it.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#71732
; Package
emacs
.
(Mon, 24 Jun 2024 12:00:02 GMT)
Full text and
rfc822 format available.
Message #49 received at 71732 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Björn Bidar <bjorn.bidar <at> thaodan.de>
>> Cc: Ihor Radchenko <yantar92 <at> posteo.net>, 71732 <at> debbugs.gnu.org
>> Date: Mon, 24 Jun 2024 00:09:38 +0300
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> >> From: Ihor Radchenko <yantar92 <at> posteo.net>
>> >> Cc: 71732 <at> debbugs.gnu.org, bjorn.bidar <at> thaodan.de
>> >> Date: Sun, 23 Jun 2024 11:42:47 +0000
>> >>
>> >> Eli Zaretskii <eliz <at> gnu.org> writes:
>> >>
>> >> According to
>> >> https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html,
>> >> 0700 permission is a part of XDG spec.
>> >
>> > I already explained that: we don't blindly follow any standards, and
>> > this particular issue is up to the calling Lisp program. xdg.el has
>> > no business forcing permissions on the caller.
>>
>> I guess the point was that the caller should follow XDG or the
>> respective standard on non-xdg platforms and to at least advice in
>> following those.
>> Emacs should integrate into the target platform if possible saving files
>> into the right directories should be something possible.
>>
>> "Blindly" following xdg or the respective platform for generic modus
>> does not sound like a wrong idea to me good defaults are valuable.
>
> The purpose of xdg.el is to represent the XDG directories to Emacs.
> It is then the job of the Lisp programs which use xdg.el to decide
> whether they create a directory and which permissions to give it.
Maybe there should be a wrapper on top of xdg.el or the respective
platform wrapper then?
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 23 Jul 2024 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 59 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.