]> git.ipfire.org Git - thirdparty/rsync.git/commitdiff
Change name map funcs to return a const char*.
authorWayne Davison <wayne@opencoder.net>
Mon, 6 Jul 2020 05:17:09 +0000 (22:17 -0700)
committerWayne Davison <wayne@opencoder.net>
Mon, 6 Jul 2020 05:17:09 +0000 (22:17 -0700)
authenticate.c
uidlist.c

index 3ef83ef2abf5791ea859f837b1627c9d1c15992d..8fd6ff69b3d06365d645ce2ae99c8f50ad9e031c 100644 (file)
@@ -227,7 +227,7 @@ char *auth_server(int f_in, int f_out, int module, const char *host,
        char *users = lp_auth_users(module);
        char challenge[MAX_DIGEST_LEN*2];
        char line[BIGPATHBUFLEN];
-       char **auth_uid_groups = NULL;
+       const char **auth_uid_groups = NULL;
        int auth_uid_groups_cnt = -1;
        const char *err = NULL;
        int group_match = -1;
@@ -287,7 +287,7 @@ char *auth_server(int f_in, int f_out, int module, const char *host,
                                else {
                                        gid_t *gid_array = gid_list.items;
                                        auth_uid_groups_cnt = gid_list.count;
-                                       auth_uid_groups = new_array(char *, auth_uid_groups_cnt);
+                                       auth_uid_groups = new_array(const char *, auth_uid_groups_cnt);
                                        for (j = 0; j < auth_uid_groups_cnt; j++)
                                                auth_uid_groups[j] = gid_to_group(gid_array[j]);
                                }
@@ -313,7 +313,7 @@ char *auth_server(int f_in, int f_out, int module, const char *host,
        else if (opt_ch == 'd')
                err = "denied by rule";
        else {
-               char *group = group_match >= 0 ? auth_uid_groups[group_match] : NULL;
+               const char *group = group_match >= 0 ? auth_uid_groups[group_match] : NULL;
                err = check_secret(module, line, group, challenge, pass);
        }
 
@@ -324,7 +324,7 @@ char *auth_server(int f_in, int f_out, int module, const char *host,
                int j;
                for (j = 0; j < auth_uid_groups_cnt; j++) {
                        if (auth_uid_groups[j])
-                               free(auth_uid_groups[j]);
+                               free((char*)auth_uid_groups[j]);
                }
                free(auth_uid_groups);
        }
index 7359d9dbc973a2f9a56ec532599e2674ad340177..cf42f103bdbcac4629970b7b452f58dbdc1f4e43 100644 (file)
--- a/uidlist.c
+++ b/uidlist.c
@@ -95,7 +95,7 @@ static struct idlist *add_to_list(struct idlist **root, id_t id, union name_or_i
 }
 
 /* turn a uid into a user name */
-char *uid_to_user(uid_t uid)
+const char *uid_to_user(uid_t uid)
 {
        struct passwd *pass = getpwuid(uid);
        if (pass)
@@ -104,7 +104,7 @@ char *uid_to_user(uid_t uid)
 }
 
 /* turn a gid into a group name */
-char *gid_to_group(gid_t gid)
+const char *gid_to_group(gid_t gid)
 {
        struct group *grp = getgrgid(gid);
        if (grp)