- add S_ISLNK pre-transaction syscall test.
authorjbj <devnull@localhost>
Wed, 12 Jul 2000 22:10:26 +0000 (22:10 +0000)
committerjbj <devnull@localhost>
Wed, 12 Jul 2000 22:10:26 +0000 (22:10 +0000)
CVS patchset: 3941
CVS date: 2000/07/12 22:10:26

CHANGES
lib/fileutil.c
lib/transaction.c
po/rpm.pot
rpm.spec

diff --git a/CHANGES b/CHANGES
index a0ce774..f1265f1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -83,6 +83,7 @@
        - fix: legacy requires './' payload prefix to be omitted for rpm itself.
        - fix: remove verbose database +++/--- messages to conform to doco.
        - compare versions if doing --freshen.
+       - add S_ISLNK pre-transaction syscall test.
 
 3.0.4 -> 3.0.5
        - handle version 4 packaging as input.
index b228d3c..7e0b6ca 100644 (file)
@@ -16,6 +16,8 @@ static struct {
 #define        RPMSYSCALL_MV           2
     { "symlink",       2 }
 #define        RPMSYSCALL_SYMLINK      3
+    { "S_ISLNK",       1 }
+#define        RPMSYSCALL_ISLNK        4
 };
 int ncmds = sizeof(cmds)/sizeof(cmds[0]);
 
@@ -149,6 +151,17 @@ int rpmSyscall(const char * cmd, int noexec)
        rc = symlink(argv[1], argv[2]);
        if (rc < 0) rc = errno;
        break;
+    case RPMSYSCALL_ISLNK:     /* stat(2) with S_ISLNK */
+       if (stat(argv[1], &st) < 0) {
+           if (rc == 0) rc = errno;
+           goto exit;
+       }
+       if (S_ISLNK(st.st_mode)) {
+           if (rc == 0) rc = EPERM;
+           goto exit;
+       }
+       rc = 0;
+       break;
     default:
        rc = EPERM;
        break;
index ce90e0b..5d4688d 100644 (file)
@@ -1383,9 +1383,14 @@ int rpmRunTransactions(rpmTransactionSet ts, rpmCallbackFunction notify,
                        _("executing pre-transaction syscall: \"%s\"\n"),
                        preTrans[j]);
                    rc = rpmSyscall(preTrans[j], 0);
+#if 1
+                   if (rc)     /* HACK HACK HACK */
+                       break;
+#else
                    if (rc != 0)
                        psAppend(probs, RPMPROB_BADPRETRANS, alp->key, alp->h,
                            preTrans[j], NULL, rc);
+#endif
                }
                xfree(preTrans);
                preTrans = NULL;
index d07d1e0..dd40146 100644 (file)
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-07-11 23:58-0400\n"
+"POT-Creation-Date: 2000-07-12 16:21-0400\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2548,7 +2548,7 @@ msgstr ""
 msgid "(unknown type)"
 msgstr ""
 
-#: lib/install.c:148 lib/uninstall.c:189
+#: lib/install.c:148 lib/uninstall.c:190
 #, c-format
 msgid "   file: %s action: %s\n"
 msgstr ""
@@ -3209,7 +3209,7 @@ msgstr ""
 msgid "error(%d) counting packages"
 msgstr ""
 
-#: lib/rpmdb.c:1155 lib/rpmdb.c:1674 lib/uninstall.c:91
+#: lib/rpmdb.c:1155 lib/rpmdb.c:1674 lib/uninstall.c:92
 #, c-format
 msgid "%s: cannot read header at 0x%x"
 msgstr ""
@@ -3681,31 +3681,31 @@ msgstr ""
 msgid "executing pre-transaction syscall: \"%s\"\n"
 msgstr ""
 
-#: lib/uninstall.c:39
+#: lib/uninstall.c:40
 #, c-format
 msgid "cannot remove %s - directory not empty"
 msgstr ""
 
-#: lib/uninstall.c:42
+#: lib/uninstall.c:43
 #, c-format
 msgid "rmdir of %s failed: %s"
 msgstr ""
 
-#: lib/uninstall.c:50
+#: lib/uninstall.c:51
 #, c-format
 msgid "removal of %s failed: %s"
 msgstr ""
 
-#: lib/uninstall.c:135
+#: lib/uninstall.c:136
 #, c-format
 msgid "will remove files test = %d\n"
 msgstr ""
 
-#: lib/uninstall.c:203
+#: lib/uninstall.c:204
 msgid "running postuninstall script (if any)\n"
 msgstr ""
 
-#: lib/uninstall.c:400
+#: lib/uninstall.c:401
 #, c-format
 msgid "execution of %s-%s-%s script failed, exit status %d"
 msgstr ""
index 5ac201f..c6e1d9e 100644 (file)
--- a/rpm.spec
+++ b/rpm.spec
@@ -8,7 +8,7 @@ Summary: The Red Hat package management system.
 Name: rpm
 %define version 4.0
 Version: %{version}
-Release: 0.51
+Release: 0.52
 Group: System Environment/Base
 Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-3.0.x/rpm-%{version}.tar.gz
 Copyright: GPL
@@ -257,6 +257,9 @@ fi
 %{__prefix}/include/popt.h
 
 %changelog
+* Wed Jul 12 2000 Jeff Johnson <jbj@redhat.com>
+- add S_ISLNK pre-transaction syscall test.
+
 * Tue Jul 11 2000 Jeff Johnson <jbj@redhat.com>
 - fix: legacy requires './' payload prefix to be omitted for rpm itself.
 - fix: remove verbose database +++/--- messages to conform to doco.