[Rpm-maint] [Suse patch] Ignore chown errors on install

Panu Matilainen pmatilai at redhat.com
Tue May 22 09:55:16 UTC 2007


This looks kinda harmless but raises a few questions. If I correctly 
tracked this to correlate to this changelog entry in Suse's rpm spec:
* Wed Jul 26 2000 - ma at suse.de
- ignore chown() errors eg. if files are installed on a DOS partition

Do we *really* care about about people trying to install packages on DOS 
(and related) filesystems? They don't support symlinks, file permissions 
etc etc etc, that chown() doesn't work is probably the least of the 
problems trying to run something from a DOS-like fs.

If the answer would be yes, we do care, then I'd think similar warnings 
should be issued for chmod() etc as well, lotsa similar potential cases 
around it. But I would say we don't really care, DOS-like filesystem isn't 
supportable in any sane way no matter what errors rpm ignores.

 	- Panu -
---

Warn the user if chown/fchown fails.

--- ./lib/fsm.c.orig	2005-12-14 20:08:04.000000000 +0000
+++ ./lib/fsm.c	2005-12-16 18:19:37.000000000 +0000
@@ -2186,6 +2191,10 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
  	break;
      case FSM_CHOWN:
  	rc = chown(fsm->path, st->st_uid, st->st_gid);
+	if (rc < 0 && errno == EPERM) {
+	    rpmMessage(RPMMESS_WARNING, "can't chown %s (%s)\n", fsm->path, strerror(errno));
+	    rc = 0;
+	}
  	if (_fsm_debug && (stage & FSM_SYSCALL))
  	    rpmMessage(RPMMESS_DEBUG, " %8s (%s, %d, %d) %s\n", cur,
  		fsm->path, (int)st->st_uid, (int)st->st_gid,
@@ -2195,6 +2204,10 @@ if (!(fsm->mapFlags & CPIO_ALL_HARDLINKS
      case FSM_LCHOWN:
  #if ! CHOWN_FOLLOWS_SYMLINK
  	rc = lchown(fsm->path, st->st_uid, st->st_gid);
+	if (rc < 0 && errno == EPERM) {
+	    rpmMessage(RPMMESS_WARNING, "can't lchown %s (%s)\n", fsm->path, strerror(errno));
+	    rc = 0;
+	}
  	if (_fsm_debug && (stage & FSM_SYSCALL))
  	    rpmMessage(RPMMESS_DEBUG, " %8s (%s, %d, %d) %s\n", cur,
  		fsm->path, (int)st->st_uid, (int)st->st_gid,



More information about the Rpm-maint mailing list