summaryrefslogtreecommitdiffstats
path: root/livecd.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2007-11-13 15:12:21 -0500
committerChris Lumens <clumens@redhat.com>2007-11-13 15:12:21 -0500
commit784c13a7988e50fa24b562aefa68e16bb21221e0 (patch)
tree1f3279a502259dc5e5e7d9426a868db01944bd45 /livecd.py
parentf99f262b8910fd7e7460e530f7ee75f915d9f91e (diff)
downloadanaconda-784c13a7988e50fa24b562aefa68e16bb21221e0.tar.gz
anaconda-784c13a7988e50fa24b562aefa68e16bb21221e0.tar.xz
anaconda-784c13a7988e50fa24b562aefa68e16bb21221e0.zip
Log errors when we can't chown files and continue (#376741).
This happens for any files that are owned by nfsnobody, as that UID maps to -1 which will cause an overflow. So far this has only occurred on /var/spool/mail/nfsnobody. Seems like fake users shouldn't have mail spools created for them.
Diffstat (limited to 'livecd.py')
-rw-r--r--livecd.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/livecd.py b/livecd.py
index e42b0717c..d63814504 100644
--- a/livecd.py
+++ b/livecd.py
@@ -62,7 +62,11 @@ def copytree(src, dst, symlinks=False, preserveOwner=False,
else:
shutil.copyfile(srcname, dstname)
if preserveOwner:
- os.chown(dstname, os.stat(srcname)[stat.ST_UID], os.stat(srcname)[stat.ST_GID])
+ try:
+ os.chown(dstname, os.stat(srcname)[stat.ST_UID], os.stat(srcname)[stat.ST_GID])
+ except OverflowError:
+ log.error("Could not set owner and group on file %s" % dstname)
+
if preserveSelinux:
selinux.lsetfilecon(dstname, selinux.lgetfilecon(srcname)[1])
shutil.copystat(srcname, dstname)