* Floppy, finger, date
@ 1997-03-25 14:44 Marco Corte
0 siblings, 0 replies; 2+ messages in thread
From: Marco Corte @ 1997-03-25 14:44 UTC (permalink / raw)
First of all thanks a lot for your help in installing and properly setting
up Linux (RH-4.1) on the AS255. This mailing list is really GREAT!
Now three new problems:
1. I can't "fdformat /dev/fd0H1440" my floppies also when I "setfdprm
/dev/fd0 1440/1440".
2. "w" reports correctly the users actually logged on, but "finger" and
"who" don't (they show many other users), so "talk" doesn't work.
3. How to tell my S3 server (3.1.2G) a "wrong" date so that I doesn't
expire without changing the date on the whole system?
Thanks.
----- Marco
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Floppy, finger, date
[not found] <Pine.OSF.3.95.970325154328.16272A-100000@dipfis.ge.infn.it>
@ 1997-03-25 18:34 ` Nikita Schmidt
0 siblings, 0 replies; 2+ messages in thread
From: Nikita Schmidt @ 1997-03-25 18:34 UTC (permalink / raw)
On Mar 25, Marco Corte wrote:
>
> Now three new problems:
>
...
>
> 3. How to tell my S3 server (3.1.2G) a "wrong" date so that I doesn't
> expire without changing the date on the whole system?
>
Unfortunately, I'm not really into RedHat distribution, so I cannot say
anything about first two problems. As for X server spoofing, my
approach is following:
1) build a shared library that defines `time' (see source code below);
2) make a setuid wrapper that starts X server with that library.
Since in pre-2.0 versions of glibc LD_PRELOAD fails on setuid
executables (more precisely, if real uid != effective uid) even when the
library name does not contain slashes (in ld-2.0.so setuid binaries can
be LD_PRELOADed with a library if its name is reasonably secure, i.e.
contains no slashes), a setuid wrapper is needed to set both real and
effective uids to 0 prior to running the X server. That's not good: for
example, X server remains rooty and cannot be killed from xinit when the
session is over (one has to press ctrl-alt-bs), and there may be
some security flaws with this approach, but I couldn't see any other
way (rebuilding ld-1.93.so is not worth it).
OK, let's take a look at the code.
---------------- libfaketime.c ----------------
#include <time.h>
time_t time (time_t *t)
{
if (t) *t = 844124400;
return 844124400;
}
-------------------- X.c ----------------------
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
main (int argc, char *argv[])
{
setenv ("LD_PRELOAD", "/usr/local/lib/libfaketime.so", 1);
setuid (0);
execv ("/usr/X11R6/bin/Xserver", argv);
perror ("Cannot execute /usr/X11R6/bin/Xserver");
return 1;
}
------------------ Makefile -------------------
FLAGS = -O2 -pipe -fomit-frame-pointer -s
XBIN = /usr/X11R6/bin
all: X libfaketime.so
X: X.c
gcc $(FLAGS) -o $@ $<
libfaketime.so: libfaketime.c
gcc $(FLAGS) -shared -nostdlib -o $@ $<
install: all
cp libfaketime.so /usr/local/lib
mv $(XBIN)/X $(XBIN)/Xserver
cp X $(XBIN)/X
chown root.root $(XBIN)/X
chmod u+s $(XBIN)/X
-----------------------------------------------
Be careful with the install part. The idea is that the wrapper
described above gets installed in /usr/X11R6/bin and runs Xserver
(which can be just a link to the real binary; I did not want to put
any particular name in X.c). If you already have something called
/usr/X11R6/bin/Xserver, don't run make install, or you'll lose it!
Kit
--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject. Do not send it to axp-list@redhat.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1997-03-25 18:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-03-25 14:44 Floppy, finger, date Marco Corte
[not found] <Pine.OSF.3.95.970325154328.16272A-100000@dipfis.ge.infn.it>
1997-03-25 18:34 ` Nikita Schmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox