Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

Location:
vendor/current/source4/lib/cmdline
Files:
1 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/lib/cmdline/popt_common.c

    r414 r740  
    6767
    6868        if (reason == POPT_CALLBACK_REASON_POST) {
    69                 if (lp_configfile(cmdline_lp_ctx) == NULL) {
    70             lp_load_default(cmdline_lp_ctx);
     69                if (lpcfg_configfile(cmdline_lp_ctx) == NULL) {
     70                        lpcfg_load_default(cmdline_lp_ctx);
    7171                }
    7272                /* Hook any 'every Samba program must do this, after
     
    8484
    8585        if (reason == POPT_CALLBACK_REASON_PRE) {
    86                 cmdline_lp_ctx = loadparm_init(talloc_autofree_context());
     86                cmdline_lp_ctx = loadparm_init_global(false);
    8787
    8888                /* Hook for 'almost the first thing to do in a samba program' here */
     
    109109
    110110        case OPT_OPTION:
    111                 if (!lp_set_option(cmdline_lp_ctx, arg)) {
     111                if (!lpcfg_set_option(cmdline_lp_ctx, arg)) {
    112112                        fprintf(stderr, "Error setting option '%s'\n", arg);
    113113                        exit(1);
     
    116116
    117117        case 'd':
    118                 lp_set_cmdline(cmdline_lp_ctx, "log level", arg);
     118                lpcfg_set_cmdline(cmdline_lp_ctx, "log level", arg);
    119119                break;
    120120
     
    125125        case 's':
    126126                if (arg) {
    127                         lp_load(cmdline_lp_ctx, arg);
     127                        lpcfg_load(cmdline_lp_ctx, arg);
    128128                }
    129129                break;
     
    132132                if (arg) {
    133133                        char *new_logfile = talloc_asprintf(NULL, "%s/log.%s", arg, pname);
    134                         lp_set_cmdline(cmdline_lp_ctx, "log file", new_logfile);
     134                        lpcfg_set_cmdline(cmdline_lp_ctx, "log file", new_logfile);
    135135                        talloc_free(new_logfile);
    136136                }
     
    153153        case 'O':
    154154                if (arg) {
    155                         lp_set_cmdline(lp_ctx, "socket options", arg);
     155                        lpcfg_set_cmdline(lp_ctx, "socket options", arg);
    156156                }
    157157                break;
    158158       
    159159        case 'W':
    160                 lp_set_cmdline(lp_ctx, "workgroup", arg);
     160                lpcfg_set_cmdline(lp_ctx, "workgroup", arg);
    161161                break;
    162162
    163163        case 'r':
    164                 lp_set_cmdline(lp_ctx, "realm", arg);
     164                lpcfg_set_cmdline(lp_ctx, "realm", arg);
    165165                break;
    166166               
    167167        case 'n':
    168                 lp_set_cmdline(lp_ctx, "netbios name", arg);
     168                lpcfg_set_cmdline(lp_ctx, "netbios name", arg);
    169169                break;
    170170               
    171171        case 'i':
    172                 lp_set_cmdline(lp_ctx, "netbios scope", arg);
     172                lpcfg_set_cmdline(lp_ctx, "netbios scope", arg);
    173173                break;
    174174
    175175        case 'm':
    176                 lp_set_cmdline(lp_ctx, "client max protocol", arg);
     176                lpcfg_set_cmdline(lp_ctx, "client max protocol", arg);
    177177                break;
    178178
    179179        case 'R':
    180                 lp_set_cmdline(lp_ctx, "name resolve order", arg);
     180                lpcfg_set_cmdline(lp_ctx, "name resolve order", arg);
    181181                break;
    182182
    183183        case 'S':
    184                 lp_set_cmdline(lp_ctx, "client signing", arg);
     184                lpcfg_set_cmdline(lp_ctx, "client signing", arg);
    185185                break;
    186186
  • vendor/current/source4/lib/cmdline/popt_credentials.c

    r414 r740  
    3232 *              -N,--no-pass
    3333 *              -S,--signing
    34  *              -P --machine-pass
    35  *                 --simple-bind-dn
    36  *                 --password
     34 *              -P,--machine-pass
     35 *              --simple-bind-dn
     36 *              --password
    3737 */
    3838
     39static bool dont_ask;
     40static bool machine_account_pending;
    3941
    40 static bool dont_ask;
    41 
    42 enum opt { OPT_SIMPLE_BIND_DN, OPT_PASSWORD, OPT_KERBEROS };
     42enum opt { OPT_SIMPLE_BIND_DN, OPT_PASSWORD, OPT_KERBEROS, OPT_SIGN, OPT_ENCRYPT };
    4343
    4444/*
     
    6666                        cli_credentials_set_cmdline_callbacks(cmdline_credentials);
    6767                }
     68
     69                if (machine_account_pending) {
     70                        cli_credentials_set_machine_account(cmdline_credentials, cmdline_lp_ctx);
     71                }
     72
    6873                return;
     74
    6975        }
    7076
     
    97103        case 'P':
    98104                /* Later, after this is all over, get the machine account details from the secrets.ldb */
    99                 cli_credentials_set_machine_account_pending(cmdline_credentials, cmdline_lp_ctx);
     105                machine_account_pending = true;
    100106                break;
    101107
     
    106112                if (arg) {
    107113                        if (!set_boolean(arg, &use_kerberos)) {
    108                                 fprintf(stderr, "Error parsing -k %s\n", arg);
     114                                fprintf(stderr, "Error parsing -k %s. Should be "
     115                                        "-k [yes|no]\n", arg);
    109116                                exit(1);
    110117                                break;
     
    120127               
    121128        case OPT_SIMPLE_BIND_DN:
     129        {
    122130                cli_credentials_set_bind_dn(cmdline_credentials, arg);
    123131                break;
     132        }
     133        case OPT_SIGN:
     134        {
     135                uint32_t gensec_features;
     136
     137                gensec_features = cli_credentials_get_gensec_features(cmdline_credentials);
     138
     139                gensec_features |= GENSEC_FEATURE_SIGN;
     140                cli_credentials_set_gensec_features(cmdline_credentials,
     141                                                    gensec_features);
     142                break;
     143        }
     144        case OPT_ENCRYPT:
     145        {
     146                uint32_t gensec_features;
     147
     148                gensec_features = cli_credentials_get_gensec_features(cmdline_credentials);
     149
     150                gensec_features |= GENSEC_FEATURE_SEAL;
     151                cli_credentials_set_gensec_features(cmdline_credentials,
     152                                                    gensec_features);
     153                break;
     154        }
    124155        }
    125156}
     
    135166        { "machine-pass", 'P', POPT_ARG_NONE, NULL, 'P', "Use stored machine account password (implies -k)" },
    136167        { "simple-bind-dn", 0, POPT_ARG_STRING, NULL, OPT_SIMPLE_BIND_DN, "DN to use for a simple bind" },
    137         { "kerberos", 'k', POPT_ARG_STRING, NULL, OPT_KERBEROS, "Use Kerberos" },
     168        { "kerberos", 'k', POPT_ARG_STRING, NULL, OPT_KERBEROS, "Use Kerberos, -k [yes|no]" },
     169        { "sign", 'S', POPT_ARG_NONE, NULL, OPT_SIGN, "Sign connection to prevent modification in transit" },
     170        { "encrypt", 'e', POPT_ARG_NONE, NULL, OPT_ENCRYPT, "Encrypt connection for privacy" },
    138171        { NULL }
    139172};
Note: See TracChangeset for help on using the changeset viewer.