mailimage2mysql/m2m: make image world-readable
authorTomas Zeman <tzeman@volny.cz>
Thu, 19 Sep 2013 14:10:57 +0200
changeset 33 49fd54c8c81a
parent 32 27a0248f5f27
child 34 bd1ec89560e0
mailimage2mysql/m2m: make image world-readable
mailimage2mysql/m2m
--- a/mailimage2mysql/m2m	Thu Sep 19 13:23:11 2013 +0200
+++ b/mailimage2mysql/m2m	Thu Sep 19 14:10:57 2013 +0200
@@ -61,6 +61,7 @@
 			ts=$(date '+%F %T')
 			cat "$f" > $imgfolder/$fn.tmp
 			mv $imgfolder/$fn.tmp $imgfolder/$fn
+			chmod 644 $imgfolder/$fn
 			printf "INSERT INTO $imgtable (file_name, orig_name, mime_type, mail_from, mail_date, mail_message_id, ts) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s');\n" "$fn" "$on" "$mt" "$mfrom" "$mdate" "$mmsgid" "$ts" | $mysql_cmd
 		fi
 	done < <(find $mdir -type f -name "$pat" -print0)