public Method

Stat.setuid?

stat.setuid?     true or false

Returns true if stat has the set-user-id permission bit set, false if it doesn’t or if the operating system doesn’t support this feature.

File.stat("/bin/su").setuid?   #=> true

Source Code

/*
*  call-seq:
*     stat.setuid?    => true or false
*  
*  Returns <code>true</code> if <i>stat</i> has the set-user-id
*  permission bit set, <code>false</code> if it doesn't or if the
*  operating system doesn't support this feature.
*     
*     File.stat("/bin/su").setuid?   #=> true
*/

static VALUE
rb_stat_suid(obj)
   VALUE obj;
{
#ifdef S_ISUID
   if (get_stat(obj)->st_mode & S_ISUID) return Qtrue;
#endif
   return Qfalse;
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.