Meta: Find potentially missing resources
This commit is contained in:
parent
5692fa6c39
commit
eccf96b703
Notes:
sideshowbarker
2024-07-19 04:28:38 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/eccf96b703d Pull-request: https://github.com/SerenityOS/serenity/pull/2914
3 changed files with 20 additions and 2 deletions
|
@ -55,7 +55,7 @@ This is all possibly by using HackStudio, Visual Builder, Terminal, and the
|
|||
(optional) GNU tools.
|
||||
|
||||
* Multimedia
|
||||
$ /res/icons/audio-unmuted.png
|
||||
$ /res/icons/audio-volume-medium.png
|
||||
> Draw while playing your favorite songs!
|
||||
Serenity includes the Piano, which allows you to create your own tunes by
|
||||
simply pressing keys on the keyboard. You can pick the wavetype, octave, and
|
||||
|
|
|
@ -12,7 +12,7 @@ In addition to the access permissions bits, executables may have the "Set User I
|
|||
|
||||
The motivation behind SUID binaries is that they allow users to do tasks that would normally require elevated permissions, without having to give users these permissions fully.
|
||||
|
||||
For example, `/usr/ping` has the Set User ID bit set and is owned by user root in group root. So if any process executes `/usr/ping`, it will run as root, which means it will be able to send network packets, even if the current process doesn't normally have network access.
|
||||
For example, `/bin/ping` has the Set User ID bit set and is owned by user root in group root. So if any process executes `/bin/ping`, it will run as root, which means it will be able to send network packets, even if the current process doesn't normally have network access.
|
||||
|
||||
For another example, many other Unix systems contain a utility `passwd` that changes the password of the current user. To store the password, it has to write to `/etc/shadow` -- but the current user is not supposed to have write access to `/etc/shadow` so that they cannot change passwords of other users. The solution is to make `passwd` a SUID binary. (SerenityOS currently doesn't have support for user passwords.)
|
||||
|
||||
|
|
18
Meta/lint-missing-resources.sh
Executable file
18
Meta/lint-missing-resources.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
set -e pipefail
|
||||
|
||||
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
||||
cd "$script_path/.."
|
||||
|
||||
# The dollar symbol in sed's argument is for "end of line", not any shell variable.
|
||||
# shellcheck disable=SC2016
|
||||
grep -Pirh '(?<!file://)(?<!\.)(?<!})(?<!\()/(etc|res|usr|www)/' AK/ Applications/ Base Demos/ DevTools/ Documentation/ Games/ Kernel/ Libraries/ MenuApplets/ Services/ Shell/ Userland/ | \
|
||||
sed -re 's,^.*["= `]/([^"%`: ]+[^"%`: /.])/?(["%`: .].*)?$,\1,' | \
|
||||
sort -u | \
|
||||
while read -r referenced_resource
|
||||
do
|
||||
if ! [ -r "Base/${referenced_resource}" ] && ! [ -r "Build/Root/${referenced_resource}" ]
|
||||
then
|
||||
echo "Potentially missing resource: ${referenced_resource}"
|
||||
fi
|
||||
done
|
Loading…
Add table
Reference in a new issue