Merge pull request #483 from edneville/317_nofollow
Adding nofollow to opens
This commit is contained in:
commit
f06a1d8b00
@ -741,7 +741,7 @@ static int copy_file (const char *src, const char *dst,
|
|||||||
char buf[1024];
|
char buf[1024];
|
||||||
ssize_t cnt;
|
ssize_t cnt;
|
||||||
|
|
||||||
ifd = open (src, O_RDONLY);
|
ifd = open (src, O_RDONLY|O_NOFOLLOW);
|
||||||
if (ifd < 0) {
|
if (ifd < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -751,7 +751,7 @@ static int copy_file (const char *src, const char *dst,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif /* WITH_SELINUX */
|
#endif /* WITH_SELINUX */
|
||||||
ofd = open (dst, O_WRONLY | O_CREAT | O_TRUNC, statp->st_mode & 07777);
|
ofd = open (dst, O_WRONLY | O_CREAT | O_TRUNC | O_NOFOLLOW, statp->st_mode & 07777);
|
||||||
if ( (ofd < 0)
|
if ( (ofd < 0)
|
||||||
|| (fchown_if_needed (ofd, statp,
|
|| (fchown_if_needed (ofd, statp,
|
||||||
old_uid, new_uid, old_gid, new_gid) != 0)
|
old_uid, new_uid, old_gid, new_gid) != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user