sss_ssh_authorizedkeys.c revision fcbcfa69f9291936f01f24b5fcb5a7672dca46f3
6b26240dca29e026900a83d51c75ca230a072a16Thiemo Wiedemeyer Jan Cholasta <jcholast@redhat.com>
98890889ffb2e8f6f722b00e265a211f13b5a861Corneliu-Claudiu Prodescu Copyright (C) 2012 Red Hat
2eeec5240b424984e3ee26296da1eeab6c6d739eChristian Maeder This program is free software; you can redistribute it and/or modify
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer it under the terms of the GNU General Public License as published by
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer the Free Software Foundation; either version 3 of the License, or
7520452bb30b5abbd471f82352fc4c1c937e02c5Till Mossakowski (at your option) any later version.
7520452bb30b5abbd471f82352fc4c1c937e02c5Till Mossakowski This program is distributed in the hope that it will be useful,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer but WITHOUT ANY WARRANTY; without even the implied warranty of
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer GNU General Public License for more details.
d7aa4e1cbe00f7f3add4da911673b3b176b140c3Thiemo Wiedemeyer You should have received a copy of the GNU General Public License
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer along with this program. If not, see <http://www.gnu.org/licenses/>.
8836fa284a241af325aa6f41234b5130b26ec4f9Thiemo Wiedemeyer { "debug", '\0', POPT_ARG_INT | POPT_ARGFLAG_DOC_HIDDEN, &pc_debug, 0,
331603b37dec12e37e2e1df9634ef0f2c5c73ddfThiemo Wiedemeyer { "domain", 'd', POPT_ARG_STRING, &pc_domain, 0,
c208973c890b8f993297720fd0247bc7481d4304Christian Maeder "set_locale() failed (%d): %s\n", ret, strerror(ret));
d1066b8fb69179973dcab47154858d77e72760a7Thiemo Wiedemeyer /* parse parameters */
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer pc = poptGetContext(NULL, argc, argv, long_options, 0);
1e3aca4178372af672efb237d16087c603fe5564Christian Maeder BAD_POPT_PARAMS(pc, poptStrerror(ret), ret, fini);
f7b9d64160c23654b7288a3b0ee3e2b95af3e752Thiemo Wiedemeyer BAD_POPT_PARAMS(pc, _("User not specified\n"), ret, fini);
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer /* look up public keys */
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer ret = sss_ssh_get_ent(mem_ctx, SSS_SSH_GET_USER_PUBKEYS,
53e76316f409f6b1b57ed3d2e5cb9cfe1cb511e5Thiemo Wiedemeyer "The user %s is valid, but not handled by sssd\n", pc_user);
28ca54b0d63d1d26a991711c8c7e85c474994715Christian Maeder "sss_ssh_get_ent() failed (%d): %s\n", ret, strerror(ret));
331603b37dec12e37e2e1df9634ef0f2c5c73ddfThiemo Wiedemeyer /* print results */
d7aa4e1cbe00f7f3add4da911673b3b176b140c3Thiemo Wiedemeyer ret = sss_ssh_format_pubkey(mem_ctx, &ent->pubkeys[i], &repr);
32d98ca5e560cf6c1062a0463be4c350af32bed5Thiemo Wiedemeyer "sss_ssh_format_pubkey() failed (%d): %s\n",