~ubuntu-branches/ubuntu/vivid/samba/vivid

« back to all changes in this revision

Viewing changes to source4/lib/cmdline/popt_common.c

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        const char *pname;
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
73
73
                 * the smb.conf is setup' functions here */
83
83
                pname++;
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 */
89
89
                /* setup for panics */
108
108
                break;
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);
114
114
                }
115
115
                break;
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
 
121
121
        case OPT_DEBUG_STDERR:
124
124
 
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;
130
130
 
131
131
        case 'l':
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
                }
137
137
                break;
152
152
        switch(opt->val) {
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
 
187
187
        }