lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 1 Feb 2017 06:41:48 -0800
From:   tip-bot for Joe Stringer <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     ast@...com, daniel@...earbox.net, tglx@...utronix.de, joe@....org,
        hpa@...or.com, mingo@...nel.org, acme@...hat.com,
        wangnan0@...wei.com, linux-kernel@...r.kernel.org
Subject: [tip:perf/core] tools perf util: Make rm_rf(path) argument const

Commit-ID:  9a9c733d68c5cb89bd5c5ab91b9821e1a5d69272
Gitweb:     http://git.kernel.org/tip/9a9c733d68c5cb89bd5c5ab91b9821e1a5d69272
Author:     Joe Stringer <joe@....org>
AuthorDate: Thu, 26 Jan 2017 13:19:59 -0800
Committer:  Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 31 Jan 2017 16:20:07 -0300

tools perf util: Make rm_rf(path) argument const

rm_rf() doesn't modify its path argument, and a future caller will pass
a string constant into it to delete.

Signed-off-by: Joe Stringer <joe@....org>
Cc: Alexei Starovoitov <ast@...com>
Cc: Daniel Borkmann <daniel@...earbox.net>
Cc: Wang Nan <wangnan0@...wei.com>
Cc: netdev@...r.kernel.org
Link: http://lkml.kernel.org/r/20170126212001.14103-5-joe@ovn.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
 tools/perf/util/util.c | 2 +-
 tools/perf/util/util.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index bf29aed..d8b45ce 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -85,7 +85,7 @@ int mkdir_p(char *path, mode_t mode)
 	return (stat(path, &st) && mkdir(path, mode)) ? -1 : 0;
 }
 
-int rm_rf(char *path)
+int rm_rf(const char *path)
 {
 	DIR *dir;
 	int ret = 0;
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 6e8be17..c74708d 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -209,7 +209,7 @@ static inline int sane_case(int x, int high)
 }
 
 int mkdir_p(char *path, mode_t mode);
-int rm_rf(char *path);
+int rm_rf(const char *path);
 struct strlist *lsdir(const char *name, bool (*filter)(const char *, struct dirent *));
 bool lsdir_no_dot_filter(const char *name, struct dirent *d);
 int copyfile(const char *from, const char *to);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ