Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
net-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
net-tools
Commits
d50af4c5
Commit
d50af4c5
authored
Sep 06, 2009
by
Mike Frysinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slattach: use fchown() rather than chown() to avoid race between creation and permission changing
parent
d114ba0f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
slattach.c
slattach.c
+6
-4
No files found.
slattach.c
View file @
d50af4c5
...
...
@@ -73,7 +73,7 @@
const
char
*
Release
=
RELEASE
,
*
Version
=
"$Id: slattach.c,v 1.1
1 2005/12/04 05:15:36 ecki
Exp $"
,
*
Version
=
"$Id: slattach.c,v 1.1
2 2009/09/06 22:59:43 vapier
Exp $"
,
*
Signature
=
"net-tools, Fred N. van Kempen et al."
;
...
...
@@ -195,15 +195,17 @@ tty_lock(char *path, int mode)
return
(
-
1
);
}
(
void
)
close
(
fd
);
/* Make sure UUCP owns the lockfile. Required by some packages. */
if
((
pw
=
getpwnam
(
_UID_UUCP
))
==
NULL
)
{
if
(
opt_q
==
0
)
fprintf
(
stderr
,
_
(
"slattach: tty_lock: UUCP user %s unknown!
\n
"
),
_UID_UUCP
);
(
void
)
close
(
fd
);
return
(
0
);
/* keep the lock anyway */
}
(
void
)
chown
(
saved_path
,
pw
->
pw_uid
,
pw
->
pw_gid
);
(
void
)
fchown
(
fd
,
pw
->
pw_uid
,
pw
->
pw_gid
);
(
void
)
close
(
fd
);
saved_lock
=
1
;
}
else
{
/* unlock */
if
(
saved_lock
!=
1
)
return
(
0
);
...
...
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