2006-12-19 00:17:44 +01:00
|
|
|
Warn the user if chown/fchown fails.
|
2006-12-19 00:17:44 +01:00
|
|
|
|
2008-09-12 20:37:28 +02:00
|
|
|
Index: lib/fsm.c
|
|
|
|
===================================================================
|
|
|
|
--- lib/fsm.c.orig
|
|
|
|
+++ lib/fsm.c
|
2009-08-28 15:54:03 +02:00
|
|
|
@@ -2093,6 +2093,10 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
|
2006-12-19 00:17:44 +01:00
|
|
|
break;
|
|
|
|
case FSM_CHOWN:
|
|
|
|
rc = chown(fsm->path, st->st_uid, st->st_gid);
|
|
|
|
+ if (rc < 0 && errno == EPERM) {
|
2009-08-28 15:54:03 +02:00
|
|
|
+ rpmlog(RPMLOG_WARNING, "can't chown %s (%s)\n", fsm->path, strerror(errno));
|
2006-12-19 00:17:44 +01:00
|
|
|
+ rc = 0;
|
2006-12-19 00:17:44 +01:00
|
|
|
+ }
|
|
|
|
if (_fsm_debug && (stage & FSM_SYSCALL))
|
2009-08-28 15:54:03 +02:00
|
|
|
rpmlog(RPMLOG_DEBUG, " %8s (%s, %d, %d) %s\n", cur,
|
2006-12-19 00:17:44 +01:00
|
|
|
fsm->path, (int)st->st_uid, (int)st->st_gid,
|
2009-08-28 15:54:03 +02:00
|
|
|
@@ -2102,6 +2106,10 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
|
2006-12-19 00:17:44 +01:00
|
|
|
case FSM_LCHOWN:
|
|
|
|
#if ! CHOWN_FOLLOWS_SYMLINK
|
|
|
|
rc = lchown(fsm->path, st->st_uid, st->st_gid);
|
|
|
|
+ if (rc < 0 && errno == EPERM) {
|
2009-08-28 15:54:03 +02:00
|
|
|
+ rpmlog(RPMLOG_WARNING, "can't lchown %s (%s)\n", fsm->path, strerror(errno));
|
2006-12-19 00:17:44 +01:00
|
|
|
+ rc = 0;
|
2006-12-19 00:17:44 +01:00
|
|
|
+ }
|
|
|
|
if (_fsm_debug && (stage & FSM_SYSCALL))
|
2009-08-28 15:54:03 +02:00
|
|
|
rpmlog(RPMLOG_DEBUG, " %8s (%s, %d, %d) %s\n", cur,
|
2006-12-19 00:17:44 +01:00
|
|
|
fsm->path, (int)st->st_uid, (int)st->st_gid,
|