* git source files with rw permissions
@ 2018-04-06 0:53 Joe Perches
2018-04-07 20:36 ` Linus Torvalds
0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2018-04-06 0:53 UTC (permalink / raw)
To: LKML; +Cc: Linus Torvalds, Andrew Morton
Some .c source files have r.x permissions (0755) that
should be updated.
A trivial script on a clean git tree like:
$ git ls-files -- "*.[chsS]" | \
xargs ls -la | \
grep -P "^[^l](?:.{2,2}x|.{5,5}x|.{8,8}x)" | \
awk '{print $9}'
today shows:
drivers/gpu/drm/amd/amdgpu/vce_v4_0.c
drivers/net/ethernet/cadence/macb_ptp.c
It would be good to update those via some script like:
$ git ls-files -- "*.[chsS]" | \
xargs ls -la | \
grep -P
"^[^l](?:.{2,2}x|.{5,5}x|.{8,8}x)" | \
awk '{print $9}' | \
xargs
chmod 644
tmpfile=$(mktemp)
echo "treewide: chmod executable source files
to 0644" > $tmpfile
git commit -s -a -F $tmpfile
rm -f $tmpfile
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git source files with rw permissions
2018-04-06 0:53 git source files with rw permissions Joe Perches
@ 2018-04-07 20:36 ` Linus Torvalds
2023-01-26 16:07 ` Joe Perches
0 siblings, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2018-04-07 20:36 UTC (permalink / raw)
To: Joe Perches; +Cc: LKML, Andrew Morton
On Thu, Apr 5, 2018 at 5:53 PM, Joe Perches <joe@perches.com> wrote:
>
> A trivial script on a clean git tree like:
>
> $ git ls-files -- "*.[chsS]" | \
> xargs ls -la | \
> grep -P "^[^l](?:.{2,2}x|.{5,5}x|.{8,8}x)" | \
> awk '{print $9}'
A simpler version of this is:
git ls-files -s '*.[chsS]' | grep '^100755'
and then you can use 'cut -f2' if you just want the filenames and do
the "xargs chmod" thing.
Which I did, and committed, and just pushed out.
Thanks,
Linus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git source files with rw permissions
2018-04-07 20:36 ` Linus Torvalds
@ 2023-01-26 16:07 ` Joe Perches
2023-01-26 18:19 ` Linus Torvalds
0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2023-01-26 16:07 UTC (permalink / raw)
To: Linus Torvalds; +Cc: LKML, Andrew Morton
On Sat, 2018-04-07 at 13:36 -0700, Linus Torvalds wrote:
> On Thu, Apr 5, 2018 at 5:53 PM, Joe Perches <joe@perches.com> wrote:
> > A trivial script on a clean git tree like:
> >
> > $ git ls-files -- "*.[chsS]" | \
> > xargs ls -la | \
> > grep -P "^[^l](?:.{2,2}x|.{5,5}x|.{8,8}x)" | \
> > awk '{print $9}'
>
> A simpler version of this is:
>
> git ls-files -s '*.[chsS]' | grep '^100755'
>
> and then you can use 'cut -f2' if you just want the filenames and do
> the "xargs chmod" thing.
>
> Which I did, and committed, and just pushed out.
Maybe time to do it again. Current tree:
$ git ls-files -s '*.[chsS]' | grep '^100755' | cut -f2 | xargs chmod 0644
$ git diff --stat -p
drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h | 0
sound/soc/codecs/es8326.c | 0
sound/soc/codecs/es8326.h | 0
3 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h b/drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h
old mode 100755
new mode 100644
diff --git a/sound/soc/codecs/es8326.c b/sound/soc/codecs/es8326.c
old mode 100755
new mode 100644
diff --git a/sound/soc/codecs/es8326.h b/sound/soc/codecs/es8326.h
old mode 100755
new mode 100644
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git source files with rw permissions
2023-01-26 16:07 ` Joe Perches
@ 2023-01-26 18:19 ` Linus Torvalds
2023-01-28 4:06 ` Joe Perches
0 siblings, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2023-01-26 18:19 UTC (permalink / raw)
To: Joe Perches; +Cc: LKML, Andrew Morton
On Thu, Jan 26, 2023 at 8:07 AM Joe Perches <joe@perches.com> wrote:
>
> Maybe time to do it again.
Thanks, done.
Linus
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git source files with rw permissions
2023-01-26 18:19 ` Linus Torvalds
@ 2023-01-28 4:06 ` Joe Perches
2023-01-28 19:31 ` Linus Torvalds
0 siblings, 1 reply; 6+ messages in thread
From: Joe Perches @ 2023-01-28 4:06 UTC (permalink / raw)
To: Linus Torvalds; +Cc: LKML, Andrew Morton
On Thu, 2023-01-26 at 10:19 -0800, Linus Torvalds wrote:
> On Thu, Jan 26, 2023 at 8:07 AM Joe Perches <joe@perches.com> wrote:
> >
> > Maybe time to do it again.
>
> Thanks, done.
fyi: there's one more straggler:
100755 07781408e78820ad49d093d4bddcfd14eeadfa39 0 Documentation/devicetree/bindings/sound/everest,es8326.yaml
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: git source files with rw permissions
2023-01-28 4:06 ` Joe Perches
@ 2023-01-28 19:31 ` Linus Torvalds
0 siblings, 0 replies; 6+ messages in thread
From: Linus Torvalds @ 2023-01-28 19:31 UTC (permalink / raw)
To: Joe Perches; +Cc: LKML, Andrew Morton
On Fri, Jan 27, 2023 at 8:06 PM Joe Perches <joe@perches.com> wrote:
>
> fyi: there's one more straggler:
And I think there's one more.
Here's another one-liner shell script for finding suspicious files:
git ls-files -s |
grep '^100755' | cut -f2 |
xargs grep -L '^#!'
and I don't think 'scripts/atomic/atomics.tbl' should be in that set.
At least that file has a reasonable explanation for why it's
executable - over-eager "mark all these scripts executable" without
noticing that one of the files in question was just the input file to
another script.
Linus
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-01-28 19:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-06 0:53 git source files with rw permissions Joe Perches
2018-04-07 20:36 ` Linus Torvalds
2023-01-26 16:07 ` Joe Perches
2023-01-26 18:19 ` Linus Torvalds
2023-01-28 4:06 ` Joe Perches
2023-01-28 19:31 ` Linus Torvalds
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).