Commit a60e2dca authored by J.W. Schultz's avatar J.W. Schultz

Create GID_NONE for use gid test readability.

parent 86c4601e
......@@ -54,14 +54,14 @@ static int skip_file(char *fname,
}
if (link_dest) {
if (preserve_perms
&& (st->st_mode & ~_S_IFMT) != (file->mode & ~_S_IFMT))
&& (st->st_mode & ~_S_IFMT) != (file->mode & ~_S_IFMT))
return 0;
if (am_root && preserve_uid && st->st_uid != file->uid)
return 0;
if (preserve_gid && file->gid != (gid_t)-1
&& st->st_gid != file->gid)
if (preserve_gid && file->gid != GID_NONE
&& st->st_gid != file->gid)
return 0;
}
......
......@@ -152,7 +152,7 @@ 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 = preserve_gid && file->gid != (gid_t)-1
change_gid = preserve_gid && file->gid != GID_NONE
&& st->st_gid != file->gid;
if (change_uid || change_gid) {
if (do_lchown(fname,
......
......@@ -362,6 +362,8 @@ enum logcode {FNONE=0, FERROR=1, FINFO=2, FLOG=3 };
#define IN_LOOPBACKNET 127
#endif
#define GID_NONE (gid_t) -1
struct file_struct {
unsigned flags;
time_t modtime;
......
......@@ -160,7 +160,7 @@ static gid_t match_gid(gid_t gid)
if (am_root)
last_out = gid;
else
last_out = (gid_t)-1;
last_out = GID_NONE;
return last_out;
}
......@@ -307,7 +307,7 @@ void recv_uid_list(int f, struct file_list *flist)
}
list->id2 = map_gid(id, name);
if (!am_root && !is_in_group(list->id2))
list->id2 = (gid_t)-1;
list->id2 = GID_NONE;
free(name);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment