Pimcore : The current system user is not allowed to execute this script. Allowed users: 'root' Executing user: 'xxx' - pimcore

I am facing issue with execute script in pimcore and getting below error :
The current system user is not allowed to execute this script. Allowed users: 'root' Executing user: 'XXX'.
My system user is : root
I have checked my user setting and this is root. so how to solve this issue

Related

missing permissions to create folder from java application

I am setting up a spring boot application and when running it, it should generate a folder in the source directory (see step 3: https://www.baeldung.com/spring-boot-h2-database)
But when running the application I receive the following error:
org.h2.message.DbException: Log file error: "/data/sample.trace.db", cause: "org.h2.message.DbException: Error while creating file ""/data"" [90062-200]" [90034-200]
at org.h2.message.DbException.get(DbException.java:194)
at org.h2.message.TraceSystem.logWritingError(TraceSystem.java:294)
at org.h2.message.TraceSystem.openWriter(TraceSystem.java:315)
at org.h2.message.TraceSystem.writeFile(TraceSystem.java:263)
at org.h2.message.TraceSystem.write(TraceSystem.java:247)
at org.h2.message.Trace.error(Trace.java:194)
it seems to be a permission problem but I do not understand why. My current user, has admin permissons. What am I missing here?
When I encounter this problem on my machine I proceed through following steps:
If I don't know what user & group I am right now: $whoami && groups
What user is the program executed with (I'm not into Java so eg. PHP "echo exec('whoami');")
Who has access to the directory: $ls -la
3.1 If only owner has access and you are not the owner: $chown user:group file
3.2 If group and owner should have access consider: $chmod 770 file

Cleartool error: Unable to update view

I am using cleartool command in my linux machine. I am trying to merge a label ONLINE_Dec_15 to main branch. I am using a view called admin_view with default config spec.
element * CHECKEDOUT
element * /main/LATEST
The view has following permissions:
Owner: vobadmin : rwx (all)
Group: ccusers : rwx (all)
Other: : r-x (read)
The vob I am working on has following permissions set:
VOB ownership:
owner vobadmin
group ccusers
The file which has to get merged has following permissions:
Element Protection:
User : vobadmin : r--
Group: ccusers : r--
Other: : r--
I am able to perform merge with these permissions in other vobs. But I am getting this error in this case. What am I missing?
I am getting following error:
cleartool: Error: Unable to update view "admin_view": Permission denied.
cleartool: Error: Unable to check out "./app/test.java".
As mentioned here
Ensure that your view was created with the correct permission's. Once again it is the Linux users' primary Group as defined when your create the Linux user.
Tip: Ensure the you use the correct umask setting when creating views
Ensure that when you created the viewstore, that you have set the correct user:group ownership
Try with a new view and see if the issue persists.
Make a comparison with other (working) views by comparing their:
cleartool lsview -l -full -pro <aview>

chef user resource does not update an existing user's home directory if it already exists

Im trying to make sure my chef recipe creates a new unix user or alters the existing user if it already exists ,using the following resource
user 'postgres' do
supports :manage_home => true
home '/home/postgres'
shell '/bin/bash'
password #{password}
action :create
end
But inthe following case:
user postgres is already created but owner of /home/postgres is root
The recipe gives output user[postgres] action create (up to date)
even though :manage_home => true is specified.
Is there better way to create/update a user and its home directory ?
Unfortunately the only thing :manage_home => true does is creating the home directory if it does not exist. If it exists it does nothing, even if there are wrong permissions.
I have a directory resource coming after every user resource, that makes sure home folder is correct:
directory '/home/postgres' do
owner 'postgres'
group 'postgres'
mode 0755
end

SELinux: Creating customized environment to specified user accounts

We could map standard linux user into SElinux user accounts. Consider I am having a standard linux user with name "Steve".
Now, I am having 2 questions.
a.) If I map "Steve" into user_u (SElinux account), then he will get execution permission on $HOME & /tmp directory. Can I restrict "Steve" from executing applications in $HOME or /tmp. I tried using "neverallow" statement in policy file (*.te), and ended in following error message.
Error Message:
"libsepol.check_assertion_helper: neverallow violated by allow user_t bin_t:file { read getattr open };"
How could I override default permissions like user_u is having execution permission in $HOME in SELinux??
b.) I have created a file and changed it's type to "mytype_t" using chcon command. Then added "allow user_t mytype_t: file { read write execute };" into my policy. I have added mytype_t to /etc/selinux/default/contexts/files/file_contexts & /etc/selinux/default/modules/active/file_context. "seinfo -t" doesn't list mytype_t.
I could successfully create *.pp file. When I tried to install this policy using "semodule -i myPolicy.pp", I have ended with the following error message. It seems, mytype_t is not recognized by SElinux Policy.
Error Message:
libsepol.print_missing_requirements: user_execution_permission's global requirements were not met: type/attribute mytype_t (No such file or directory).
libsemanage.semanage_link_sandbox: Link packages failed (No such file or directory).
semodule: Failed!
Simply I just want to create user "Steve" who can execute aare having standard linux users that are mapped into SElinux user-account. For example "Steve" is a standard linux user-account that can be mapped to any of the following, such as user_u (or) staff_u (or) system_u (or) unconfined_u.ll files with type "mytype_t" in anywhere in system, But should not be able to execute applications with other types.
I am working on debian 6 with policy.24, Thanks in advance for help!

Vagrant puppet change owner of folder in pp exec

I am trying to develop a CakePHP application, and I am using Vagrant to run a testing environment. However, I was getting this error in the browser
Warning (2):
session_start() [http://php.net/function.session-start]:
open(/var/lib/php/session/sess_speva7ghaftl8n98r9id5a7434, O_RDWR) failed:
Permission denied (13) [CORE/Cake/Model/Datasource/CakeSession.php, line 614]
I can get rid of the error by SSHing to the vm and doing
[vagrant#myserver ~]$ sudo su -
[root#myserver ~]# chown -R vagrant. /var/lib/php/session/
I don't want to have to do this every time I restart the vm, so I tried adding this to myserver.pp
exec { 'chown':
command => 'chown -R vagrant. /var/lib/php/session/',
path => '/bin',
user => 'root'
}
but it gets an error while starting up the vm...
err:
/Stage[main]/Myserver/Exec[chown]/returns: change from notrun to 0 failed:
chown -R vagrant. /var/lib/php/session/
returned 1 instead of one of [0] at /tmp/vagrant-puppet/manifests/myserver.pp:35
I was unable to find any useful examples of how to use exec on the internet, and I have never used Vagrant or Puppet before, so the above code is just the best guess I could come up with, and I apologize if it is a simple fix to get this working.
I have verified using which chown within the vm that the path is /bin, and the command is exactly the same as when I run it in the vm myself. I'm thinking it is the user that is causing problem. Do I have that line right? Is it even possible to exec commands as root from a .pp file?
When using exec, you normally have to enter the full path to the command you execute. So if you change your command into
exec { 'chown':
command => '/bin/chown -R vagrant:vagrant /var/lib/php/session/',
path => '/bin',
user => 'root'
}
it should work imo.
However, it depends a lot how you install your application. If the setup/start of the application is also managed with Puppet, you can also manage the directory you're interested in with Puppet, like this
file { "/var/lib/php/session" :
ensure => directory,
group => "vagrant",
owner => "vagrant",
recurse => true,
}
before you start your app. This would be much more the Puppet way, as you manage a reource then instead of executing commands. However, normally /var/lib/... should not be owned by someone other than root.
So you should maybe look into how your app is started and make it start with another user or as root. If it is started with an exec, you can add an additional property
user => root
to it and that should also do the trick.

Resources