This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] jar tool should honour umask while creating a jar


>>>>> "Ranjit" == Ranjit Mathew <rmathew@hotmail.com> writes:

Ranjit> My understanding is that if you leave out the third mode argument,
Ranjit> the file is created in accordance with the umask of the user.
Ranjit> Thus the third argument is not needed IMO and hence the patch.

The man page indicates that the mode should always be used when
O_CREAT is specified.  This makes sense to me.  I'm checking in the
appended.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* jartool.c: Use mode 0666 when opening new file.

Index: jartool.c
===================================================================
RCS file: /cvs/gcc/gcc/fastjar/jartool.c,v
retrieving revision 1.16
diff -u -r1.16 jartool.c
--- jartool.c 9 Sep 2002 21:19:16 -0000 1.16
+++ jartool.c 20 Oct 2002 23:28:25 -0000
@@ -439,8 +439,7 @@
   /* create the jarfile */
   if(action == ACTION_CREATE){
     if(jarfile){
-      jarfd = open(jarfile, O_CREAT | O_BINARY | O_WRONLY | O_TRUNC,
-		   S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+      jarfd = open(jarfile, O_CREAT | O_BINARY | O_WRONLY | O_TRUNC, 0666);
 
       if(jarfd < 0){
         fprintf(stderr, "Error opening %s for writing!\n", jarfile);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]