version 1.31, 2014/07/12 03:48:04 |
version 1.32, 2015/01/16 06:40:11 |
|
|
static int |
static int |
sendhardlink(opt_t opts, struct linkbuf *lp, char *rname, int destdir) |
sendhardlink(opt_t opts, struct linkbuf *lp, char *rname, int destdir) |
{ |
{ |
static char buff[MAXPATHLEN]; |
static char buff[PATH_MAX]; |
char *lname; /* name of file to link to */ |
char *lname; /* name of file to link to */ |
char ername[MAXPATHLEN*4], elname[MAXPATHLEN*4]; |
char ername[PATH_MAX*4], elname[PATH_MAX*4]; |
|
|
debugmsg(DM_MISC, |
debugmsg(DM_MISC, |
"sendhardlink: rname='%s' pathname='%s' src='%s' target='%s'\n", |
"sendhardlink: rname='%s' pathname='%s' src='%s' target='%s'\n", |
|
|
{ |
{ |
int goterr, f; |
int goterr, f; |
off_t i; |
off_t i; |
char ername[MAXPATHLEN*4]; |
char ername[PATH_MAX*4]; |
|
|
if (stb->st_nlink > 1) { |
if (stb->st_nlink > 1) { |
struct linkbuf *lp; |
struct linkbuf *lp; |
|
|
struct stat stb; |
struct stat stb; |
int didupdate = 0; |
int didupdate = 0; |
int n; |
int n; |
char targ[MAXPATHLEN*4]; |
char targ[PATH_MAX*4]; |
|
|
debugmsg(DM_CALL, "rmchk()\n"); |
debugmsg(DM_CALL, "rmchk()\n"); |
|
|
|
|
char *optarget, *cp; |
char *optarget, *cp; |
int len; |
int len; |
int didupdate = 0; |
int didupdate = 0; |
char ername[MAXPATHLEN*4]; |
char ername[PATH_MAX*4]; |
|
|
/* |
/* |
* Send recvdir command in recvit() format. |
* Send recvdir command in recvit() format. |
|
|
if (!strcmp(dp->d_name, ".") || |
if (!strcmp(dp->d_name, ".") || |
!strcmp(dp->d_name, "..")) |
!strcmp(dp->d_name, "..")) |
continue; |
continue; |
if (len + 1 + (int) strlen(dp->d_name) >= MAXPATHLEN - 1) { |
if (len + 1 + (int) strlen(dp->d_name) >= PATH_MAX - 1) { |
error("%s/%s: Name too long", target, |
error("%s/%s: Name too long", target, |
dp->d_name); |
dp->d_name); |
continue; |
continue; |
|
|
{ |
{ |
int f, n; |
int f, n; |
static char tbuf[BUFSIZ]; |
static char tbuf[BUFSIZ]; |
char lbuf[MAXPATHLEN]; |
char lbuf[PATH_MAX]; |
u_char *s; |
u_char *s; |
char ername[MAXPATHLEN*4]; |
char ername[PATH_MAX*4]; |
|
|
debugmsg(DM_CALL, "sendlink(%s, %lx, stb, %d)\n", rname, opts, destdir); |
debugmsg(DM_CALL, "sendlink(%s, %lx, stb, %d)\n", rname, opts, destdir); |
|
|
|
|
char *owner = NULL, *group = NULL; |
char *owner = NULL, *group = NULL; |
int done, n; |
int done, n; |
u_char *cp; |
u_char *cp; |
char ername[MAXPATHLEN*4]; |
char ername[PATH_MAX*4]; |
|
|
debugmsg(DM_CALL, "update(%s, 0x%lx, %p)\n", rname, opts, statp); |
debugmsg(DM_CALL, "update(%s, 0x%lx, %p)\n", rname, opts, statp); |
|
|
|
|
struct stat *st, char *user, char *group) |
struct stat *st, char *user, char *group) |
{ |
{ |
int rv = 0; |
int rv = 0; |
char ername[MAXPATHLEN*4]; |
char ername[PATH_MAX*4]; |
int lmode = st->st_mode & 07777; |
int lmode = st->st_mode & 07777; |
|
|
if (u == US_CHMOG) { |
if (u == US_CHMOG) { |
|
|
int |
int |
install(char *src, char *dest, int ddir, int destdir, opt_t opts) |
install(char *src, char *dest, int ddir, int destdir, opt_t opts) |
{ |
{ |
static char destcopy[MAXPATHLEN]; |
static char destcopy[PATH_MAX]; |
char *rname; |
char *rname; |
int didupdate = 0; |
int didupdate = 0; |
char ername[MAXPATHLEN*4]; |
char ername[PATH_MAX*4]; |
|
|
debugmsg(DM_CALL, |
debugmsg(DM_CALL, |
"install(src=%s,dest=%s,ddir=%d,destdir=%d,opts=%ld) start\n", |
"install(src=%s,dest=%s,ddir=%d,destdir=%d,opts=%ld) start\n", |