public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/18366] New: auto-load declined message prints filename not directory
@ 2015-05-01 18:20 richard_sharman at mitel dot com
  2015-05-03  7:14 ` [Bug gdb/18366] " jan.kratochvil at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: richard_sharman at mitel dot com @ 2015-05-01 18:20 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18366

            Bug ID: 18366
           Summary: auto-load declined message prints filename not
                    directory
           Product: gdb
           Version: archer
            Status: NEW
          Severity: minor
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: richard_sharman at mitel dot com
  Target Milestone: ---

Created attachment 8295
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8295&action=edit
Remove the last directory specifier before printing

If an auto-load file is declined, gdb prints a message indictating
what to do to allow it, but instead of printing the directory to add
it prints the filename.

E.g.

To enable execution of this file add
        add-auto-load-safe-path
/home/gx5000/sharman/gdb/gdb-7.9/build/gdb/gdb-gdb.gdb
line to your configuration file "/home/gx5000/sharman/.gdbinit".

It should have said
        add-auto-load-safe-path /home/gx5000/sharman/gdb/gdb-7.9/build/gdb

Enclosed is a patch to print the directory. It replaces the slash with
NUL before printing it then restores it afterwards.  (I don't think
that is necessary but wasn't sure how the cleanup of the string worked.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug gdb/18366] auto-load declined message prints filename not directory
  2015-05-01 18:20 [Bug gdb/18366] New: auto-load declined message prints filename not directory richard_sharman at mitel dot com
@ 2015-05-03  7:14 ` jan.kratochvil at redhat dot com
  2015-05-04 12:57 ` richard.sharman at mitel dot com
  2015-05-04 13:18 ` [Bug gdb/18366] doc: auto-load should document also filenames (not just directories) jan.kratochvil at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jan.kratochvil at redhat dot com @ 2015-05-03  7:14 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18366

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |jan.kratochvil at redhat dot com
         Resolution|---                         |WONTFIX

--- Comment #1 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
It intentionally prints the filename.  It works and if you want to load that
file permit that file.  There can be other files in the same directory which
wre downloaded there from untrusted sources.  Permitting whole directory for
loading one file could inadvertly permit+load there also the other untrusted
files.

Sure if you are aware the whole directory and all its subdirectories are
trusted feel free to enable whatever you want.  But that is outside of the
scope of this suggestion - it says "To enable execution of >>>this file<<<".

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug gdb/18366] auto-load declined message prints filename not directory
  2015-05-01 18:20 [Bug gdb/18366] New: auto-load declined message prints filename not directory richard_sharman at mitel dot com
  2015-05-03  7:14 ` [Bug gdb/18366] " jan.kratochvil at redhat dot com
@ 2015-05-04 12:57 ` richard.sharman at mitel dot com
  2015-05-04 13:18 ` [Bug gdb/18366] doc: auto-load should document also filenames (not just directories) jan.kratochvil at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: richard.sharman at mitel dot com @ 2015-05-04 12:57 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18366

--- Comment #2 from richard.sharman at mitel dot com ---
My apologies.
I quite thought I had entered what said and got an error and,  thinking
that it only accepted directories "fixed" it.  I must have typed it in
wrong because trying it now it works.
The info page implies that only entries are accepted.  Perhaps there should
be a bug raised for that?
Richard


On 3 May 2015 at 03:14, jan.kratochvil at redhat dot com <
sourceware-bugzilla@sourceware.org> wrote:

> https://sourceware.org/bugzilla/show_bug.cgi?id=18366
>
> Jan Kratochvil <jan.kratochvil at redhat dot com> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>              Status|NEW                         |RESOLVED
>                  CC|                            |jan.kratochvil at redhat
> dot com
>          Resolution|---                         |WONTFIX
>
> --- Comment #1 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
> It intentionally prints the filename.  It works and if you want to load
> that
> file permit that file.  There can be other files in the same directory
> which
> wre downloaded there from untrusted sources.  Permitting whole directory
> for
> loading one file could inadvertly permit+load there also the other
> untrusted
> files.
>
> Sure if you are aware the whole directory and all its subdirectories are
> trusted feel free to enable whatever you want.  But that is outside of the
> scope of this suggestion - it says "To enable execution of >>>this
> file<<<".
>
> --
> You are receiving this mail because:
> You reported the bug.
>

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug gdb/18366] doc: auto-load should document also filenames (not just directories)
  2015-05-01 18:20 [Bug gdb/18366] New: auto-load declined message prints filename not directory richard_sharman at mitel dot com
  2015-05-03  7:14 ` [Bug gdb/18366] " jan.kratochvil at redhat dot com
  2015-05-04 12:57 ` richard.sharman at mitel dot com
@ 2015-05-04 13:18 ` jan.kratochvil at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: jan.kratochvil at redhat dot com @ 2015-05-04 13:18 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=18366

Jan Kratochvil <jan.kratochvil at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
            Version|archer                      |HEAD
         Resolution|WONTFIX                     |---
            Summary|auto-load declined message  |doc: auto-load should
                   |prints filename not         |document also filenames
                   |directory                   |(not just directories)

--- Comment #3 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
# 'set auto-load safe-path [DIRECTORIES]'
#   Set the list of directories (and their subdirectories) trusted for
# 'add-auto-load-safe-path'
#   Add an entry (or list of entries) the list of directories trusted

Yes, you are right the doc is not exactly right.  It is normally expected there
will be directories but one can put even filenames there.  I was writing it
being aware of it but I somehow found it good that way for simplicity. 
Apparently it can cause confusion.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-04 13:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-01 18:20 [Bug gdb/18366] New: auto-load declined message prints filename not directory richard_sharman at mitel dot com
2015-05-03  7:14 ` [Bug gdb/18366] " jan.kratochvil at redhat dot com
2015-05-04 12:57 ` richard.sharman at mitel dot com
2015-05-04 13:18 ` [Bug gdb/18366] doc: auto-load should document also filenames (not just directories) jan.kratochvil at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).