Ticket #1031 (closed defect: fixed)
POSIX client tool for device creation doesn't set mode correctly
Reported by: | https://www.google.com/accounts/o8/id?id=AItOawkfar6gGD3PuUixQdEZQyRr2mpowLW1A70 | Owned by: | solj |
---|---|---|---|
Priority: | major | Milestone: | Bcfg2 1.2.0 Release |
Component: | bcfg2-client | Version: | 1.0 |
Keywords: | Cc: |
Description
It appears that when assigning a mode attribute to a Path of type device the permission created on disk is not as expected.
<Path type='device' name='/var/lib/bind/dev/null' owner='root' group='root' dev_type='char' major='1' minor='3' mode='0777'/>
Results in a file with permissions 0755.
The calcPerms method in Client/Tools?/POSIX.py returns a value sent to os.mknod. It is not clear whether the problem is with os.mknod and the permissions mask or the value generated by calcPerms.
docs for os.mknod:
"mode specifies both the permissions to use and the type of node to be created, being combined (bitwise OR) with one of stat.S_IFREG, stat.S_IFCHR, stat.S_IFBLK, and stat.S_IFIFO (those constants are available in stat)"
Could this either be fixed to work as expected or the correct mode setting be documented? mode is not listed at http://docs.bcfg2.org/server/configurationentries.html?highlight=posix
Attachments
Change History
comment:1 Changed 12 years ago by solj
- Owner changed from desai to solj
- Status changed from new to accepted
comment:2 Changed 12 years ago by solj
- Status changed from accepted to closed
- Resolution set to fixed
Fixed in a2988f20dd3db239bb35994aa92cb8f3a5328051.