commit 43da379bc3259b0c368f63be06e100e768955240
parent ec882aa0fa04202e102a4e40cc2c5ec00b3c0f62
Author: kocotian <kocotian@kocotian.pl>
Date: Mon, 9 Nov 2020 20:55:15 +0100
authorization tweaks
Diffstat:
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/nmps b/nmps
Binary files differ.
diff --git a/nmps.c b/nmps.c
@@ -15,14 +15,14 @@
extern void herror(const char *s);
-static size_t authorize(const char *host, const char *port, const char *username, const char *password);
+static size_t authorize(char *host, const char *port, char *username, char *password);
static size_t request(char *hostname, unsigned short port, char *command, char *args[], char **buffer);
static void usage(void);
char *argv0;
static size_t
-authorize(const char *host, const char *port, const char *username, const char *password)
+authorize(char *host, const char *port, char *username, char *password)
{
size_t size;
char *buffer, *args[] = {username, password, NULL};
@@ -32,8 +32,9 @@ authorize(const char *host, const char *port, const char *username, const char *
if(!strcmp(truncateHeader(buffer), "Authorized"))
return size;
else
- die("%s", truncateHeader(buffer));
+ die("Permission denied: %s", truncateHeader(buffer));
}
+ return 0;
}
static size_t