mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] Hard-coded directory permissions
@ 2020-06-10  9:35 Nico Lastzka
  2020-06-10 11:32 ` Bruno Thomsen
  0 siblings, 1 reply; 6+ messages in thread
From: Nico Lastzka @ 2020-06-10  9:35 UTC (permalink / raw)
  To: ptxdist

Hi,

I ran into a problem with the latest ptxdist 2020.06 when trying to install an ssh key to
"/root/.ssh/authorized_keys".

--8<--------------------

#> ptxdist images

... # output skipped

Incompatible ownership or permissions for '/root':
image-enhancements: 0.0 0755 (implicit)
rootfs: 0.0 0700
One of these packages must be fixed!

-------------------->8--

Here, the "image-enhancements rule" contains the following code which breaks the image creation:

     @$(call install_copy, image_enhancements, 0, 0, 0400, $(PTXDIST_PLATFORMCONFIGDIR)/access/key-develop_id_ed25519.pub, /root/.ssh/authorized_keys )

I found the code in "scripts/lib/ptxd_lib_check_dir_permissions.awk" to be responsible for this
issue. In this file the directory permissions are hardcoded. The following "patch" is my current
workaround for this problem:

--8<--------------------

diff --git a/scripts/lib/ptxd_lib_check_dir_permissions.awk b/scripts/lib/ptxd_lib_check_dir_permissions.awk
index 9bd009f04..4ad132561 100644                                                                           
--- a/scripts/lib/ptxd_lib_check_dir_permissions.awk                                                        
+++ b/scripts/lib/ptxd_lib_check_dir_permissions.awk                                                        
@@ -33,6 +33,9 @@ $1 ~ "f" {                                                                                
                 path = gensub(/\/[^/]*$/,"",1,path)                                                         
                 if (path == "")                                                                             
                         break;                                                                              
-               check(path, "0.0 0755", 1)                                                                  
+               if (path == "/root")                                                                        
+                       check(path, "0.0 0700", 1)                                                          
+               else                                                                                        
+                       check(path, "0.0 0755", 1)                                                          
         }                                                                                                   
  }                                                                                                          

-------------------->8--

What would be a proper solution to this problem?

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-06-12  6:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10  9:35 [ptxdist] Hard-coded directory permissions Nico Lastzka
2020-06-10 11:32 ` Bruno Thomsen
2020-06-10 11:42   ` Nico Lastzka
2020-06-11  5:46     ` Michael Olbrich
2020-06-11  6:19       ` Nico Lastzka
2020-06-12  6:51         ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox