Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SW477941:WA: Manually add groups and permission #54

Merged
merged 1 commit into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash -e

# Create groups if not available
for i in web ipmi redfish priv-admin priv-operator priv-user priv-callback; do
if grep -q $i /etc/group; then
echo "$i already exists"
else
echo "$i does not exist, add it"
groupadd -f $i
fi
done

# Root needs to be a member of these groups
for i in ipmi web redfish priv-admin; do
if id -nG root | grep -q $i; then
echo "root already in $i"
else
echo "root not in group $i, add it"
usermod -a -G $i root
fi
done
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
[Unit]
Description=Phosphor User Manager
Wants=obmc-mapper.target
After=obmc-mapper.target
After=sysinit.target
ConditionPathIsReadWrite=/etc

[Service]
# Ensure appropriate groups and permissions set
ExecStartPre=/usr/bin/env add_groups_workaround.sh
ExecStart=/usr/bin/env phosphor-user-manager
SyslogIdentifier=phosphor-user-manager
Restart=always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ DBUS_SERVICE_phosphor-ldap = " \
xyz.openbmc_project.Ldap.Config.service \
xyz.openbmc_project.LDAP.PrivilegeMapper.service \
"
SRC_URI += "file://add_groups_workaround.sh"
SRC_URI += "git://github.com/ibm-openbmc/phosphor-user-manager;branch=OP940"
SRCREV = "c10f815d8d29e702afbbbbbf6ae1807d1566274b"
S = "${WORKDIR}/git"

do_install_append() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/add_groups_workaround.sh ${D}${bindir}/add_groups_workaround.sh
}