[Pkg-libvirt-commits] [libguestfs] 65/72: customize: fix --upload to FAT partition (RHBZ#1196101)
Hilko Bengen
bengen at moszumanska.debian.org
Sun Apr 5 15:19:53 UTC 2015
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch master
in repository libguestfs.
commit 2f33c96da06ab768345c5ae1f26c31da505a3ec3
Author: Maros Zatko <mzatko at redhat.com>
Date: Thu Mar 26 16:47:58 2015 +0100
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.
(cherry picked from commit e6dadd6aca139792863cd3d274270095ec49a34e)
---
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 5356747..98d7353 100644
--- a/customize/customize_run.ml
+++ b/customize/customize_run.ml
@@ -257,7 +257,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;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git
More information about the Pkg-libvirt-commits
mailing list