Batch/At (does it work for you as a user?)

Jamie nospam at geniegate.com
Mon Sep 4 00:23:22 PDT 2006


Feel silly asking this, but I've been trying to figure out what I goofed
up all night.

As a normal user, can you try this:

	echo whoami | batch

See if it works for you?

I have an empty at.deny and.. just for good measure I added the name to at.allow
(then removed the file after that didn't work)

I get errors about accessing the lock files. at/batch are setuid, according
to mtree my permission settings are correct. (I think, I've never used mtree
before this)

In a last resort, I inserted some stuff into the source of priv.h:

#define PRIV_START {\
            printf("\npriv_start .. \n"); \
			printf("real_uid=%d, effective_uid=%d\n",real_uid,effective_uid); \
            system("whoami"); \
            setreuid(real_uid, effective_uid); \
            setregid(real_gid, effective_gid); \
            system("whoami"); \
            printf(".. done with PRIV_START\n"); \


Seems to do the right thing until just at the point where it accessed the lock
file, but at the critical moment both in AND out report the regular user.


at.c:
	PRIV_START

    if ((lockdes = open(LFILE, O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR)) < 0)
    perr("cannot open lockfile " LFILE);
         ^^^^^^^^^^^^^^^^^^^^

whoami reports the regular user going in and out of PRIV_START, real_uid and
effective_uid are 500,0 

Wondering if this is just my setup (if I botched something) or if it's actually
broken? I tried a cvsup just in case I did something, but that didn't seem to
help either. 

(C isn't my primary language.. plz. forgive the crude approach to debugging)

Jamie
-- 
http://www.geniegate.com                    Custom web programming
guhzo_42 at xxxxxxxxx (rot13)                User Management Solutions





More information about the Users mailing list