version 1.25, 2004/01/15 19:12:31 |
version 1.26, 2004/01/16 01:12:35 |
|
|
continue; |
continue; |
|
|
case 'L': /* Log. save message in log file */ |
case 'L': /* Log. save message in log file */ |
log(lfp, "%s", cp); |
logit(lfp, "%s", cp); |
continue; |
continue; |
#endif |
#endif |
|
|
|
|
|
|
if (pw == NULL || pw->pw_uid != stb.st_uid) |
if (pw == NULL || pw->pw_uid != stb.st_uid) |
if ((pw = getpwuid(stb.st_uid)) == NULL) { |
if ((pw = getpwuid(stb.st_uid)) == NULL) { |
log(lfp, "%s: no password entry for uid %u \n", |
logit(lfp, "%s: no password entry for uid %u \n", |
target, stb.st_uid); |
target, stb.st_uid); |
pw = NULL; |
pw = NULL; |
(void) snprintf(user, sizeof(user), ":%u", stb.st_uid); |
(void) snprintf(user, sizeof(user), ":%u", stb.st_uid); |
} |
} |
if (gr == NULL || gr->gr_gid != stb.st_gid) |
if (gr == NULL || gr->gr_gid != stb.st_gid) |
if ((gr = getgrgid(stb.st_gid)) == NULL) { |
if ((gr = getgrgid(stb.st_gid)) == NULL) { |
log(lfp, "%s: no name for group %u\n", |
logit(lfp, "%s: no name for group %u\n", |
target, stb.st_gid); |
target, stb.st_gid); |
gr = NULL; |
gr = NULL; |
(void) snprintf(group, sizeof(group), ":%u", |
(void) snprintf(group, sizeof(group), ":%u", |
|
|
} |
} |
if (u == 1) { |
if (u == 1) { |
if (opts & VERIFY) { |
if (opts & VERIFY) { |
log(lfp, "need to install: %s\n", target); |
logit(lfp, "need to install: %s\n", target); |
goto dospecial; |
goto dospecial; |
} |
} |
log(lfp, "installing: %s\n", target); |
logit(lfp, "installing: %s\n", target); |
opts &= ~(COMPARE|REMOVE); |
opts &= ~(COMPARE|REMOVE); |
} |
} |
|
|
|
|
|
|
if (u == 2) { |
if (u == 2) { |
if (opts & VERIFY) { |
if (opts & VERIFY) { |
log(lfp, "need to update: %s\n", target); |
logit(lfp, "need to update: %s\n", target); |
goto dospecial; |
goto dospecial; |
} |
} |
log(lfp, "updating: %s\n", target); |
logit(lfp, "updating: %s\n", target); |
} |
} |
|
|
if (stb.st_nlink > 1) { |
if (stb.st_nlink > 1) { |
|
|
continue; |
continue; |
if (sc->sc_args != NULL && !inlist(sc->sc_args, target)) |
if (sc->sc_args != NULL && !inlist(sc->sc_args, target)) |
continue; |
continue; |
log(lfp, "special \"%s\"\n", sc->sc_name); |
logit(lfp, "special \"%s\"\n", sc->sc_name); |
if (opts & VERIFY) |
if (opts & VERIFY) |
continue; |
continue; |
(void) snprintf(buf, sizeof(buf), "SFILE=%s;%s\n", target, |
(void) snprintf(buf, sizeof(buf), "SFILE=%s;%s\n", target, |
|
|
} |
} |
lp = (struct linkbuf *) malloc(sizeof(*lp)); |
lp = (struct linkbuf *) malloc(sizeof(*lp)); |
if (lp == NULL) |
if (lp == NULL) |
log(lfp, "out of memory, link information lost\n"); |
logit(lfp, "out of memory, link information lost\n"); |
else { |
else { |
lp->nextp = ihead; |
lp->nextp = ihead; |
ihead = lp; |
ihead = lp; |
|
|
case '\3': |
case '\3': |
*--cp = '\0'; |
*--cp = '\0'; |
if (lfp != NULL) |
if (lfp != NULL) |
log(lfp, "update: note: %s\n", s); |
logit(lfp, "update: note: %s\n", s); |
goto again; |
goto again; |
|
|
default: |
default: |
|
|
if (stp->st_mtime == mtime) |
if (stp->st_mtime == mtime) |
return(0); |
return(0); |
if (stp->st_mtime < mtime) { |
if (stp->st_mtime < mtime) { |
log(lfp, "Warning: %s: remote copy is newer\n", target); |
logit(lfp, "Warning: %s: remote copy is newer\n", target); |
return(0); |
return(0); |
} |
} |
} else if (stp->st_mtime == mtime && stp->st_size == size) |
} else if (stp->st_mtime == mtime && stp->st_size == size) |
|
|
case '\0': |
case '\0': |
*--cp = '\0'; |
*--cp = '\0'; |
if (*s != '\0') |
if (*s != '\0') |
log(lfp, "%s\n", s); |
logit(lfp, "%s\n", s); |
break; |
break; |
|
|
case 'E': |
case 'E': |
|
|
} |
} |
|
|
void |
void |
log(FILE *fp, const char *fmt, ...) |
logit(FILE *fp, const char *fmt, ...) |
{ |
{ |
va_list ap; |
va_list ap; |
|
|
|
|
case '\0': |
case '\0': |
*--cp = '\0'; |
*--cp = '\0'; |
if (*s != '\0') { |
if (*s != '\0') { |
log(lfp, "%s\n", s); |
logit(lfp, "%s\n", s); |
return(1); |
return(1); |
} |
} |
return(0); |
return(0); |
case '\3': |
case '\3': |
*--cp = '\0'; |
*--cp = '\0'; |
log(lfp, "Note: %s\n",s); |
logit(lfp, "Note: %s\n",s); |
return(response()); |
return(response()); |
|
|
default: |
default: |