devshr: rename hook
This commit is contained in:
parent
e3cc408215
commit
27fd88af23
5 changed files with 16 additions and 0 deletions
|
@ -9,6 +9,7 @@ dev
|
|||
proc
|
||||
mnt
|
||||
srv
|
||||
shr
|
||||
dup
|
||||
rtc
|
||||
ssl
|
||||
|
|
|
@ -9,6 +9,7 @@ dev
|
|||
proc
|
||||
mnt
|
||||
srv
|
||||
shr
|
||||
dup
|
||||
rtc
|
||||
ssl
|
||||
|
|
|
@ -134,6 +134,7 @@ hostownerwrite(char *a, int n)
|
|||
|
||||
renameuser(eve, buf);
|
||||
srvrenameuser(eve, buf);
|
||||
shrrenameuser(eve, buf);
|
||||
kstrdup(&eve, buf);
|
||||
kstrdup(&up->user, buf);
|
||||
up->basepri = PriNormal;
|
||||
|
|
|
@ -640,3 +640,15 @@ Dev shrdevtab = {
|
|||
shrremove,
|
||||
shrwstat,
|
||||
};
|
||||
|
||||
void
|
||||
shrrenameuser(char *old, char *new)
|
||||
{
|
||||
Shr *sp;
|
||||
|
||||
qlock(&shrlk);
|
||||
for(sp = shr; sp; sp = sp->link)
|
||||
if(sp->owner!=nil && strcmp(old, sp->owner)==0)
|
||||
kstrdup(&sp->owner, new);
|
||||
qunlock(&shrlk);
|
||||
}
|
|
@ -319,6 +319,7 @@ void splx(int);
|
|||
void splxpc(int);
|
||||
char* srvname(Chan*);
|
||||
void srvrenameuser(char*, char*);
|
||||
void shrrenameuser(char*, char*);
|
||||
int swapcount(ulong);
|
||||
int swapfull(void);
|
||||
void swapinit(void);
|
||||
|
|
Loading…
Reference in a new issue