10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have written a shell script that calls below sql file. It is not sending the query data in table in the body of email.
spool table_update.html;
SELECT * FROM PROCESS_LOG_STATS where process = 'ActivateSubscription';
spool off;
exit;
Please use code tags next time for your code and data.... (9 Replies)
Discussion started by: Sharanakumar
9 Replies
2. Shell Programming and Scripting
Hi ,
I have a sql query in the unix script ,whose output is shown below.I want to convert this output to HTML table format & send email from unix with this table as email body.
p_id src_system amount
1 A 100
2 B 200
3 C ... (3 Replies)
Discussion started by: jagadeeshn04
3 Replies
3. UNIX for Dummies Questions & Answers
Please read How To Ask Questions The Smart Way (1 Reply)
Discussion started by: balu_279013
1 Replies
4. Red Hat
hey , i am using this code to store value of a sql query and and then use
it in other query but after some time , but it is not working. please help
#!/bin/bash
val_1=$( sqlplus -s rte/rted2@rel76d2 << EOF
setting heading off
select max(stat_id) from cvt_stats;
exit
EOF
)
nohup... (5 Replies)
Discussion started by: ramsavi
5 Replies
5. Shell Programming and Scripting
Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database.
I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :(
What should I do? I'm not sure that... (2 Replies)
Discussion started by: Kapom
2 Replies
6. Shell Programming and Scripting
Hello ,
I am trying to write a unix shell script to compare folder permission to say drwxr-x-wx and then send an email to my id in case the folders don't have the drwxr-x-wx permissions set for them .
I have been trying to come up with a script for few days now , pls help me:( (2 Replies)
Discussion started by: nairshar
2 Replies
7. Shell Programming and Scripting
Hi Friends,
I am using AIX version and sqlplus to connect to database while writing a shell script.
I have implemented three ways to connect to database :
1)
sqlplus -s <USERNAME>/<PASSWORD> <<!
@<SQL FILE TO EXECUTE>
exit
!
2)
sqlplus -s <USERNAME>/<PASSWORD> <<!
-----sql statemenets... (6 Replies)
Discussion started by: gauravgarg
6 Replies
8. Shell Programming and Scripting
HI,
We need a script that invokes the sql query every 14 days ans send email (0 Replies)
Discussion started by: bujjisveeru
0 Replies
9. Shell Programming and Scripting
Hello,
I have a sh script excuting a sql query through sqlplus. I am having trouble making my date equal to the date of the server time in the sql script. How can i call the server date from my query?
Thanks (2 Replies)
Discussion started by: kingluke
2 Replies
10. UNIX for Dummies Questions & Answers
Hello
To do :
'automate the process of generating report and send it to client every 15 days after encrypting the report file'
Did so far :
- generate Java program to encrypt the file.
- generate SQL query to run the report.
Is there any body who can help me to go further ?
... (7 Replies)
Discussion started by: cub
7 Replies
PAM::FAQ(3pm) User Contributed Perl Documentation PAM::FAQ(3pm)
NAME
Authen::PAM::FAQ - Frequently-Asked Questions about Authen::PAM.
SYNOPSIS
perldoc Authen::PAM::FAQ
VERSION
This document is currently at version 0.05, as of May 4, 2005
DESCRIPTION
1. Can I authenticate a user non interactively?
Yes, you can although not in a very clean way. The PAM library has a mechanism, in a form of a conversation function, to send and receive
text data from the user. For details of the format of the conversation function consult the Authen::PAM manual. This function receives a
list of code/string pairs. There are two codes (PAM_TEXT_INFO and PAM_ERROR_MSG) for displaying the associated string to the user and two
codes (PAM_ECHO_ON and PAM_ECHO_OFF) for getting input from the user. As you can see the codes are rather general and you can not be
completely sure when you are asked for a user name and when for a password. However, the common practice is that PAM_ECHO_ON is used for a
user name and PAM_ECHO_OFF is used for a password. So, what you can do is to write your own conversation function which ignores the
PAM_TEXT_INFO and PAM_ERROR_MSG codes and returns the user name for the code PAM_ECHO_ON and the password for the code PAM_ECHO_OFF. If you
pass the user name in the initialization function then usually you will not be asked for it. Here is a simple example how to do this:
use Authen::PAM;
use POSIX qw(ttyname);
$service = "login";
$username = "foo";
$password = "bar";
$tty_name = ttyname(fileno(STDIN));
sub my_conv_func {
my @res;
while ( @_ ) {
my $code = shift;
my $msg = shift;
my $ans = "";
$ans = $username if ($code == PAM_PROMPT_ECHO_ON() );
$ans = $password if ($code == PAM_PROMPT_ECHO_OFF() );
push @res, (PAM_SUCCESS(),$ans);
}
push @res, PAM_SUCCESS();
return @res;
}
ref($pamh = new Authen::PAM($service, $username, &my_conv_func)) ||
die "Error code $pamh during PAM init!";
$res = $pamh->pam_set_item(PAM_TTY(), $tty_name);
$res = $pamh->pam_authenticate;
print $pamh->pam_strerror($res),"
" unless $res == PAM_SUCCESS();
The Authen::PAM module comes with a default conversation function which you can find in the file PAM.pm.
2. Can I change a password non interactively?
All the discussion of the previous question also applies here. There is however one serious complication. When changing a password it is
quite possible that the PAM library will send you at lest two PAM_ECHO_OFF prompts - one for the old password and one or two for the new
one. Therefore, the first thing you should do is to see what sequence of prompts is produced by your service. Then the conversation
function should include some state variable to distinguish the different prompts. Here is an example:
use Authen::PAM;
$service = "passwd";
$username = "foo";
$oldpassword = "old_pass";
$newpassword = "new_pass";
sub my_conv_func {
my @res;
while ( @_ ) {
my $code = shift;
my $msg = shift;
my $ans = "";
$ans = $username if ($code == PAM_PROMPT_ECHO_ON() );
if ($code == PAM_PROMPT_ECHO_OFF() ) {
$ans = $oldpassword if ($state == 0);
$ans = $newpassword if ($state == 1);
$ans = $newpassword if ($state == 2);
$state++;
}
push @res, (PAM_SUCCESS(),$ans);
}
push @res, PAM_SUCCESS();
return @res;
}
ref($pamh = new Authen::PAM($service, $username, &my_conv_func)) ||
die "Error code $pamh during PAM init!";
$state = 0;
$res = $pamh->pam_chauthtok;
print $pamh->pam_strerror($res),"
" unless $res == PAM_SUCCESS();
If you are running the script as root then most likely you will not be prompted for an old password. In this case you can simply return the
new password at the ECHO_OFF prompt.
The $msg variable contains the text of the input prompt which you can use for additional test or for debugging purposes, e.g.
if ($code == PAM_PROMPT_ECHO_OFF() ) {
if ($state>=1 || $msg=~/new/i) { # are we asked for a new password
$ans = $newpassword;
} else {
$ans = $oldpassword;
}
$state++;
}
3. Why are the constants PAM_AUTHTOK and PAM_OLDAUTHTOK not avaliable?
The PAM_AUTHTOK and PAM_OLDAUTHTOK items can be used to pass authentication tokens (passwords) from one module to another. However, they
are avaliable only to PAM modules and not to PAM applicatinos. If you have a special setup in which you really need to preset the password
from the application (e.g. using a radius server) then you can use the pam_set_authtok module avaliable from
http://www.uni-hohenheim.de/~schaefer/linux/pam/pam_set_authtok.html <http://www.uni-
hohenheim.de/~schaefer/linux/pam/pam_set_authtok.html>.
SEE ALSO
Authen::PAM
AUTHOR
Nikolay Pelov <NIKIP at cpan.org>
COPYRIGHT
Copyright (c) 1998-2005 Nikolay Pelov. All rights reserved. This file is part of the Authen::PAM library. This library is free software;
you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2005-06-30 PAM::FAQ(3pm)