Bug 275978 - man(1) does not support spaces in filenames
Summary: man(1) does not support spaces in filenames
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Wolfram Schneider
URL: https://reviews.freebsd.org/D43222
Keywords:
: 261357 (view as bug list)
Depends on: 275967
Blocks:
  Show dependency treegraph
 
Reported: 2023-12-28 09:03 UTC by Wolfram Schneider
Modified: 2024-10-27 15:53 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfram Schneider freebsd_committer freebsd_triage 2023-12-28 09:03:41 UTC
The shell script /usr/bin/man does not spaces in filenames.

e.g.:

$ cp /usr/share/man/man1/cat.1.gz  'ZZZ cat.1.gz'
/usr/bin/man "./ZZZ cat.1.gz"
No manual entry for ./ZZZ
No manual entry for cat.1.gz
Comment 1 commit-hook freebsd_committer freebsd_triage 2023-12-28 10:52:15 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=789480702e490818244af11279868ba4f3dabe6b

commit 789480702e490818244af11279868ba4f3dabe6b
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2023-12-28 10:50:29 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2023-12-28 10:50:29 +0000

    support spaces in filenames

    PR:             275978
    MFC after:      1 week

 usr.bin/man/man.sh | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
Comment 2 Wolfram Schneider freebsd_committer freebsd_triage 2023-12-28 15:08:16 UTC
There is another problem with white spaces. The globbing function in exists() cannot handle white spaces. This is not trivial to fix, we have to rewrite the function.

mkdir -p man/man1
cp /usr/share/man/man1/cat.1.gz "man/man1/ZZZ cat.1.gz"
/usr/bin/man -M man "ZZZ cat"
No manual entry for ZZZ
No manual entry for cat
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-01-05 08:22:00 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=d93d7230fa708a8e86b68d9d70f403ff8b8a6050

commit d93d7230fa708a8e86b68d9d70f403ff8b8a6050
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2023-12-28 10:50:29 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-01-05 08:21:05 +0000

    support spaces in filenames

    PR:             275978
    MFC after:      1 week

    (cherry picked from commit 789480702e490818244af11279868ba4f3dabe6b)

 usr.bin/man/man.sh | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-01-05 08:22:01 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=5e78db7b45ede9b8799fa0d293d282842aa00cc0

commit 5e78db7b45ede9b8799fa0d293d282842aa00cc0
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2023-12-28 10:50:29 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-01-05 08:21:29 +0000

    support spaces in filenames

    PR:             275978
    MFC after:      1 week

    (cherry picked from commit 789480702e490818244af11279868ba4f3dabe6b)

 usr.bin/man/man.sh | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-01-08 16:07:55 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=1e82d882ed3372bcaf82451bfb865483a409ab1f

commit 1e82d882ed3372bcaf82451bfb865483a409ab1f
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2024-01-08 15:53:11 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-01-08 16:05:50 +0000

    fix using man(1) with multiple pages

    PR: 275978
    Reported by: Mohamed Akram
    Fixes: 789480702e490818244af11279868ba4f3dabe6b
    MFC after: 1 week

 usr.bin/man/man.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2024-01-13 16:18:40 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e3c7b76fa8105929ae9a785e5ffc44274b1b0a81

commit e3c7b76fa8105929ae9a785e5ffc44274b1b0a81
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2024-01-13 16:16:55 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-01-13 16:16:55 +0000

    man(1): support spaces in filenames

    The globbing function in exists() needs to handle white spaces.

    PR:          275978
    Reviewed by: kevans, bapt, emaste
    MFC after:   1 week

 usr.bin/man/man.sh | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-01-15 07:38:12 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=79e7fef944f7f4bb6865d2b5d0d38b7933ed6e79

commit 79e7fef944f7f4bb6865d2b5d0d38b7933ed6e79
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2024-01-08 15:53:11 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-01-15 07:36:59 +0000

    fix using man(1) with multiple pages

    PR: 275978
    Reported by: Mohamed Akram
    Fixes: 789480702e490818244af11279868ba4f3dabe6b
    MFC after: 1 week

    (cherry picked from commit 1e82d882ed3372bcaf82451bfb865483a409ab1f)

 usr.bin/man/man.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2024-01-15 07:38:15 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=1540a1b6fc05cfa192acec23c693bbe97e73d844

commit 1540a1b6fc05cfa192acec23c693bbe97e73d844
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2024-01-08 15:53:11 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-01-15 07:34:27 +0000

    fix using man(1) with multiple pages

    PR: 275978
    Reported by: Mohamed Akram
    Fixes: 789480702e490818244af11279868ba4f3dabe6b
    MFC after: 1 week

    (cherry picked from commit 1e82d882ed3372bcaf82451bfb865483a409ab1f)

 usr.bin/man/man.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2024-01-20 08:56:15 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=7169c947ab4150a539f2af6c9dcf3ab4344b0033

commit 7169c947ab4150a539f2af6c9dcf3ab4344b0033
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2024-01-13 16:16:55 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-01-20 08:51:12 +0000

    man(1): support spaces in filenames

    The globbing function in exists() needs to handle white spaces.

    PR:          275978
    Reviewed by: kevans, bapt, emaste
    Differential Revision: https://reviews.freebsd.org/D43222
    MFC after:   1 week

    (cherry picked from commit e3c7b76fa8105929ae9a785e5ffc44274b1b0a81)

 usr.bin/man/man.sh | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)
Comment 10 commit-hook freebsd_committer freebsd_triage 2024-02-12 15:49:48 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=1024a7c061ed5cb34f5f3730f70432b5c01c9a12

commit 1024a7c061ed5cb34f5f3730f70432b5c01c9a12
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2024-01-13 16:16:55 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-02-12 15:45:52 +0000

    man(1): support spaces in filenames

    The globbing function in exists() needs to handle white spaces.

    PR:          275978
    Reviewed by: kevans, bapt, emaste
    Differential Revision: https://reviews.freebsd.org/D43222
    MFC after:   1 week

    (cherry picked from commit e3c7b76fa8105929ae9a785e5ffc44274b1b0a81)
    (cherry picked from commit 7169c947ab4150a539f2af6c9dcf3ab4344b0033)

 usr.bin/man/man.sh | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)
Comment 11 commit-hook freebsd_committer freebsd_triage 2024-02-12 15:49:50 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=ec4c6d7ebfc91a2e6a06949451aaaad4bf582041

commit ec4c6d7ebfc91a2e6a06949451aaaad4bf582041
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2024-02-12 15:44:40 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-02-12 15:44:40 +0000

    fix using man(1) with multiple pages

    PR: 275978
    Reported by: Mohamed Akram
    Fixes: 789480702e490818244af11279868ba4f3dabe6b
    MFC after: 1 week

    (cherry picked from commit 1e82d882ed3372bcaf82451bfb865483a409ab1f)

 usr.bin/man/man.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 12 commit-hook freebsd_committer freebsd_triage 2024-05-20 16:08:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=37be4197f72ae3a61bd5e93d2ebdc9bd6d09ed21

commit 37be4197f72ae3a61bd5e93d2ebdc9bd6d09ed21
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2024-05-20 16:02:21 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-05-20 16:02:21 +0000

    man: the exists function needs to validate the first parameter

    This fixes an issue with the ".so " macro for FreeBSD
    ports manual pages.

    PR: 275978
    Reported by:    Jamie Landeg-Jones <jamie@catflap.org>
    MFC after:      1 week

    Differential Revision:  https://reviews.freebsd.org/D45231 (discussion)

 usr.bin/man/man.sh | 4 ++++
 1 file changed, 4 insertions(+)
Comment 13 commit-hook freebsd_committer freebsd_triage 2024-05-26 05:36:39 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=432c0128bd3da3f7800e9fa525d677f8fb99d7a1

commit 432c0128bd3da3f7800e9fa525d677f8fb99d7a1
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2024-05-20 16:02:21 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-05-26 05:34:40 +0000

    man: the exists function needs to validate the first parameter

    This fixes an issue with the ".so " macro for FreeBSD
    ports manual pages.

    PR: 275978
    Reported by:    Jamie Landeg-Jones <jamie@catflap.org>
    MFC after:      1 week

    Differential Revision:  https://reviews.freebsd.org/D45231 (discussion)

 usr.bin/man/man.sh | 4 ++++
 1 file changed, 4 insertions(+)
Comment 14 commit-hook freebsd_committer freebsd_triage 2024-05-26 05:44:40 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=36294c97c147733c3f4408cb6ecfacb8de8cc282

commit 36294c97c147733c3f4408cb6ecfacb8de8cc282
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2024-05-20 16:02:21 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2024-05-26 05:43:45 +0000

    man: the exists function needs to validate the first parameter

    This fixes an issue with the ".so " macro for FreeBSD
    ports manual pages.

    PR: 275978
    Reported by:    Jamie Landeg-Jones <jamie@catflap.org>
    MFC after:      1 week

    Differential Revision:  https://reviews.freebsd.org/D45231 (discussion)

 usr.bin/man/man.sh | 4 ++++
 1 file changed, 4 insertions(+)
Comment 15 Wolfram Schneider freebsd_committer freebsd_triage 2024-10-27 15:53:41 UTC
*** Bug 261357 has been marked as a duplicate of this bug. ***