<div dir="ltr">One small thing before someday it becomes a template. As written:<br><br> find . ! -type l -a \<br> \( -perm /111 -a ! -perm 755 -a -exec chmod -f 755 {} + \) -o \<br> \( ! -perm /111 -a ! -perm 644 -a -exec chmod -f 644 {} + \)<br><br>-a binds tighter than -o, so this parses as<br><br> ( ! -type l AND first-group ) OR ( second-group )<br><br>and the "! -type l" never applies to the second branch. It is still safe<br>on Linux, but incidentally rather than by design: the kernel forces mode<br>0777 on symlinks (umask is ignored, there is no lchmod, and even tar<br>cannot restore a different mode), so "! -perm /111" is false for them and<br>the 644 branch never fires. That is a property of Linux symlink modes,<br>not of the guard - and it stops being true on an NFS or FUSE mount from<br>a host where symlinks do carry real modes.<br><br>One outer group fixes it:<br><br> find . ! -type l -a \( \<br> \( -perm /111 -a ! -perm 755 -a -exec chmod -f 755 {} + \) -o \<br> \( ! -perm /111 -a ! -perm 644 -a -exec chmod -f 644 {} + \) \<br> \)<br><br>Same behaviour, same timing, two extra characters - but now the code stays more correct if either branch<br>is ever edited.</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Στις Δευ 3 Αυγ 2026 στις 8:52 μ.μ., ο/η Andrzej Telszewski <<a href="mailto:andrzej@telszewski.com">andrzej@telszewski.com</a>> έγραψε:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 03/08/2026 14:31, Franzen via SlackBuilds-users wrote:<br>
><br>
>> chmod -R u+w,go-w,a+rX-st .<br>
><br>
> Here is an explanation why my proposal might not be that good. It's 13 <br>
> years old, maybe chmod has changed to the better:<br>
> <a href="https://unix.stackexchange.com/a/79874" rel="noreferrer" target="_blank">https://unix.stackexchange.com/a/79874</a><br>
<br>
Unless enforced by SBo rules, I'll prefer `chmod -R` variant over `find` <br>
variant,<br>
for its compactness.<br>
<br>
Now, it's not strictly important how much time changing the permissions <br>
takes,<br>
but how much time does it take compared to the build time as a whole.<br>
<br>
--<br>
Best regards,<br>
Andrzej Telszewski<br>
<br>
_______________________________________________<br>
SlackBuilds-users mailing list<br>
<a href="mailto:SlackBuilds-users@slackbuilds.org" target="_blank">SlackBuilds-users@slackbuilds.org</a><br>
<a href="https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users" rel="noreferrer" target="_blank">https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users</a><br>
Archives - <a href="https://lists.slackbuilds.org/pipermail/slackbuilds-users/" rel="noreferrer" target="_blank">https://lists.slackbuilds.org/pipermail/slackbuilds-users/</a><br>
FAQ - <a href="https://slackbuilds.org/faq/" rel="noreferrer" target="_blank">https://slackbuilds.org/faq/</a><br>
<br>
</blockquote></div>