Date: Fri, 27 Feb 2004 14:10:15 -0800 (PST) From: "Christian S.J. Peron" <maneo@bsdpro.com> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/55980: [patch] rmuser does not remove IPC mechanisms owned by the user Message-ID: <200402272210.i1RMAF16063089@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/55980; it has been noted by GNATS. From: "Christian S.J. Peron" <maneo@bsdpro.com> To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: bin/55980: [patch] rmuser does not remove IPC mechanisms owned by the user Date: Fri, 27 Feb 2004 18:01:20 +0000 My previous patch implements redundant flags when calling xargs. I have re-created the patch to be a bit more sane. --- usr.sbin/adduser/rmuser.sh.bak Fri Feb 27 15:54:13 2004 +++ usr.sbin/adduser/rmuser.sh Fri Feb 27 17:41:32 2004 @@ -145,6 +145,19 @@ verbose && echo '.' } +# rm_ipc login +# Remove all IPC mechanisms which are owned by the user. +# +rm_ipc() { + verbose && echo "Removing IPC mechanisms" + for i in s m q + do + ipcs -$i | grep ^$i | awk -v usr=$1 \ + '{ if ($5 == usr) { print $2 } }' | \ + xargs -n 1 ipcrm -$i + done +} + # rm_user login # Remove user $login from the system. This subroutine makes use # of the pw(8) command to remove a user from the system. The pw(8) @@ -338,6 +351,7 @@ ! verbose && echo -n "Removing user ($_user):" rm_crontab $_user rm_at_jobs $_user + rm_ipc $_user kill_procs $_user rm_files $_user rm_mail $_user
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402272210.i1RMAF16063089>