On Thursday 20 November 2003 13:31, Kay Sievers wrote:> +                       for (i=0; i < CALLOUT_MAXARG; i++) {> +                               args[i] = strsep(&arg, " ");> +                               if (args[i] = NULL)> +                                       break;> +                       }> +                       if (args[i])> +                               dbg("to many args"); This still doesn't look correct: args[i] will be out of boundswhen the loop has finished on CALLOUT_MAXARG, and the argsarray is not zero terminated when calling execve. I haven't tried it yet, but I think this would make more sense: +                       for (i=0; i < CALLOUT_MAXARG-1; i++) {+                               args[i] = strsep(&arg, " ");+                               if (args[i] = NULL)+                                       break;+                       }+ args[i] = arg;+                       if (args[i])+                               dbg("to many args"); Aside from that, it looks good. Maybe there should be a way to escapespaces in the argument in case someone wants to do something like that: CALLOUT, PROGRAM="sh -c 'echo ${DEVPATH} | tr a-z A-Z'", BUS="usb", ID="XXX", NAME="webcam%n" To take that even further, do you think it might be a good idea to preprocess the string in the same way as the NAME= argument, allowing e.g.PROGRAM="/bin/devname %b %M:%m" ? Arnd <><ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÓ†+ù޵隊X¬²š'²ŠÞu¼ÿH_çzÑ¢½æÚrCë¢Ú›ðèzĨº·Šà{ùÞ¶¥§*.m騭êk¡Ûœ¶+Þü:²+azZr¢ç+y«^mëmz·(uïÒDLq 9QÿjwazZn²¥¥ƒ”ü)brAÞ­ïá¶Úÿÿû(º·~Šà{ùÞ·÷h«^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.)îÇøh¶™nƒ÷^½éfj)bž b²Øm¶ŸÿþX§»á¢Úeºì¢êÜyú+ïçzÒâžìÿ†‹i–èÿuëÞ—ùb²Ûÿ²‹«qçè®ÿëa¶ÚlÿÿåŠËlþÊ.­ÇŸ¢¸þw­þX¬¶ÏåŠËbú?–)îÇøh¶™nƒ÷^