don't do realpath stuff here; it's done in rpmdbFindByFile() now
authorewt <devnull@localhost>
Tue, 15 Dec 1998 05:43:18 +0000 (05:43 +0000)
committerewt <devnull@localhost>
Tue, 15 Dec 1998 05:43:18 +0000 (05:43 +0000)
CVS patchset: 2599
CVS date: 1998/12/15 05:43:18

lib/query.c
verify.c

index 65e33e7..2a2a75c 100644 (file)
@@ -572,27 +572,6 @@ int rpmQuery(char * prefix, enum rpmQuerySources source, int queryFlags,
        break;
 
       case QUERY_PATH:
-       if (*arg != '/') {
-           /* Using realpath on the arg isn't correct if the arg is a symlink,
-            * especially if the symlink is a dangling link.  What we should
-            * instead do is use realpath() on `.' and then append arg to
-            * it.
-            */
-           if (realpath(".", path) != NULL) {
-               if (path[strlen(path)] != '/') {
-                   if (strncat(path, "/", sizeof(path) - strlen(path) - 1) == NULL) {
-                       fprintf(stderr, _("maximum path length exceeded\n"));
-                       return 1;
-                   }
-               }
-               /* now append the original file name to the real path */
-               if (strncat(path, arg, sizeof(path) - strlen(path) - 1) == NULL) {
-                   fprintf(stderr, _("maximum path length exceeded\n"));
-                   return 1;
-               }
-               arg = path;
-           }
-       }
        if (rpmdbFindByFile(db, arg, &matches)) {
            int myerrno = 0;
            if (access(arg, F_OK) != 0)
index 732a605..735bf15 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -229,28 +229,6 @@ int doVerify(char * prefix, enum verifysources source, char ** argv,
                break;
 
            case VERIFY_PATH:
-             if (*arg != '/') {
-               /* Using realpath on the arg isn't correct if the arg is a symlink,
-                * especially if the symlink is a dangling link.  What we should
-                * instead do is use realpath() on `.' and then append arg to
-                * it.
-                */
-              if (realpath(".", path) != NULL) {
-               if (path[strlen(path)] != '/') {
-                   if (strncat(path, "/", sizeof(path) - strlen(path) - 1) == NULL) {
-                       fprintf(stderr, _("maximum path length exceeded\n"));
-                       return 1;
-                   }
-               }
-               /* now append the original file name to the real path */
-               if (strncat(path, arg, sizeof(path) - strlen(path) - 1) == NULL) {
-                   fprintf(stderr, _("maximum path length exceeded\n"));
-                   return 1;
-               }
-               arg = path;
-              }
-             }
-
                if (rpmdbFindByFile(db, arg, &matches)) {
                    fprintf(stderr, _("file %s is not owned by any package\n"), 
                                arg);