summaryrefslogtreecommitdiff
path: root/src/grpck.c
diff options
context:
space:
mode:
authorBalint Reczey <balint@balintreczey.hu>2016-11-30 02:36:06 +0100
committerBalint Reczey <balint@balintreczey.hu>2016-11-30 02:36:06 +0100
commit365658d0f3a51814626afbb70aa2dd7b5e82ac36 (patch)
tree7218fb9147359258fda0f9a43da5a29b2d20e85b /src/grpck.c
parentbfaa59229d61adb7fa0c570f0d94fd324c6e05aa (diff)
downloadshadow-365658d0f3a51814626afbb70aa2dd7b5e82ac36.tar.gz
Imported Upstream version 4.4upstream/4.4
Diffstat (limited to 'src/grpck.c')
-rw-r--r--src/grpck.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/grpck.c b/src/grpck.c
index 9d1ed903..ea5d3b39 100644
--- a/src/grpck.c
+++ b/src/grpck.c
@@ -299,7 +299,7 @@ static void open_files (void)
* Open the files. Use O_RDONLY if we are in read_only mode,
* O_RDWR otherwise.
*/
- if (gr_open (read_only ? O_RDONLY : O_RDWR) == 0) {
+ if (gr_open (read_only ? O_RDONLY : O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog,
grp_file);
if (use_system_grp_file) {
@@ -308,7 +308,7 @@ static void open_files (void)
fail_exit (E_CANT_OPEN);
}
#ifdef SHADOWGRP
- if (is_shadow && (sgr_open (read_only ? O_RDONLY : O_RDWR) == 0)) {
+ if (is_shadow && (sgr_open (read_only ? O_RDONLY : O_CREAT | O_RDWR) == 0)) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog,
sgr_file);
if (use_system_sgr_file) {