Skip to content

UMASK not not used consistently / chmod running twice #59

@Giermann

Description

@Giermann

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I am currently evaluating rclone for sync and stumbled across this Docker image.
But there is some error, if I do not misunderstand something:

You can set UMASK env variable to i.e. 002 to create new files and folders group-writable.
But unfortunately on start-up, a find-loop resets everything back to 750/640, no matter what UMASK is set to:

# Security: Ensure proper ownership with restricted permissions (safely)
echo "Setting directory permissions..."
chown -R abc:abc "${CONFIG_PATH}" "${DATA_PATH}" 2>/dev/null || true
find "${CONFIG_PATH}" "${DATA_PATH}" -type d -exec chmod 750 {} \; 2>/dev/null || true
find "${CONFIG_PATH}" "${DATA_PATH}" -type f -exec chmod 640 {} \; 2>/dev/null || true

Further, this loop is present in rclone/run, which is dependent from init-rclone-config, and also in init-rclone-config/up.
The actual 'umask' command is only being executed in init-rclone-config/up - shouldn't this be set in rclone/run instead?

Expected Behavior

Run the enforcing of correct permissions only once and respect UMASK environment variable for existing files on startup.

Steps To Reproduce

  1. Set UMASK to 002
  2. Start rclone Container and sync some files, they should be created with 775
  3. Stop and restart Container
  4. Find all previously uploaded files being reset to 750

Environment

All versions

Container creation

Pull from Docker Hub.

Container logs

not relevant

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions