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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z2mQ4RdSE_EfbGyO@x1>
Date: Mon, 23 Dec 2024 13:33:37 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: linux@...blig.org
Cc: irogers@...gle.com, peterz@...radead.org, mingo@...hat.com,
	namhyung@...nel.org, mark.rutland@....com,
	alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
	adrian.hunter@...el.com, kan.liang@...ux.intel.com,
	linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf tools: Remove unused is_executable_file

On Mon, Dec 23, 2024 at 01:32:15PM -0300, Arnaldo Carvalho de Melo wrote:
> On Sun, Dec 22, 2024 at 09:58:31PM +0000, linux@...blig.org wrote:
> > From: "Dr. David Alan Gilbert" <linux@...blig.org>
> > 
> > is_executable_file()  has been unused since 2022's
> > commit 7391db645938 ("perf test: Refactor shell tests allowing subdirs")
> > 
> > Remove it.
> 
> Did you patch this on:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git perf-tools-next
> 
> ?
> 
> That function is still there, so I'll fixup your patch, keep your
> credits and test it all.

FYI, it fails on the .h file:

⬢ [acme@...lbox perf-tools-next]$ patch -p1 < ./20241222_linux_perf_tools_remove_unused_is_executable_file.mbx
patching file tools/perf/util/path.c
Hunk #1 succeeded at 77 (offset 10 lines).
patching file tools/perf/util/path.h
Hunk #1 FAILED at 12.
1 out of 1 hunk FAILED -- saving rejects to file tools/perf/util/path.h.rej
⬢ [acme@...lbox perf-tools-next]$ git diff
diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c
index 9712466c51e2f30e..2e62f272fda8671a 100644
--- a/tools/perf/util/path.c
+++ b/tools/perf/util/path.c
@@ -77,15 +77,3 @@ bool is_directory_at(int dir_fd, const char *path)
 
        return S_ISDIR(st.st_mode);
 }
-
-bool is_executable_file(const char *base_path, const struct dirent *dent)
-{
-       char path[PATH_MAX];
-       struct stat st;
-
-       snprintf(path, sizeof(path), "%s/%s", base_path, dent->d_name);
-       if (stat(path, &st))
-               return false;
-
-       return !S_ISDIR(st.st_mode) && (st.st_mode & S_IXUSR);
-}
⬢ [acme@...lbox perf-tools-next]$

⬢ [acme@...lbox perf-tools-next]$ cat tools/perf/util/path.h.rej
--- tools/perf/util/path.h
+++ tools/perf/util/path.h
@@ -12,6 +12,5 @@ int path__join3(char *bf, size_t size, const char *path1, const char *path2, con
 
 bool is_regular_file(const char *file);
 bool is_directory(const char *base_path, const struct dirent *dent);
-bool is_executable_file(const char *base_path, const struct dirent *dent);
 
 #endif /* _PERF_PATH_H */
⬢ [acme@...lbox perf-tools-next]$ 

Fixed up, thanks.

- Arnaldo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ