]> the.earth.li Git - onak.git/blobdiff - keyd.c
Cleanup postinst to avoid recursive chown of database
[onak.git] / keyd.c
diff --git a/keyd.c b/keyd.c
index a7b797c538f8b0b154bc10b2ee1b1b8f04e7b4cb..ddd1366a9bb7c94b56b6d31fc7b181005ae2c663 100644 (file)
--- a/keyd.c
+++ b/keyd.c
@@ -13,8 +13,7 @@
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 51
- * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <errno.h>
@@ -33,7 +32,7 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "config.h"
+#include "build-config.h"
 
 #ifdef HAVE_SYSTEMD
 #include <systemd/sd-daemon.h>
@@ -49,7 +48,6 @@
 #include "mem.h"
 #include "onak-conf.h"
 #include "parsekey.h"
-#include "version.h"
 
 /* Maximum number of clients we're prepared to accept at once */
 #define MAX_CLIENTS 16
@@ -446,8 +444,9 @@ static int sock_do(struct onak_dbctx *dbctx, int fd)
                                ret = 1;
                        }
                        if (ret == 0) {
-                               bytes = read(fd, &keyid, sizeof(keyid));
-                               if (bytes != sizeof(keyid)) {
+                               bytes = read(fd, &fingerprint,
+                                               sizeof(fingerprint));
+                               if (bytes != sizeof(fingerprint)) {
                                        ret = 1;
                                }
                        }
@@ -457,32 +456,7 @@ static int sock_do(struct onak_dbctx *dbctx, int fd)
                                                ", result: %d",
                                                keyid,
                                                dbctx->delete_key(dbctx,
-                                                       keyid, false));
-                       }
-                       break;
-               case KEYD_CMD_GETFULLKEYID:
-                       if (!keyd_write_reply(fd, KEYD_REPLY_OK)) {
-                               ret = 1;
-                       }
-                       if (ret == 0) {
-                               bytes = read(fd, &keyid, sizeof(keyid));
-                               if (bytes != sizeof(keyid)) {
-                                       ret = 1;
-                               }
-                       }
-                       if (ret == 0) {
-                               keyid = dbctx->getfullkeyid(dbctx, keyid);
-                               cmd = sizeof(keyid);
-                               bytes = write(fd, &cmd, sizeof(cmd));
-                               if (bytes != sizeof(cmd)) {
-                                       ret = 1;
-                               }
-                       }
-                       if (ret == 0) {
-                               bytes = write(fd, &keyid, sizeof(keyid));
-                               if (bytes != sizeof(keyid)) {
-                                       ret = 1;
-                               }
+                                                       &fingerprint, false));
                        }
                        break;
                case KEYD_CMD_KEYITER: