Changeset 740 for vendor/current/source4/lib/cmdline
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- 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 67 67 68 68 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); 71 71 } 72 72 /* Hook any 'every Samba program must do this, after … … 84 84 85 85 if (reason == POPT_CALLBACK_REASON_PRE) { 86 cmdline_lp_ctx = loadparm_init (talloc_autofree_context());86 cmdline_lp_ctx = loadparm_init_global(false); 87 87 88 88 /* Hook for 'almost the first thing to do in a samba program' here */ … … 109 109 110 110 case OPT_OPTION: 111 if (!lp _set_option(cmdline_lp_ctx, arg)) {111 if (!lpcfg_set_option(cmdline_lp_ctx, arg)) { 112 112 fprintf(stderr, "Error setting option '%s'\n", arg); 113 113 exit(1); … … 116 116 117 117 case 'd': 118 lp _set_cmdline(cmdline_lp_ctx, "log level", arg);118 lpcfg_set_cmdline(cmdline_lp_ctx, "log level", arg); 119 119 break; 120 120 … … 125 125 case 's': 126 126 if (arg) { 127 lp _load(cmdline_lp_ctx, arg);127 lpcfg_load(cmdline_lp_ctx, arg); 128 128 } 129 129 break; … … 132 132 if (arg) { 133 133 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); 135 135 talloc_free(new_logfile); 136 136 } … … 153 153 case 'O': 154 154 if (arg) { 155 lp _set_cmdline(lp_ctx, "socket options", arg);155 lpcfg_set_cmdline(lp_ctx, "socket options", arg); 156 156 } 157 157 break; 158 158 159 159 case 'W': 160 lp _set_cmdline(lp_ctx, "workgroup", arg);160 lpcfg_set_cmdline(lp_ctx, "workgroup", arg); 161 161 break; 162 162 163 163 case 'r': 164 lp _set_cmdline(lp_ctx, "realm", arg);164 lpcfg_set_cmdline(lp_ctx, "realm", arg); 165 165 break; 166 166 167 167 case 'n': 168 lp _set_cmdline(lp_ctx, "netbios name", arg);168 lpcfg_set_cmdline(lp_ctx, "netbios name", arg); 169 169 break; 170 170 171 171 case 'i': 172 lp _set_cmdline(lp_ctx, "netbios scope", arg);172 lpcfg_set_cmdline(lp_ctx, "netbios scope", arg); 173 173 break; 174 174 175 175 case 'm': 176 lp _set_cmdline(lp_ctx, "client max protocol", arg);176 lpcfg_set_cmdline(lp_ctx, "client max protocol", arg); 177 177 break; 178 178 179 179 case 'R': 180 lp _set_cmdline(lp_ctx, "name resolve order", arg);180 lpcfg_set_cmdline(lp_ctx, "name resolve order", arg); 181 181 break; 182 182 183 183 case 'S': 184 lp _set_cmdline(lp_ctx, "client signing", arg);184 lpcfg_set_cmdline(lp_ctx, "client signing", arg); 185 185 break; 186 186 -
vendor/current/source4/lib/cmdline/popt_credentials.c
r414 r740 32 32 * -N,--no-pass 33 33 * -S,--signing 34 * -P--machine-pass35 * 36 * 34 * -P,--machine-pass 35 * --simple-bind-dn 36 * --password 37 37 */ 38 38 39 static bool dont_ask; 40 static bool machine_account_pending; 39 41 40 static bool dont_ask; 41 42 enum opt { OPT_SIMPLE_BIND_DN, OPT_PASSWORD, OPT_KERBEROS }; 42 enum opt { OPT_SIMPLE_BIND_DN, OPT_PASSWORD, OPT_KERBEROS, OPT_SIGN, OPT_ENCRYPT }; 43 43 44 44 /* … … 66 66 cli_credentials_set_cmdline_callbacks(cmdline_credentials); 67 67 } 68 69 if (machine_account_pending) { 70 cli_credentials_set_machine_account(cmdline_credentials, cmdline_lp_ctx); 71 } 72 68 73 return; 74 69 75 } 70 76 … … 97 103 case 'P': 98 104 /* 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; 100 106 break; 101 107 … … 106 112 if (arg) { 107 113 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); 109 116 exit(1); 110 117 break; … … 120 127 121 128 case OPT_SIMPLE_BIND_DN: 129 { 122 130 cli_credentials_set_bind_dn(cmdline_credentials, arg); 123 131 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 } 124 155 } 125 156 } … … 135 166 { "machine-pass", 'P', POPT_ARG_NONE, NULL, 'P', "Use stored machine account password (implies -k)" }, 136 167 { "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" }, 138 171 { NULL } 139 172 };
Note:
See TracChangeset
for help on using the changeset viewer.