Re: [PATCH 1/4] Allow creation of arbitrary git-shell commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> +                     user_argv[0] = prog;
>> +                     execv(user_argv[0], (char *const *) user_argv);
>> +                     free(prog);
>> +             }
>> +             free(user_argv);
>> +             /*
>> +              * split_cmdline modifies its argument in-place, so 'prog' now
>> +              * holds the actual command name
>> +              */
>> +             die("unrecognized command '%s'", prog_cpy);
>> +     } else {
>> +             /*
>> +              * split_cmdline has clobbered prog and printed an
>> +              * error message, so print the original
>> +              */
>> +             die("invalid command format '%s'", prog_cpy);
>
> Hmm, we might want to fix split_cmdline to report the breakage better
> then (perhaps not as part of this patch series).  Instead of seeing
>
>    error: cmdline ends with \.
>    fatal: invalid command format 'foo bar \'.
>
> wouldn't it be nicer to see a single error message:
>
>    fatal: invalid command 'foo bar\': cmdline ends with \.
>
That would definitely be preferable.  If possible, I would rather not
do it as part of this patch series, but would be happy to work on
fixing split_cmdline afterwards.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]