mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2025-12-21 21:17:37 -08:00
fcaps.eclass: remove default value for owner/group
This makes the options behave like the mode/caps mode options. Usually the file is already owned by root so the chown call is a noop. Signed-off-by: Mike Gilbert <floppym@gentoo.org>
This commit is contained in:
parent
eef0792888
commit
537f565690
@ -87,9 +87,8 @@ esac
|
|||||||
# The caps mode is used to set the permission on the file if capabilities
|
# The caps mode is used to set the permission on the file if capabilities
|
||||||
# were properly set on the file. No change is applied by default.
|
# were properly set on the file. No change is applied by default.
|
||||||
#
|
#
|
||||||
# If the system is unable to set capabilities, it will use the specified user,
|
# If capabilities are not sucessfully applied, the permissions on the file are
|
||||||
# group, and mode. The user and group default to 0. If mode is unspecified, no
|
# updated according to the owner, group, and mode options, if provided.
|
||||||
# change is applied.
|
|
||||||
#
|
#
|
||||||
# For example, "-m u+s" may be used to enable suid as a fallback when file caps
|
# For example, "-m u+s" may be used to enable suid as a fallback when file caps
|
||||||
# are unavailable. This should be used with care, typically when the
|
# are unavailable. This should be used with care, typically when the
|
||||||
@ -103,8 +102,8 @@ fcaps() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Process the user options first.
|
# Process the user options first.
|
||||||
local owner='0'
|
local owner=
|
||||||
local group='0'
|
local group=
|
||||||
local mode=
|
local mode=
|
||||||
local caps_mode=
|
local caps_mode=
|
||||||
|
|
||||||
@ -183,12 +182,12 @@ fcaps() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If we're still here, setcaps failed.
|
# If we're still here, setcaps failed or filecaps are disabled.
|
||||||
|
if [[ -n ${owner} || -n ${group} ]]; then
|
||||||
|
debug-print "${FUNCNAME}: setting owner on '${file}'"
|
||||||
|
chown "${owner}${group:+:}${group}" "${file}" || die
|
||||||
|
fi
|
||||||
if [[ -n ${mode} ]]; then
|
if [[ -n ${mode} ]]; then
|
||||||
if [[ -n ${owner} || -n ${group} ]]; then
|
|
||||||
debug-print "${FUNCNAME}: setting owner on '${file}'"
|
|
||||||
chown "${owner}:${group}" "${file}" || die
|
|
||||||
fi
|
|
||||||
debug-print "${FUNCNAME}: setting mode on '${file}'"
|
debug-print "${FUNCNAME}: setting mode on '${file}'"
|
||||||
chmod ${mode} "${file}" || die
|
chmod ${mode} "${file}" || die
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user