NIS stores its information in DBM files. These are key-value databases. (Every key is unique and has one value). NIS does this so that the information is retained across process restarts. There are some programs to read from a DBM file. Usually, one can use perl to do more interesting things to the data:
Hello all,
I'm not sure if this is the right forum, but I would like to know if Redhat running NIS ( not NIS +) would have conflict with Solaris running NIS+. Currently I am running NIS+ on Solaris but will be adding RedHat to the network. I seem to be unable to find and information regarding... (2 Replies)
Hi all,
I just took over the admin role from someone and I wanna setup sendmail (just to send mail from the host) however, after I config all the resolv.conf, nssitch.conf, hosts file and when I try to send a mail out, after I punched ctl-D, it returned he following,
"NIS map mail.aliases... (2 Replies)
We have a RedHat 8.0 NIS master, with a RedHat 8.0 NIS Slave.
We also have a small number of SUSE 9.1 and SUSE 10 machines here for evaluation.
However, no matter what i do, the SUSE machines will not talk to the NIS Servers.
If i broadcast for NIS Servers for the specified NIS domain, it... (1 Reply)
Hi, all.
I have a Solaris client here needs to bind to NIS server in another subnet. Following is the configuration i made on the client,
1) edit /etc/inet/hosts to add an entry of the NIS server -- nserver01
2) execute `domainname` to set local NIS domain to the domain of the NIS server.... (1 Reply)
Hi
Our nis server running on Sun solaris 8 operating system.
I have added a new user in the nis passwd file
& when I am trying to update the file from nis server by using
following command:
# cd /var/yp
# make
updated passwd
It updates the passwd file but does not come back to command... (3 Replies)
I have a DBM database back up file I'd like to convert to mySQL or even to a .CSV, but.......
How can I do it?
The big problem is I have no idea about scripts, how to install them etc. so these methods are basically useless to me.
I guess is there a data base migration software for dummies? (1 Reply)
Hello i have some account already defined on NIS server. I would like to use this account on my machine.
What do i have to do ? Only create the home directory then use the account ??
If the user defined is using the korn shell, and i want to use bash, how can i change it ?? (2 Replies)
I'm creating a scrip for auditing our AIX box's to ensure that they are built according to our system standards. I'm not sure on the logic for checking to see if the NIS and NIS+ services are disabled. any idea's? (2 Replies)
Discussion started by: sport
2 Replies
LEARN ABOUT X11R4
perldbmfilter
PERLDBMFILTER(1) Perl Programmers Reference Guide PERLDBMFILTER(1)NAME
perldbmfilter - Perl DBM Filters
SYNOPSIS
$db = tie %hash, 'DBM', ...
$old_filter = $db->filter_store_key ( sub { ... } );
$old_filter = $db->filter_store_value( sub { ... } );
$old_filter = $db->filter_fetch_key ( sub { ... } );
$old_filter = $db->filter_fetch_value( sub { ... } );
DESCRIPTION
The four "filter_*" methods shown above are available in all the DBM modules that ship with Perl, namely DB_File, GDBM_File, NDBM_File,
ODBM_File and SDBM_File.
Each of the methods work identically, and are used to install (or uninstall) a single DBM Filter. The only difference between them is the
place that the filter is installed.
To summarise:
filter_store_key
If a filter has been installed with this method, it will be invoked every time you write a key to a DBM database.
filter_store_value
If a filter has been installed with this method, it will be invoked every time you write a value to a DBM database.
filter_fetch_key
If a filter has been installed with this method, it will be invoked every time you read a key from a DBM database.
filter_fetch_value
If a filter has been installed with this method, it will be invoked every time you read a value from a DBM database.
You can use any combination of the methods from none to all four.
All filter methods return the existing filter, if present, or "undef" in not.
To delete a filter pass "undef" to it.
The Filter
When each filter is called by Perl, a local copy of $_ will contain the key or value to be filtered. Filtering is achieved by modifying the
contents of $_. The return code from the filter is ignored.
An Example -- the NULL termination problem.
DBM Filters are useful for a class of problems where you always want to make the same transformation to all keys, all values or both.
For example, consider the following scenario. You have a DBM database that you need to share with a third-party C application. The C appli-
cation assumes that all keys and values are NULL terminated. Unfortunately when Perl writes to DBM databases it doesn't use NULL termina-
tion, so your Perl application will have to manage NULL termination itself. When you write to the database you will have to use something
like this:
$hash{"$key "} = "$value ";
Similarly the NULL needs to be taken into account when you are considering the length of existing keys/values.
It would be much better if you could ignore the NULL terminations issue in the main application code and have a mechanism that automati-
cally added the terminating NULL to all keys and values whenever you write to the database and have them removed when you read from the
database. As I'm sure you have already guessed, this is a problem that DBM Filters can fix very easily.
use strict;
use warnings;
use SDBM_File;
use Fcntl;
my %hash;
my $filename = "filt";
unlink $filename;
my $db = tie(%hash, 'SDBM_File', $filename, O_RDWR|O_CREAT, 0640)
or die "Cannot open $filename: $!
";
# Install DBM Filters
$db->filter_fetch_key ( sub { s/ $// } );
$db->filter_store_key ( sub { $_ .= "