Skip to content

Commit

Permalink
Support follow-symlinks SMB properties (#2258)
Browse files Browse the repository at this point in the history
  • Loading branch information
adreed-msft authored Jul 25, 2023
1 parent 06264a1 commit 0dffc94
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
11 changes: 0 additions & 11 deletions cmd/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,10 +676,6 @@ func (raw rawCopyCmdArgs) cook() (CookedCopyCmdArgs, error) {

cooked.IncludeDirectoryStubs = raw.includeDirectoryStubs

if err = crossValidateSymlinksAndPermissions(cooked.SymlinkHandling, cooked.preservePermissions.IsTruthy()); err != nil {
return cooked, err
}

cooked.backupMode = raw.backupMode
if err = validateBackupMode(cooked.backupMode, cooked.FromTo); err != nil {
return cooked, err
Expand Down Expand Up @@ -987,13 +983,6 @@ func validateSymlinkHandlingMode(symlinkHandling common.SymlinkHandlingType, fro
return nil // other older symlink handling modes can work on all OSes
}

func crossValidateSymlinksAndPermissions(symlinkHandling common.SymlinkHandlingType, preservePermissions bool) error {
if symlinkHandling != common.ESymlinkHandlingType.Skip() && preservePermissions {
return errors.New("cannot handle symlinks when preserving permissions (since the correct permission inheritance behaviour for symlink targets is undefined)")
}
return nil
}

func validateBackupMode(backupMode bool, fromTo common.FromTo) error {
if !backupMode {
return nil
Expand Down
3 changes: 0 additions & 3 deletions cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ func (raw *rawSyncCmdArgs) cook() (cookedSyncCmdArgs, error) {
if err = cooked.symlinkHandling.Determine(raw.followSymlinks, raw.preserveSymlinks); err != nil {
return cooked, err
}
if err = crossValidateSymlinksAndPermissions(cooked.symlinkHandling, true /* replace with real value when available */); err != nil {
return cooked, err
}
cooked.recursive = raw.recursive
cooked.forceIfReadOnly = raw.forceIfReadOnly
if err = validateForceIfReadOnly(cooked.forceIfReadOnly, cooked.fromTo); err != nil {
Expand Down

0 comments on commit 0dffc94

Please sign in to comment.