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
|
proc
|
||||||
mnt
|
mnt
|
||||||
srv
|
srv
|
||||||
|
shr
|
||||||
dup
|
dup
|
||||||
rtc
|
rtc
|
||||||
ssl
|
ssl
|
||||||
|
|
|
@ -9,6 +9,7 @@ dev
|
||||||
proc
|
proc
|
||||||
mnt
|
mnt
|
||||||
srv
|
srv
|
||||||
|
shr
|
||||||
dup
|
dup
|
||||||
rtc
|
rtc
|
||||||
ssl
|
ssl
|
||||||
|
|
|
@ -134,6 +134,7 @@ hostownerwrite(char *a, int n)
|
||||||
|
|
||||||
renameuser(eve, buf);
|
renameuser(eve, buf);
|
||||||
srvrenameuser(eve, buf);
|
srvrenameuser(eve, buf);
|
||||||
|
shrrenameuser(eve, buf);
|
||||||
kstrdup(&eve, buf);
|
kstrdup(&eve, buf);
|
||||||
kstrdup(&up->user, buf);
|
kstrdup(&up->user, buf);
|
||||||
up->basepri = PriNormal;
|
up->basepri = PriNormal;
|
||||||
|
|
|
@ -640,3 +640,15 @@ Dev shrdevtab = {
|
||||||
shrremove,
|
shrremove,
|
||||||
shrwstat,
|
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);
|
void splxpc(int);
|
||||||
char* srvname(Chan*);
|
char* srvname(Chan*);
|
||||||
void srvrenameuser(char*, char*);
|
void srvrenameuser(char*, char*);
|
||||||
|
void shrrenameuser(char*, char*);
|
||||||
int swapcount(ulong);
|
int swapcount(ulong);
|
||||||
int swapfull(void);
|
int swapfull(void);
|
||||||
void swapinit(void);
|
void swapinit(void);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue