"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "authenticate.c" between
rsync-3.2.1.tar.gz and rsync-3.2.2.tar.gz

About: rsync is a fast incremental file-copying tool for bringing remote (and local) files into sync.

authenticate.c  (rsync-3.2.1):authenticate.c  (rsync-3.2.2)
skipping to change at line 23 skipping to change at line 23
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, visit the http://fsf.org website. * with this program; if not, visit the http://fsf.org website.
*/ */
#include "rsync.h" #include "rsync.h"
#include "itypes.h" #include "itypes.h"
#include "ifuncs.h"
extern int read_only; extern int read_only;
extern char *password_file; extern char *password_file;
/*************************************************************************** /***************************************************************************
encode a buffer using base64 - simple and slow algorithm. null terminates encode a buffer using base64 - simple and slow algorithm. null terminates
the result. the result.
***************************************************************************/ ***************************************************************************/
void base64_encode(const char *buf, int len, char *out, int pad) void base64_encode(const char *buf, int len, char *out, int pad)
{ {
skipping to change at line 253 skipping to change at line 254
if (!read_line_old(f_in, line, sizeof line, 0) if (!read_line_old(f_in, line, sizeof line, 0)
|| (pass = strchr(line, ' ')) == NULL) { || (pass = strchr(line, ' ')) == NULL) {
rprintf(FLOG, "auth failed on module %s from %s (%s): " rprintf(FLOG, "auth failed on module %s from %s (%s): "
"invalid challenge response\n", "invalid challenge response\n",
lp_name(module), host, addr); lp_name(module), host, addr);
return NULL; return NULL;
} }
*pass++ = '\0'; *pass++ = '\0';
if (!(users = strdup(users))) users = strdup(users);
out_of_memory("auth_server");
for (tok = strtok(users, " ,\t"); tok; tok = strtok(NULL, " ,\t")) { for (tok = strtok(users, " ,\t"); tok; tok = strtok(NULL, " ,\t")) {
char *opts; char *opts;
/* See if the user appended :deny, :ro, or :rw. */ /* See if the user appended :deny, :ro, or :rw. */
if ((opts = strchr(tok, ':')) != NULL) { if ((opts = strchr(tok, ':')) != NULL) {
*opts++ = '\0'; *opts++ = '\0';
opt_ch = isUpper(opts) ? toLower(opts) : *opts; opt_ch = isUpper(opts) ? toLower(opts) : *opts;
if (opt_ch == 'r') { /* handle ro and rw */ if (opt_ch == 'r') { /* handle ro and rw */
opt_ch = isUpper(opts+1) ? toLower(opts+1) : opts [1]; opt_ch = isUpper(opts+1) ? toLower(opts+1) : opts [1];
if (opt_ch == 'o') if (opt_ch == 'o')
skipping to change at line 290 skipping to change at line 290
* if it is in a group that matches tok+1 wildmat. */ * if it is in a group that matches tok+1 wildmat. */
if (auth_uid_groups_cnt < 0) { if (auth_uid_groups_cnt < 0) {
item_list gid_list = EMPTY_ITEM_LIST; item_list gid_list = EMPTY_ITEM_LIST;
uid_t auth_uid; uid_t auth_uid;
if (!user_to_uid(line, &auth_uid, False) if (!user_to_uid(line, &auth_uid, False)
|| getallgroups(auth_uid, &gid_list) != NULL) || getallgroups(auth_uid, &gid_list) != NULL)
auth_uid_groups_cnt = 0; auth_uid_groups_cnt = 0;
else { else {
gid_t *gid_array = gid_list.items; gid_t *gid_array = gid_list.items;
auth_uid_groups_cnt = gid_list.count; auth_uid_groups_cnt = gid_list.count;
if ((auth_uid_groups = new_array(char *, auth_uid_groups = new_array(char *, auth_
auth_uid_groups_cnt)) == NULL) uid_groups_cnt);
out_of_memory("auth_server");
for (j = 0; j < auth_uid_groups_cnt; j++) for (j = 0; j < auth_uid_groups_cnt; j++)
auth_uid_groups[j] = gid_to_group (gid_array[j]); auth_uid_groups[j] = gid_to_group (gid_array[j]);
} }
} }
for (j = 0; j < auth_uid_groups_cnt; j++) { for (j = 0; j < auth_uid_groups_cnt; j++) {
if (auth_uid_groups[j] && wildmatch(tok+1, auth_u id_groups[j])) { if (auth_uid_groups[j] && wildmatch(tok+1, auth_u id_groups[j])) {
group_match = j; group_match = j;
break; break;
} }
} }
 End of changes. 3 change blocks. 
5 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)