diff options
author | aiju <aiju@phicode.de> | 2011-07-28 14:22:39 +0200 |
---|---|---|
committer | aiju <aiju@phicode.de> | 2011-07-28 14:22:39 +0200 |
commit | 27fd88af23b165c1c3c454cb1e1f889d9b74784c (patch) | |
tree | 1dab6c6eb94a1db822042434b1c3b6d491ca05a7 | |
parent | e3cc4082159706680418a76fd585aec1e5a5b3ca (diff) |
devshr: rename hook
-rw-r--r-- | sys/src/9/pc/pccpuf | 1 | ||||
-rw-r--r-- | sys/src/9/pc/pcf | 1 | ||||
-rw-r--r-- | sys/src/9/port/auth.c | 1 | ||||
-rw-r--r-- | sys/src/9/port/devshr.c | 12 | ||||
-rw-r--r-- | sys/src/9/port/portfns.h | 1 |
5 files changed, 16 insertions, 0 deletions
diff --git a/sys/src/9/pc/pccpuf b/sys/src/9/pc/pccpuf index 6e50e3c9a..4605736aa 100644 --- a/sys/src/9/pc/pccpuf +++ b/sys/src/9/pc/pccpuf @@ -9,6 +9,7 @@ dev proc mnt srv + shr dup rtc ssl diff --git a/sys/src/9/pc/pcf b/sys/src/9/pc/pcf index bfebfa2b5..f4e31d9eb 100644 --- a/sys/src/9/pc/pcf +++ b/sys/src/9/pc/pcf @@ -9,6 +9,7 @@ dev proc mnt srv + shr dup rtc ssl diff --git a/sys/src/9/port/auth.c b/sys/src/9/port/auth.c index 7521e5a43..6c4bdac98 100644 --- a/sys/src/9/port/auth.c +++ b/sys/src/9/port/auth.c @@ -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; diff --git a/sys/src/9/port/devshr.c b/sys/src/9/port/devshr.c index 62442b018..4b11d6634 100644 --- a/sys/src/9/port/devshr.c +++ b/sys/src/9/port/devshr.c @@ -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); +}
\ No newline at end of file diff --git a/sys/src/9/port/portfns.h b/sys/src/9/port/portfns.h index 4dd37938d..6e6653901 100644 --- a/sys/src/9/port/portfns.h +++ b/sys/src/9/port/portfns.h @@ -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); |