* [PATCH] fix another d_type problem on xfs
@ 2015-04-07 7:29 qiaonuohan
2015-04-07 7:30 ` qiaonuohan
0 siblings, 1 reply; 3+ messages in thread
From: qiaonuohan @ 2015-04-07 7:29 UTC (permalink / raw)
To: systemtap; +Cc: dsmith
Function get_server_mok_fingerprints is supposed to find mok on server.
Because of d_type problem on xfs, existing mok will be ignored.
Signed-off-by: qiaonuohan <qiaonuohan@cn.fujitsu.com>
---
stap-serverd.cxx | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/stap-serverd.cxx b/stap-serverd.cxx
index 917c52a..cedc017 100644
--- a/stap-serverd.cxx
+++ b/stap-serverd.cxx
@@ -473,7 +473,19 @@ get_server_mok_fingerprints(vector<string> &mok_fingerprints, bool verbose,
{
// We're only interested in directories (of key files).
if (direntp->d_type != DT_DIR)
- continue;
+ {
+ if (direntp->d_type == DT_UNKNOWN)
+ {
+ // If the filesystem doesn't support d_type, we'll have to
+ // call stat().
+ struct stat tmpstat;
+ stat((mok_path + "/" + direntp->d_name).c_str (), &tmpstat);
+ if (!S_ISDIR(tmpstat.st_mode))
+ continue;
+ }
+ else
+ continue;
+ }
// We've got a directory. If the directory name isn't in the right
// format for a MOK fingerprint, skip it.
--
1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix another d_type problem on xfs
2015-04-07 7:29 [PATCH] fix another d_type problem on xfs qiaonuohan
@ 2015-04-07 7:30 ` qiaonuohan
2015-04-07 15:34 ` David Smith
0 siblings, 1 reply; 3+ messages in thread
From: qiaonuohan @ 2015-04-07 7:30 UTC (permalink / raw)
To: dsmith; +Cc: systemtap
Hello David,
This is an another d_type problem, please check.
On 04/07/2015 03:29 PM, qiaonuohan wrote:
> Function get_server_mok_fingerprints is supposed to find mok on server.
> Because of d_type problem on xfs, existing mok will be ignored.
>
> Signed-off-by: qiaonuohan <qiaonuohan@cn.fujitsu.com>
> ---
> stap-serverd.cxx | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/stap-serverd.cxx b/stap-serverd.cxx
> index 917c52a..cedc017 100644
> --- a/stap-serverd.cxx
> +++ b/stap-serverd.cxx
> @@ -473,7 +473,19 @@ get_server_mok_fingerprints(vector<string> &mok_fingerprints, bool verbose,
> {
> // We're only interested in directories (of key files).
> if (direntp->d_type != DT_DIR)
> - continue;
> + {
> + if (direntp->d_type == DT_UNKNOWN)
> + {
> + // If the filesystem doesn't support d_type, we'll have to
> + // call stat().
> + struct stat tmpstat;
> + stat((mok_path + "/" + direntp->d_name).c_str (), &tmpstat);
> + if (!S_ISDIR(tmpstat.st_mode))
> + continue;
> + }
> + else
> + continue;
> + }
>
> // We've got a directory. If the directory name isn't in the right
> // format for a MOK fingerprint, skip it.
>
--
Regards
Qiao Nuohan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix another d_type problem on xfs
2015-04-07 7:30 ` qiaonuohan
@ 2015-04-07 15:34 ` David Smith
0 siblings, 0 replies; 3+ messages in thread
From: David Smith @ 2015-04-07 15:34 UTC (permalink / raw)
To: qiaonuohan; +Cc: systemtap
On 04/07/2015 02:30 AM, qiaonuohan wrote:
> Hello David,
>
> This is an another d_type problem, please check.
The patch looks fine. I've checked both of them in.
Thanks for the fixes.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-07 15:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-07 7:29 [PATCH] fix another d_type problem on xfs qiaonuohan
2015-04-07 7:30 ` qiaonuohan
2015-04-07 15:34 ` David Smith
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).