Umm - this implies that you are calling "setuid" with no arguments -
in that case, what are you trying to accomplish?  With your modifications
the command will do nothing in this case.
The "60001" value is a solaris-ism - its standard "nobody" account.

>>>Orion said:
 > I was trying to use setuid and I kept getting a userid of 60001. Looking
 > at the code I found the reason.
 > 
 >     uid = 60001;
 >     if (argc > 1) {
 >         Tcl_GetInt(interp, argv[1], &uid);      /* new user id */
 >     }
 >     if (setuid((uid_t)uid) < 0) {
 >         Tcl_AppendResult(interp, "setuid: ", Tcl_PosixError(interp),
 > NULL);
 >         return TCL_ERROR;
 >     }
 >     return TCL_OK;
 > 
 > this works a lot better as
 > 
 >     uid = 60001;
 >     if (argc > 1) {
 >         Tcl_GetInt(interp, argv[1], &uid);      /* new user id */
 >         if (setuid((uid_t)uid) < 0) {
 >             Tcl_AppendResult(interp, "setuid: ", Tcl_PosixError(interp),
 > NULL);
 >             return TCL_ERROR;
 >         }
 >     }
 >     return TCL_OK;
 > 
 > -- 
 >      Orion Robillard <[EMAIL PROTECTED]>
 >      Smith & Wesson: The original point-and-click interface.
 > 

--      Brent Welch     <[EMAIL PROTECTED]>
        http://www.ajubasolutions.com
        Scriptics changes to Ajuba Solutions
        scriptics.com => ajubasolutions.com


Reply via email to