<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>Andrew Price pushed to branch master at <a href="https://projects.sucs.org/arthur/mw">Justin Mitchell / mw</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/285b561f65e7a676e7e7cdb42c85c5cb8dbaeea5">285b561f</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-07T20:56:03Z</i>
</div>
<pre class='commit-message'>Improve mw.service

- Run as mw:mw
- Make systemd create and cleanup /var/run/mw for us
- Correct the path to mwserv</pre>
</li>
<li>
<strong><a href="https://projects.sucs.org/arthur/mw/commit/54027aa0d6cd0baab2a5bd53d01c77ed4241b85a">54027aa0</a></strong>
<div>
<span>by Andrew Price</span>
<i>at 2015-11-07T21:05:41Z</i>
</div>
<pre class='commit-message'>Migrate folders to directories after setuid

Makes sure we don't create the directories with root ownership.

Also make mwserv's stdout line buffered to work better with logging
systems which capture stdout.</pre>
</li>
</ul>
<h4>4 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
mw.service
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
src/server/mwserv.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
src/server/servsock.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
src/server/servsock.h
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://projects.sucs.org/arthur/mw/compare/d881fc863cfee125b72b8c07e89090b7a4dceeb6...54027aa0d6cd0baab2a5bd53d01c77ed4241b85a#diff-0'>
<strong>
mw.service
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/mw.service
</span><span style="color: #000000;background-color: #ddffdd">+++ b/mw.service
</span><span style="color: #aaaaaa">@@ -3,9 +3,10 @@ Description=Milliways server
</span> After=network.target
 
 [Service]
<span style="color: #000000;background-color: #ffdddd">-ExecStartPre=-/bin/mkdir /var/run/mw
-ExecStartPre=/bin/chown -R mw:mw /var/run/mw
-ExecStart=/usr/bin/mwserv --foreground --port 9999
</span><span style="color: #000000;background-color: #ddffdd">+User=mw
+Group=mw
+RuntimeDirectory=mw
+ExecStart=/usr/lib/mw/mwserv --foreground --port 9999
</span> 
 [Install]
 WantedBy=multi-user.target
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://projects.sucs.org/arthur/mw/compare/d881fc863cfee125b72b8c07e89090b7a4dceeb6...54027aa0d6cd0baab2a5bd53d01c77ed4241b85a#diff-1'>
<strong>
src/server/mwserv.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/server/mwserv.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/server/mwserv.c
</span><span style="color: #aaaaaa">@@ -177,7 +177,11 @@ int main(int argc, char **argv)
</span>           }
        }
 
<span style="color: #000000;background-color: #ffdddd">-        if (!cfg_get_bool("foreground")) daemon(0, 0);
</span><span style="color: #000000;background-color: #ddffdd">+   migrate_old_folders();
+       if (cfg_get_bool("foreground"))
+               setlinebuf(stdout);
+       else
+               daemon(0, 0);
</span> 
        uptime = time(0);
        watch_mainsock(mainsock);
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://projects.sucs.org/arthur/mw/compare/d881fc863cfee125b72b8c07e89090b7a4dceeb6...54027aa0d6cd0baab2a5bd53d01c77ed4241b85a#diff-2'>
<strong>
src/server/servsock.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/server/servsock.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/server/servsock.c
</span><span style="color: #aaaaaa">@@ -597,7 +597,7 @@ static char *has_suffix(char *str, const char *suffix)
</span>   return NULL;
 }
 
<span style="color: #000000;background-color: #ffdddd">-static void migrate_old_folders(void)
</span><span style="color: #000000;background-color: #ddffdd">+void migrate_old_folders(void)
</span> {
        int dfd;
        DIR *dirp;
<span style="color: #aaaaaa">@@ -682,8 +682,6 @@ static void migrate_old_folders(void)
</span> 
 void init_server()
 {
<span style="color: #000000;background-color: #ffdddd">-        migrate_old_folders();
-
</span>   INIT_LIST_HEAD(&connection_list);
        if (pollfd == -1) {
                pollfd = epoll_create(30);
</code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://projects.sucs.org/arthur/mw/compare/d881fc863cfee125b72b8c07e89090b7a4dceeb6...54027aa0d6cd0baab2a5bd53d01c77ed4241b85a#diff-3'>
<strong>
src/server/servsock.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/src/server/servsock.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/src/server/servsock.h
</span><span style="color: #aaaaaa">@@ -15,6 +15,7 @@ int msg_attach_to_userid(ipc_message_t *msg, uint32_t userposn);
</span> int msg_attach_to_username(ipc_message_t *msg, const char *username);
 void msg_attach_to_channel(ipc_message_t *msg, int channel, const char * exclude);
 void msg_attach(ipc_message_t *msg, ipc_connection_t *conn);
<span style="color: #000000;background-color: #ddffdd">+void migrate_old_folders(void);
</span> void init_server(void);
 void send_error(ipc_connection_t *conn, ipc_message_t *orig, const char *format, ...);
 void msg_apply_gag(struct user * from, ipc_message_t * msg, const char * field);
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://projects.sucs.org/arthur/mw/compare/d881fc863cfee125b72b8c07e89090b7a4dceeb6...54027aa0d6cd0baab2a5bd53d01c77ed4241b85a">View it on GitLab</a>
<br>
You're receiving this email because of your account on <a href="https://projects.sucs.org/">projects.sucs.org</a>.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":["merge_requests","issues","commit"],"url":"https://projects.sucs.org/arthur/mw/compare/d881fc863cfee125b72b8c07e89090b7a4dceeb6...54027aa0d6cd0baab2a5bd53d01c77ed4241b85a"}}</script>
</p>
</div>
</body>
</html>