Maros Zatko
2015-Mar-25 14:41 UTC
[Libguestfs] [PATCH] customize: fix --upload to FAT partition
FAT doesn't support file ownership, so show warning instead of error. Fixes RHBZ#1196101 Maros Zatko (1): customize: fix --upload to FAT partition (RHBZ#1196101) customize/customize_run.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 1.9.3
Maros Zatko
2015-Mar-25 14:41 UTC
[Libguestfs] [PATCH] customize: fix --upload to FAT partition (RHBZ#1196101)
FAT doesn't support file ownership, so show warning instead of error. --- customize/customize_run.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/customize/customize_run.ml b/customize/customize_run.ml index dbb77df..306b7f2 100644 --- a/customize/customize_run.ml +++ b/customize/customize_run.ml @@ -290,7 +290,10 @@ 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 e -> warning "%s" e in + chown () | `Write (path, content) -> msg (f_"Writing: %s") path; -- 1.9.3
Pino Toscano
2015-Mar-25 14:55 UTC
Re: [Libguestfs] [PATCH] customize: fix --upload to FAT partition (RHBZ#1196101)
On Wednesday 25 March 2015 15:41:15 Maros Zatko wrote:> FAT doesn't support file ownership, so show warning instead > of error. > --- > customize/customize_run.ml | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/customize/customize_run.ml b/customize/customize_run.ml > index dbb77df..306b7f2 100644 > --- a/customize/customize_run.ml > +++ b/customize/customize_run.ml > @@ -290,7 +290,10 @@ 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 e -> warning "%s" e in > + chown ()This will reduce any chown failure into a warning, which is not a great idea when ownership handling is supported. You should detect ENOTSUP, and only in that case demote the error into a warning (or even an information message, since this happens while uploading a file). -- Pino Toscano
Possibly Parallel Threads
- [PATCH] 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)
- [PACTH v2] customize: fix --upload to FAT partition
- [PATCH v3] customize: fix --upload to FAT partition (RHBZ#1196101)