setting file permissons

28 views
Skip to first unread message

sushant pradhan

unread,
Feb 27, 2013, 12:59:45 AM2/27/13
to yadt-...@googlegroups.com
Hi, 

I want to copy a script to the target machine with file permissions '-rwxr-xr-x'. The permissions are set to '755' in the source code repo, but YADT does not respect the original file permissions but copies the file with permissions '-rw-r--r--'. How do I make sure that YADT sets the given file permissions at the target machine?

Thanks,
Sushant 

manniking50

unread,
Feb 27, 2013, 1:08:26 AM2/27/13
to yadt-...@googlegroups.com
If you are interested in fax software. Please contact our customer service from here, http://joyfax.com/contact.html

Thank you, I wish you have a good day!



2013/2/27 sushant pradhan <sushanta...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "YADT Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yadt-devel+...@googlegroups.com.
To post to this group, send email to yadt-...@googlegroups.com.
Visit this group at http://groups.google.com/group/yadt-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

maximili...@gmail.com

unread,
Feb 27, 2013, 3:37:59 AM2/27/13
to yadt-...@googlegroups.com
Hey Sushant,

That's correct, the original file permissions are not preserved by the yadt-config-rpm-maker (for security reasons, among others) and you have to explicitly set them if you don't want the "sane default".

This is done like so: 

Example : you want to change the permissions of /foo/bar

Your source must contain two files :
  • /foo/bar
  • /foo/bar.%attr
The contents of  /foo/bar.%attr file must respect the syntax of the %attr directive from RPM, e.G. 
a content of 
755,-,- 
will result in 
-rwxr-xr-x
for the file.

Please refer to the documentation at http://www.rpm.org/max-rpm-snapshot/s1-rpm-specref-files-list-directives.html for more information about %attr and %defattr. 

Regards,
max

sushant pradhan

unread,
Mar 7, 2013, 6:33:47 AM3/7/13
to yadt-...@googlegroups.com
Hi max,

While I am trying to follow the steps as mentioned by you, I get the below error

Processed 1 hosts in 0 seconds
ERROR: At least one host has a configuration error:

devweb02: error: Missing '(' in %attr 
devweb02: error: Missing '(' in %attr 
devweb02: 
devweb02: 
devweb02: RPM build errors:
devweb02:     Missing '(' in %attr 
devweb02:     Missing '(' in %attr 
devweb02: /home/yadt/src/yadt.config-rpm/hooks/config_rpm_maker: ERROR: Could not build RPM for host 'devweb02'

NOTICE:
Even though your commit as been accepted by the SVN server, due to the
errors mentioned above _no_ RPMs have been created.

Please fix the issues first and trigger the RPM creation with a dummy commit.

My dir struct

-rw-r--r--  1 sush  wheel    0 Mar  7 15:03 foo
-rw-r--r--  1 sush  wheel   16 Mar  7 16:58 foo.%attr

Contents of foo.%attr 

$ cat foo.%attr 
755,xvid,xvid


Also tried with

$ cat foo.%attr 
(755,xvid,xvid)

Could you please help me in figuring out where am I doing wrong?

Thanks,
Sushant

Maximilien Riehl

unread,
Mar 12, 2013, 8:28:31 AM3/12/13
to yadt-...@googlegroups.com
Hi,

both variants you tried work for me.
Is foo an empty folder? Note that for empty folders, you need to put a
foo.%dir file beneath it and use foo.%defattr (and there you'd set
the dir-permissions).

Regards,
max
Reply all
Reply to author
Forward
0 new messages