This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch]: fs_info::update

On Jan 27 21:58, Pierre A. Humblet wrote:
> When a user has no read access to the root of a drive, GetVolumeInformation
> fails and has_acls is left unset. Consequently ntsec is off on that drive.
> If a user "chmod -r" the root of a drive, ntsec is turned off and "chmod +r"
> has no effect.
> The patch does its best to set has_acls even in case of failure.
> 2005-01-28  Pierre Humblet <>
> 	* (fs_info::update) Set has_acls even in case of failure.
> Index:
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/,v
> retrieving revision 1.340
> diff -u -p -r1.340
> ---     26 Jan 2005 04:34:19 -0000      1.340
> +++     28 Jan 2005 02:48:54 -0000
> @@ -381,6 +381,8 @@ fs_info::update (const char *win32_path)
>        debug_printf ("Cannot get volume information (%s), %E", root_dir);
>        has_buggy_open (false);
>        has_ea (false);
> +      has_acls (GetLastError () == ERROR_ACCESS_DENIED
> +                && (allow_smbntsec || !is_remote_drive ()));
>        flags () = serial () = 0;
>        return false;
>      }

This looks pretty much like a band-aid.  I can see the use for checking
the last error code, but shouldn't Cygwin opt for safety and not assume
ACLs?  Also, if there's no right to read a remote drive, there might be
a good reason for that, which doesn't necessarily mean the drive has acls.

After all, the effect of chmod -r can be reverted with Windows own means.


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader
Red Hat, Inc.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]