if (copy_perms_from_skel)
permissions = info.permissions();
- /* Symlinks themselves don't have permissions, and we don't want to
- * change the underlying file's. I'm not sure why we check the source's
- * symlink status, not the destination's, but in theory they should be
- * the same so we save a stat() call (and I am too afraid to change
- * legacy behaviour). If using the destination's state, we could skip
- * the check and use the `fs::perm_options::nofollow` flag, but when I
- * tried it (early Tizen 10, 2025-01), it threw "operation not supported". */
+ /* Symlinks themselves don't have permissions (or rather they always have
+ * permissions hardcoded to 0777, but they cannot be changed and are not
+ * actually meaninfgully used anywhere). We also don't want to change the
+ * file's permissions either, so do nothing in that case. */
if (!is_symlink(info))
fs::permissions(dest_path, permissions);
}
u_group="users"
u_perms="drwxr-xr-x"
if [ -L "$f" ]; then
- u_perms="lrwxrwxrwx"
+ # Symlink permissions don't matter.
+ verbose_echo " skipping permission checks for $f (is symlink)"
else
prefix_to_remove="$skeldir/"
prefix_removed_f="${templf/#"$prefix_to_remove"}"
fi
unset first_level second_level third_level
- fi
- if [ "$user" != "$u_user" ] || [ "$group" != "$u_group" ] || [ "$perms" != "$u_perms" ]; then
- echo "$f: incorrect permissions set!"
- remove_test_users false
- exit 1
+ if [ "$user" != "$u_user" ] || [ "$group" != "$u_group" ] || [ "$perms" != "$u_perms" ] ; then
+ echo "$f: incorrect permissions set!"
+ remove_test_users false
+ exit 1
+ fi
fi
# Check SMACK attributes (access, transmute, etc.)