I'm writing a small utility that uses the nidump command (I'm on OS X, and a lot of info on the system is located in the NetInfo database - that can be reached through the command line via the nidump command), fork() an execve(). The problem is that no file is created and no output is collected from NetInfo; The application failes completely.

The filename is given by the user (argv[1]), and the exec funtion I chose to execute the nidump command, with arguments, was execve. I'm not sure it's the right one to use, though, as it doesn't seem to work right (maybe it's just me that's a bit rusty). Anyway, here's some code:
Code:
int main(int argc, char *argv[]) {
 
    int PID, status, waitsignal;
    char *args[] = {">> . ", argv[1], NULL}; // this isn't working correct
    
    printf("OS X pssword file dumping\n");
    
    if(argc < 2) {
        printf("usage: %s <filename>\n", argv[0]);
        exit(0);
    }
    
    PID = fork();
    
    if(PID == -1) {
        
        perror("fork error");
        exit(EXIT_FAILURE);
        
    } else if(PID == 0) {
        
        printf("child pid: %d\n", getpid());
        execve("/usr/bin/nidump passwd", args, NULL); // this isn't working correct either
        
        if(errno == -1) {
            perror("error");
        } else {
            //printf("nidump process completed!\n");
        }

[...]
I know there's something wrong with the args variable and the execve function, but I can't figure it out. Where should the argument for the command (nidump) be placed? Should I use another exec function instead?