[MDEV-12618] mysys/mysys_priv.h shouldn't use O_EXEC as O_PATH on illumos Created: 2017-04-28  Updated: 2017-04-28  Resolved: 2017-04-28

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 5.5.55
Fix Version/s: 5.5.56

Type: Bug Priority: Major
Reporter: Alexander Pyhalov Assignee: Sergei Golubchik
Resolution: Duplicate Votes: 0
Labels: None
Environment:

OpenIndiana Hipster


Issue Links:
Duplicate
is duplicated by MDEV-12310 openat(<directory>, ...O_EXEC) fails ... Closed

 Description   

In mysys_priv.h MariaDB defines:

#if !defined(O_PATH) && defined(O_EXEC) /* FreeBSD */
#define O_PATH O_EXEC
#endif

This makes mariadb server trying to do:

	openat64(-1, "/var", O_EXEC|O_NOFOLLOW)		Err#8 ENOEXEC

which errors out.
Solaris uses POSIX O_SEARCH for this. The following would work:

#if !defined(O_PATH)
#if defined(O_SEARCH)  /* illumos */
#define O_PATH O_SEARCH
#elif defined(O_EXEC) /* FreeBSD */
#define O_PATH O_EXEC
#endif
#endif

Or better switch to using O_SEARCH (as it's posix-compliant ) and defining it on systems which don't have it.



 Comments   
Comment by Sergei Golubchik [ 2017-04-28 ]

Duplicate of MDEV-12310

Already fixed in https://github.com/mariadb/server/commit/ffc0492d

Generated at Thu Feb 08 07:59:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.