arshidkv12 · GitHub

@arshidkv12

Copy link Copy Markdown

Contributor

No description provided.

@arshidkv12

devnexen

--TEST--
mkdir(): invalid mode
--FILE--
<?php

Copy link Copy Markdown

Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add few more cases (e.g. -1)

Copy link Copy Markdown

Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@arshidkv12

@arshidkv12

devnexen

Girgias

Z_PARAM_RESOURCE_OR_NULL(zcontext)
ZEND_PARSE_PARAMETERS_END();

if (mode < 0 || (mode & ~07777)) {

Copy link Copy Markdown

Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it makes sense to provide a Zend API for this. As a lot of code does file permissions checks (including INI settings (or should at least))

Copy link Copy Markdown

Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’ve created a helper function zend_validate_file_permissions(). I think this can be used to validate permission masks for any filesystem-related operations. Please let me know if this approach makes sense.

@arshidkv12

@arshidkv12

@arshidkv12

@bukka

Copy link Copy Markdown

Member

BC break so it requires RFC.

@arshidkv12

Read the original on github.com ↗