Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Mar 2004 21:38:40 -0500 (EST)
From:      Robert Watson <rwatson@freebsd.org>
To:        Ganbold <ganbold@micom.mng.net>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Question regarding shell user creation at login time
Message-ID:  <Pine.NEB.3.96L.1040328213714.35345F-100000@fledge.watson.org>
In-Reply-To: <6.0.3.0.2.20040329102508.029f5670@202.179.0.80>

next in thread | previous in thread | raw e-mail | index | archive | help

On Mon, 29 Mar 2004, Ganbold wrote:

> Hi,
> 
> I traced sshd using ktrace and it says:
> ......
>   10198 new      CALL  setuid(0)
>   10198 new      RET   setuid -1 errno 1 Operation not permitted
>   10198 new      CALL  execve(0x80485d0,0xbfbfed8c,0xbfbfed94)
>   10198 new      NAMI  "/home/new/new.pl"
>   10198 new      RET   execve -1 errno 13 Permission denied
>   10198 new      CALL  exit(0xffffffff)
> .....

Don't you mean to be running /home/new/new instead?  new.pl isn't world
readable/executable. 

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert@fledge.watson.org      Senior Research Scientist, McAfee Research


> 
> My C program is:
> 
> #include <unistd.h>
> 
> main(ac, av)
>          char **av;
> {
>          setuid(0);
>          execv("/home/new/new.pl",av);
> }
> 
> Directory:
> 
> public# ls -la ~new
> total 46
> drwxr-xr-x  2 root  wheel    512 Mar 29 09:10 .
> drwxr-xr-x  8 root  wheel    512 Mar 25 15:28 ..
> -r--r-----  1 root  new      767 Mar 24 17:43 .cshrc
> -r--r-----  1 root  new      248 Mar 26 12:32 .login
> -r--r-----  1 root  new      158 Mar 24 17:43 .login_conf
> -r--r-----  1 root  new      373 Mar 24 17:43 .mail_aliases
> -r--r-----  1 root  new      331 Mar 24 17:43 .mailrc
> -r--r-----  1 root  new      797 Mar 24 17:43 .profile
> -r--r-----  1 root  new      276 Mar 24 17:43 .rhosts
> -r--r-----  1 root  new      975 Mar 24 17:43 .shrc
> -rwsr-x---  1 root  new     4651 Mar 26 08:47 new
> ----------  1 root  wheel     94 Mar 26 08:47 new.c
> -r-x------  1 root  wheel  15430 Mar 25 15:16 new.pl
> -rw-r--r--  1 root  wheel     52 Mar 25 16:52 new.sh
> 
> 
> Can somebody tell me the reason why it is failed?
> 
> Thanks in advance,
> 
> Ganbold
> 
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
> 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1040328213714.35345F-100000>