X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mjo-overlay.git;a=blobdiff_plain;f=eclass%2Fsys-user.eclass;fp=eclass%2Fsys-user.eclass;h=e14cdfb733ec1a5947f8f681f1ef341b449c917d;hp=d76e6190327aef906179ed0e0362d073aeeed540;hb=ad88c75318cc9173a5959ca329ccf16f2ac73553;hpb=79143a78e86fe8a181c2a749cab7ff08e08a7d11 diff --git a/eclass/sys-user.eclass b/eclass/sys-user.eclass index d76e619..e14cdfb 100644 --- a/eclass/sys-user.eclass +++ b/eclass/sys-user.eclass @@ -271,11 +271,16 @@ sys-user_pkg_prerm() { # We have successfully done nothing. ewarn "Tried to remove nonexistent user ${SYS_USER_NAME}." elif [[ -z "${REPLACING_VERSIONS}" ]]; then - # The user to remove exists, and this is not an upgrade, so - # we really do remove him. - userdel "${SYS_USER_NAME}" || \ - die "failed to remove user ${SYS_USER_NAME}" - einfo "Removed user ${SYS_USER_NAME} from the system." + # The user to remove exists, and this is not an upgrade. For + # Phase 1, we maintain the status quo and simply refuse to + # remove him (unless you know what you are doing). + if [[ "${I_KNOW_WHAT_I_AM_DOING}" == "yes" ]]; then + userdel "${SYS_USER_NAME}" || \ + die "failed to remove user ${SYS_USER_NAME}" + einfo "Removed user ${SYS_USER_NAME} from the system." + else + die "refusing to remove package for system user ${SYS_USER_NAME}" + fi # The missing case: if the user exists and this is an upgrade, # we leave the user alone to be modified in