Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

xp_write_file permission

2 posts in General Discussion Last posting was on 2004-08-30 05:56:42.0Z
Brett Posted on 2004-08-27 20:04:12.0Z
Sender: 6c34.412f93f5.1804289383@sybase.com
From: Brett
Newsgroups: ianywhere.public.general
Subject: xp_write_file permission
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <412f9533.6cdf.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 27 Aug 2004 13:10:27 -0700, 10.22.241.42
Lines: 4
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 27 Aug 2004 12:53:55 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 27 Aug 2004 13:04:12 -0700
X-Trace: forums-1-dub 1093637052 10.22.108.75 (27 Aug 2004 13:04:12 -0700)
X-Original-Trace: 27 Aug 2004 13:04:12 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3450
Article PK: 7357

I'm using xp_write_file to extract binary data from a Sybase
database (9.0.1 on Linux) and when the file extracts, it has
permissions -rw-r-----. How can I change it to where when
the file extracts, everyone has read priveledges. Thanks.


Nick Elson Posted on 2004-08-30 05:56:42.0Z
From: "Nick Elson" <no_spam_nicelson@sybase.com>
Newsgroups: ianywhere.public.general
References: <412f9533.6cdf.1681692777@sybase.com>
Subject: Re: xp_write_file permission
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Original-NNTP-Posting-Host: surfec007.sybase.com
Message-ID: <4132c31a$1@forums-2-dub>
X-Original-Trace: 29 Aug 2004 23:03:06 -0700, surfec007.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 29 Aug 2004 22:46:11 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 29 Aug 2004 22:56:42 -0700
X-Trace: forums-1-dub 1093845402 10.22.108.75 (29 Aug 2004 22:56:42 -0700)
X-Original-Trace: 29 Aug 2004 22:56:42 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3454
Article PK: 7355

I would suggest xp_cmdshell 'chmod ...'

On most UNIX/UNIX-like implementation a `umask ...` can be used
to allow you to change the default 'file creation' permission on a per
user's basis. For a background process it may need to be the account
which starts it (since this most likely needs to be set in a .profile or .rc
script each connection).

One web hit into the Linux Programmer's Guide, indicates this facility also
exists in LINUX and that UMASK is

CONFORMING TO
SVr4, SVID, POSIX, X/OPEN, BSD 4.3

as well.

I am not certain you want all files (log files, output files, unload files,
....
to also have the same permissions) to have the same permissions as
your application's usage so user be aware (and maybe just use
xp_cmdshell to launch a chmod for this specific case).

Generally, I believe it is a bad thing (security wise) to be too
promiscuous with umask (or even chmod); umask tends to leave
an implicit assumption about security that could be leveraged in
subtle but dangerous ways. Avoiding execution permissions may
only be the tip of the iceberg here..


Of course, posting questions like this would probably get a more
informed answer if you posted them to the

sybase.public.sqlanywhere.linux

newsgroup instead.

<Brett> wrote in message news:412f9533.6cdf.1681692777@sybase.com...
> I'm using xp_write_file to extract binary data from a Sybase
> database (9.0.1 on Linux) and when the file extracts, it has
> permissions -rw-r-----. How can I change it to where when
> the file extracts, everyone has read priveledges. Thanks.