index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Aaron Griffin <aaron@archlinux.org> | 2007-03-21 03:08:19 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-03-21 03:08:19 +0000 |
commit | 941c23025c886b820af8a17959bdf6dc4c2c0c9a (patch) | |
tree | d5e044e916ba3cf63fd8d8279cb9517db34822a9 /src | |
parent | 8ded2051d2449045ad07117d7ac58a17784d20ef (diff) |
-rw-r--r-- | src/pacman/query.c | 15 |
diff --git a/src/pacman/query.c b/src/pacman/query.c index 76cbc7fc..e7e9cf92 100644 --- a/src/pacman/query.c +++ b/src/pacman/query.c @@ -27,6 +27,7 @@ #include <string.h> #include <sys/stat.h> #include <libintl.h> +#include <errno.h> #include <alpm.h> #include <alpm_list.h> @@ -57,8 +58,18 @@ static void query_fileowner(pmdb_t *db, char *filename) return; } - if(stat(filename, &buf) == -1 || S_ISDIR(buf.st_mode) || realpath(filename, rpath) == NULL) { - /* fail silently if we're a directory */ + if(stat(filename, &buf) == -1) { + ERR(NL, _("failed to read file '%s': %s"), filename, strerror(errno)); + return; + } + + if(S_ISDIR(buf.st_mode)) { + ERR(NL, _("can not determine ownership of a directory")); + return; + } + + if(realpath(filename, rpath) == NULL) { + ERR(NL, _("cannot determine real path for '%s': %s"), filename, strerror(errno)); return; } |