2015-07-17 1:02 GMT+03:00 Ted Unangst <[email protected]>:
> Vadim Zhukov wrote:
>> The manpage recommends using absolute paths for commands, but those
>> won't work. :) This patch makes everything not in a list of special
>> characters to be a part of word; this way you can easily put
>> the following in doas.conf:
>>
>>   permit :somepeople cmd /usr/bin/mail [email protected]
>
> I don't think this works even so, since there's no argv[1] checking.

R-r-r-right. But at least the "/usr/bin/mail" part will work now. And
I do know where to steal arguments handling code...

>> The next step will be quotes support, I think?
>>
>> --
>> WBR,
>>   Vadim Zhukov
>>
>>
>> Index: parse.y
>> ===================================================================
>> RCS file: /cvs/src/usr.bin/doas/parse.y,v
>> retrieving revision 1.1
>> diff -u -p -r1.1 parse.y
>> --- parse.y   16 Jul 2015 20:44:21 -0000      1.1
>> +++ parse.y   16 Jul 2015 21:52:46 -0000
>> @@ -183,19 +183,24 @@ yylex(void)
>>                       return c;
>>               case EOF:
>>                       return 0;
>> -             case ':':
>> -                     *p++ = c;
>> -                     c = getc(yyfp);
>> -                     break;
>> -             default:
>> -                     break;
>>       }
>> -     while (isalnum(c)) {
>> +     while (1) {
>> +             switch (c) {
>> +             case '\n':
>> +             case '{':
>> +             case '}':
>> +             case '#':
>> +             case ' ':
>> +             case '\t':
>> +             case EOF:
>> +                     goto eow;
>> +             }
>>               *p++ = c;
>>               if (p == ebuf)
>>                       yyerror("too much stuff");
>>               c = getc(yyfp);
>>       }
>> +eow:
>>       *p = 0;
>>       if (c != EOF)
>>               ungetc(c, yyfp);
>>

--
  WBR,
  Vadim Zhukov

Reply via email to