]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - mysql_selector.c
list.h add doxygen file comment
[paraslash.git] / mysql_selector.c
index 45a10bac0e9264e96b38dda81b7233370c02958e..a2a5bcddaf8b031cb10a02660285f9aa93510b36 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1999-2006 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1999-2007 Andre Noll <maan@systemlinux.org>
  *
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
 /** \endcond */
 #include "server.cmdline.h"
 #include "server.h"
-#include "afs.h"
+#include "vss.h"
 #include "db.h"
 #include <mysql/mysql.h>
 #include <mysql/mysql_version.h>
 #include "error.h"
 #include "net.h"
 #include "string.h"
+#include "user_list.h"
 
 /** pointer to the shared memory area */
 extern struct misc_meta_data *mmd;
@@ -112,7 +113,7 @@ static struct server_command cmds[] = {
 {
 .name = "cs",
 .handler = com_cs,
-.perms = AFS_WRITE | DB_READ | DB_WRITE,
+.perms = VSS_WRITE | DB_READ | DB_WRITE,
 .description = "change stream",
 .synopsis = "cs [s]",
 .help =
@@ -123,7 +124,7 @@ static struct server_command cmds[] = {
 {
 .name = "csp",
 .handler = com_cs,
-.perms = AFS_WRITE | DB_READ,
+.perms = VSS_WRITE | DB_READ,
 .description = "change stream and play",
 .synopsis = "csp s",
 .help =
@@ -288,7 +289,7 @@ static struct server_command cmds[] = {
 {
 .name = "ns",
 .handler = com_ps,
-.perms = AFS_WRITE | DB_READ | DB_WRITE,
+.perms = VSS_WRITE | DB_READ | DB_WRITE,
 .description = "change to next stream",
 .synopsis = "ns",
 .help =
@@ -376,7 +377,7 @@ static struct server_command cmds[] = {
 {
 .name = "ps",
 .handler = com_ps,
-.perms = AFS_WRITE | DB_READ | DB_WRITE,
+.perms = VSS_WRITE | DB_READ | DB_WRITE,
 .description = "change to previous stream",
 .synopsis = "ps",
 .help =
@@ -1501,11 +1502,11 @@ static int com_mv(__a_unused int fd, int argc, char *argv[])
        ret = -E_ESCAPE;
        ebn1 = escaped_basename(argv[1]);
        ebn2 = escaped_basename(argv[2]);
-       if (!ebn1 || !ebn2 | !*ebn1 || !*ebn2)
+       if (!ebn1 || !ebn2 || !*ebn1 || !*ebn2)
                goto out;
        ret = -E_MYSQL_SYNTAX;
        if (!strcmp(ebn1, ebn2))
-               goto out;
+               goto update_dir;
        remove_entry(argv[2]); /* no need to escape, ignore error */
        q = make_message("update data set name = '%s' where name = '%s'",
                ebn2, ebn1);
@@ -1522,6 +1523,7 @@ static int com_mv(__a_unused int fd, int argc, char *argv[])
        free(q);
        if (ret < 0)
                goto out;
+update_dir:
        ret = 1;
        dn = para_dirname(argv[2]);
        if (!dn)
@@ -2072,9 +2074,9 @@ static int com_cs(int fd, int argc, char *argv[])
        }
        if (csp) {
                mmd_lock();
-               mmd->new_afs_status_flags |= AFS_PLAYING;
+               mmd->new_vss_status_flags |= VSS_PLAYING;
                if (stream_change)
-                       mmd->new_afs_status_flags |= AFS_NEXT;
+                       mmd->new_vss_status_flags |= VSS_NEXT;
                mmd_unlock();
        }
        ret = 1;