Re: [solved] FreeBSD auth

2005-11-03 Thread Dan Toganel
Sorry,me stupid.
Of course, i wasn't root.
Thanks for help.





__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: FreeBSD auth

2005-11-03 Thread Dan Toganel
--- Lowell Gilbert
<[EMAIL PROTECTED]> wrote:
> getpwent() *does* give you the encrypted password.
> It's the second field in the structure passed back.
> 
Well, i did:

include
#include

extern int errno;

int main()
{
char *name="dan";
struct passwd *password;
int uid;

password=getpwnam(name);

if(!password)
{
perror("getpwnam failed");
exit(1);
}

uid=password->pw_uid;

printf("Uid: %d, passwd:
%s\n",uid,password->pw_passwd);

exit(0);
}
.
bash-2.05b$ ./a.out
Uid: 1001, passwd: *

I get passwd field from /etc/passwd.which
is '*' for every user, not the hash 
from /etc/master.passwd.

Where am i wrong?




__ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: FreeBSD auth

2005-11-03 Thread Dan Toganel

--- Igor Robul <[EMAIL PROTECTED]> wrote:

> It is not recommended directly use /etc/passwd, you
> your program need 
> authentification, then use
> PAM (man 3 pam). If you still want ignore PAM, you
> can use getpwent(3) 
> family of functions.
>
Thanks for your interest.
Well, the problem with getpwent() is that i can't 
retrive hash from master.passwd, 
I can use it, only to parse passwd file.
But i also need to parse master.passwd to obtain 
the hash and to crypt user password and obtain 
the hash.
I need more specific help about those two.
 




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


FreeBSD auth

2005-11-02 Thread Dan Toganel
Hello list, 
I'm a newbie in freebsd programming and i need some
docs & hints in order to port a program from linux to
FreeBSD.

The piece of code is:
..
struct spwd* shadow=getspnam(name);
if(!shadow)
{
.
}
char *key=crypt(passwd,shadow->sp_pwdp);
if(!key)
{

}
if(strncmp(shadow->sp_pwdp,key,strlen(shadow->sp_pwdp))==0)
{
/*login success*/
}
else
{
/*login failed*/
}

I realize that in FreeBSD master.passwd is the
replacement for linux shadow file.
Is there a function to parse it?
And how can i obtain the hash string?
Thanks in advance for any help.





__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


ftpd in a jail

2005-09-13 Thread Dan Toganel
I have a ftpd server running in a jail and i want to
redirect the ftp traffic from my real host to jail.
I have already configured my traffic from 22 and 25 to
jail with natd and ipfw, but isn't working for ftp.
And i set all security.jail.* to 1 , (except 
security.jail.jailed)
How can it be done?




__ 
Yahoo! for Good 
Donate to the Hurricane Katrina relief effort. 
http://store.yahoo.com/redcross-donate3/ 

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"