Access to var/log in non-admin mode

Hi. My apologizes if my questions seem to have obvious. I’m a rookie to Linux
I’m creating an industrial application for non administrator persons, executed in non-admin mode
In this program, I need to look at the “Linux journal” → var/log and get informations inside.
problem: the folder var/log is write-only for non admin (read-write for admin)
Question: is there a way for non-admin application to access those? is it possible to grant exceptional permissions to specific programs?

thanks in advance for your advise

Hello and welcome to the openSUSE forums.

I assume that with “admin” you mean user root.

You tagged this as “other”. Which means to us that you are using a non-supported version of openSUSE. We will still try to help you, but telling then which version you use is the more important!

BTW, in my openSUSE Leap 15.5:

boven:/var # ls -ld /var/log
drwxr-xr-x 21 root root 12288 Aug 28 07:56 /var/log
boven:/var #

which means that everybody can read and access that directory, but the only the owner root can write to it.
This is contrary to what you say?

It is indeed the case that most files in /var/log/ have permissions like this one:

boven:/var # l log/messages
-rw-r----- 1 root root 1707418 Aug 28 10:25 log/messages
boven:/var # 

which means that other users (not being member of the root group) can not read those files. This is for obvious security reasons.

my version, in “details” window is
SUSE Linux Enterprise 15 SP3

which means that everybody can read and access that directory, but the only the owner root can write to it.
This is contrary to what you say?> Citation
I confirm, what I say is the contrary

My program uses an API who writes to var/log/messages in the non-admin accounts, even if the right access are “none”
thus I wandered if if was possible to read as well, but I have now the feeling it’s not.

thanks

While the owners and permissions of those directory/files are most probably the same, this is NOT a SLES/SLED forum. This is the openSUSE forum.

Better go to the SLES/SLED community: Welcome to the SUSE & Rancher Community | SUSE

my apologises. I didn’t even know “openSUSE” was something different :slight_smile:

@moderators can you delete this thread?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.