[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

automake change permissions

How can I set the permissions of the files that get installed with
make install ?

basically, there are two files that get installed that I want to chmod to 700 instead of the default 755.  Is there a change I can make to the Makefile.am file which does this?
0
lwinkenb
Asked:
lwinkenb
  • 2
1 Solution
 
sunnycoderCommented:
Hi lwinkenb,

I think you should be able to control it using your umask setting

umask [-p] [-S] [mode]
The user file-creation mask is set to mode. If mode begins with a digit, it is interpreted as an octal number; otherwise it is interpreted as a symbolic mode mask similar to that accepted by chmod(1). If mode is omitted, the current value of the mask is printed. The -S option causes the mask to be printed in symbolic form; the default output is an octal number. If the -p option is supplied, and mode is omitted, the output is in a form that may be reused as input. The return status is 0 if the mode was successfully changed or if no mode argument was supplied, and false otherwise.

umask 077 should help

Sunnycoder
0
 
g0rathCommented:
Modify you Makefile.in that creates the Makefile.am file...

change this line...

INSTALL_PROGRAM = @INSTALL_PROGRAM@

to

INSTALL_PROGRAM = @INSTALL_PROGRAM@ -m 700
0
 
g0rathCommented:
of course that makes everything...if you want seperate modes for each type then you would modify the other sections


install-exec-local: install-local-stuff

     $(INSTALL) -m 700 $(yourprogs_whatever)

install-data-local:
   
    $(INSTALL)  -m 644 doc/whatever or whatever else
0
 
lwinkenbAuthor Commented:
sorry for the late accept.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now