1 /* Copyright (c) 2012, 2021, Oracle and/or its affiliates.
2 
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6 
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation.  The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License, version 2.0, for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
22 
23 
24 #ifndef NAMED_PIPE_INCLUDED
25 #define NAMED_PIPE_INCLUDED
26 
27 #include <windows.h>
28 
29 const DWORD NAMED_PIPE_OWNER_PERMISSIONS= GENERIC_READ | GENERIC_WRITE;
30 const DWORD NAMED_PIPE_EVERYONE_PERMISSIONS=
31 FILE_READ_ATTRIBUTES | FILE_READ_DATA | FILE_WRITE_ATTRIBUTES |
32 FILE_WRITE_DATA | SYNCHRONIZE | READ_CONTROL;
33 const DWORD NAMED_PIPE_FULL_ACCESS_GROUP_PERMISSIONS =
34 GENERIC_READ | GENERIC_WRITE;
35 
36 HANDLE create_server_named_pipe(SECURITY_ATTRIBUTES **ppsec_attr,
37   DWORD buffer_size, const char *name,
38   char *name_buf, size_t buflen,
39   const char *full_access_group_name= NULL);
40 
41 bool is_valid_named_pipe_full_access_group(const char *group_name);
42 bool my_security_attr_add_rights_to_group(SECURITY_ATTRIBUTES *psa,
43   const char *group_name,
44   DWORD group_rights);
45 #define DEFAULT_NAMED_PIPE_FULL_ACCESS_GROUP ""
46 #define NAMED_PIPE_FULL_ACCESS_GROUP_EVERYONE "*everyone*"
47 #endif /* NAMED_PIPE_INCLUDED */
48