BookmarkSubscribeRSS Feed
DonH
Lapis Lazuli | Level 10
When I use EG and save .sas program files or SAS data sets the default permissions created for them is 644 which means that other folks in the same group don't have write access. Is it possible to configure EG so files it creates use 664 instead?

We've tried updating the user profiles to set a umask to allow this, but it appears that EG is ignoring that.

Thanks,
Don Henderson
13 REPLIES 13
Doc_Duke
Rhodochrosite | Level 12
EGuide must run on Windows, but your comments make it look like the files are being stored in a Unix environment of some sort. You probably need to work with your unix admin on how the unix-to-pc connection is made (Samba, NFS ?).
DonH
Lapis Lazuli | Level 10
Yes, EG is running on Windows - as part of an EBI environment where all the SAS data files and code are to be saved on the Unix server. The Unix admin has set things up so the default umask is 664. I have confirmed that works for a number of applications. But EG seems to not be using the default umask. So my question is how I tell EG to honor the profile information set for the user on Unix.
ChrisHemedinger
Community Manager
Don,

EG is using the IOM FileService to write the files into the UNIX server file system. So it's the SAS process running on UNIX that is writing the file. I guess I'd expect it to behave similar to writing a file you reference with a SAS fileref in a SAS program.

We can look into how that behavior is affecting the umask. I suggest working with tech support to help track the details.

Chris
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
DonH
Lapis Lazuli | Level 10
Wanted to close the loop with the solution provided by TS:
===============
The Unix file permissions of files created via an Enterprise Guide session are inherited from the userid that starts the Object Spawner process. If you'd like to alter the file permissions for EG users that launch workspace server processes you'll need to add a umask command to the WorkspaceServer script, WorkspaceServer.sh. This script is located in your configuration directory at:
//Lev1/SASApp/WorkspaceServer

In your case you would add umask 113 to the script somewhere prior to the the following line:
cmd="$SAS_COMMAND...

Save the WorkspaceServer.sh script and restart the Object Spawner and any existing EG sessions.
===============
Assuming TS says OK, I will likely post this as a Tip of the Day on sasCommunity.org
deleted_user
Not applicable
I also see this note on SAS support site that will make umask value effective for all workspace sessions but what would be the solution when users need flexibility i.,e save files as 664 or 644 as required through EG? Is there any way to run Unix commands like chmod through EG as they are not unix savy ?
ChrisHemedinger
Community Manager
Another option in SAS 9.2 to inherit the correct default umask:

Add the lines:

# Source Profile
~/.profile

in the file workspaceserver.sh. This is located in the config directory Lev1/SASApp/WorkSpaceServer.

Chris
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
avinashginjupal
Obsidian | Level 7

Macro to change the permissions of SAS Dataset:

 

%macro chmod(libname,dataset,permis=777);

  proc sql;
     /* get the absolute path of the libname */
     select path into: extpath from dictionary.members
       where libname="%UPCASE(&LIBNAME)";

     /* find out if there are any datasets in the library */
     select count(path) into: cnt from dictionary.members
       where libname="%UPCASE(&LIBNAME)";

     /* if there are datasets...then issue the below command to change the 
        permissions of the dataset called in this macro  to 777 */ 
     %if &cnt > 0 %then %do;
        filename chmod pipe "chmod &PERMIS %trim(&extpath)/&dataset..ssd01";
        data _null_;
          file chmod;
        run;
     %end;
%mend;



/* assign a libref to test the macro */
libname link '/local/u/sssims/sasuser612';

/* test the macro on the 'houses' dataset in the 'link' library */
%chmod(link,houses);
larryrobert
Calcite | Level 5

Am I understanding this correctly in that if you change the profile in script reference above that it will change the permissions for all users of EG?

 

That is a problem in that we only want the permissions changed for specific users upon creating files - it seems like the default as one user noted is 644, we want 664 for selected users not everybody.  We want each user to be able to control this in their .bashrc with umask.

 

Note that if I run code outside of EG (for example using XWindows program like Mobaxterm) directly on the Unix server, then it reads my umask.

 

Using chmod is impractical since we are creating many permanent files all the time.

 

Is there any other way - can individual users' umask be read by executing a script in EG code with a system command "X....."?

SASKiwi
PROC Star

@larryrobert  - Surely this would be easier and more reliable to implement via a special login profile for the SAS users that require it? I'm not familiar enough with Unix to suggest how to do this but a Unix administrator should be able to advise.

Kurt_Bremser
Super User

In the WorkspaceServer_usermods.sh file, you can set the umask conditionally for certain users. When the shell script runs, the switch to the logged-in (via metadata) user has already been made (from the user that is running the object spawner).

 

The umask that you experience per default is the one from the userid running the object spawner.

sas_royal
Calcite | Level 5
Fixed the issue. Thanks.
sas_royal
Calcite | Level 5

This fixed our issue, just added umask 007 as we needed rw-rw---- permission.Thank you so much.

sas_royal
Calcite | Level 5
Fixed the issue.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 13 replies
  • 13678 views
  • 2 likes
  • 9 in conversation