Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!uunet!murtoa.cs.mu.oz.au!munnari.oz.au!comp.vuw.ac.nz!dsiramd!csnz!paul From: paul@csnz.co.nz (Paul Gillingwater) Newsgroups: comp.databases Subject: Re: Informix Isql Protection Keywords: user-menu Message-ID: <101@csnz.co.nz> Date: 18 Aug 89 00:04:43 GMT References: <4266@uhccux.uhcc.hawaii.edu> <463@techwood.UUCP> Reply-To: paul@csnz.co.nz (Paul Gillingwater) Organization: Computer Sciences of NZ Limited Lines: 28 In article <463@techwood.UUCP> johnw@techwood.UUCP (John Wheeler) writes: >In article <4266@uhccux.uhcc.hawaii.edu> you write: >>Howzit, >> >> I am using Informix Isql on the unix for the first time. >> ... How do I limit access to just the row where the >> the logged-in student's record is? I don't want student to access other >> student records. > >You make a field in the database which contains the login name >for that student. You then use the USER (which is a predefined >variable, filled in at isql invocation) in a select statement >as in >select * from tablename where loginname matches USER Depends on the student's knowledge of UNIX, and whether they get at the shell. I suspect the USER variable might be set up in the .profile -- which could be edited. Alternatively, you could do something like: USER=`id | sed -e 's/[^(]*(\([^)]*\).*/\1/'` export USER which is harder to forge. Don't put it in the .profile, but in the wrapper for Informix. -- Paul Gillingwater, Computer Sciences of New Zealand Limited Bang: ..!uunet!dsiramd!csnz!paul Domain: paul@csnz.co.nz Call Magic Tower BBS V21/23/22/22bis 24 hrs +0064 4 767 326