-
Notifications
You must be signed in to change notification settings - Fork 217
Update the startServer.sh copy functionality to only chmod owned files #2046
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
Conversation
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.
LGTM
if [ -O "$2" ]; then | ||
chmod 770 $2 | ||
[ $? -ne 0 ] && trace SEVERE "failed chmod 770 $2" && exitOrLoop | ||
fi |
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.
What file isn't owned? Note that there is similar logic in the liveness probe script.
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.
On OpenShift, the containers will not be run as the "oracle" user, but instead will be run as a new user (large UID), but that is part of the "root" group. In the case of the boot.properties, or any file that already exists and is being copied over, the file will still be owned by "oracle" and so the script cannot chmod the file.
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.
Yes, I'll change the liveness probe too
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.
It's interesting that boot.properties is created and copied over by the operator at runtime (contains the WL credentials), but it still needs an unknown check and a chmod...
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.
It's not copied by the "operator". It's copied by the user principal inside the server instance running a script injected by the operator.
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.
LGTM
This is part of making restrictive SCC work on OpenShift. In addition to the specific change to startServer.sh to only chmod when permitted, I noticed that many of the integration tests were initializing PV's with chown oracle:oracle rather than with oracle:root. I've updated those references too.