diff options
author | Andrew Tridgell <tridge@samba.org> | 1996-10-01 04:12:30 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1996-10-01 04:12:30 +0000 |
commit | 7b8356d0bcc11d7681294afde83a18dfd46fa1ad (patch) | |
tree | 0e5688f015ad1184a349f806b168ac42ffb2440b /hlink.c | |
parent | 280cbb85375b7968e4f81c86ceb303c7f1ee563b (diff) | |
download | rsync-7b8356d0bcc11d7681294afde83a18dfd46fa1ad.tar.gz rsync-7b8356d0bcc11d7681294afde83a18dfd46fa1ad.tar.bz2 rsync-7b8356d0bcc11d7681294afde83a18dfd46fa1ad.zip |
- detect presence of remsh and use it instead of rsh
- handle directory ownership and permissions much better.
- fix bug where links caused the permissions of files to be
set incorrectly
- override the default umask in setting file permissions
- better handling -o and -D being passed to non-root users
- handle rsync to a destination of /
- fix the handling of mismatched file types at either end of the
link. For example, if the destination is a link and the source is not.
Diffstat (limited to 'hlink.c')
-rw-r--r-- | hlink.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -54,7 +54,9 @@ void init_hard_links(struct file_list *flist) (struct file_struct *)malloc(sizeof(hlink_list[0])*flist->count))) out_of_memory("init_hard_links"); - bcopy((char *)flist->files,hlink_list,sizeof(hlink_list[0])*flist->count); + bcopy((char *)flist->files, + (char *)hlink_list, + sizeof(hlink_list[0])*flist->count); qsort(hlink_list,flist->count, sizeof(hlink_list[0]), @@ -113,8 +115,8 @@ void do_hard_links(struct file_list *flist) hlink_list[i].inode == hlink_list[i-1].inode) { struct stat st1,st2; - if (stat(hlink_list[i-1].name,&st1) != 0) continue; - if (stat(hlink_list[i].name,&st2) != 0) { + if (lstat(hlink_list[i-1].name,&st1) != 0) continue; + if (lstat(hlink_list[i].name,&st2) != 0) { if (!dry_run && link(hlink_list[i-1].name,hlink_list[i].name) != 0) { fprintf(FINFO,"link %s => %s : %s\n", hlink_list[i].name,hlink_list[i-1].name,strerror(errno)); |