Skip to content

Commit

Permalink
check chown() return value
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Frysinger <vapier@gmail.com>
  • Loading branch information
vapier committed Jan 29, 2010
1 parent e699c99 commit c3f07e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
(N)compress version 4.2.4.3
o Check return value of chown().

(N)compress version 4.2.4.2
o Integrate build/man touchups from Debian.
o Add fix from Fedora for handling of 0 byte files.
Expand Down
7 changes: 6 additions & 1 deletion compress42.c
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,12 @@ comprexx(fileptr)
exit_code = 1;
}
#ifndef DOS
chown(ofname, infstat.st_uid, infstat.st_gid); /* Copy ownership */
if (chown(ofname, infstat.st_uid, infstat.st_gid)) /* Copy ownership */
{
fprintf(stderr, "\nchown error (ignored) ");
perror(ofname);
exit_code = 1;
}
#endif
#endif
remove_ofname = 0;
Expand Down

0 comments on commit c3f07e9

Please sign in to comment.