pts-localauth-20080204
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Mon, 4 Feb 2008 19:41:49 +0000 (19:41 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 4 Feb 2008 19:41:49 +0000 (19:41 +0000)
LICENSE IPL10

distilled from changes by mdw@umich.edu

22 files changed:
doc/man-pages/pod1/pts.pod
doc/man-pages/pod1/pts_adduser.pod
doc/man-pages/pod1/pts_chown.pod
doc/man-pages/pod1/pts_creategroup.pod
doc/man-pages/pod1/pts_createuser.pod
doc/man-pages/pod1/pts_delete.pod
doc/man-pages/pod1/pts_examine.pod
doc/man-pages/pod1/pts_interactive.pod
doc/man-pages/pod1/pts_listentries.pod
doc/man-pages/pod1/pts_listmax.pod
doc/man-pages/pod1/pts_listowned.pod
doc/man-pages/pod1/pts_membership.pod
doc/man-pages/pod1/pts_quit.pod
doc/man-pages/pod1/pts_removeuser.pod
doc/man-pages/pod1/pts_rename.pod
doc/man-pages/pod1/pts_setfields.pod
doc/man-pages/pod1/pts_setmax.pod
doc/man-pages/pod1/pts_sleep.pod
doc/man-pages/pod1/pts_source.pod
src/ptserver/pts.c
src/ptserver/ptuser.c
src/ptserver/utils.c

index 4761174..913a9ff 100644 (file)
@@ -91,6 +91,12 @@ The value of the AFSCELL environment variable.
 
 The local F</usr/vice/etc/ThisCell> file.
 
+Do not combine the B<-cell> and B<-localauth> options. A command on which
+the B<-localauth> flag is included always runs in the local cell (as
+defined in the server machine's local F</usr/afs/etc/ThisCell> file),
+whereas a command on which the B<-cell> argument is included runs in the
+specified foreign cell.
+
 =back
 
 =item B<-force>
@@ -123,6 +129,29 @@ privileged users to issue commands that change the Protection Database,
 and refuses to perform such an action even if the B<-noauth> flag is
 provided.
 
+=item B<-localauth>
+
+Constructs a server ticket using the server encryption key with the
+highest key version number in the local F</usr/afs/etc/KeyFile> file. The
+B<pts> command interpreter presents the ticket, which never expires, to
+the BOS Server during mutual authentication.
+
+Use this flag only when issuing a command on a server machine; client
+machines do not usually have a F</usr/afs/etc/KeyFile> file.  The issuer
+of a command that includes this flag must be logged on to the server
+machine as the local superuser C<root>. The flag is useful for commands
+invoked by an unattended application program, such as a process controlled
+by the UNIX B<cron> utility. It is also useful if an administrator is
+unable to authenticate to AFS but is logged in as the local superuser
+C<root>.
+
+Do not combine the B<-cell> and B<-localauth> options. A command on which
+the B<-localauth> flag is included always runs in the local cell (as
+defined in the server machine's local F</usr/afs/etc/ThisCell> file),
+whereas a command on which the B<-cell> argument is included runs in the
+specified foreign cell. Also, do not combine the B<-localauth> and
+B<-noauth> flags.
+
 =back
 
 =head1 PRIVILEGE REQUIRED
index ac2f332..cefc970 100644 (file)
@@ -8,10 +8,10 @@ pts_adduser - Adds a user or machine to a Protection Database group
 <div class="synopsis">
 
 B<pts adduser> S<<< B<-user> <I<user name>>+ >>> S<<< B<-group> <I<group name>>+ >>>
-    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-force>] [B<-help>]
+    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-localauth>] [B<-force>] [B<-help>]
 
 B<pts ad> S<<< B<-u> <I<user name>>+ >>> S<<< B<-g> <I<group name>>+ >>>
-    S<<< [B<-c> <I<cell name>>] >>> [B<-n>] [B<-f>] [B<-h>]
+    S<<< [B<-c> <I<cell name>>] >>> [B<-n>] [B<-l>] [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -60,6 +60,14 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. The B<pts> command interpreter presents the
+ticket to the Protection Server during mutual authentication. Do not combine 
+this flag with the B<-cell> or B<-noauth> options. For more details, see
+L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index cde8b98..c3de2c3 100644 (file)
@@ -8,10 +8,10 @@ pts_chown - Changes the owner of a Protection Database entry
 <div class="synopsis">
 
 B<pts chown> S<<< B<-name> <I<group name>> >>> S<<< B<-owner> <I<new owner>> >>>
-    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-force>] [B<-help>]
+    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-localauth>] [B<-force>] [B<-help>]
 
 B<pts cho> S<<< B<-na> <I<group name>> >>> S<<< B<-o> <I<new owner>> >>>
-    S<<< [B<-c> <I<cell name>>] >>> [B<-no>] [B<-f>] [B<-h>]
+    S<<< [B<-c> <I<cell name>>] >>> [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -62,6 +62,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the B<-cell> 
+or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index d2886e9..ed78053 100644 (file)
@@ -10,15 +10,15 @@ pts_creategroup - Creates an (empty) Protection Database group entry
 B<pts creategroup> S<<< B<-name> <I<group name>>+ >>>
     S<<< [B<-owner> <I<owner of the group>>] >>>
     S<<< [B<-id> <I<id (negated) for the group>>+] >>> S<<< [B<-cell> <I<cell name>>] >>>
-    [B<-noauth>] [B<-force>] [B<-help>]
+    [B<-noauth>] [B<-localauth>] [B<-force>] [B<-help>]
 
 B<pts createg> S<<< B<-na> <I<group name>>+ >>>  S<<< [B<-o> <I<owner of the group>>] >>>
     S<<< [B<-i> <I<id (negated) for the group>>+] >>> S<<< [B<-c> <I<cell name>>] >>>
-    [B<-no>] [B<-f>] [B<-h>]
+    [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 B<pts cg> S<<< B<-na> <I<group name>>+ >>> S<<< [B<-o> <I<owner of the group>>] >>>
     S<<< [B<-i> <I<id (negated) for the group>>+] >>> S<<< [B<-c> <I<cell name>>] >>>
-    [B<-no>] [B<-f>] [B<-h>]
+    [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -154,6 +154,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index 64abd23..75c8bff 100644 (file)
@@ -8,13 +8,14 @@ pts_createuser - Creates a user or machine entry in the Protection Database
 <div class="synopsis">
 
 B<pts createuser> S<<< B<-name> <I<user name>>+ >>> S<<< [B<-id> <I<user id>>+] >>>
-    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-force>] [B<-help>]
+    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-localauth>] [B<-force>] 
+    [B<-help>]
 
 B<pts createu> S<<< B<-na> <I<user name>>+ >>> S<<< [B<-i> <I<user id>>+] >>>
-    S<<< [B<-c> <I<cell name>>] >>> [B<-no>] [B<-f>] [B<-h>]
+    S<<< [B<-c> <I<cell name>>] >>> [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 B<pts cu> S<<< B<-na> <I<user name>>+ >>> S<<< [B<-i> <I<user id>>+] >>>
-    S<<< [B<-c> <I<cell name>>] >>> [B<-no>] [B<-f>] [B<-h>]
+    S<<< [B<-c> <I<cell name>>] >>> [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -137,6 +138,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index 6af9542..b06b35b 100644 (file)
@@ -8,10 +8,11 @@ pts_delete - Deletes a Protection Database entry
 <div class="synopsis">
 
 B<pts delete> S<<< B<-nameorid> <I<user or group name or id>>+ >>>
-    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-force>] [B<-help>]
+    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-localauth>] 
+    [B<-force>] [B<-help>]
 
 B<pts d> S<<< B<-na> <I<user or group name or id>>+ >>>
-    S<<< [B<-c> <I<cell name>>] >>> [B<-no>] [B<-f>] [-h]
+    S<<< [B<-c> <I<cell name>>] >>> [B<-no>] [B<-l>] [B<-f>] [-h]
 
 =for html
 </div>
@@ -71,6 +72,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index 068e1eb..6921d97 100644 (file)
@@ -8,16 +8,17 @@ pts_examine - Displays a Protection Database entry
 <div class="synopsis">
 
 B<pts examine> S<<< B<-nameorid> <I<user or group name or id>>+ >>>
-    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-force>] [B<-help>]
+    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-localauth>] 
+    [B<-force>] [B<-help>]
 
 B<pts e> S<<< B<-na> <I<user or group name or id>>+ >>> S<<< [B<-c> <I<cell name>>] >>>
-    [B<-no>] [B<-f>] [B<-h>]
+    [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 B<pts check> S<<< B<-na> <I<user or group name or id>>+ >>> S<<< [B<-c> <I<cell name>>] >>>
-    [B<-no>] [B<-f>] [B<-h>]
+    [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 B<pts che> S<<< B<-na> <I<user or group name or id>>+ >>> S<<< [B<-c> <I<cell name>>] >>>
-    [B<-no>] [B<-f>] [B<-h>]
+    [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -51,6 +52,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index 5839703..6c8a641 100644 (file)
@@ -8,7 +8,7 @@ pts_interactive - Enters interactive mode
 <div class="synopsis">
 
 B<pts interactive> S<<< [B<-cell>] <I<cell name>> >>> [B<-noauth>]
-    [B<-force>]
+    [B<-auth>] [B<-localauth>] [B<-force>]
 
 B<pts in> S<<< [B<-c>] <I<cell name>> >>> [B<-n>] [B<-f>]
 
@@ -20,6 +20,12 @@ B<pts in> S<<< [B<-c>] <I<cell name>> >>> [B<-n>] [B<-f>]
 The B<pts interactive> command allows the user to enter an interactive
 mode, useful for running bulk commands like creating new users or groups.
 
+B<pts interactive> uses the authentication state supplied on its command
+line to run all bulk commands. However, if a bulk command is supplied 
+with authentication options such as B<-cell>, B<-localauth>, B<-auth> 
+or B<-noauth> then it, and all subsequent bulk commands, will be run with
+those options.
+
 =head1 CAUTIONS
 
 Prior to OpenAFS 1.4.5 and OpenAFS 1.5.23, the B<pts interactive> command
@@ -56,6 +62,12 @@ if one of many operations fails.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =back
 
 =head1 OUTPUT
index 99b7107..79d53c1 100644 (file)
@@ -8,9 +8,10 @@ pts_listentries - Displays all users or groups in the Protection Database
 <div class="synopsis">
 
 B<pts listentries> [B<-users>] [B<-groups>] S<<< [B<-cell> <I<cell name>>] >>>
-    [B<-noauth>] [B<-force>] [B<-help>]
+    [B<-noauth>] [B<-localauth>] [B<-force>] [B<-help>]
 
-B<pts liste> [B<-u>] [B<-g>] S<<< [B<-c> <I<cell name>>] >>> [B<-n>] [B<-f>] [B<-h>]
+B<pts liste> [B<-u>] [B<-g>] S<<< [B<-c> <I<cell name>>] >>> [B<-n>] [B<-l>] 
+             [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -47,6 +48,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index 151ac68..4fec04e 100644 (file)
@@ -7,9 +7,10 @@ pts_listmax - Displays the max user id and max group id counters
 =for html
 <div class="synopsis">
 
-B<pts listmax> S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-force>] [B<-help>]
+B<pts listmax> S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-localauth>] 
+    [B<-force>] [B<-help>]
 
-B<pts listm> S<<< [B<-c> <I<cell name>>] >>> [B<-n>] [B<-f>] [B<-h>]
+B<pts listm> S<<< [B<-c> <I<cell name>>] >>> [B<-n>] [B<-l>] [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -44,6 +45,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index fc0d464..5baf3a6 100644 (file)
@@ -8,10 +8,10 @@ pts_listowned - Show the Protection Database groups owned by a user or group
 <div class="synopsis">
 
 B<pts listowned> S<<< B<-nameorid> <I<user or group name or id>>+ >>>
-    [-cell <I<cell name>>] [B<-noauth>] [B<-force>] [B<-help>]
+    [-cell <I<cell name>>] [B<-noauth>] [B<-localauth>] [B<-force>] [B<-help>]
 
 B<pts listo> S<<< B<-na> <I<user or group name or id>>+ >>>
-    [-c <I<cell name>>] [B<-no>] [B<-f>] [B<-h>]
+    [-c <I<cell name>>] [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -51,6 +51,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index 7bacc0b..e5cbdc4 100644 (file)
@@ -8,16 +8,17 @@ pts_membership - Displays the membership list for a user or group
 <div class="synopsis">
 
 B<pts membership> S<<< B<-nameorid> <I<user or group name or id>>+ >>>
-    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-force>] [B<-help>]
+    S<<< [B<-cell> <I<cell name>>] >>> [B<-localauth>] [B<-noauth>] 
+    [B<-force>] [B<-help>]
 
 B<pts m> S<<< B<-na> <I<user or group name or id>>+ >>> S<<< [B<-c> <I<cell name>>] >>>
-    [B<-no>] [B<-f>] [B<-h>]
+    [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 B<pts groups> S<<< B<-na> <I<user or group name or id>>+ >>> [-c <I<cell name>>]
-    [B<-no>] [B<-f>] [B<-h>]
+    [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 B<pts g> S<<< B<-na> <I<user or group name or id>>+ >>> S<<< [B<-c> <I<cell name>>] >>>
-    [B<-no>] [B<-f>] [B<-h>]
+    [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -59,6 +60,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index 102e885..a7a2510 100644 (file)
@@ -7,9 +7,10 @@ pts_quit - Exit from pts interactive mode
 =for html
 <div class="synopsis">
 
-B<pts quit> S<<< [B<-cell>] <I<cell name>> >>> [B<-noauth>] [B<-force>]
+B<pts quit> S<<< [B<-cell>] <I<cell name>> >>> [B<-noauth>] [B<-localauth>] 
+    [B<-force>]
 
-B<pts q> S<<< [B<-c>] <I<cell name>> >>> [B<-n>] [B<-f>]
+B<pts q> S<<< [B<-c>] <I<cell name>> >>> [B<-n>] [B<-l>] [B<-f>]
 
 =for html
 </div>
@@ -44,6 +45,12 @@ L<pts(1)>.
 Enables the command to continue executing as far as possible when errors
 or other problems occur, rather than halting execution at the first error.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-noauth>
 
 Assigns the unprivileged identity anonymous to the issuer. For more
index eb7bc9f..f60a664 100644 (file)
@@ -8,10 +8,11 @@ pts_removeuser - Removes a user from a Protection Database group
 <div class="synopsis">
 
 B<pts removeuser> S<<< B<-user> <I<user name>>+ >>> S<<< B<-group> <I<group name>>+ >>>
-    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-force>] [B<-help>]
+    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-localauth>] [B<-force>] 
+    [B<-help>]
 
 B<pts rem> S<<< B<-u> <I<user name>>+ >>> S<<< B<-g> <I<group name>>+ >>>
-    S<<< [B<-c> <I<cell name>>] >>> [B<-n>] [B<-f>] [B<-h>]
+    S<<< [B<-c> <I<cell name>>] >>> [B<-n>] [B<-l>] [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -56,6 +57,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index aef05ea..3d461e8 100644 (file)
@@ -8,10 +8,11 @@ pts_rename - Changes the name of a Protection Database entry
 <div class="synopsis">
 
 B<pts rename> S<<< B<-oldname> <I<old name>> >>> S<<< B<-newname> <I<new name>> >>>
-    S<<< [B<-cell> <I<cell name>>] >>>  [B<-noauth>]  [B<-force>]  [B<-help>]
+    S<<< [B<-cell> <I<cell name>>] >>>  [B<-noauth>]  [B<-localauth>]  
+    [B<-force>]  [B<-help>]
 
 B<pts ren> S<<< B<-o> <I<old name>> >>> S<<< B<-ne> <I<new name>> >>> S<<< [B<-c> <I<cell name>>] >>>
-    [B<-no>] [B<-f>] [B<-h>]
+    [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -69,6 +70,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index f530d10..ac7bf0e 100644 (file)
@@ -10,12 +10,13 @@ pts_setfields - Sets privacy flags or quota for a Protection Database entry
 B<pts setfields> S<<< B<-nameorid> <I<user or group name or id>>+ >>>
     S<<< [B<-access> <I<set privacy flags>>] >>>
     S<<< [B<-groupquota> <I<set limit on group creation>>] >>>
-    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-force>] [B<-help>]
+    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-localauth>]
+    [B<-force>] [B<-help>]
 
 B<pts setf> S<<< B<-na> <I<user or group name or id>>+ >>>
     S<<< [B<-a> <I<set privacy flags>>] >>>
     S<<< [B<-g> <I<set limit on group creation>>] >>> S<<< [B<-c> <I<cell name>>] >>>
-    [B<-no>] [B<-f>] [B<-h>]
+    [B<-no>] [B<-l>] [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -203,6 +204,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index 09df9de..9749848 100644 (file)
@@ -8,10 +8,10 @@ pts_setmax - Sets the value of the max group id or max user id counter
 <div class="synopsis">
 
 B<pts setmax> S<<< [B<-group> <I<group max>>] >>> S<<< [B<-user> <I<user max>>] >>>
-    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-force>] [B<-help>]
+    S<<< [B<-cell> <I<cell name>>] >>> [B<-noauth>] [B<-localauth>] [B<-force>] [B<-help>]
 
 B<pts setm> [B<-g> I<group max>>] S<<< [B<-u> <I<user max>>] >>>
-    S<<< [B<-c> <I<cell name>>] >>> [B<-n>] [B<-f>] [B<-h>]
+    S<<< [B<-c> <I<cell name>>] >>> [B<-n>] [B<-l>] [B<-f>] [B<-h>]
 
 =for html
 </div>
@@ -56,6 +56,12 @@ L<pts(1)>.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =item B<-force>
 
 Enables the command to continue executing as far as possible when errors
index 363b4a2..4c00908 100644 (file)
@@ -8,10 +8,10 @@ pts_sleep - Pauses for a few seconds
 <div class="synopsis">
 
 B<pts sleep> S<<< [B<-delay>] <I<# of seconds>> >>>
-   S<<< [B<-cell>] <I<cell name>> >>> [B<-noauth>] [B<-force>]
+   S<<< [B<-cell>] <I<cell name>> >>> [B<-noauth>] [B<-localauth>] [B<-force>]
 
 B<pts sl> S<<< [B<-d>] <I<# of seconds>> >>> S<<< [B<-c>] <I<cell name>> >>>
-   [B<-n>] [B<-f>]
+   [B<-n>] [B<-l>] [B<-f>]
 
 =for html
 </div>
@@ -33,7 +33,7 @@ it is always available.
 
 =head1 OPTIONS
 
-Although they have no effect, B<pts quit> takes the following standard
+Although they have no effect, B<pts sleep> takes the following standard
 B<pts> options:
 
 =over 4
@@ -53,6 +53,12 @@ or other problems occur, rather than halting execution at the first error.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the 
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =back
 
 =head1 OUTPUT
index c1859fc..ccaffd6 100644 (file)
@@ -8,10 +8,10 @@ pts_source - Read pts commands from a file
 <div class="synopsis">
 
 B<pts source> S<<< [B<-file>] <I<file name>> >>> S<<< [B<-cell>] <I<cell name>> >>>
-   [B<-noauth>] [B<-force>]
+   [B<-noauth>] [B<-localauth>] [B<-force>]
 
 B<pts so> S<<< [B<-f>] <I<file name>> >>> S<<< [B<-c>] <I<cell name>> >>>
-   [B<-n>] [B<-f>]
+   [B<-n>] [B<-l>] [B<-f>]
 
 =for html
 </div>
@@ -56,6 +56,12 @@ if one of many operations fails.
 Assigns the unprivileged identity anonymous to the issuer. For more
 details, see L<pts(1)>.
 
+=item B<-localauth>
+
+Constructs a server ticket using a key from the local
+F</usr/afs/etc/KeyFile> file. Do not combine this flag with the
+B<-cell> or B<-noauth> options. For more details, see L<pts(1)>.
+
 =back
 
 =head1 OUTPUT
index 6614685..60809d9 100644 (file)
@@ -50,6 +50,12 @@ struct sourcestack {
     FILE *s_file;
 } *shead;
 
+struct authstate {
+    int sec;
+    const char *confdir;
+    char cell[MAXCELLCHARS];
+};
+
 int
 pts_Interactive(struct cmd_syndesc *as, void *arock)
 {
@@ -132,32 +138,71 @@ osi_audit()
 int
 GetGlobals(struct cmd_syndesc *as, void *arock)
 {
-    register afs_int32 code;
-    char *cell;
-    afs_int32 sec = 1;
+    struct authstate *state = (struct authstate *) arock;
+    afs_int32 code;
+    char *cell = NULL;
+    afs_int32 sec;
+    int changed = 0;
+    const char* confdir;
 
     whoami = as->a0name;
 
     if (!strcmp(as->name, "help"))
        return 0;
-    if (as->parms[16].items)
+
+    if (*state->cell) {
+       cell = state->cell;
+    }
+    sec = state->sec;
+
+    if (state->confdir == NULL) {
+       changed = 1;
+    }
+
+    if (as->parms[16].items) {
+       changed = 1;
        cell = as->parms[16].items->data;
-    else
-       cell = 0;
-    if (as->parms[17].items)
+    }
+    if (as->parms[17].items) { /* -noauth */
+       changed = 1;
        sec = 0;
-
-    if (as->parms[18].items) { /* testing? */
-       code = pr_Initialize(sec, AFSDIR_SERVER_ETC_DIRPATH, cell);
+    }
+    if (as->parms[20].items) { /* -localauth */
+       changed = 1;
+       sec = 2;
+    }
+    if (as->parms[21].items) { /* -auth */
+       changed = 1;
+       sec = 1;
+    }
+    if (as->parms[18].items || as->parms[20].items) { /* -test, -localauth */
+       changed = 1;
+       confdir = AFSDIR_SERVER_ETC_DIRPATH;
     } else {
-       code = pr_Initialize(sec, AFSDIR_CLIENT_ETC_DIRPATH, cell);
+       if (sec == 2)
+           confdir = AFSDIR_SERVER_ETC_DIRPATH;
+       else
+           confdir = AFSDIR_CLIENT_ETC_DIRPATH;
+    }
+    if (changed) {
+       CleanUp(as, arock);
+       code = pr_Initialize(sec, confdir, cell);
+    } else {
+       code = 0;
     }
     if (code) {
        afs_com_err(whoami, code, "while initializing");
        return code;
     }
+    state->sec = sec;
+    state->confdir = confdir;
+    if (cell && cell != state->cell)
+        strncpy(state->cell, cell, MAXCELLCHARS-1);
+
+    force = 0;
     if (as->parms[19].items)
        force = 1;
+
     return code;
 }
 
@@ -704,7 +749,7 @@ ListEntries(struct cmd_syndesc *as, void *arock)
            pr_ListEntries(flag, startindex, &nentries, &entriesp,
                           &nextstartindex);
        if (code) {
-           afs_com_err(whoami, code, "; unable to list entries\n");
+           afs_com_err(whoami, code, "; unable to list entries");
            if (entriesp)
                free(entriesp);
            break;
@@ -972,6 +1017,10 @@ add_std_args(register struct cmd_syndesc *ts)
     cmd_AddParm(ts, "-test", CMD_FLAG, CMD_OPTIONAL | CMD_HIDE, test_help);
     cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL,
                "Continue oper despite reasonable errors");
+    cmd_AddParm(ts, "-localauth", CMD_FLAG, CMD_OPTIONAL,
+               "use local authentication");
+    cmd_AddParm(ts, "-auth", CMD_FLAG, CMD_OPTIONAL,
+               "use user's authentication (default)");
 }
 
 /*
@@ -996,6 +1045,7 @@ main(int argc, char **argv)
     int parsec;
     char *parsev[CMD_MAXPARMS];
     char *savec;
+    struct authstate state;
 
 #ifdef WIN32
     WSADATA WSAjunk;
@@ -1020,6 +1070,9 @@ main(int argc, char **argv)
     sigaction(SIGSEGV, &nsa, NULL);
 #endif
 
+    memset(&state, 0, sizeof(state));
+    state.sec = 1; /* default is auth */
+
     ts = cmd_CreateSyntax("creategroup", CreateGroup, NULL,
                          "create a new group");
     cmd_AddParm(ts, "-name", CMD_LIST, 0, "group name");
@@ -1121,7 +1174,7 @@ main(int argc, char **argv)
     cmd_AddParm(ts, "-delay", CMD_SINGLE, 0, "seconds");
     add_std_args(ts);
 
-    cmd_SetBeforeProc(GetGlobals, 0);
+    cmd_SetBeforeProc(GetGlobals, &state);
 
     finished = 1;
     source = stdin;
index 7635319..0c4eaf1 100644 (file)
@@ -91,11 +91,12 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell)
        if (!tdir) {
            if (confDir && strcmp(confDir, ""))
                fprintf(stderr,
-                       "libprot: Could not open configuration directory: %s.\n",
-                       confDir);
+                       "%s: Could not open configuration directory: %s.\n",
+                       whoami, confDir);
             else
                fprintf(stderr,
-                       "libprot: No configuration directory specified.\n");
+                       "%s: No configuration directory specified.\n",
+                       whoami);
            return -1;
        }
         gottdir = 1;
@@ -173,16 +174,22 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell)
     /* Most callers use secLevel==1, however, the fileserver uses secLevel==2
      * to force use of the KeyFile.  secLevel == 0 implies -noauth was
      * specified. */
-    if ((secLevel == 2) && (afsconf_GetLatestKey(tdir, 0, 0) == 0)) {
-       /* If secLevel is two assume we're on a file server and use
-        * ClientAuthSecure if possible. */
-       code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex);
-       if (code)
-           fprintf(stderr,
-                   "libprot: clientauthsecure returns %d %s"
-                   " (so trying noauth)\n", code, afs_error_message(code));
-       if (code)
-           scIndex = 0;        /* use noauth */
+    if (secLevel == 2) {
+       code = afsconf_GetLatestKey(tdir, 0, 0);
+       if (code) {
+           afs_com_err(whoami, code, 
+                       "(getting key from local KeyFile)\n");
+           scIndex = 0; /* use noauth */
+       } else {
+           /* If secLevel is two assume we're on a file server and use
+            * ClientAuthSecure if possible. */
+           code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex);
+           if (code) {
+               afs_com_err(whoami, code,
+                           "(calling client secure)\n");
+               scIndex = 0;    /* use noauth */
+           }
+        }
        if (scIndex != 2)
            /* if there was a problem, an unauthenticated conn is returned */
            sc[scIndex] = sc[2];
@@ -192,16 +199,17 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell)
        sname.instance[0] = 0;
        strcpy(sname.name, "afs");
        code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
-       if (code)
+       if (code) {
+           afs_com_err(whoami, code, "(getting token)");
            scIndex = 0;
-       else {
+       } else {
            if (ttoken.kvno >= 0 && ttoken.kvno <= 256)
                /* this is a kerberos ticket, set scIndex accordingly */
                scIndex = 2;
            else {
                fprintf(stderr,
-                       "libprot: funny kvno (%d) in ticket, proceeding\n",
-                       ttoken.kvno);
+                       "%s: funny kvno (%d) in ticket, proceeding\n",
+                       whoami, ttoken.kvno);
                scIndex = 2;
            }
            sc[2] =
@@ -216,8 +224,9 @@ pr_Initialize(IN afs_int32 secLevel, IN const char *confDir, IN char *cell)
     if ((scIndex == 0) && (sc[0] == 0))
        sc[0] = rxnull_NewClientSecurityObject();
     if ((scIndex == 0) && (secLevel != 0))
-       afs_com_err(whoami, code,
-               "Could not get afs tokens, running unauthenticated.");
+       fprintf(stderr,
+               "%s: Could not get afs tokens, running unauthenticated\n",
+               whoami);
 
     memset(serverconns, 0, sizeof(serverconns));       /* terminate list!!! */
     for (i = 0; i < info.numServers; i++)
index ee01ac3..a127e3c 100644 (file)
@@ -824,6 +824,9 @@ IsAMemberOf(struct ubik_trans *at, afs_int32 aid, afs_int32 gid)
        return 1;
     if (gid == AUTHUSERID && aid != ANONYMOUSID)
        return 1;
+    /* check -localauth case */
+    if (gid == SYSADMINID && aid == SYSADMINID)
+        return 1;
     if ((gid == 0) || (aid == 0))
        return 0;
 #if defined(SUPERGROUPS)