[Libguestfs] [PATCH] sysprep: remove /var/spool/mail/username

Richard W.M. Jones rjones at redhat.com
Tue Oct 28 11:19:48 UTC 2014


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 at 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

ACK.  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




More information about the Libguestfs mailing list