From 784c13a7988e50fa24b562aefa68e16bb21221e0 Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Tue, 13 Nov 2007 15:12:21 -0500 Subject: 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. --- livecd.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'livecd.py') 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) -- cgit