Branch: Tag:

2001-12-21

2001-12-21 12:31:45 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed request tracing of the SETUID() macro.

Rev: server/modules/filesystems/filesystem.pike:1.114

7:   inherit "module";   inherit "socket";    - constant cvs_version= "$Id: filesystem.pike,v 1.113 2001/09/27 17:53:43 nilsson Exp $"; + constant cvs_version= "$Id: filesystem.pike,v 1.114 2001/12/21 12:31:45 grubba Exp $";   constant thread_safe=1;      #include <module.h>
258:    privs=Privs(X, uid->uid(), uid->gid() ); \    }    + #define SETUID_TRACE(X,LEVELS) \ +  if( access_as_user ) \ +  { \ +  User uid = id->conf->authenticate( id,access_as_user_db ); \ +  if( access_as_user_throw && !uid ) { \ +  int levels = (LEVELS); \ +  while(levels--) TRACE_LEAVE(""); \ +  TRACE_LEAVE(X ": Auth required."); \ +  return id->conf->authenticate_throw( id, "User",access_as_user_db);\ +  } \ +  if( uid && uid->uid() ) \ +  privs=Privs(X, uid->uid(), uid->gid() ); \ +  } +    #define SETUID_NT(X) \    if( access_as_user ) \    { \
600:    TRACE_ENTER("Opening file \"" + f + "\"", 0);       object privs; -  SETUID("Open file"); +  SETUID_TRACE("Open file", 1);       o = Stdio.File( );    if(!o->open(norm_f, "r" )) o = 0;
657:    }    mkdirs++;    object privs; -  SETUID("Creating file"); +  SETUID_TRACE("Creating file", 0);       if (query("no_symlinks") && (contains_symlinks(path, oldf))) {    privs = 0;
719:    }       -  SETUID("Saving file"); +  SETUID_TRACE("Saving file", 0);       if (query("no_symlinks") && (contains_symlinks(path, oldf))) {    privs = 0;
819:    }       -  SETUID("CHMODing file"); +  SETUID_TRACE("CHMODing file", 0);       if (query("no_symlinks") && (contains_symlinks(path, oldf))) {    privs = 0;
896:    return 0;    }    -  SETUID("Moving file"); +  SETUID_TRACE("Moving file", 0);       if (query("no_symlinks") &&    ((contains_symlinks(path, oldf)) ||
995:    return 0;    }    -  SETUID("Moving file"); +  SETUID_TRACE("Moving file", 0);       if (query("no_symlinks") &&    ((contains_symlinks(path, f)) ||
1060:    report_notice(LOCALE(49,"DELETING the file %s.\n"),f);    accesses++;    -  SETUID("Deleting file"); +  SETUID_TRACE("Deleting file", 0);       /* Clear the stat-cache for this file */    if (stat_cache) {