47
50
if(strcmp(optarg, "linux") == 0) os_type = LINUX;
48
else if(strcmp(optarg, "windowsxp") == 0)
51
else if(strcmp(optarg, "windowsxp") == 0) {
49
52
os_type = WINDOWSXP;
53
initialize_registry_paths();
84
89
target = windowsxp_import_userpicture;
85
90
else if(strcmp(optarg, "wallpaper") == 0)
86
91
target = windowsxp_import_wallpaper;
87
else if(strcmp(optarg, "mozillafirefox") == 0)
88
target = firefox_import_firefox;
89
else if(strcmp(optarg, "internetexplorer") == 0)
90
target = firefox_import_internetexplorer;
91
else if(strcmp(optarg, "opera") == 0)
92
target = firefox_import_opera;
93
else if(strcmp(optarg, "outlookexpress") == 0)
94
target = evolution_import_outlookexpress;
95
else if(strcmp(optarg, "evolution") == 0)
96
target = evolution_import_evolution;
92
else if(strcmp(optarg, "mozillafirefox") == 0)
93
target = firefox_import_firefox;
94
else if(strcmp(optarg, "internetexplorer") == 0)
95
target = firefox_import_internetexplorer;
96
else if(strcmp(optarg, "opera") == 0)
97
target = firefox_import_opera;
98
else if(strcmp(optarg, "outlookexpress") == 0)
99
target = evolution_import_outlookexpress;
100
else if(strcmp(optarg, "evolution") == 0)
101
target = evolution_import_evolution;
106
111
if((from_user && to_user) && (from_location && to_location)) {
108
// Instead of chowning everything we create, we just drop to the user
109
// we're working with. Not entirely sure if this is a good/bad idea.
115
asprintf(&passwd_file, "%s/etc/passwd", to_location);
116
fp = fopen(passwd_file, "r");
119
while((p = fgetpwent(fp)) != NULL) {
120
if(strcmp(p->pw_name, to_user) == 0) {
117
// Instead of chowning everything we create, we just drop to the user
118
// we're working with. Not entirely sure if this is a good/bad idea.
119
asprintf(&passwd_file, "%s/etc/passwd", to_location);
120
fp = fopen(passwd_file, "r");
123
while((p = fgetpwent(fp)) != NULL) {
124
if(strcmp(p->pw_name, to_user) == 0) {
132
fprintf(stderr, "Unable to open %s\n", passwd_file);
134
// vim:ai:et:sts=4:tw=80:sw=4:
143
/* vim:ai:et:sts=4:tw=80:sw=4: */