diff -Naur nALFS-1.2.0-orig/src/handlers/stage.c nALFS-1.2.0/src/handlers/stage.c
old
|
new
|
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /* getpwnam() is failing in chroot() */ |
116 | | while ((pw = fgetpwent(fp))) { |
| 116 | while ((pw = getpwent())) { |
117 | 117 | if (strcmp(pw->pw_name, user) == 0) { |
118 | 118 | break; |
119 | 119 | } |
diff -Naur nALFS-1.2.0-orig/src/handlers/su.c nALFS-1.2.0/src/handlers/su.c
old
|
new
|
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /* getpwnam() is failing in chroot() */ |
111 | | while ((pw = fgetpwent(fp))) { |
| 111 | while ((pw = getpwent())) { |
112 | 112 | if (strcmp(pw->pw_name, user) == 0) { |
113 | 113 | break; |
114 | 114 | } |
diff -Naur nALFS-1.2.0-orig/src/lib/get_url.c nALFS-1.2.0/src/lib/get_url.c
old
|
new
|
|
48 | 48 | int command_status; |
49 | 49 | struct stat stat_buf; |
50 | 50 | char *temp_file_name; |
51 | | |
| 51 | const char *template_file = ".nALFS.XXXXXX"; |
| 52 | char *buffer = xstrdup(destination); |
| 53 | int temp_file_size = strlen(dirname(buffer)) + 1 + strlen(template_file) + 1; // 1 for / and one for '\0' |
52 | 54 | |
53 | 55 | /* Construct a temporary filename */ |
54 | 56 | |
55 | | temp_file_name = xstrdup(".nALFS.XXXXXX"); |
| 57 | temp_file_name = xmalloc(temp_file_size); |
| 58 | strcat(strcat(strcpy(temp_file_name, buffer), "/"), template_file); |
56 | 59 | if (create_temp_file(temp_file_name)) |
57 | 60 | goto free_all_and_return; |
58 | 61 | /* There is a small risk that another user could create a symlink |
… |
… |
|
103 | 106 | status = 0; |
104 | 107 | |
105 | 108 | free_all_and_return: |
| 109 | xfree(buffer); |
106 | 110 | xfree(temp_file_name); |
107 | 111 | |
108 | 112 | return status; |