Mac 2007-004/005 security updates kill ap.executeProgram

See below for the cause. Anyone got a solution?

I have this script to backup an open Sybase database on the Mac. It works on some machines, but on others no file is created. I have no idea why - same version of Servoy, Java, ASA, OSX.

It creates a subfolder in the Backups folder using the date/time as the subfolder name, eg Backups/2007_05_22_1201

Is there a better syntax?

var UserDir = plugins.it2be_tools.client().userDir
var BackupDir = UserDir + "/backups/"
plugins.file.createFolder(BackupDir)

var DBPath = UserDir + "/database/"
var BackupFolderName = utils.dateFormat(application.getTimeStamp(), "yyyy_MM_dd_HHmm")
var BackupPath = BackupDir + BackupFolderName
var SybasePath = UserDir + "/sybase_db/"

application.executeProgram( SybasePath+"dbbackup",  "-y",  "-c uid=dba;pwd=sql;dbn=user_data",  BackupPath)

This may have to do with user rights.

Or maybe spaces in UserDir?

Rob

Dear Marcel and Rob,

Thanks for the excellent tips. I was hopeful that they would do the trick, but sadly no.

I’ve checked that there are no spaces in the path
I’ve confirmed that the permissions (via Get Info) are the same at all sites on the Servoy folder, the Sybase_db folder, the backups folder and the dbbackup executable.

Both sites are Macs OSX 10.4.9 with PowerPC G4 processord, Java J2SE 5.0, Servoy 3.1.4

I’ve confirmed that I can run dbbackup at both sites in a terminal window.

Even stranger, the backups were running previously at the clients site. The solution they are running now is a direct import of the servoy file exported from my site.

It’s a mystery.

A revelation! I discovered the cause of the problem, the affected machines have all installed the Mac Security Update 2007-004 or 2007-005. I was able to replicate it here. So that completely explains the odd behaviour. If you have a moment, can you try it too?

application.executeProgram( "/Applications/Servoy3/Sybase_db/dbbackup", "-y", "-c uid=dba;pwd=sql;dbn=user_data", "/Applications/Servoy3/BackupTest")

Should I put this into the Servoy tracking system?

Now - any idea how to fix it?

See Sybase Central fix for SQL Anywhere - Classic Servoy - Servoy Community

For information, I used this workaround.

With a text editor create a file called dbbackup.sh in the Servoy folder

#!/bin/sh
#
cd sybase_db
./dbbackup -y -c uid=dba;pwd=sql;dbn=user_data ../backups
cd

and set the Unix permissions in a terminal window to make it executable

chmod 755 dbbackup.sh

dbbackup.sh can then be called with

var result = application.executeProgram("./dbbackup.sh")

Alternatively, you can modify the .sh to pass parameters to it

#!/bin/sh
#
cd sybase_db
./dbbackup $1 $2 $3 $4
cd

and call it with

var result = application.executeProgram("./dbbackup.sh",  "-y",  "-c", "uid=dba;pwd=sql;dbn=user_data",  "../backups")

Just found that the same code to run dbbackup (ASA 9) has fallen over with Leopard.

The software calls it from a shell script, passing the required parameters.

#!/bin/sh
#
cd sybase_db
./dbbackup $1 $2 $3 $4
cd ..

This has been running fine on 10.4.
It looks like a new variation on the permissions problem

I don’t have Leopard yet, so I can’t try it out

antonio:
Just found that the same code to run dbbackup (ASA 9) has fallen over with Leopard.

What error do you get.

dyld: Library not loaded: libdbtool9_r.dylib
Referenced from: /Applications/CuttingEdgeDistribution/CuttingEdge/sybase_db/dbbackup
Reason: image not found

I don’t have access to the machine at the moment, but the sh script runs fine from same software on OSX 10.4
The ASA9 files libdbtool9_r.dylib and dbbackup are present in the sybase_db folder.

In that case I’d recommend your customers to downgrade to 10.4. If the software is essential to them I assume they can wait for 10.5 until you have the ability to support it.