Changeset c8d100bb03e0fe0501037b914fe3638afd593ee4

Show
Ignore:
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
  • libsemanage/src/conf-parse.y

    reb014c7 rc8d100b  
    5858 
    5959%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 
    6161%token BZIP_BLOCKSIZE BZIP_SMALL 
    6262%token VERIFY_MOD_START VERIFY_LINKED_START VERIFY_KERNEL_START BLOCK_END 
     
    8383        |       save_linked 
    8484        |       disable_genhomedircon 
     85        |       usepasswd 
    8586        |       handle_unknown 
    8687        |       bzip_blocksize 
     
    154155 } 
    155156 
     157usepasswd: 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 
    156168handle_unknown: HANDLE_UNKNOWN '=' ARG { 
    157169        if (strcasecmp($3, "deny") == 0) { 
     
    253265        conf->expand_check = 1; 
    254266        conf->handle_unknown = -1; 
     267        conf->usepasswd = 1; 
    255268        conf->file_mode = 0644; 
    256269        conf->bzip_blocksize = 9; 
  • libsemanage/src/conf-scan.l

    ree98270 rc8d100b  
    4747save-linked       return SAVE_LINKED; 
    4848disable-genhomedircon return DISABLE_GENHOMEDIRCON; 
     49usepasswd return USEPASSWD; 
    4950handle-unknown    return HANDLE_UNKNOWN; 
    5051bzip-blocksize  return BZIP_BLOCKSIZE; 
  • libsemanage/src/direct_api.c

    r0b2f9ef rc8d100b  
    960960        if (!sh->conf->disable_genhomedircon) { 
    961961                if (out && (retval = 
    962                      semanage_genhomedircon(sh, out, 1)) != 0) { 
     962                     semanage_genhomedircon(sh, out, sh->conf->usepasswd)) != 0) { 
    963963                        ERR(sh, "semanage_genhomedircon returned error code %d.", 
    964964                            retval); 
  • libsemanage/src/semanage_conf.h

    ree98270 rc8d100b  
    3939        int save_linked; 
    4040        int disable_genhomedircon; 
     41        int usepasswd; 
    4142        int handle_unknown; 
    4243        mode_t file_mode;