4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Although ":set" is not allowed in the sandbox, ":let &opt = val"
13 Solution: Do allow changing options in the sandbox, but not the ones that
14 can't be changed from a modeline.
15 Files: src/ex_cmds.h, src/option.c
18 *** ../vim-6.2.264/src/ex_cmds.h Tue Feb 10 19:35:15 2004
19 --- src/ex_cmds.h Mon Feb 16 17:06:54 2004
22 EX(CMD_scscope, "scscope", do_scscope,
23 EXTRA|NOTRLCOM|SBOXOK),
24 EX(CMD_set, "set", ex_set,
25 ! TRLBAR|EXTRA|CMDWIN),
26 EX(CMD_setfiletype, "setfiletype", ex_setfiletype,
27 TRLBAR|EXTRA|NEEDARG|CMDWIN),
28 EX(CMD_setglobal, "setglobal", ex_set,
30 EX(CMD_scscope, "scscope", do_scscope,
31 EXTRA|NOTRLCOM|SBOXOK),
32 EX(CMD_set, "set", ex_set,
33 ! TRLBAR|EXTRA|CMDWIN|SBOXOK),
34 EX(CMD_setfiletype, "setfiletype", ex_setfiletype,
35 TRLBAR|EXTRA|NEEDARG|CMDWIN),
36 EX(CMD_setglobal, "setglobal", ex_set,
37 *** ../vim-6.2.264/src/option.c Wed Feb 4 21:42:30 2004
38 --- src/option.c Tue Feb 17 11:17:55 2004
46 + /* Disallow changing some options in the sandbox */
47 + if (sandbox > 0 && (flags & P_SECURE))
49 + errmsg = (char_u *)_(e_sandbox);
54 if (vim_strchr((char_u *)"?=:!&<", nextchar) != NULL)
63 opt_idx = findoption(name);
65 EMSG2(_("E355: Unknown option: %s"), name);
66 - else if (options[opt_idx].flags & P_STRING)
67 - set_string_option(opt_idx, string, opt_flags);
70 ! varp = get_varp(&options[opt_idx]);
71 ! if (varp != NULL) /* hidden option is not changed */
73 ! if (options[opt_idx].flags & P_NUM)
74 ! (void)set_num_option(opt_idx, varp, number, NULL, opt_flags);
76 ! (void)set_bool_option(opt_idx, varp, (int)number, opt_flags);
86 opt_idx = findoption(name);
88 EMSG2(_("E355: Unknown option: %s"), name);
91 ! flags = options[opt_idx].flags;
93 ! /* Disallow changing some options in the sandbox */
94 ! if (sandbox > 0 && (flags & P_SECURE))
98 ! if (flags & P_STRING)
99 ! set_string_option(opt_idx, string, opt_flags);
102 ! varp = get_varp(&options[opt_idx]);
103 ! if (varp != NULL) /* hidden option is not changed */
106 ! (void)set_num_option(opt_idx, varp, number, NULL, opt_flags);
108 ! (void)set_bool_option(opt_idx, varp, (int)number, opt_flags);
113 *** ../vim-6.2.264/src/version.c Tue Feb 17 20:22:36 2004
114 --- src/version.c Tue Feb 17 20:38:04 2004
118 { /* Add new patch number below this line */
124 In Joseph Heller's novel "Catch-22", the main character tries to get out of a
125 war by proving he is crazy. But the mere fact he wants to get out of the war
126 only shows he isn't crazy -- creating the original "Catch-22".
128 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
129 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
130 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
131 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///