Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 646116 - app-misc/jail fails with dir containing any "." - jail: can't canonize path "${path//.*}". Bad path?
Summary: app-misc/jail fails with dir containing any "." - jail: can't canonize path "...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: NeedPatch
Depends on:
Blocks:
 
Reported: 2018-01-30 10:57 UTC by INODE64 Sistemas
Modified: 2018-11-04 12:34 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
honor standalone '.' in path, split jail dir on "/./" pattern (jail-2.0-dot-pattern.patch,568 bytes, patch)
2018-10-22 18:49 UTC, Alexander Zubkov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description INODE64 Sistemas 2018-01-30 10:57:30 UTC
A user's pathname contains any dot, example /var/www/domain.com/

When executing: su - user

It shows this error:

----
jail: can't canonize path "/var/www/domain". Bad path?
----

I found the problem with the function "make_jail_dir", It's in patch multiuser-rsa.patch, but I don't find any info about this problem and why it did make this patch.


Reproducible: Always
Comment 1 Pacho Ramos gentoo-dev 2018-02-01 14:50:07 UTC
this is not a regression over current stable
Comment 2 Alexander Zubkov 2018-10-22 18:49:27 UTC
Created attachment 552432 [details, diff]
honor standalone '.' in path, split jail dir on "/./" pattern

Hello.

I suppose this is done in such way so one is able to use the dot pattern "/./" in home path to split jail root from home path in the jail. For example:

/home/jail/./home/user/

The function make_jail_dir() checks only for a dot in the path to cut the dir. Proposed patch changes it to search for pattern "/./" only.
Comment 3 Larry the Git Cow gentoo-dev 2018-11-04 12:34:24 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2d45cce35de863eb4ce529cfc5b161349aa3f4d

commit b2d45cce35de863eb4ce529cfc5b161349aa3f4d
Author:     Pacho Ramos <pacho@gentoo.org>
AuthorDate: 2018-11-04 12:08:09 +0000
Commit:     Pacho Ramos <pacho@gentoo.org>
CommitDate: 2018-11-04 12:33:54 +0000

    app-misc/jail: Lots of bugfixes
    
    - Handle dirs with dots (#646116)
    - support openat() syscall too (#668898)
    - do not pass program parameters to ldd call (#668898)
    - do not duplicate jail in shells file (#668898)
    
    Thanks-to: Alexander Zubkov
    Closes: https://bugs.gentoo.org/646116
    Closes: https://bugs.gentoo.org/668898
    Signed-off-by: Pacho Ramos <pacho@gentoo.org>
    Package-Manager: Portage-2.3.51, Repoman-2.3.11

 app-misc/jail/files/jail-2.0-duplicate-jail.patch | 19 ++++++
 app-misc/jail/files/jail-2.0-fix-paths.patch      | 21 +++++++
 app-misc/jail/files/jail-2.0-ldd-call.patch       | 19 ++++++
 app-misc/jail/files/jail-2.0-openat-syscall.patch | 23 +++++++
 app-misc/jail/jail-2.0-r3.ebuild                  | 75 +++++++++++++++++++++++
 5 files changed, 157 insertions(+)