473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

confirm password for logged in user

Hei,

I know this kind of stuff has probably been asked a couple of times
already, and did quite a bit of googling about it, but the answers i
found were either unsatisfying or not specific enough to what i want to
do:

I'm writing on a (Linux only) python daemon that runs as regular user.

Under certain conditions the daemon should create a total screen lock as
in gksu and should require input of the users password to release the
lock.

This is similar to what xscreensavers oder gnome-screensavers screenlock
features do.

The problem kicks in because it should work with shadowed passwords.

I understand that shadowed passwords can be retrieved in Python 2.5, but
only if the program runs as superuser (or has the necessary privileges
for some other reason). This creates two problems: I'd like it to work
in Python 2.4 and the daemon doesn't and shouldn't run as superuser.

I'm wondering, though, if there isn't ANY way to have the password
confirmed for the user that is already logged in. Please note the
difference, i don't want to write some kind of login functionality. The
user is already authenticated, i just want to have a typed in password
checked agains the already logged in users password.

Isn't there any way? A simple bash trick would help as well, but i
couldn't find one.

I don't have much of a clue about PAM, but i got the notion that it
could be done via PyPAM? It's a pretty old package, which refrained me
from looking into this option so far.

Thanks for any help,
André.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBGGxKUEOp8fsnyxsQRAm+DAKCSID4S3rhTQLgS1G8jB4 RA/lMRygCcCG6M
JyQLNvhfL6/UT3QnsVnlSlg=
=67rD
-----END PGP SIGNATURE-----

Apr 10 '07 #1
1 2563
André Wyrwa schrieb:
I'm wondering, though, if there isn't ANY way to have the password
confirmed for the user that is already logged in. Please note the
difference, i don't want to write some kind of login functionality. The
user is already authenticated, i just want to have a typed in password
checked agains the already logged in users password.
It is not possible to check a password against the shadow file without
having root privileges. Neither with nor without PAM.

Whyt you can do is install (or write yourself) a small program that
checks the password for you. That program must run as root (be installed
with suid root), but your daemon does not need to. The daemon calls the
external program to do the password check. http://unixpapa.com/pwauth
should work for your purposes.

--
René
Apr 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Matt | last post by:
Hiya I have to develop a web application for my company in which I need to have a facility for username and password for the employees to do certain tasks. How can this be implemented in ASP. I...
3
by: arktikturtle | last post by:
Hi! I'm looking for a way to validate a password within PL/SQL. I want to write CREATE PROCEDURE change_password(old_password IN VARCHAR2) IS BEGIN -- check if old_password is correct... but...
2
by: RICHARD BROMBERG | last post by:
I am building a password protected ASP web site. (http://www.allscrewedup.org) When you go to this site there is a link in upper left corner (VIP) that takes you to a Logon Screen. The user...
4
by: - Steve - | last post by:
I'm trying to change a user's password using objUser.Invoke("setPassword", "newpassword") It works fine as a console application if I'm logged in with someone with the correct permissions. If...
3
by: Wm. Scott Miller | last post by:
Hello all: I'd like some advice on the best way to validate and confirm an e-mail address entered during a registration process. What we are thinking of is something like the following: 1. ...
1
by: Sudhakara.T.P. | last post by:
Hi, I have an application in VB.NET windows application, wherein the administrator has the option to change the authentication mode ie., whether the application should work as a normal database...
0
by: =?Utf-8?B?UmFq?= | last post by:
In Create User Wizard, if password and confirm passowrd does not match....we get an error msg, once you set the confirm password right and without moving cursor out of the confirm password box...
30
by: diane | last post by:
I've got an application running with table-based security: i capture the user's windows login with fOsusername, then have them enter a password checked against their username/login in my own table....
5
by: ahilar12 | last post by:
hi all, i wanted to check whether the password entered matches with the confirm password.either through javascript or through php.i have enclosed my code somebody help on this <html> ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.