Roxen.git/
server/
modules/
filesystems/
filesystem.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2001-12-21
2001-12-21 12:31:45 by Henrik Grubbström (Grubba) <grubba@grubba.org>
e291040e5055dc36bdae5c9b2957a715636017c3 (
31
lines) (+
23
/-
8
)
[
Show
|
Annotate
]
Branch:
2.2
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) {