FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-06-2011, 05:34 PM
Florian Pritz
 
Default replace access() calls for debug info where applicable

Signed-off-by: Florian Pritz <bluewind@xinu.at>
---
lib/libalpm/remove.c | 2 +-
lib/libalpm/signing.c | 4 ++--
lib/libalpm/trans.c | 3 +--
3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 9b8517c..03aaeca 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -205,7 +205,7 @@ static int can_remove_file(alpm_handle_t *handle, const alpm_file_t *file,
}
/* If we fail write permissions due to a read-only filesystem, abort.
* Assume all other possible failures are covered somewhere else */
- if(access(filepath, W_OK) == -1) {
+ if(_alpm_access(handle, NULL, filepath, W_OK) == -1) {
if(errno != EACCES && errno != ETXTBSY && access(filepath, F_OK) == 0) {
/* only return failure if the file ACTUALLY exists and we can't write to
* it - ignore "chmod -w" simple permission failures */
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index b08416f..26226dc 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -225,7 +225,7 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
unsigned char *decoded_sigdata = NULL;
FILE *file = NULL, *sigfile = NULL;

- if(!path || access(path, R_OK) != 0) {
+ if(!path || _alpm_access(handle, NULL, path, R_OK) != 0) {
RET_ERR(handle, ALPM_ERR_NOT_A_FILE, -1);
}

@@ -239,7 +239,7 @@ int _alpm_gpgme_checksig(alpm_handle_t *handle, const char *path,
CALLOC(sigpath, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, -1));
snprintf(sigpath, len, "%s.sig", path);

- if(!access(sigpath, R_OK) == 0) {
+ if(!_alpm_access(handle, NULL, sigpath, R_OK) == 0) {
/* sigcount is 0 */
}
}
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 6cea9b7..1bab830 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -288,8 +288,7 @@ int _alpm_runscriptlet(alpm_handle_t *handle, const char *installfn,
int clean_tmpdir = 0;
int retval = 0;

- if(access(installfn, R_OK)) {
- /* not found */
+ if(_alpm_access(handle, NULL, installfn, R_OK) != 0) {
_alpm_log(handle, ALPM_LOG_DEBUG, "scriptlet '%s' not found
", installfn);
return 0;
}
--
1.7.6
 

Thread Tools




All times are GMT. The time now is 03:21 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org