Changeset 3491 for trunk/src/tools/pkcs11-tool.c
- Timestamp:
- 04/25/08 11:51:03 (9 months ago)
- Files:
-
- 1 modified
-
trunk/src/tools/pkcs11-tool.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tools/pkcs11-tool.c
r3439 r3491 959 959 p11_fatal("C_SignFinal", rv); 960 960 961 #ifdef _WIN32962 961 if (opt_output == NULL) 963 962 fd = 1; 964 else if ((fd = open(opt_output, O_CREAT|O_TRUNC|O_WRONLY|O_BINARY, 0666)) < 0)963 else if ((fd = open(opt_output, O_CREAT|O_TRUNC|O_WRONLY|O_BINARY, S_IRUSR|S_IWUSR)) < 0) { 965 964 util_fatal("failed to open %s: %m", opt_output); 966 #else 967 if (opt_output == NULL) 968 fd = 1; 969 else if ((fd = open(opt_output, O_CREAT|O_TRUNC|O_WRONLY, 0666)) < 0) 970 util_fatal("failed to open %s: %m", opt_output); 971 #endif /* _WIN32 */ 965 } 972 966 973 967 r = write(fd, buffer, sig_len); … … 1020 1014 if (opt_output == NULL) 1021 1015 fd = 1; 1022 else if ((fd = open(opt_output, O_CREAT|O_TRUNC|O_WRONLY , 0666)) < 0)1016 else if ((fd = open(opt_output, O_CREAT|O_TRUNC|O_WRONLY|O_BINARY, S_IRUSR|S_IWUSR)) < 0) 1023 1017 util_fatal("failed to open %s: %m", opt_output); 1024 1018
