Skip to content

Commit

Permalink
refactor: umask is not useful for mkstemp
Browse files Browse the repository at this point in the history
I misunderstood the utility of umask. mkstemp
creates the temporary file with permissions 600,
the permission level I'm looking for in the first
place, but that level cannot be altered before the
file is created anyway. This means that I not
only don't need umask for what I thought I did
but it wasn't doing what I intended anyway.
  • Loading branch information
mcauley-penney committed Jul 13, 2023
1 parent 3f8e6e5 commit 6a6ccd2
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ int main(int argc, char *argv[])

char tmp_path[] = "/tmp/mmv_XXXXXX";

umask(077);

if (write_strarr_to_tmpfile(src_set, tmp_path) != 0) goto free_src_out;

if (edit_tmpfile(tmp_path) != 0) goto rm_path_out;
Expand Down

0 comments on commit 6a6ccd2

Please sign in to comment.