This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] Cygwin: get_posix_access: avoid negative subscript
- From: Ken Brown <kbrown at cornell dot edu>
- To: "cygwin-patches at cygwin dot com" <cygwin-patches at cygwin dot com>
- Date: Tue, 27 Aug 2019 20:00:13 +0000
- Subject: Re: [PATCH] Cygwin: get_posix_access: avoid negative subscript
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8zSkEmaGb3iJWOiBr3YGc1cro3TNnJFOUPfcGUDiGS4=; b=MUXXcOmMJua0nw7Vgqqh66LH3jpRZtlu+5KERP0CQGrMRCdta941vn88zWQqelpKCFSqcKPAk9nKYn/FyWPDgVsZbSHgG0zaUpCcJrwpPeGcDhqJdY+umuXAHy+HEbGQBtJzX2D1toQsA1tn9mQQWRZ1i/gkilbKNC9gUTephECKzcbd0DqiCIrxs+yQCypdi9Z1bZUn95CfrYZNAVTFARnLCp3/SNO+o07nl6xym1fqgY6CPX9a9XSfwW1WATSdNGV4LzMxc6L4UikZ5/XjQFsPK4ZkTm7Wrx6rHW/nUN4bFBByN1qopmeub3ZC9qTqz7IbBo4D0kXYQbe6HqNFlA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UdyVbIsd51T50Xi43ZREgmpIRw+R7V/rq6lJfuS5Smja4wWKVf4oU76165kw69QLFbKUMFVcJcs6e3S51s143EhX13t3YVQt4HdM/TpzS4HDNnb3C4Ev+x01qXFcIYxrhOA4OAerYzkZ1RWTnpBk21F5bz2AVj44SlNjq2Br3GhF3j4jNJcjH3ubSwMOZ5+OQVSu6fr+lCrimg7bWumticLDLQCqZ4/SkngOQvbmf7p6zIAWjc93akNl5y2HuEiBEjSHqtinmEyuVe6Cmsb+jPyUBwJwETsbpgAHbfDxPFViQNLE3SAaE/6eNUD7+HwpMORiegVcJcjXEqvMIU0GNA==
- References: <20190826174324.46043-1-kbrown@cornell.edu> <20190827081355.GS11632@calimero.vinschen.de>
On 8/27/2019 4:13 AM, Corinna Vinschen wrote:
> On Aug 26 17:43, Ken Brown wrote:
>> Don't refer to lacl[pos] unless we know that pos >= 0.
>
> I'm not sure this is entirely right. Moving the assignment to
> class_perm/def_class_perm into the previous if makes sense, but the
> bools has_class_perm and has_def_class_perm should be set no matter
> what, to indicate that class perms had been specified.
I don't think has_class_perm should be set if class_perm isn't set; that would
cause a problem at sec_acl.cc:1169. For has_def_class_perm it doesn't seem to
matter. Unless I'm missing something, has_def_class_perm is not used when
new_style is true.
> Either way, does this solve a real-world problem? If so, a pointer
> or a short description would be nice.
No, I just happened to notice it while studying the ACL code.
Ken