The following commit has been merged in the master branch:
commit 4e841712e9ec4eff38008ef22747b3810012116d
Author: Guillem Jover <[email protected]>
Date: Wed Sep 9 18:06:41 2009 +0200
Rename chmodsafe_unlink functions to secure_unlink
diff --git a/src/help.c b/src/help.c
index 03af902..cb123cf 100644
--- a/src/help.c
+++ b/src/help.c
@@ -505,17 +505,17 @@ void oldconffsetflags(const struct conffile *searchconff)
{
}
int
-chmodsafe_unlink(const char *pathname)
+secure_unlink(const char *pathname)
{
struct stat stab;
if (lstat(pathname,&stab)) return -1;
- return chmodsafe_unlink_statted(pathname, &stab);
+ return secure_unlink_statted(pathname, &stab);
}
int
-chmodsafe_unlink_statted(const char *pathname, const struct stat *stab)
+secure_unlink_statted(const char *pathname, const struct stat *stab)
{
if (S_ISREG(stab->st_mode) ? (stab->st_mode & 07000) :
!(S_ISLNK(stab->st_mode) || S_ISDIR(stab->st_mode) ||
@@ -544,7 +544,7 @@ void ensure_pathname_nonexisting(const char *pathname) {
/* Either it's a file, or one of the path components is. If one
* of the path components is this will fail again ...
*/
- if (chmodsafe_unlink(pathname) == 0)
+ if (secure_unlink(pathname) == 0)
return; /* OK, it was */
if (errno == ENOTDIR) return;
}
diff --git a/src/main.h b/src/main.h
index 1921724..59214ae 100644
--- a/src/main.h
+++ b/src/main.h
@@ -231,8 +231,8 @@ int force_conff_miss(struct deppossi *possi);
int force_conflicts(struct deppossi *possi);
void oldconffsetflags(const struct conffile *searchconff);
void ensure_pathname_nonexisting(const char *pathname);
-int chmodsafe_unlink(const char *pathname);
-int chmodsafe_unlink_statted(const char *pathname, const struct stat *stab);
+int secure_unlink(const char *pathname);
+int secure_unlink_statted(const char *pathname, const struct stat *stab);
void checkpath(void);
struct filenamenode *namenodetouse(struct filenamenode*, struct pkginfo*);
diff --git a/src/processarc.c b/src/processarc.c
index 6fd0f7f..4d2f7fe 100644
--- a/src/processarc.c
+++ b/src/processarc.c
@@ -759,7 +759,7 @@ void process_archive(const char *filename) {
if (sameas)
continue;
- if (chmodsafe_unlink_statted(fnamevb.buf, &oldfs)) {
+ if (secure_unlink_statted(fnamevb.buf, &oldfs)) {
warning(_("unable to securely remove old file '%.250s': %s"),
namenode->name, strerror(errno));
}
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]