File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88# version of a protocol, use multiple inheritance as shown below.
99
1010
11+ import rpc
1112from rpc import Packer , Unpacker , TCPClient , UDPClient
1213
1314MOUNTPROG = 100005
@@ -76,6 +77,18 @@ def addpackers(self):
7677 self .packer = MountPacker ().init ()
7778 self .unpacker = MountUnpacker ().init ('' )
7879
80+ # This function is called to gobble up a suitable
81+ # authentication object for a call to procedure 'proc'.
82+ # (Experiments suggest that for Mnt/Unmnt, Unix authentication
83+ # is necessary, while the other calls require no
84+ # authentication.)
85+ def mkcred (self , proc ):
86+ if proc not in (1 , 3 , 4 ): # not Mnt/Unmnt/Unmntall
87+ return rpc .AUTH_NULL , ''
88+ if self .cred == None :
89+ self .cred = rpc .AUTH_UNIX , rpc .make_auth_unix_default ()
90+ return self .cred
91+
7992 # The methods Mnt, Dump etc. each implement one Remote
8093 # Procedure Call. Their general structure is
8194 # self.start_call(<procedure-number>)
You can’t perform that action at this time.
0 commit comments