-
Notifications
You must be signed in to change notification settings - Fork 159
runtimetest: add linux default symbolic link validation #284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hqhq
merged 1 commit into
opencontainers:master
from
Mashimiao:runtime-test-linux-default-symboliclink-validation
Jan 6, 2017
Merged
runtimetest: add linux default symbolic link validation #284
hqhq
merged 1 commit into
opencontainers:master
from
Mashimiao:runtime-test-linux-default-symboliclink-validation
Jan 6, 2017
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Author
|
ping @opencontainers/runtime-tools-maintainers |
Member
mrunalp
reviewed
Jan 4, 2017
cmd/runtimetest/main.go
Outdated
| } | ||
|
|
||
| func validateDefaultSymlinks(spec *rspec.Spec) error { | ||
| logrus.Debugf("validating linux default Symbolic links") |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Symbolic -> symbolic
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thanks
Signed-off-by: Ma Shimiao <[email protected]>
22706e1 to
da25004
Compare
Author
|
@mrunalp @liangchenye PTAL |
Contributor
1 similar comment
Contributor
58 tasks
wking
added a commit
to wking/ocitools-v2
that referenced
this pull request
Apr 6, 2018
We've been using ModeSymlink as the mask since the check landed in da25004 (runtimetest: add linux default symbolic link validation, 2016-11-30, opencontainers#284). POSIX provides S_IS*(m) macros to portably interpret the mode type, but does not define values for each type [2]. Alban pointed out that st_mode is not a bitfield on Linux [1]. For example, Linux defines [3]: S_IFBLK 060000 S_IFDIR 040000 S_IFCHR 020000 So 'm&S_IFCHR == S_IFCHR', for example, would succeed for both character and block devices. Go translates the system values to a platform-agnostic bitfield [4], so the previous approach works on Go. But it may be confusing for people used to the native non-bitfield mode, so this commit moves us to an approach that does not rely on Go's using a bitfield. [1]: opencontainers#308 (comment) [2]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html [3]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/stat.h?h=v4.16#n9 [4]: https://github.com/golang/go/blob/b0d437f866eb8987cde7e6550cacd77876f36d4b/src/os/types.go#L45 Signed-off-by: W. Trevor King <[email protected]>
wking
added a commit
to wking/ocitools-v2
that referenced
this pull request
Apr 6, 2018
We've been using ModeSymlink as the mask since the check landed in da25004 (runtimetest: add linux default symbolic link validation, 2016-11-30, opencontainers#284). POSIX provides S_IS*(m) macros to portably interpret the mode type, but does not define values for each type [2]. Alban pointed out that st_mode is not a bitfield on Linux [1]. For example, Linux defines [3]: S_IFBLK 060000 S_IFDIR 040000 S_IFCHR 020000 So 'm&S_IFCHR == S_IFCHR', for example, would succeed for both character and block devices. Go translates the system values to a platform-agnostic bitfield [4], so the previous approach works on Go. But it may be confusing for people used to the native non-bitfield mode, so this commit moves us to an approach that does not rely on Go's using a bitfield. [1]: opencontainers#308 (comment) [2]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html [3]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/stat.h?h=v4.16#n9 [4]: https://github.com/golang/go/blob/b0d437f866eb8987cde7e6550cacd77876f36d4b/src/os/types.go#L45 Signed-off-by: W. Trevor King <[email protected]>
wking
added a commit
to wking/ocitools-v2
that referenced
this pull request
Apr 6, 2018
We've been using ModeSymlink as the mask since the check landed in da25004 (runtimetest: add linux default symbolic link validation, 2016-11-30, opencontainers#284). POSIX provides S_IS*(m) macros to portably interpret the mode type, but does not define values for each type [2]. Alban pointed out that st_mode is not a bitfield on Linux [1]. For example, Linux defines [3]: S_IFBLK 060000 S_IFDIR 040000 S_IFCHR 020000 So 'm&S_IFCHR == S_IFCHR', for example, would succeed for both character and block devices. Go translates the system values to a platform-agnostic bitfield [4], so the previous approach works on Go. But it may be confusing for people used to the native non-bitfield mode, so this commit moves us to an approach that does not rely on Go's using a bitfield. [1]: opencontainers#308 (comment) [2]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html [3]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/stat.h?h=v4.16#n9 [4]: https://github.com/golang/go/blob/b0d437f866eb8987cde7e6550cacd77876f36d4b/src/os/types.go#L45 Signed-off-by: W. Trevor King <[email protected]>
wking
added a commit
to wking/ocitools-v2
that referenced
this pull request
Apr 6, 2018
We've been using ModeSymlink as the mask since the check landed in da25004 (runtimetest: add linux default symbolic link validation, 2016-11-30, opencontainers#284). POSIX provides S_IS*(m) macros to portably interpret the mode type, but does not define values for each type [2]. Alban pointed out that st_mode is not a bitfield on Linux [1]. For example, Linux defines [3]: S_IFBLK 060000 S_IFDIR 040000 S_IFCHR 020000 So 'm&S_IFCHR == S_IFCHR', for example, would succeed for both character and block devices. Go translates the system values to a platform-agnostic bitfield [4], so the previous approach works on Go. But it may be confusing for people used to the native non-bitfield mode, so this commit moves us to an approach that does not rely on Go's using a bitfield. [1]: opencontainers#308 (comment) [2]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html [3]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/stat.h?h=v4.16#n9 [4]: https://github.com/golang/go/blob/b0d437f866eb8987cde7e6550cacd77876f36d4b/src/os/types.go#L45 Signed-off-by: W. Trevor King <[email protected]>
wking
added a commit
to wking/ocitools-v2
that referenced
this pull request
Apr 6, 2018
We've been using ModeSymlink as the mask since the check landed in da25004 (runtimetest: add linux default symbolic link validation, 2016-11-30, opencontainers#284). POSIX provides S_IS*(m) macros to portably interpret the mode type, but does not define values for each type [2]. Alban pointed out that st_mode is not a bitfield on Linux [1]. For example, Linux defines [3]: S_IFBLK 060000 S_IFDIR 040000 S_IFCHR 020000 So 'm&S_IFCHR == S_IFCHR', for example, would succeed for both character and block devices. Go translates the system values to a platform-agnostic bitfield [4], so the previous approach works on Go. But it may be confusing for people used to the native non-bitfield mode, so this commit moves us to an approach that does not rely on Go's using a bitfield. [1]: opencontainers#308 (comment) [2]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html [3]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/stat.h?h=v4.16#n9 [4]: https://github.com/golang/go/blob/b0d437f866eb8987cde7e6550cacd77876f36d4b/src/os/types.go#L45 Signed-off-by: W. Trevor King <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Ma Shimiao [email protected]