Re: Non DBA UPDATE STATISTICS
Posted in 1998
On Tue, 8 Sep 1998, Art S. Kagel wrote: > sanjeev sagar wrote: > > Informix IDS 7.30 > > O/S : Solaris 2.5.1 > > > > There are two user id, user x and user y. User x owns > > the database and tables. There is a requirement that > > user y should run the UPDATE STATISTICS. > > > > I did check that for running the update statistics, > > it has to have DBA priviledge, even for giving SET > > SESSION AUTHORIZATION. > > > > B'coz of security reason i can not grant DBA to User > > y. And i have to run UPDATE STATISTICS under user y > > id. Is it possible?? > > > > I would highly appreciate any help for the same. > > Create a 4GL or ESQL/C program that runs suid to a DBA account and have > that app execute the UPDATE STATISTICS commands. You can get my > dostats.ec from the IIUG Software Repository, in the submission named > utils2_ak, and make it an suid program. Beware SUID programs with Informix. Historically, Informix only used the real UID, not the effective UID which is set by a SUID program, for controlling the database access -- and there was a good reason why it did so which I'll go into if you really need me to. With shared libraries, running SUID programs gets tricky on many machines. For example, on Solaris, the shared libraries must be accessible in /usr/lib to be usable, or you have to link the program with special options such as -R or with LD_RUN_PATH set in the environment. If you've worked around those issues, then you still have the problem that Informix works with the real UID. You can specify a user and password when you do an explicit CONNECT statement, and the database regards you as being to the specified user regardless of your real or effective UID. This may be your best approach -- write a program which will connect to the database as a suitably privileged user with a compiled in password, but only do this once the actual user has identified themselves by specifying an appropriate password. You'll need to ensure that you don't let people get at the user and password information casually, so your source code should not contain either the special user's name or password in clear text -- they should be encrypted (but reversibly) so that the not-so-casual scanner of the object code won't spot the information. That's the bare minimum security; you could get more paranoid than that, and keeping the source code off the machine would be a good idea. Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn