• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Mods redirect or fake chmod [Root only]

and4me

Lurker
Got another one for ya experts :)
rsync can work with the option --password-file=blabla
this file must be 600 and owned by root, so far it all works ok.

Now the issue, the password file is stored on a external encryption storage so no rights to be set, rsync moans about this, trying a "sh rsync ..... < file" it keeps asking for a password...

Trying a symlink and rsync crashes (though a cat 'symlink' works)

'cat file | rsync' same sh*t.

Any ideas? anyone up for hacking the rsync binary and bypassing the code around "password file must not be other-accessible"? or a android tool which can (container) format ext2/3/4?
 
Never mind, its done, source file: authenticate.c
Lines 190-204:
--diff--
if (do_stat(filename, &st) == -1) {
rsyserr(FERROR, errno, "stat(%s)", filename);
exit_cleanup(RERR_SYNTAX);
}
// if ((st.st_mode & 06) != 0) {
// rprintf(FERROR, "ERROR: password file must not be other-accessible\n");
// exit_cleanup(RERR_SYNTAX);
// }
// if (MY_UID() == 0 && st.st_uid != 0) {
// rprintf(FERROR, "ERROR: password file must be owned by root when running as root\n");
// exit_cleanup(RERR_SYNTAX);
// }

n = read(fd, buffer, sizeof buffer - 1);
close(fd);
--diff--
Android binary attached, rsync 3.1.1.
After years of moaning to the developers to make this optional here's a fix they can stick where the sun don't shine.
 

Attachments

Back
Top Bottom