php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #77319 Add an optional group paramter for chown() and lchown()
Submitted: 2018-12-19 06:35 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: manuel dot schmitt at manitu dot de Assigned:
Status: Open Package: *Directory/Filesystem functions
PHP Version: Irrelevant OS: n/a
Private report: No CVE-ID: None
 [2018-12-19 06:35 UTC] manuel dot schmitt at manitu dot de
Description:
------------
The chown() and lchown() function do currently change owner ($user) only.

Especially for *nix systems it would be great to have an optional $group parameter for changing user and group in one step instead of using chgrp() / lchgrp() as another step.

On most *nix systems this optional, 3rd parameter could be "simply" passed to

    int chown(const char *path, uid_t owner, gid_t group);
    int lchown(const char *path, uid_t owner, gid_t group);

    (from $ man 2 chown)

I think an optional 3rd paramter should not break existing script/applications so it could be integrated very smoothly.




Expected result:
----------------
chown() and lchown() should accept a 3rd, optional group name or group id parameter.

Actual result:
--------------
chown() and lchown() currently only accept only 2 parameters.

Patches

chown_gid.patch (last revision 2018-12-19 06:36 UTC by manuel dot schmitt at manitu dot de)

Pull Requests

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 14:01:29 2024 UTC