[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Make setting AFS_SYSCALL="/proc/..." usefull as maybe intened inthe first place.




in lib/kafs/afssys.c around line 456 env (value of $AFS_SYSCALL) is
checked to be used as the value of the entry in /proc (tokens linux
style). However this check is useless if there is a AFS syscall active
or one of the entries in /proc exists as that is used before the one
specified in AFS_SYSCALL and then the code jumps around to the label
"done".

    if (try_proc("/proc/fs/openafs/afs_ioctl") == 0)
	goto done;
    if (try_proc("/proc/fs/nnpfs/afs_ioctl") == 0)
	goto done;
    if (env && try_proc(env) == 0)
	goto done;

If I set the AFS_SYSCALL env variable to something beginning in "/proc"
I don't want the real syscall, I promise. So you can either check
things in this order:

1.
    if (env && try_proc(env) == 0)
	goto done;
2.
     if (try_proc("/proc/fs/openafs/afs_ioctl") == 0)
	goto done;
3.
    if (try_proc("/proc/fs/nnpfs/afs_ioctl") == 0)
	goto done;

4. All "real syscall" stuff

Or you can add the patch below which does preserve the current
behaviour but adds the special case in the beginning to make
AFS_SYSCALL="/proc...." useable.

Harald.

habarber:heimdal-0.7.1rc# diff -u lib/kafs/afssys.c{.orig,}
--- lib/kafs/afssys.c.orig      2005-06-02 09:25:58.000000000 +0200
+++ lib/kafs/afssys.c   2005-08-11 12:48:29.000000000 +0200
@@ -364,6 +364,9 @@
     saved_func = signal(SIGSYS, SIGSYS_handler);
 #endif
 
+    if (env && strncmp("/proc", env, 5) == 0 && try_proc(env) == 0)
+       goto done;
+
 #if defined(AFS_SYSCALL) || defined(AFS_SYSCALL2) || defined(AFS_SYSCALL3)
     {
        int tmp;