Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Do not hardcoded username and group #97

Merged
merged 1 commit into from Sep 15, 2016
Merged

Conversation

mamchenkov
Copy link
Contributor

For chown/chgrp operations we need to know which username and
group to use. This varies from system to system and is not
always reliable.

Therefor we use the $USER environment variable, assuming that:

  1. The variable is defined and set to the current username.
  2. The group with the same name exists
  3. The current user is the member of that group

This works well for combinatinos like root:root, nginx:nginx,
someuser:someuser, etc.

For chown/chgrp operations we need to know which username and
group to use.  This varies from system to system and is not
always reliable.

Therefor we use the $USER environment variable, assuming that:

1. The variable is defined and set to the current username.
2. The group with the same name exists
3. The current user is the member of that group

This works well for combinatinos like root:root, nginx:nginx,
someuser:someuser, etc.
@mamchenkov mamchenkov merged commit fb6a349 into master Sep 15, 2016
@mamchenkov mamchenkov deleted the travis-bitbucket-pipelines branch September 15, 2016 08:18
Copy link
Contributor

@georgeconstantinou georgeconstantinou left a comment

Choose a reason for hiding this comment

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

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants