Skip to content

Wrong user directory matching rule when copying to server #103

@sunxiyuan

Description

@sunxiyuan

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '复制到服务器'
  2. Click on '开始复制'
    
    Expected behavior
    The replication should be executed correctly, but the target server prompts: SSH key not available in the origin server!
    
    Additional context
    
    This issue is caused by the use of imprecise matching rules in the 81 origin site sync. sh file during the extraction of user directories.
    Specific code:
    homedir=grep $localuser /etc/passwd|cut -d':' -f6
    The correct one should be:
    homedir=$(grep '^root:' /etc/passwd | cut -d':' -f6)
    Otherwise, it will match:
    snapd-range-524288-root:x:524288:524288::/nonexistent:/usr/bin/false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions