chiark / gitweb /
insufficient rights always produces 51x response
authorrjk@greenend.org.uk <>
Sat, 22 Dec 2007 19:52:35 +0000 (19:52 +0000)
committerrjk@greenend.org.uk <>
Sat, 22 Dec 2007 19:52:35 +0000 (19:52 +0000)
doc/disorder_protocol.5.in
server/server.c

index 6bb28572820c440c11d81832eb3e51e41149a12c..7cb69a7b68cf2983dba6af66be2f6931b8898209 100644 (file)
@@ -320,6 +320,9 @@ The second digit breaks down the origin of the response:
 Generic responses not specific to the handling of the command.  Mostly this is
 parse errors.
 .TP
 Generic responses not specific to the handling of the command.  Mostly this is
 parse errors.
 .TP
+.B 1
+51x errors indicate that the user had insufficient rights for the command.
+.TP
 .B 3
 Authentication responses.
 .TP
 .B 3
 Authentication responses.
 .TP
index dfea91e73360a10d41b8040a12c91fa452c48731..8d49193acded8acdc4c7ff8ef91fcaf40c0771c6 100644 (file)
@@ -248,7 +248,7 @@ static int c_remove(struct conn *c, char **vec,
     r = RIGHT_REMOVE_RANDOM;
   if(!(c->rights & r)) {
     sink_writes(ev_writer_sink(c->w),
     r = RIGHT_REMOVE_RANDOM;
   if(!(c->rights & r)) {
     sink_writes(ev_writer_sink(c->w),
-               "550 Not authorized to remove that track\n");
+               "510 Not authorized to remove that track\n");
     return 1;
   }
   queue_remove(q, c->who);
     return 1;
   }
   queue_remove(q, c->who);
@@ -286,7 +286,7 @@ static int c_scratch(struct conn *c,
     r = RIGHT_SCRATCH_RANDOM;
   if(!(c->rights & r)) {
     sink_writes(ev_writer_sink(c->w),
     r = RIGHT_SCRATCH_RANDOM;
   if(!(c->rights & r)) {
     sink_writes(ev_writer_sink(c->w),
-               "550 Not authorized to scratch that track\n");
+               "510 Not authorized to scratch that track\n");
     return 1;
   }
   scratch(c->who, nvec == 1 ? vec[0] : 0);
     return 1;
   }
   scratch(c->who, nvec == 1 ? vec[0] : 0);
@@ -754,7 +754,7 @@ static int c_volume(struct conn *c,
   }
   rights = set ? RIGHT_VOLUME : RIGHT_READ;
   if(!(c->rights & rights)) {
   }
   rights = set ? RIGHT_VOLUME : RIGHT_READ;
   if(!(c->rights & rights)) {
-    sink_writes(ev_writer_sink(c->w), "530 Prohibited\n");
+    sink_writes(ev_writer_sink(c->w), "510 Prohibited\n");
     return 1;
   }
   if(mixer_control(&l, &r, set))
     return 1;
   }
   if(mixer_control(&l, &r, set))
@@ -877,7 +877,7 @@ static int c_move(struct conn *c,
   }
   if(!has_move_rights(c, &q, 1)) {
     sink_writes(ev_writer_sink(c->w),
   }
   if(!has_move_rights(c, &q, 1)) {
     sink_writes(ev_writer_sink(c->w),
-               "550 Not authorized to move that track\n");
+               "510 Not authorized to move that track\n");
     return 1;
   }
   n = queue_move(q, atoi(vec[1]), c->who);
     return 1;
   }
   n = queue_move(q, atoi(vec[1]), c->who);
@@ -911,7 +911,7 @@ static int c_moveafter(struct conn *c,
     }
   if(!has_move_rights(c, qs, nvec)) {
     sink_writes(ev_writer_sink(c->w),
     }
   if(!has_move_rights(c, qs, nvec)) {
     sink_writes(ev_writer_sink(c->w),
-               "550 Not authorized to move those tracks\n");
+               "510 Not authorized to move those tracks\n");
     return 1;
   }
   queue_moveafter(q, nvec, qs, c->who);
     return 1;
   }
   queue_moveafter(q, nvec, qs, c->who);
@@ -1121,7 +1121,7 @@ static int c_edituser(struct conn *c,
     else
       sink_writes(ev_writer_sink(c->w), "250 OK\n");
   } else
     else
       sink_writes(ev_writer_sink(c->w), "250 OK\n");
   } else
-    sink_writes(ev_writer_sink(c->w), "550 Restricted to administrators\n");
+    sink_writes(ev_writer_sink(c->w), "510 Restricted to administrators\n");
   return 1;
 }
 
   return 1;
 }
 
@@ -1145,7 +1145,7 @@ static int c_userinfo(struct conn *c,
     else
       sink_writes(ev_writer_sink(c->w), "550 No such user\n");
   } else
     else
       sink_writes(ev_writer_sink(c->w), "550 No such user\n");
   } else
-    sink_writes(ev_writer_sink(c->w), "550 Restricted to administrators\n");
+    sink_writes(ev_writer_sink(c->w), "510 Restricted to administrators\n");
   return 1;
 }
 
   return 1;
 }
 
@@ -1309,7 +1309,7 @@ static int command(struct conn *c, char *line) {
   else {
     if(commands[n].rights
        && !(c->rights & commands[n].rights)) {
   else {
     if(commands[n].rights
        && !(c->rights & commands[n].rights)) {
-      sink_writes(ev_writer_sink(c->w), "530 Prohibited\n");
+      sink_writes(ev_writer_sink(c->w), "510 Prohibited\n");
       return 1;
     }
     ++vec;
       return 1;
     }
     ++vec;