diff --git a/sas/sasjs/services/hooks/mpe_security_postedit.sas b/sas/sasjs/services/hooks/mpe_security_postedit.sas index 7697bc4..4110c42 100644 --- a/sas/sasjs/services/hooks/mpe_security_postedit.sas +++ b/sas/sasjs/services/hooks/mpe_security_postedit.sas @@ -19,6 +19,11 @@ data work.staging_ds; set work.staging_ds; LIBREF=upcase(LIBREF); + if LIBREF in ('WORK','CASUSER','SASUSER') then do; + putlog "ERR" +(-1) "OR: invalid LIBREF - " LIBREF; + call symputx('errval',1); + call symputx('errmsg',"Invalid LIBREF: "!!LIBREF); + end; DSN=upcase(DSN); ACCESS_LEVEL=upcase(ACCESS_LEVEL); if ACCESS_LEVEL not in ('EDIT','APPROVE','VIEW','SIGNOFF','AUDIT') then do; diff --git a/sas/sasjs/services/hooks/mpe_tables_postedit.sas b/sas/sasjs/services/hooks/mpe_tables_postedit.sas index 6a9c754..974c0bd 100644 --- a/sas/sasjs/services/hooks/mpe_tables_postedit.sas +++ b/sas/sasjs/services/hooks/mpe_tables_postedit.sas @@ -39,6 +39,13 @@ data work.staging_ds; audit_libds=upcase(audit_libds); rk_underlying=upcase(rk_underlying); + /* do not accept certain librefs */ + if LIBREF in ('WORK','CASUSER','SASUSER') + then do; + call symputx('errmsg',"Invalid LIBREF: "!!LIBREF); + call symputx('errflag',1); + end; + /* check for valid loadtype */ if LOADTYPE not in ('UPDATE','TXTEMPORAL','FORMAT_CAT','BITEMPORAL','REPLACE') then do; diff --git a/sas/sasjs/targets/viya/macros_viya/dc_getlibs.sas b/sas/sasjs/targets/viya/macros_viya/dc_getlibs.sas index cfac4e6..84c6c34 100644 --- a/sas/sasjs/targets/viya/macros_viya/dc_getlibs.sas +++ b/sas/sasjs/targets/viya/macros_viya/dc_getlibs.sas @@ -21,7 +21,7 @@ create table &outds as ,engine ,'' as libraryid length=17 from dictionary.libnames - where libname not in ('WORK','SASUSER'); + where libname not in ('WORK','SASUSER','CASUSER'); insert into &syslast values ("&DC_LIBREF", "&DC_LIBNAME",'','V9'); %mend dc_getlibs;