Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
3b83a220
Commit
3b83a220
authored
Sep 02, 2009
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define and use "our_gid" variable.
parent
8e15bd87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
10 deletions
+6
-10
main.c
main.c
+2
-0
uidlist.c
uidlist.c
+4
-10
No files found.
main.c
View file @
3b83a220
...
...
@@ -85,6 +85,7 @@ extern struct file_list *first_flist;
extern
filter_rule_list
daemon_filter_list
;
uid_t
our_uid
;
gid_t
our_gid
;
int
am_generator
=
0
;
int
local_server
=
0
;
int
daemon_over_rsh
=
0
;
...
...
@@ -1485,6 +1486,7 @@ int main(int argc,char *argv[])
starttime
=
time
(
NULL
);
our_uid
=
MY_UID
();
our_gid
=
MY_GID
();
am_root
=
our_uid
==
0
;
memset
(
&
stats
,
0
,
sizeof
(
stats
));
...
...
uidlist.c
View file @
3b83a220
...
...
@@ -33,6 +33,7 @@ extern int preserve_uid;
extern
int
preserve_gid
;
extern
int
preserve_acls
;
extern
int
numeric_ids
;
extern
gid_t
our_gid
;
extern
char
*
usermap
;
extern
char
*
groupmap
;
...
...
@@ -101,7 +102,6 @@ static int is_in_group(gid_t gid)
if
(
gid
==
last_in
)
return
last_out
;
if
(
ngroups
<
-
1
)
{
gid_t
mygid
=
MY_GID
();
if
((
ngroups
=
getgroups
(
0
,
NULL
))
<
0
)
ngroups
=
0
;
gidset
=
new_array
(
GETGROUPS_T
,
ngroups
+
1
);
...
...
@@ -111,11 +111,11 @@ static int is_in_group(gid_t gid)
ngroups
=
getgroups
(
ngroups
,
gidset
);
/* The default gid might not be in the list on some systems. */
for
(
n
=
0
;
n
<
ngroups
;
n
++
)
{
if
(
gidset
[
n
]
==
my
gid
)
if
(
gidset
[
n
]
==
our_
gid
)
break
;
}
if
(
n
==
ngroups
)
gidset
[
ngroups
++
]
=
my
gid
;
gidset
[
ngroups
++
]
=
our_
gid
;
if
(
DEBUG_GTE
(
OWN
,
2
))
{
int
pos
;
char
*
gidbuf
=
new_array
(
char
,
ngroups
*
21
+
32
);
...
...
@@ -139,13 +139,7 @@ static int is_in_group(gid_t gid)
return
last_out
=
0
;
#else
static
gid_t
mygid
=
GID_NONE
;
if
(
mygid
==
GID_NONE
)
{
mygid
=
MY_GID
();
if
(
DEBUG_GTE
(
OWN
,
2
))
rprintf
(
FINFO
,
"process has gid %u
\n
"
,
(
unsigned
)
mygid
);
}
return
gid
==
mygid
;
return
gid
==
our_gid
;
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment