Skip to content

Commit

Permalink
receiver: fix panic by initializing last seen file
Browse files Browse the repository at this point in the history
tridge rsync declares “static uid_t uid;”, i.e. initializes uid=0.
This means when running as root, rsync does not need to transfer
the uid and can just set the XMIT_SAME_UID flag for the first entry.

related to #9
  • Loading branch information
stapelberg committed Jan 26, 2025
1 parent 7b83b7e commit e010550
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/receiver/flist.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (rt *Transfer) receiveFileEntry(flags uint16, last *File) (*File, error) {

// rsync/flist.c:recv_file_list
func (rt *Transfer) ReceiveFileList() ([]*File, error) {
var lastFileEntry *File
lastFileEntry := new(File)
var fileList []*File
for {
b, err := rt.Conn.ReadByte()
Expand Down

0 comments on commit e010550

Please sign in to comment.