RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Ralf S. Engelschall Root: /v/rpm/cvs Email: r...@rpm5.org Module: rpm Date: 05-Jan-2009 20:49:14 Branch: HEAD Handle: 2009010519491400 Modified files: rpm VENDOR rpm/rpmio ugid.c Log: OpenPKG-specific change "no-hard-coded-ugid": do not make hard-coded assumptions about any uid/gid, because OpenPKG can safely rely on the /etc/passwd and /etc/group lookups for all uid/gid and has no need to assume that for instance GID 0 is "root". Actually, such an assumption is a portability problem as GID 0 under e.g. BSD is named "wheel" and not "root", etc. As a result, things like "rpm -V" would report wrong information, etc. Summary: Revision Changes Path 2.66 +11 -0 rpm/VENDOR 2.11 +10 -0 rpm/rpmio/ugid.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/VENDOR ============================================================================ $ cvs diff -u -r2.65 -r2.66 VENDOR --- rpm/VENDOR 21 Dec 2008 17:16:47 -0000 2.65 +++ rpm/VENDOR 5 Jan 2009 19:49:14 -0000 2.66 @@ -35,6 +35,17 @@ Characteristic: cross-platform multiple-instance use of RPM ________________________________________________________________________ + Change: no-hard-coded-ugid + Purpose: do not make hard-coded assumptions about any uid/gid + Reason: OpenPKG can safely rely on the /etc/passwd and /etc/group + lookups for all uid/gid and has no need to assume + that for instance GID 0 is "root". Actually, such + an assumption is a portability problem as GID 0 + under e.g. BSD is named "wheel" and not "root", + etc. As a result, things like "rpm -V" would report + wrong information, etc. + ________________________________________________________________________ + Change: splitted-source-directory Purpose: support so-called "splitted source directories", i.e., source files (listed on SourceX and PatchX headers) @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/ugid.c ============================================================================ $ cvs diff -u -r2.10 -r2.11 ugid.c --- rpm/rpmio/ugid.c 6 Oct 2007 19:40:23 -0000 2.10 +++ rpm/rpmio/ugid.c 5 Jan 2009 19:49:14 -0000 2.11 @@ -25,9 +25,11 @@ if (!thisUname) { lastUnameLen = 0; return -1; +#if !defined(RPM_VENDOR_OPENPKG) /* no-hard-coded-ugid */ } else if (strcmp(thisUname, "root") == 0) { *uid = 0; return 0; +#endif } thisUnameLen = strlen(thisUname); @@ -69,9 +71,11 @@ if (thisGname == NULL) { lastGnameLen = 0; return -1; +#if !defined(RPM_VENDOR_OPENPKG) /* no-hard-coded-ugid */ } else if (strcmp(thisGname, "root") == 0) { *gid = 0; return 0; +#endif } thisGnameLen = strlen(thisGname); @@ -91,6 +95,7 @@ /*...@=internalglobs@*/ grent = getgrnam(thisGname); if (grent == NULL) { +#if !defined(RPM_VENDOR_OPENPKG) /* no-hard-coded-ugid */ /* XXX The filesystem package needs group/lock w/o getgrnam. */ if (strcmp(thisGname, "lock") == 0) { *gid = lastGid = 54; @@ -100,6 +105,7 @@ *gid = lastGid = 12; return 0; } else +#endif return -1; } } @@ -120,8 +126,10 @@ if (uid == (uid_t) -1) { lastUid = (uid_t) -1; return NULL; +#if !defined(RPM_VENDOR_OPENPKG) /* no-hard-coded-ugid */ } else if (uid == (uid_t) 0) { return "root"; +#endif } else if (uid == lastUid) { return lastUname; } else { @@ -151,8 +159,10 @@ if (gid == (gid_t) -1) { lastGid = (gid_t) -1; return NULL; +#if !defined(RPM_VENDOR_OPENPKG) /* no-hard-coded-ugid */ } else if (gid == (gid_t) 0) { return "root"; +#endif } else if (gid == lastGid) { return lastGname; } else { @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org