Skip to content

Conversation

@dongsupark
Copy link

Split out the test function into checkReadonlyPaths(), and add more cases for read-only paths like subdirectory, file under subdirectory, and directory under subdirectory.

Test inside container should return error if a relative path is given for read-only paths.

Deliberately create an invalid read-only symlink that points out of the container, to see if the test fails inside the container.

Create read-only block device, char device, and fifo, to check if they are read-only as expected.

}

// Deliberately set a relative path to be read-only, and expect an error
readonlyRelPath := "/etc/../readonly-relpath"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a relative path? I think it equal to /readonly-relpath. It's a absolute path.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@q384566678 Fixed the relative path.
Also fixed the same one in #643.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use readonlyRelPath := "readonly-relpath" ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@q384566678 Done. Also done in #643.

Split out the test function into `checkReadonlyPaths()`, and add more
cases for readonly paths like subdirectory, file under subdirectory,
and directory under subdirectory.

Signed-off-by: Dongsu Park <dongsu@kinvolk.io>
@dongsupark dongsupark force-pushed the dongsu/test-readonly-paths branch from 3e4cae6 to fc6aec7 Compare June 8, 2018 07:16
Dongsu Park added 3 commits June 12, 2018 10:33
Test inside container should return error if a relative path is given
for read-only paths.

Signed-off-by: Dongsu Park <dongsu@kinvolk.io>
Deliberately create an invalid read-only symlink that points out of the
container, to see if the test fails inside the container.

Signed-off-by: Dongsu Park <dongsu@kinvolk.io>
Create read-only block device, char device, and fifo, to check if
they are read-only as expected.

Signed-off-by: Dongsu Park <dongsu@kinvolk.io>
@dongsupark dongsupark force-pushed the dongsu/test-readonly-paths branch from fc6aec7 to 303ae30 Compare June 12, 2018 08:35
@zhouhao3
Copy link

zhouhao3 commented Jun 25, 2018

LGTM

Approved with PullApprove

@zhouhao3 zhouhao3 merged commit 80195d8 into opencontainers:master Jun 25, 2018
@dongsupark dongsupark deleted the dongsu/test-readonly-paths branch June 25, 2018 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants