[Zope] Re: useradd command in Zope

2005-11-03 Thread Josef Meile

Hi ajit,


   i don't think this is non-zope question bca'z...

   i am using python script to add user to system which works fine 
when run outside of zope ...
  but when i run it through zope as external script (with all 
permission) it's not working and returning 256 without giving any error...

That's because the user running zope doesn't have any root privileges
and a external method is run as this user and not as root.

Anyway, I just don't think it is safe to allow an zope admin user to
create users in your operating system. What if your zope admin password
gets hacked? Then the hacker could easily create a user in your machine
and gain access to it as well. Why don't you do it directly by following
the old way: logging in to the unix console, su to root and then
calling useradd?

Anyway, if you still want to do this, then you have to use sudo as
Andreas said. Other alternatives would be:
1) Run zope as root.

2) use set-user-ID or set-group-ID (man chmod) with a C binary that
   calls useradd

3) Add your zope user to the group of root.

Those two things are too dangerous. If I were you, I wouldn't consider
any of them; however, it is up-to-you to decide this.

Regards,
Josef

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: useradd command in Zope

2005-11-07 Thread Josef Meile

> su zope (or whoever your zope runs)
> ./yourmethod.py someuser somepass
>
> You will see it fail (apart from the fact you need
> the #!/path/to/python.bin and set the execution bit
> with chmod a+x before you try)
>
>
>  >   i tried using another user outside of zope .
>  working very well(adding user to system)
Perhaps the other user is either root or it belongs to the root's
groups.

>  owner of external method is root and set_user_id bit is set.
>  but problem is when i run attached app it is not adding user 
set_user_id only works with C binary files. So, here you have to use
sudo as suggested.

Regards,
Josef

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )