SemiOT: filePro on FreeBSD chown gotcha

Bill Campbell bill at celestial.com
Tue Jun 22 09:16:22 PDT 2004


On Tue, Jun 22, 2004, Walter Vaughan wrote:
>We've spent a few hours chasing our tails around here with an issue that 
> seems like we've actually bitten our own tail.
>
>Using a filePro export to create a file...
>using "CLOSE" to make sure it gets written... file looks fine
>just need to move file to a "watched" directory and everything will be 
>peachy-keen.
>
>Using system "cp" < file < watch_directory worked, except that it left 
>the file as 0600 owned by filepro, and the watching program needed it 
>read-writeable.
>
>Woops.
>
>So I jump in and say "let's just chown it". Of course that failed 
>silently within the processing table. And then with my eyes as big as a 
>quarter it doesn't work from the command line either? What? chown 
>doesn't work.
>
>Finally I break down and JPR it.
>I type "man chmod". Read it three times. Should work. What the heck.
>Googling is of no help web or newsgroups.
>Read a fourth time. Read every letter this time.
>
><quote>
>The ownership of a file may only be altered by a super-user for obvious
>security reasons.
></quote>
>
>Luckly in this instance, we can mv the file just fine and since the file 
>is created 0666 the application can read and delete it.
>
>But what if I *really needed* to cp that file. Or change ownership?
>Is this a possible wishlist item to create a file under a different 
>name? Or am I missing something?

The safest way to deal with is probably to write a special purpose script
that will do filepro specific copies and chowns, then run that with
``sudo''.  The script could copy its argument(s) to the ``watched''
directory, then do the appropriate chown and chmod appropriate to the
watcher user.

Bill
--
INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Systems, Inc.
UUCP:               camco!bill  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676
URL: http://www.celestial.com/

Memoirs -- Bill Clinton is getting $12 million for his memoirs, and his
wife Hillary got $8 million for hers.  That's $20 million for memories from
two people who for eight years repeatedly testified  they couldn't remember
anything.


More information about the Filepro-list mailing list