Bug 5088 - server can still create a repo when in --readonly mode
: server can still create a repo when in --readonly mode
Status: RESOLVED FIXINSOURCE
Product: pkg
depot
: os200811_rc1c (979f1be5339d)
: Other Solaris
: P4 minor (vote)
: ---
Assigned To: Shawn Walker
: pkg/depot watcher
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-11-14 16:11 UTC by Dan Price
Modified: 2009-02-13 12:08 UTC (History)
0 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Dan Price 2008-11-14 16:11:06 UTC
If the depot server is pointed at a bogus directory, it will create a
repo there, even when started in --readonly mode.  It'd be nice to simply
error out and exit 1 on this case instead.
Comment 1 Shawn Walker 2009-02-06 21:50:57 UTC
As a side-effect of my local publishing changes, this was easily fixed.
Comment 2 Shawn Walker 2009-02-06 21:53:06 UTC
If the specified repo_dir does not exist, it will exit this way:

$ ./depot.py -p 8009 -d /tmp/repo --readonly --content-root=`pwd`
pkg.depotd: an error occurred while trying to initialize the depot repository
directory structures:
The specified repository root '/tmp/repo' does not exist.

$ echo $?
1


If the specified repo_dir does exist, but doesn't contain all of the requisite
repository directories and cfg_cache, it will exit this way:

./depot.py -p 8009 -d /tmp/repo --readonly --content-root=`pwd`
pkg.depotd: an error occurred while trying to initialize the depot repository
directory structures:
The specified repository root '/tmp/repo' is not a valid repository.

$ echo $?
1

There are unit tests to verify this now as well.
Comment 3 Shawn Walker 2009-02-13 12:08:41 UTC
Fixed in changeset 873 / b95d76c53b5eeece7335982e3ccf7047770decc4.