Hey all,

I've added one ssh key to image that needs permissions 0600 (and they are in 
ipk) but I've discovered that final rootfs have 0644 permissions.

Following code (include/image.mk) breaks permissions:

 270 define Image/mkfs/prepare/default
 271         # Use symbolic permissions to avoid clobbering SUID/SGID/sticky 
bits
 272         - $(FIND) $(TARGET_DIR) -type f -not -perm /0100 -not -name 
'ssh_host*' -not -name 'shadow' -print0 | $(XARGS) -0 chmod u+rw,g+r,o+r
 273         - $(FIND) $(TARGET_DIR) -type f -perm /0100 -print0 | $(XARGS) -0 
chmod u+rwx,g+rx,o+rx
 274         - $(FIND) $(TARGET_DIR) -type d -print0 | $(XARGS) -0 chmod 
u+rwx,g+rx,o+rx
 275         $(INSTALL_DIR) $(TARGET_DIR)/tmp $(TARGET_DIR)/overlay
 276         chmod 1777 $(TARGET_DIR)/tmp
 277 endef

I've back tracked this to commit from 2007: 
12c49b6 ("build system cleanup/restructuring as described in 
http://lists.openwrt.org/pipermail/openwrt-devel/2007-August/001159.html";, 
2007-08-07)

Does anyone know why this is needed? I think this wrong for many reasons 
including security.

-- 
Maciej Skrzypek
R&D Engineer
Information Security Officer
maciej.skrzy...@flytronic.pl
+48 697 550 199
Flytronic sp. z o.o.
www.flytronic.pl
tel. +48 32 461 23 50
fax  +48 32 461 23 54
ul. Bojkowska 43, 44-100 Gliwice
NIP:969 151 39 93, REGON:  240851769, KRS  0000298330, Sąd Rejonowy w 
Gliwicach, X Wydział Gospodarczy Krajowego Rejestru Sądowego

--
Niniejsza wiadomość jest przeznaczona tylko dla jej adresata i nie może być 
ujawniona osobom trzecim. Jeśli nie jest Pan/i zamierzonym adresatem niniejszej 
wiadomości bądź osobą przez niego upoważnioną do jej odbioru lub przekazania 
adresatowi, informujemy, że jej rozpowszechnianie, dystrybucja, kopiowanie lub 
inne działanie o podobnym charakterze jest zabronione. Jeżeli wiadomość dotarła 
do Pan/i omyłkowo, prosimy o poinformowanie nadawcy oraz usunięcie wiadomości z 
poczty bez otwierania załączników. Dziękujemy.

This e-mail is intended solely for the addressee(s) and must not be disclosed 
to third parties. If you are not the addressee of this e-mail or has not been 
authorized by the addressee to receive or forward this message, we inform that 
its disclosure, distribution, copying or any other similar action is unlawful. 
If you have received this e-mail in error, please notify the sender immediately 
by return e-mail. Please then delete the e-mail from your mail box without 
opening attachments. Thank you.
--

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to