Uh oh!
There was an error while loading. Please reload this page.
validate: add maskedpaths and readonlypaths check - #259
Conversation
vbatts
left a comment
There was a problem hiding this comment.
Is checking for absolute path enough to determine read-only? I wonder if there is a unit test for some of these validations. It would require permission though.
Mashimiao
commented
Oct 26, 2016
This just check config file in bundle if it meets the requirements in runtime SPEC. |
| } | ||
| for _, maskedPath := range v.spec.Linux.MaskedPaths { | ||
| if !filepath.IsAbs(maskedPath) { |
There was a problem hiding this comment.
We should probably factor our explicit-platform filepath analog out into its own package to handle cross-platform validation. See previous discussion in #256.
There was a problem hiding this comment.
maskedPath and readonlyPath are Linux-specific, I think we don't need cross-platform validation here.
There was a problem hiding this comment.
You might be validating a Linux config on a Windows host. When --host-specific is not set, the validating host shouldn't matter at all.
There was a problem hiding this comment.
maskedPath and readonlyPath means to set paths inside Linux-based container to be masked and readonly in container namespace. In my opinion there is nothing to do with Windows host and there is nothing to do with --host-specific
There was a problem hiding this comment.
Nothing to do with a Windows runtime host, but you should be able to do host-agnostic validation with oci-runtime-tool validate … regardless of whether the config is for Linux/Solaris/Windows or your validating host is Linux/Solaris/Windows.
Consider the use-case where someone is running a config registry and they want to validate all the configs they host against the spec. Maybe their registry is on a Linux box, or maybe it's on a Windows box, but either way, they should still be able to check for “If this is a Linux config, are all the paths in linux.maskedPath absolute?”.
Mashimiao
commented
Oct 31, 2016
On 10/28/2016 11:46 AM, W. Trevor King wrote:
Part agreed.
Agreed, and that's also the current implement. |
wking
commented
Oct 31, 2016
On Sun, Oct 30, 2016 at 08:20:37PM -0700, Ma Shimiao wrote:
Agreed, but “I'm validating a Linux container” doesn't mean “I'm
I want to replace path/filepath with a version of filepath that lets if !explicitOSFilepath.IsAbs(v.spec.Platform.OS, maskedPath) and similarly for readonlyPath. explicitOSFilepath is a terrible import ( or some such. And once we'd completed the transition: import ( |
Mashimiao
commented
Oct 31, 2016
On 10/31/2016 12:45 PM, W. Trevor King wrote:
Until here, I do really know what you mean...
I think there is no need to do so complicated thing. |
f86075c to
c8001eaComparewking
commented
Oct 31, 2016
On Sun, Oct 30, 2016 at 10:36:35PM -0700, Ma Shimiao wrote:
Grepping for ‘filepath.’, I turn up a few more filepath.IsAbs calls |
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
c8001ea to
6bfa0a0CompareMashimiao
commented
Nov 4, 2016
ping @opencontainers/runtime-tools-maintainers |
liangchenye
commented
Nov 11, 2016
@Mashimiao LGTM |
Mashimiao
commented
Nov 11, 2016
@liangchenye need you re-LGTM. And just comment |
Signed-off-by: Ma Shimiao mashimiao.fnst@cn.fujitsu.com