On Thursday 13 November 2003 10:16, Ron Artstein wrote:
> ...
> bash: ./a.out: Permission denied
> ...
> Also, I don't know what is the information that system calls get
> when they can't access a file. But if they can discriminate between
> denied access as a result of file permissions and denied access as
> a result of mount options, it would be nice if they could return
> this useful information to the user in the form of a meaningful
> error message.

I must say that I was also surprised errno returned by the system
in this case was EACCES (Permission denied). I would intuitively
expect the kernel to return in this case EPERM (Operation not permitted)
as this is the common error for "unsupported operations" --
E.g: making a hard link on filesystem that doesn't support it, etc.

Indeed, checking fs/exec.c in the kernel source (open_exec function)
reveals that the kernel returns EACCES in both cases which is a pitty
(I'm almost sure there isn't an official standard relating to this case, as
mounting with "noexec" is pretty Linux specific).

Cheers, (well not so much)

-- 
Oron Peled                             Voice/Fax: +972-4-8228492
[EMAIL PROTECTED]                  http://www.actcom.co.il/~oron

"Don't worry about what anybody else is going to do. 
 The best way to predict the future is to invent it."

                                  -- Alan Kay


--------------------------------------------------------------------------
Haifa Linux Club Mailing List (http://www.haifux.org)
To unsub send an empty message to [EMAIL PROTECTED]


Reply via email to