chiark / gitweb /
remove become from client; more docs updates
authorRichard Kettlewell <rjk@greenend.org.uk>
Fri, 21 Dec 2007 13:15:04 +0000 (13:15 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Fri, 21 Dec 2007 13:15:04 +0000 (13:15 +0000)
clients/authorize.c
clients/disorder.c
doc/disorder.1.in

index 8697abe21fdab488d28c756df957f3d4d16e6da2..bb6d3665ec935a07626ec5767e82da18732048aa 100644 (file)
@@ -38,7 +38,7 @@
 
 /** @brief Create a DisOrder login for the calling user, called @p user
  * @param client DisOrder client
- * @param user Username to create
+ * @param user Username to create (UTF-8)
  * @return 0 on success, non-0 on error
  */
 int authorize(disorder_client *client, const char *user) {
index 1491b2e17e90de130dfaf4571c3fd73e290d4d49..5b43b099bae5bb1b1cab78068f992ccd2254285f 100644 (file)
@@ -302,11 +302,6 @@ static void cf_set_volume(disorder_client *c,
   if(disorder_set_volume(c, atoi(argv[0]), atoi(argv[1]))) exit(EXIT_FAILURE);
 }
 
-static void cf_become(disorder_client *c,
-                     char **argv) {
-  if(disorder_become(c, argv[0])) exit(EXIT_FAILURE);
-}
-
 static void cf_log(disorder_client *c,
                   char attribute((unused)) **argv) {
   if(disorder_log(c, sink_stdio("stdout", stdout))) exit(EXIT_FAILURE);
@@ -460,8 +455,6 @@ static const struct command {
                       "List all files and directories in DIR" },
   { "authorize",      1, 1, cf_authorize, 0, "USER",
                       "Authorize USER to connect to the server" },
-  { "become",         1, 1, cf_become, 0, "USER",
-                      "Become user USER" },
   { "deluser",        1, 1, cf_deluser, 0, "USER",
                       "Delete a user" },
   { "dirs",           1, 2, cf_dirs, isarg_regexp, "DIR [~REGEXP]",
index 8e8c0108e66c0c2e8a6df25c237831a27ecd2014..fa81dbaf0f754700baf1d62a16210fef3955b2e7 100644 (file)
@@ -57,6 +57,13 @@ List all known commands.
 .B adduser \fIUSER PASSWORD\fR
 Create a new user with default rights.
 .TP
+.B authorize \fIUSER\fR
+Chooses a password for \fIUSER\fR and adds it to \fIconfig.private\fR.  Also
+creates an appropriate \fIconfig.USER\fR, be owned by the user.
+.IP
+If at least one \fBauthorize\fR command succeeds then the server is
+automatically told to re-read its configuration.
+.TP
 .B deluser \fIUSER\fR
 Delete a user.
 .TP
@@ -141,9 +148,17 @@ Enable random play.
 List recently played tracks.  The first entry is the oldest track, the last
 entry is the most recently played one.
 .TP
+.B reconfigure
+Make the daemon reload its configuration file.
+.TP
 .B remove \fITRACK\fR
 Remove a track from the queue.
 .TP
+.B rescan
+Rescan the filesystem for new tracks.  There is an automatic daily rescan but
+if you've just added some tracks and want them to show up immediately, use this
+command.
+.TP
 .B resolve \fITRACK\fR
 Resolve aliases for \fITRACK\fR and print out the real track name.
 .TP
@@ -180,6 +195,9 @@ Set a global preference.
 .B set-volume \fBLEFT\fR \fBRIGHT\fR
 Sets the volume.
 .TP
+.B shutdown
+Shut down the daemon.
+.TP
 .B stats
 List server statistics.
 .TP
@@ -204,22 +222,6 @@ and
 .BR remove ,
 tracks may be specified by name or by ID.  If you use the name and a track
 appears twice in the queue it is undefined which is affected.
-.SS "Privileged Commands"
-These commands are only available to privileged users.
-.TP
-.B become \fIUSER\fR
-Become another user.
-.TP
-.B reconfigure
-Make the daemon reload its configuration file.
-.TP
-.B rescan
-Rescan the filesystem for new tracks.  There is an automatic daily rescan but
-if you've just added some tracks and want them to show up immediately, use this
-command.
-.TP
-.B shutdown
-Shut down the daemon.
 .SH PREFERENCES
 Currently the following preferences are supported.  Some are expected
 to be set by users, others updated automatically by plugins.
@@ -264,23 +266,18 @@ is not present.
 .B unscratched
 The number of times the track has been played to completion without
 being scratched.
-.SH "Superuser Commands"
-These commands will (generally) only work for root, who must be a privileged
-user.
-.TP
-.B authorize \fIUSER\fR
-Chooses a password for \fIUSER\fR and adds it to \fIconfig.private\fR.  Also
-creates an appropriate \fIconfig.USER\fR, be owned by the user.
-.IP
-If at least one \fBauthorize\fR command succeeds then the server is
-automatically told to re-read its configuration.
 .SH NOTES
 .B disorder
 is locale-aware.  If you do not set the locale correctly then it may
 not handle non-ASCII data properly.
 .PP
-The client determines which user to attempt to authenticate as by
-examining the current UID.
+The client determines which user to attempt to authenticate as by examining the
+current UID.  This can be overridden in a per-user configuration file, see
+\fBdisorder_config\fR(5).
+.PP
+See \fBdisorder_protocol\fR(5) for the rights required to run each command.
+(For instance, \fBshutdown\fR requires the \fBadmin\fR right, which most users
+would not normally have.)
 .PP
 This program is not intended to run in a setuid environment.
 .PP