Skip to content

Commit 50fe9bd

Browse files
committed
feat: dde-api安全整改
/lib/systemd/system/deepin-locale-helper.service 应该默认仅deepin和uos打包; Log: dde-api安全整改 PMS: TASK-369021
1 parent 4551e6d commit 50fe9bd

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ libdir = /lib
66
SYSTEMD_LIB_DIR = ${libdir}
77
SYSTEMD_SERVICE_DIR = ${SYSTEMD_LIB_DIR}/systemd/system/
88
GOBUILD = env GOPATH="${CURDIR}/${GOBUILD_DIR}:${GOPATH}" go build
9+
INSTALL_LOCALE_HELPER ?= 0
910

1011
TESTS = \
1112
${GOPKG_PREFIX}/adjust-grub-theme \
@@ -133,14 +134,21 @@ install-binary:
133134
mkdir -pv ${DESTDIR}${PREFIX}/share/polkit-1/actions
134135
cp misc/polkit-action/*.policy ${DESTDIR}${PREFIX}/share/polkit-1/actions/
135136

136-
mkdir -pv ${DESTDIR}/var/lib/polkit-1/localauthority/10-vendor.d
137-
cp misc/polkit-localauthority/*.pkla ${DESTDIR}/var/lib/polkit-1/localauthority/10-vendor.d/
137+
mkdir -pv ${DESTDIR}/var/lib/polkit-1/rules.d
138+
cp misc/polkit-rules/*.rules ${DESTDIR}/var/lib/polkit-1/rules.d/
138139

139140
mkdir -pv ${DESTDIR}${PREFIX}/share/dde-api
140141
cp -R misc/data ${DESTDIR}${PREFIX}/share/dde-api
141142

142143
mkdir -pv ${DESTDIR}${SYSTEMD_SERVICE_DIR}
143144
cp -R misc/systemd/system/*.service ${DESTDIR}${SYSTEMD_SERVICE_DIR}
145+
# 默认不安装 deepin-locale-helper.service,只有显式开启时才保留
146+
if [ "${INSTALL_LOCALE_HELPER}" != "1" ]; then \
147+
rm -f ${DESTDIR}${SYSTEMD_SERVICE_DIR}/deepin-locale-helper.service; \
148+
rm -f ${DESTDIR}${PREFIX}/share/dbus-1/system-services/org.deepin.dde.LocaleHelper1.service; \
149+
rm -f ${DESTDIR}${PREFIX}/share/polkit-1/actions/org.deepin.dde.locale-helper.policy; \
150+
rm -f ${DESTDIR}${PREFIX}/share/dbus-1/system.d/org.deepin.dde.LocaleHelper1.conf; \
151+
fi
144152

145153
mkdir -pv ${DESTDIR}${PREFIX}/share/icons/hicolor
146154
cp -R misc/icons/* ${DESTDIR}${PREFIX}/share/icons/hicolor

debian/rules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ endif
1414
dh $@ --buildsystem=makefile
1515

1616
override_dh_auto_install:
17-
dh_auto_install
17+
dh_auto_install -- INSTALL_LOCALE_HELPER=1
1818

1919
override_dh_strip:
2020
dh_strip --dbgsym-migration=dde-api-dbg
2121

2222
override_dh_installsystemd:
23-
dh_installsystemd --no-start
23+
dh_installsystemd --no-start --no-restart-on-upgrade

0 commit comments

Comments
 (0)