2011-04-13 04:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbunix/chroot.c
! following suit with the others functions, on error, errno should be
saved.
+ further, in about 101% of the cases, chroot() is to be followed by a
chdir("/"), so i think it would be right to include this right here.
; [Tamas Tevesz]
This commit is contained in:
@@ -16,6 +16,14 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2011-04-13 04:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbunix/chroot.c
|
||||
! following suit with the others functions, on error, errno should be
|
||||
saved.
|
||||
+ further, in about 101% of the cases, chroot() is to be followed by a
|
||||
chdir("/"), so i think it would be right to include this right here.
|
||||
; [Tamas Tevesz]
|
||||
|
||||
2011-04-13 02:09 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
+ contrib/hbunix/chroot.c
|
||||
* contrib/hbunix/hbunix.hbp
|
||||
|
||||
@@ -54,5 +54,16 @@
|
||||
|
||||
HB_FUNC( UNIX_CHROOT )
|
||||
{
|
||||
hb_retni( chroot( hb_parcx( 1 ) ) );
|
||||
if( chroot( hb_parcx( 1 ) ) == -1 )
|
||||
{
|
||||
hb_posix_save_errno();
|
||||
hb_retni( -1 );
|
||||
}
|
||||
else if( chdir( "/" ) == -1 )
|
||||
{
|
||||
hb_posix_save_errno();
|
||||
hb_retni( -1 );
|
||||
}
|
||||
else
|
||||
hb_retni( 0 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user