Regex

English! place to talk about OTRS development, programming and coding
Post Reply
manoj99
OTRS newbie
Posts: 7
Joined: 22 Jan 2020, 00:00
OTRS Version?: 6.0.24
Real Name: mk99

Regex

Post by manoj99 »

Hello,

I'm trying to develop a simple if condition clause for my otrs.SetPermissions.pl file so that it would set permissions for /opt/otrs/ exlucding or ignoring few paths i.e
/opt/otrs/scripts
/opt/otrs/var/tmp/Article
/opt/otrs/var/tmp/Ticket
..
..

or may be passing a variable that matches to ignore multiple paths using qr ?

Can someone provide some inputs.

Thanks,
M.

zzz
OTRS superhero
Posts: 393
Joined: 15 Dec 2016, 15:13
OTRS Version?: 3.x - 6.0.x
Real Name: Emin Yazi
Company: Efflux GmbH
Contact:

Re: Regex

Post by zzz »

Hey,

If you only want to ignore articles, you can go for the parameter --skip-article-dir

If you also want to add multiple paths, go for:
/opt/otrs/bin/otrs.SetPermissions.pl --skip-article-dir --skip-regex="^/scripts/" --skip-regex="^/NextFolder/EvenWithSubfolders/"

The starting point of your RegEx is always the home path of OTRS.

Best regards
Emin
Professional OTRS services for development, consulting, hosting and support:
efflux.de – German | efflux.de/en/ – English

Free and premium OTRS add-ons (TextModule, AdBlocker, ModernSkin ... growing): portal.efflux.de

manoj99
OTRS newbie
Posts: 7
Joined: 22 Jan 2020, 00:00
OTRS Version?: 6.0.24
Real Name: mk99

Re: Regex

Post by manoj99 »

Thanks for the reply Emin. thats actually a good solution but Im setting up SeLinx labels: For, Home dir (/opt/otrs) it needs sys_content(read only) excluding some folders under /opt/otrs/var that needs rw_content and .pl files that need exec permissions. So, if I use skip-regex that would intent to skill totally and I cannot have the permissions needed. So, If feel a simple regex function with if clause inside SetPermissions.pl would be great to have. so that it would be specific for certain folders that are in the list.

Hope you understood what Im trying to acheive.

Thanks,
M.

jojo
Moderator
Posts: 14643
Joined: 26 Jan 2007, 14:50
OTRS Version?: Git Master
Contact:

Re: Regex

Post by jojo »

OTRS user and webserver need full access in whole OTRS home directory. Otherwise Package Manager and other tools will not work correctly
"Production": OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com :: Share your ideas

manoj99
OTRS newbie
Posts: 7
Joined: 22 Jan 2020, 00:00
OTRS Version?: 6.0.24
Real Name: mk99

Re: Regex

Post by manoj99 »

Yes, under /opt/otrs , the directory permissions are 750 and files has 640 with otrs as an user and apache as a admin and webgroup. So, I think OTRS is happy with the permissions.

All I need is a solution for the use case mentioned above.

Post Reply