Skip to content

Commit

Permalink
2024-12-29 00:28 UTC+0100 Aleksander Czajczynski (hb fki.pl)
Browse files Browse the repository at this point in the history
  * src/rtl/hbproces.c
    ! in process creating functions like hb_processRun(), *Open(),
      on Android: don't use setuid( getuid() ) method for resetting
      attributes as it rises "Bad system call" and the process is not
      executed. This fixes building Harbour in hbmk2 stage on Android
      device itself (for example using Termux) and can fix deploying
      multi-process Android apps. For devices older than Android 8,
      where the kernel was not hardened, please report any regresions,
      if you have such multi-process deployments.

  * ChangeLog.txt
    % stripped spaces before EOLs
  • Loading branch information
alcz committed Dec 28, 2024
1 parent ce1bc20 commit a23ea49
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
20 changes: 17 additions & 3 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
Entries may not always be in chronological/commit order.
See license at the end of file. */

2024-12-29 00:28 UTC+0100 Aleksander Czajczynski (hb fki.pl)
* src/rtl/hbproces.c
! in process creating functions like hb_processRun(), *Open(),
on Android: don't use setuid( getuid() ) method for resetting
attributes as it rises "Bad system call" and the process is not
executed. This fixes building Harbour in hbmk2 stage on Android
device itself (for example using Termux) and can fix deploying
multi-process Android apps. For devices older than Android 8,
where the kernel was not hardened, please report any regresions,
if you have such multi-process deployments.

* ChangeLog.txt
% stripped spaces before EOLs

2024-12-19 10:24 UTC+0100 Aleksander Czajczynski (hb fki.pl)
* contrib/rddsql/sqlbase.c
% cleanup unnecessary braces
Expand All @@ -17,8 +31,8 @@
2024-12-18 21:48 UTC-0800 Eric Lendvai (harbour.wiki)
* contrib/rddsql/sqlbase.c
* contrib/rddsql/sqlmix.c
+ added support to timestamp field type.
You can now use "@" in DbCreate as the timestamp field type.
+ added support to timestamp field type.
You can now use "@" in DbCreate as the timestamp field type.
Thanks to Grigory Filatov for fixing crash!

2024-12-17 03:07 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
Expand Down Expand Up @@ -1420,7 +1434,7 @@
2021-04-01 15:55 UTC-0300 Marco Aurelio V (marcoprodata/at/gmail.com)
* contrib/hbpgsql/tpostgre.prg
! corrected buggy in refresh method when execute commands to change
struct
struct
[REVERTED]

2021-03-31 23:43 UTC+0200 Aleksander Czajczynski (hb fki.pl)
Expand Down
15 changes: 13 additions & 2 deletions src/rtl/hbproces.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,15 @@ static int hb_fsProcessExec( const char * pszFileName,
for( i = 3; i < iMaxFD; ++i )
hb_fsClose( i );
}
/* reset extended process attributes */

#if ! defined( __BIONIC__ )
/* reset extended process attributes
* except on Android libc, where in practice
* this method raises "Bad system call" exception
*/
( void ) setuid( getuid() );
( void ) setgid( getgid() );
#endif

/* execute command */
execvp( argv[ 0 ], argv );
Expand Down Expand Up @@ -846,9 +852,14 @@ HB_FHANDLE hb_fsProcessOpen( const char * pszFileName,
hb_fsClose( i );
}

/* reset extended process attributes */
# if ! defined( __BIONIC__ )
/* reset extended process attributes
* except on Android libc, where in practice
* this method raises "Bad system call" exception
*/
if( setuid( getuid() ) == -1 ) {}
if( setgid( getgid() ) == -1 ) {}
# endif

/* execute command */
{
Expand Down

0 comments on commit a23ea49

Please sign in to comment.