aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Dykstra <dwd@samba.org>1999-03-01 21:16:49 +0000
committerDavid Dykstra <dwd@samba.org>1999-03-01 21:16:49 +0000
commit86692050b54b16e5b289ddeacbb59f890455cca7 (patch)
tree4795a7102cc2dbd4341822481c016e30b32d9c19
parent460f6b990a89a13060b57e1e52f72346bf020679 (diff)
downloadandroid_external_rsync-86692050b54b16e5b289ddeacbb59f890455cca7.tar.gz
android_external_rsync-86692050b54b16e5b289ddeacbb59f890455cca7.tar.bz2
android_external_rsync-86692050b54b16e5b289ddeacbb59f890455cca7.zip
When comparing -1 to a group id, cast -1 with gid_t because on some systems
such as sunos4 gid_t is an unsigned short. This prevented the just-added non-mapped group test from working on sunos4.
-rw-r--r--rsync.c4
-rw-r--r--uidlist.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/rsync.c b/rsync.c
index ceabfdac..178dc523 100644
--- a/rsync.c
+++ b/rsync.c
@@ -180,8 +180,8 @@ int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
}
change_uid = am_root && preserve_uid && st->st_uid != file->uid;
- change_gid = !am_daemon && preserve_gid && file->gid != -1 \
- && st->st_gid != file->gid;
+ change_gid = !am_daemon && preserve_gid && file->gid != (gid_t) -1 && \
+ st->st_gid != file->gid;
if (change_gid && !am_root) {
/* enforce bsd-style group semantics: non-root can only
change to groups that the user is a member of */
diff --git a/uidlist.c b/uidlist.c
index e4b61b88..14611a55 100644
--- a/uidlist.c
+++ b/uidlist.c
@@ -126,7 +126,7 @@ static gid_t match_gid(gid_t gid)
if (am_root)
last_out = gid;
else
- last_out = -1;
+ last_out = (gid_t) -1;
return last_out;
}