Maros Zatko
2015-Mar-26 15:47 UTC
[Libguestfs] [PATCH v3] customize: fix --upload to FAT partition (RHBZ#1196101)
Some filesystems, such as FAT doesn't support file ownership, so show warning instead of error on EPERM. Maros Zatko (1): customize: fix --upload to FAT partition (RHBZ#1196101) customize/customize_run.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 1.9.3
Maros Zatko
2015-Mar-26 15:47 UTC
[Libguestfs] [PATCH v3] customize: fix --upload to FAT partition (RHBZ#1196101)
Some filesystems, such as FAT doesn't support file ownership, so show warning instead of error on EPERM. --- customize/customize_run.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/customize/customize_run.ml b/customize/customize_run.ml index dbb77df..f2dbaa2 100644 --- a/customize/customize_run.ml +++ b/customize/customize_run.ml @@ -290,7 +290,13 @@ exec >>%s 2>&1 let perms = statbuf.st_perm land 0o7777 (* sticky & set*id *) in g#chmod perms dest; let uid, gid = statbuf.st_uid, statbuf.st_gid in - g#chown uid gid dest + let chown () + try g#chown uid gid dest + with Guestfs.Error m as e -> + if g#last_errno () = Guestfs.Errno.errno_EPERM + then warning "%s" m + else raise e in + chown () | `Write (path, content) -> msg (f_"Writing: %s") path; -- 1.9.3
Richard W.M. Jones
2015-Mar-27 10:05 UTC
Re: [Libguestfs] [PATCH v3] customize: fix --upload to FAT partition (RHBZ#1196101)
On Thu, Mar 26, 2015 at 04:47:58PM +0100, Maros Zatko wrote:> Some filesystems, such as FAT doesn't support file > ownership, so show warning instead of error on EPERM. > --- > customize/customize_run.ml | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/customize/customize_run.ml b/customize/customize_run.ml > index dbb77df..f2dbaa2 100644 > --- a/customize/customize_run.ml > +++ b/customize/customize_run.ml > @@ -290,7 +290,13 @@ exec >>%s 2>&1 > let perms = statbuf.st_perm land 0o7777 (* sticky & set*id *) in > g#chmod perms dest; > let uid, gid = statbuf.st_uid, statbuf.st_gid in > - g#chown uid gid dest > + let chown () > + try g#chown uid gid dest > + with Guestfs.Error m as e -> > + if g#last_errno () = Guestfs.Errno.errno_EPERM > + then warning "%s" m > + else raise e in > + chown () > > | `Write (path, content) -> > msg (f_"Writing: %s") path; > --Thanks - applied. 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
Apparently Analagous Threads
- [PATCH] customize: fix --upload to FAT partition
- [PATCH] customize: fix --upload to FAT partition (RHBZ#1196101)
- [PACTH v2] customize: fix --upload to FAT partition
- [PATCH v3] customize: fix --upload to FAT partition (RHBZ#1196101)
- [PACTH v2] customize: fix --upload to FAT partition (RHBZ#1196101)