aboutsummaryrefslogtreecommitdiffstats
path: root/P2
diff options
context:
space:
mode:
authorMatt Strapp <strap012@umn.edu>2020-11-03 09:19:58 -0600
committerMatt Strapp <strap012@umn.edu>2020-11-03 09:19:58 -0600
commitc9ad2b99dcf34ce9ba3685adba622dc2abd665ef (patch)
tree264964541d4893393779fcb25e1185ffb1c067db /P2
parentwrite more (diff)
downloadcsci4061-c9ad2b99dcf34ce9ba3685adba622dc2abd665ef.tar
csci4061-c9ad2b99dcf34ce9ba3685adba622dc2abd665ef.tar.gz
csci4061-c9ad2b99dcf34ce9ba3685adba622dc2abd665ef.tar.bz2
csci4061-c9ad2b99dcf34ce9ba3685adba622dc2abd665ef.tar.lz
csci4061-c9ad2b99dcf34ce9ba3685adba622dc2abd665ef.tar.xz
csci4061-c9ad2b99dcf34ce9ba3685adba622dc2abd665ef.tar.zst
csci4061-c9ad2b99dcf34ce9ba3685adba622dc2abd665ef.zip
Fix dir traversal maybe?????
Diffstat (limited to '')
-rw-r--r--P2/lib/utils.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/P2/lib/utils.c b/P2/lib/utils.c
index 4b2e35f..c7f752d 100644
--- a/P2/lib/utils.c
+++ b/P2/lib/utils.c
@@ -101,10 +101,9 @@ void shuffle(int nMappers, int nReducers) {
DIR *dir = opendir(newpath);
struct dirent* entry;
while ((entry = readdir(dir)) != NULL) {
- char newmsg[200];
if (!strcmp(".", entry->d_name) || !strcmp("..", entry->d_name))
continue;
-
+ sprintf(message.msgText, "%s/%s", newpath, entry -> d_name);
message.msgType = hashFunction(entry -> d_name, nReducers);
printf("%ld\n", message.msgType);
msgsnd(id, &message, chunkSize, 0);