On Mon, Sep 06, 2010 at 06:18:00PM -0700, Brock Pytlik wrote:
> webrev:
> http://cr.opensolaris.org/~bpytlik/ips-16852-v1/
>
> Bugs:
> 16852 pkg should look at its image for certs if active image
> lacks certs
> 16919 pkg should look to image relative directories for certs
In general, I think this is fine. I wondered if it's actually necessary
to copy the pkg command into the newly created image, but I don't have
really strong feelings about this.
At least for C programs, it's entirely possible to call exec(2) with
argv containing no arguments. As an example:
#include <stdio.h>
int
main(int argc, char *argv[])
{
int i;
printf("argc: %d\n", argc);
for (i = 0; i < argc; i++) {
printf("arg[%d] = %s\n", i, argv[i]);
}
return (0);
}
and
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int
main(void)
{
int rc;
char *args[1];
args[0] = NULL;
rc = execv("/home/johansen/args", args);
if (rc < 0) {
perror("execv");
exit(EXIT_FAILURE);
}
return (0);
}
If I run the first program from the shell, I get this:
$ ./args
argc: 1
arg[0] = ./args
However, if I run it using the second program, I can get this:
$ ./exec_test
argc: 0
Because Python uses the #! interpreter syntax from the shell, we may not
have as much flexibility about modifying argv with exec, but at least
from C, you can supply whatever you want in argv[] as long as the
executable argument points at something legit.
-j
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss