0

I have below configuration in pom.xml file for rpm. I want to copy a jar at specific folder when rpm runs. The code is as below in pom.xml:

<mapping>
   <directory>/var/lib/abc</directory>
   <filemode>777</filemode>
   <username>aaa</username>
   <groupname>aaa</groupname>
   <sources>
       <source>
          <location>/opt/lib/temp.jar</location>
       </source>
   </sources>
</mapping>

The same configuration I have in another pom file for another rpm.

The problem is, when I run the any rpm first it created the folder, copy the file.

Working as expected but I run another rpm file, it generated error that the files are already present and not overwrite those file.

I just want to know, is there any way to overwrite those file or any way avoid the error if the files are already present to that location.

Thanks, Atul

Atul
  • 3,043
  • 27
  • 39

1 Answers1

0

The issue has been resolved.

There is strange fix I did:

<filemode>777</filemode>

This line I have to added in pom file, where it was missing.

I thought, it would allow me, as the directoy is already created.

Atul
  • 3,043
  • 27
  • 39
  • I'm not sure exactly what you're doing, but this is _probably_ a bad idea. Permission 777 on a globally-installed file is _always_ a security risk. – Aaron D. Marasco Feb 27 '19 at 00:31
  • @AaronD.Marasco , yes you are right. The solution I have found to solve the problem given here. We have already changed those permissions as per the requirement. As per the requirement, user change the permissions and use it. – Atul Feb 27 '19 at 07:06