Subversion Repositories wimsdev

Rev

Rev 15509 | Rev 15547 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15509 Rev 15546
Line 312... Line 312...
312
/* log posted data */
312
/* log posted data */
313
void post_log(void)
313
void post_log(void)
314
{
314
{
315
  char *h, *l, logstr[2*MAX_LINELEN+2];
315
  char *h, *l, logstr[2*MAX_LINELEN+2];
316
  char *authpwd, *p, *ll, *l1 ;
316
  char *authpwd, *p, *ll, *l1 ;
-
 
317
  static char *obliterate[]={"auth_password=","passwd="};
-
 
318
  int i, oblicnt=sizeof(obliterate)/sizeof(char*);;
317
 
319
 
318
  h=remote_addr;
320
  h=remote_addr;
319
  if(mpboundary[0]!=0) l="multipart/form-data"; else l=stdinbuf;
321
  if(mpboundary[0]!=0) l="multipart/form-data"; else l=stdinbuf;
320
 
322
 
321
  ll=strdup(l);
323
  ll=strdup(l);
-
 
324
  for(i=0;i<oblicnt;++i){
322
  authpwd="auth_password=";
325
    authpwd=obliterate[i];
323
  if((p=strstr(l,authpwd))!=NULL ) {
326
    if((p=strstr(ll,authpwd))!=NULL ) {
324
    l1=strdup(l);
327
      l1=strdup(ll);
325
    mystrncpy(ll,l,p-l+strlen(authpwd)+1);
328
      mystrncpy(ll,l1,p-ll+strlen(authpwd)+1);
326
    strcat(ll,"xxxx");
329
      strcat(ll,"xxxx");
327
    mystrncpy(l1,p+strlen(authpwd),strlen(l));
330
      mystrncpy(l1,p+strlen(authpwd),strlen(l));
328
    if((p=strstr(l1,"&"))!=NULL) strcat(ll,p);
331
      if((p=strstr(l1,"&"))!=NULL) strcat(ll,p);
-
 
332
    }
329
  }
333
  }
330
 
-
 
331
  snprintf(logstr,sizeof(logstr),"%s %s\t%s",
334
  snprintf(logstr,sizeof(logstr),"%s %s\t%s",
332
     nowstr, h, ll);
335
     nowstr, h, ll);
333
  write_logfile("post.log",logstr);
336
  write_logfile("post.log",logstr);
334
}
337
}
335
 
338