Skip to content

Commit

Permalink
minstall: Correctly set uid/gid of installed files
Browse files Browse the repository at this point in the history
In commit caab4d3, the uid and gid arguments passed to os.chown() by
set_chown() were accidentally swapped, causing files to end up with
incorrect owner/group if the owner and group are not the same.

Also update the documentation to better indicate which argument to
install_mode is which.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
  • Loading branch information
Peter Kjellerstedt authored and jpakkane committed Mar 6, 2021
1 parent fcbab59 commit 6226ac2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/markdown/Reference-manual.md
Expand Up @@ -1065,7 +1065,7 @@ arguments. The following keyword arguments are supported:

`install_mode: 'rw-r--r--'` for just the file mode

`install_mode: ['rw-r--r--', 'nobody', 'nobody']` for the file mode and the user/group
`install_mode: ['rw-r--r--', 'nobody', 'nogroup']` for the file mode and the user/group

`install_mode: ['rw-r-----', 0, 0]` for the file mode and uid/gid

Expand Down
2 changes: 1 addition & 1 deletion mesonbuild/minstall.py
Expand Up @@ -148,7 +148,7 @@ def chown(path: T.Union[int, str, 'os.PathLike[str]', bytes, 'os.PathLike[bytes]
Use a real function rather than a lambda to help mypy out. Also real
functions are faster.
"""
real_os_chown(path, gid, uid, dir_fd=dir_fd, follow_symlinks=follow_symlinks)
real_os_chown(path, uid, gid, dir_fd=dir_fd, follow_symlinks=follow_symlinks)

try:
os.chown = chown
Expand Down

0 comments on commit 6226ac2

Please sign in to comment.