Changeset c8d100bb03e0fe0501037b914fe3638afd593ee4
- Timestamp:
- 03/06/10 16:56:23
(5 months ago)
- Author:
- Joshua Brindle <method@manicmethod.com>
- Committer:
- Joshua Brindle <method@manicmethod.com> 1267916183 -0500
- Parent:
[955f8d8e288bbba32732a661d1db6b2c471ae91e]
- Message:
Patch to run genhomedircon without looking at /etc/passwd
I want to change the default of libsemanage to not look for home
directories in getpwent. This patch allows you to set the flag
usepasswd=false in the semanage.conf file. and genhomedircon will only
setup the labeling of /home, /export/home and any confined users homedirs.
If this patch is not acceptable because libsemanage is being rewritten,
I would like the functionality to be added to the new libsemanage.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| reb014c7 |
rc8d100b |
|
| 58 | 58 | |
|---|
| 59 | 59 | %token MODULE_STORE VERSION EXPAND_CHECK FILE_MODE SAVE_PREVIOUS SAVE_LINKED |
|---|
| 60 | | %token LOAD_POLICY_START SETFILES_START DISABLE_GENHOMEDIRCON HANDLE_UNKNOWN |
|---|
| | 60 | %token LOAD_POLICY_START SETFILES_START DISABLE_GENHOMEDIRCON HANDLE_UNKNOWN USEPASSWD |
|---|
| 61 | 61 | %token BZIP_BLOCKSIZE BZIP_SMALL |
|---|
| 62 | 62 | %token VERIFY_MOD_START VERIFY_LINKED_START VERIFY_KERNEL_START BLOCK_END |
|---|
| … | … | |
| 83 | 83 | | save_linked |
|---|
| 84 | 84 | | disable_genhomedircon |
|---|
| | 85 | | usepasswd |
|---|
| 85 | 86 | | handle_unknown |
|---|
| 86 | 87 | | bzip_blocksize |
|---|
| … | … | |
| 154 | 155 | } |
|---|
| 155 | 156 | |
|---|
| | 157 | usepasswd: USEPASSWD '=' ARG { |
|---|
| | 158 | if (strcasecmp($3, "false") == 0) { |
|---|
| | 159 | current_conf->usepasswd = 0; |
|---|
| | 160 | } else if (strcasecmp($3, "true") == 0) { |
|---|
| | 161 | current_conf->usepasswd = 1; |
|---|
| | 162 | } else { |
|---|
| | 163 | yyerror("usepasswd can only be 'true' or 'false'"); |
|---|
| | 164 | } |
|---|
| | 165 | free($3); |
|---|
| | 166 | } |
|---|
| | 167 | |
|---|
| 156 | 168 | handle_unknown: HANDLE_UNKNOWN '=' ARG { |
|---|
| 157 | 169 | if (strcasecmp($3, "deny") == 0) { |
|---|
| … | … | |
| 253 | 265 | conf->expand_check = 1; |
|---|
| 254 | 266 | conf->handle_unknown = -1; |
|---|
| | 267 | conf->usepasswd = 1; |
|---|
| 255 | 268 | conf->file_mode = 0644; |
|---|
| 256 | 269 | conf->bzip_blocksize = 9; |
|---|
| ree98270 |
rc8d100b |
|
| 47 | 47 | save-linked return SAVE_LINKED; |
|---|
| 48 | 48 | disable-genhomedircon return DISABLE_GENHOMEDIRCON; |
|---|
| | 49 | usepasswd return USEPASSWD; |
|---|
| 49 | 50 | handle-unknown return HANDLE_UNKNOWN; |
|---|
| 50 | 51 | bzip-blocksize return BZIP_BLOCKSIZE; |
|---|
| r0b2f9ef |
rc8d100b |
|
| 960 | 960 | if (!sh->conf->disable_genhomedircon) { |
|---|
| 961 | 961 | if (out && (retval = |
|---|
| 962 | | semanage_genhomedircon(sh, out, 1)) != 0) { |
|---|
| | 962 | semanage_genhomedircon(sh, out, sh->conf->usepasswd)) != 0) { |
|---|
| 963 | 963 | ERR(sh, "semanage_genhomedircon returned error code %d.", |
|---|
| 964 | 964 | retval); |
|---|
| ree98270 |
rc8d100b |
|
| 39 | 39 | int save_linked; |
|---|
| 40 | 40 | int disable_genhomedircon; |
|---|
| | 41 | int usepasswd; |
|---|
| 41 | 42 | int handle_unknown; |
|---|
| 42 | 43 | mode_t file_mode; |
|---|