Hu Tao
2014-Oct-28 07:51 UTC
[Libguestfs] [PATCH] sysprep: remove /var/spool/mail/username
remove /var/spool/mail/username if --enable user-account. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> --- sysprep/sysprep_operation_user_account.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/sysprep/sysprep_operation_user_account.ml b/sysprep/sysprep_operation_user_account.ml index fda5547..bda6331 100644 --- a/sysprep/sysprep_operation_user_account.ml +++ b/sysprep/sysprep_operation_user_account.ml @@ -83,6 +83,7 @@ let user_account_perform ~verbose ~quiet g root side_effects g#aug_rm userpath; g#aug_rm (sprintf "/files/etc/shadow/%s" username); g#aug_rm (sprintf "/files/etc/group/%s" username); + g#rm_rf ("/var/spool/mail/" ^ username); match home_dir with | None -> () | Some dir -> g#rm_rf dir -- 1.9.3
Richard W.M. Jones
2014-Oct-28 11:19 UTC
Re: [Libguestfs] [PATCH] sysprep: remove /var/spool/mail/username
On Tue, Oct 28, 2014 at 03:51:24PM +0800, Hu Tao wrote:> remove /var/spool/mail/username if --enable user-account. > > Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> > --- > sysprep/sysprep_operation_user_account.ml | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/sysprep/sysprep_operation_user_account.ml b/sysprep/sysprep_operation_user_account.ml > index fda5547..bda6331 100644 > --- a/sysprep/sysprep_operation_user_account.ml > +++ b/sysprep/sysprep_operation_user_account.ml > @@ -83,6 +83,7 @@ let user_account_perform ~verbose ~quiet g root side_effects > g#aug_rm userpath; > g#aug_rm (sprintf "/files/etc/shadow/%s" username); > g#aug_rm (sprintf "/files/etc/group/%s" username); > + g#rm_rf ("/var/spool/mail/" ^ username); > match home_dir with > | None -> () > | Some dir -> g#rm_rf dir > -- > 1.9.3ACK. I will push this in a bit. Thanks, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Seemingly Similar Threads
- [PATCH] sysprep: user-account: remove the correct home
- [PATCH] sysprep: user-account: mark "changed file" if users were removed
- [PATCH 1/2] mllib: add and use last_part_of
- Re: [PATCH 1/2] mllib: add and use last_part_of
- [PATCH 2/3] mllib: add and use last_part_of