From e86021e471a791861799a16efe11ce9fa3452de2 Mon Sep 17 00:00:00 2001 Message-Id: From: Mark Wooding Date: Fri, 21 Dec 2007 13:15:04 +0000 Subject: [PATCH] remove become from client; more docs updates Organization: Straylight/Edgeware From: Richard Kettlewell --- clients/authorize.c | 2 +- clients/disorder.c | 7 ------ doc/disorder.1.in | 53 +++++++++++++++++++++------------------------ 3 files changed, 26 insertions(+), 36 deletions(-) diff --git a/clients/authorize.c b/clients/authorize.c index 8697abe..bb6d366 100644 --- a/clients/authorize.c +++ b/clients/authorize.c @@ -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) { diff --git a/clients/disorder.c b/clients/disorder.c index 1491b2e..5b43b09 100644 --- a/clients/disorder.c +++ b/clients/disorder.c @@ -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]", diff --git a/doc/disorder.1.in b/doc/disorder.1.in index 8e8c010..fa81dba 100644 --- a/doc/disorder.1.in +++ b/doc/disorder.1.in @@ -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 -- [mdw]