All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] Access02 and use of system() library function
Date: Thu, 30 Mar 2017 16:19:13 +0200	[thread overview]
Message-ID: <20170330141913.GA886@rei.lan> (raw)
In-Reply-To: <1e809374-8b45-aae8-69b2-14a0728fc2d6@gezedo.com>

Hi!
> > What LTP version is this? The access02 test was rewritten some time ago and
> > there is no test_file3 since commit:
> >
> > commit adb3e23d9de5f8ff54d2395112f79f25c36cf598
> > Author: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
> > Date:   Wed Jul 20 18:44:39 2016 +0800
> >
> >     syscalls/access02: reconstruct and convert to new API
> >
> > Which is included in last to stable releases....
> >
> You're right, i am using an old version of LTP (20160126).
>
> It does not change my remark anyway, newer test does X_OK test using
> system() library function. The return value is checked against 0 for
> success, whereas I suggest that it should check against any positive
> value, or even against any value but -1.

Hmm, we can always write a shebang to the file then the file should be
recognized by shell, right?

Does this fixes the issue:

diff --git a/testcases/kernel/syscalls/access/access02.c b/testcases/kernel/syscalls/access/access02.c
index 779e81a..86e0342 100644
--- a/testcases/kernel/syscalls/access/access02.c
+++ b/testcases/kernel/syscalls/access/access02.c
@@ -187,6 +187,7 @@ static void setup(void)
 	SAFE_TOUCH(FNAME_R, 0444, NULL);
 	SAFE_TOUCH(FNAME_W, 0222, NULL);
 	SAFE_TOUCH(FNAME_X, 0555, NULL);
+	SAFE_FILE_PRINTF(FNAME_X, "#!/bin/sh\n");
 
 	SAFE_SYMLINK(FNAME_F, SNAME_F);
 	SAFE_SYMLINK(FNAME_R, SNAME_R);

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2017-03-30 14:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16 14:04 [LTP] Access02 and use of system() library function Laurent GONZALEZ
2017-03-20 11:11 ` Cyril Hrubis
2017-03-20 12:22   ` Laurent GONZALEZ
2017-03-30 14:19     ` Cyril Hrubis [this message]
2017-03-31  7:58       ` Laurent GONZALEZ
2017-03-31 11:29         ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170330141913.GA886@rei.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.