2 * rs-serve - (c) 2013 Niklas E. Cathor
4 * This program is distributed in the hope that it will be useful,
5 * but WITHOUT ANY WARRANTY; without even the implied warranty of
6 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7 * GNU Affero General Public License for more details.
9 * You should have received a copy of the GNU Affero General Public License
10 * along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #include "common/auth.h"
26 static void print_usage(char *progname) {
27 fprintf(stderr, "Usage: %s <user> <token>\n", progname);
30 int main(int argc, char **argv) {
35 open_authorizations("r+");
36 struct rs_authorization auth;
37 auth.username = argv[1];
39 int success = remove_authorization(&auth);
40 close_authorizations();
41 fprintf(stderr, (success == DB_NOTFOUND) ? "Token not found!\n" : (success == 0 ? "Token removed.\n" : "Error removing token!\n"));