public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: chrubis@suse.cz
To: Alexey Kodanev <alexey.kodanev@oracle.com>
Cc: vasily.isaenko@oracle.com, ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH 2/2] docs: add a paragraph about access() to Common Problems section
Date: Tue, 13 May 2014 12:55:31 +0200	[thread overview]
Message-ID: <20140513105531.GA11786@rei> (raw)
In-Reply-To: <1399973868-26408-1-git-send-email-alexey.kodanev@oracle.com>

Hi!
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
> ---
>  doc/test-writing-guidelines.txt |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
> index 91edbf0..aaf6b4a 100644
> --- a/doc/test-writing-guidelines.txt
> +++ b/doc/test-writing-guidelines.txt
> @@ -883,6 +883,13 @@ settings which may clear some of the bits. If your test depends on specific
>  file permissions you need to 'chmod()' the file afterwards or use SAFE_TOUCH()
>  that does the 'chmod()' for you.
>  
> +3.2 access()
> +~~~~~~~~~~~
> +
> +If access(some_file, W_OK) is executed by root it will return success even
> +if the file has read-only permission. As a workaround you can use 'open()' to

Perhaps it would be more clear to say "even if the file doesn't have
write permission bits set." Because access() still returns zero if the
file is not writeable nor readable. And the same goes for R_OK for
privileged user.

The X_OK behaves a bit differently, there must be at least one
executable flag enabled in this case.

> +test sysfs file for write permission. It might not work for other filesystems,
> +but you have stat, lstat and fstat functions.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

      reply	other threads:[~2014-05-13 10:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13  9:37 [LTP] [PATCH 2/2] docs: add a paragraph about access() to Common Problems section Alexey Kodanev
2014-05-13 10:55 ` chrubis [this message]

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=20140513105531.GA11786@rei \
    --to=chrubis@suse.cz \
    --cc=alexey.kodanev@oracle.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=vasily.isaenko@oracle.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox