Просмотр исходного кода

Rename chmodsafe_unlink functions to secure_unlink

Guillem Jover лет назад: 17
Родитель
Сommit
4e841712e9
3 измененных файлов с 7 добавлено и 7 удалено
  1. 4 4
      src/help.c
  2. 2 2
      src/main.h
  3. 1 1
      src/processarc.c

+ 4 - 4
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;
   }

+ 2 - 2
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*);

+ 1 - 1
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));
       }