Vidyadhar, thanks for the tip! The host we use, uses the java service wrapper to launch tomcat so I added wrapper.java.umask=0002 to the .conf file. Now I can ratchet the the permissions down with PosixFilePermisions All is well now. thanks again, Scott -------- Original Message -------- Subject: Re: Controlling permissions when creating directories From: Techienote com [via Tomcat] <ml-node+s10n500236...@n6.nabble.com> To: sderrick <sc...@tnstaafl.net> Date: 07/30/2013 08:52 AM Hi Scott, Try following 1. Stop the services 2. Set the umask to 002. Command for the same is umask 022 3. Start the services Remember you need to perform all above in a single shell/terminal. Above umask will give permissions are as follows Directory 775 File 664 Regards, Vidyadhar Sent on my BlackBerry® from Vodafone -----Original Message----- From: Christopher Schultz < [hidden email] > Date: Mon, 29 Jul 2013 21:16:57 To: Tomcat Users List< [hidden email] > Reply-To: "Tomcat Users List" < [hidden email] > Subject: Re: Controlling permissions when creating directories -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Scott, On 7/29/13 8:36 PM, Scott Derrick wrote: > I am using tomcat7, on centOS6 > > The app crates a folder, uploads a file to the folder, processes > the file and then provides a download link to the resulting file. > All this works fine on a tomcat7 server running on my desktop > machine. Running tomcat7 on the server, its broke. > > I create the folder, OK. I upload the file, OK I run the first > process, NOT! > > I've tracked it down the permissions on the created folders. They > don't have write access on the group, so the write fails. If I > manually change the permission to 0760 it works fine. I specify > write permissions when I create the folder but it doesn't get set. Pesky Java 7 API. I'll have to read-up on that some time. > Its always drwxr-x--- My code in the servlet is > > */ Path imagePath = Paths.get(baseDir, user, Accession, > Accession); Set<PosixFilePermission> perms = > PosixFilePermissions.fromString("rwxrwxr--"); > FileAttribute<Set&lt;PosixFilePermission>> attr = > PosixFilePermissions.asFileAttribute(perms); > Files.createDirectory(imagePath.toAbsolutePath(), attr);/ * > > The permissions must be overridden somewhere. If I apply a more > restrictive permission, say 0600, that gets set correctly., I can't > seem to set the group permission to writable. > > Any ideas! I've been banging on this for hours! Any idea how PosixFilePermissions works with the process's umask? What kind of filesystem is it? What is the umask of the process? - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJR9xQGAAoJEBzwKT+lPKRY8UwP/RAvdvFPWwSb5W3OsOf1Veh0 hDLXTz3vV6gTDhPwiWMnuoAZEKLEz+kcJqMeeJxt1w1+pzcnm2JOnHETr95SpXuC X9LT2Qi3w686E2BrHjm+5ad1KN4KqXmcU0Eyh8HLPudyZwiNBMkhY8o3pLLDTEZF 4TxTzQoNSFSXsX1UcCQQM0bUYsURuvamhs8xytSa1VrTKLJUxaGFicZ+g+OVR5In Zg5Fg/BfjWDKGYW1ILWDaVG8dwCZ+CCwOOq6kBNZaU9zaPY2TSfkC8XAiY7xvah9 noLYUsSi2yEThqcPkn9QFZcKZFw24Vu7wQwhp2NihsKWu+WqAYOhFwRXegER6lnL k7JAuE/35+Y5V2Kxei34Ov/UW8tsuMi8c9G3B3lhBeaCT1MFMnjcpZn2LWeoXzBE 5of6TFQYmMjVhj0NJXBpThluomSkhOh9XmyWyzLcT+HmOjsAD+U30z5GrNBqFjN7 Sh4Xywrdolg8qS75mc4D6tf1vXkKYlHCM1/TOchB+8xdQPOQ+O97pDxzthKdpij7 5KuoNT/n2Zfdsuu5DVS3xjROeyst5Elwb6DNsSnAgzCjBxf8GFNniURcsoXA074t M6IXIMnen4lA/ipvRrV0iKQz+DNkiriDi8HA4Ze2ecE9LY6ETCW5ax4x518xeFty e8YrrK03AKUtpe9y5oWC =OOCi -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] If you reply to this email, your message will be added to the discussion below: http://tomcat.10.x6.nabble.com/Controlling-permissions-when-creating-directories-tp5002328p5002367.html To unsubscribe from Controlling permissions when creating directories, click here . NAML -- If you cannot work with love but only with distaste, it is better that you should leave your work. Kahlil Gibran
-- View this message in context: http://tomcat.10.x6.nabble.com/Controlling-permissions-when-creating-directories-tp5002328p5002369.html Sent from the Tomcat - User mailing list archive at Nabble.com.