[request-sponsor] Request Sponsor Bug : 6638873 :usermod -m could optimize the move

2008-02-12 Thread Avinash Joshi
Hi.

Rishi M Nair (OS0148) and I Avinash Joshi(OS0142) would like to work on the
bug 6638873. We will send the fix at the earliest.

Bug ID - 6638873
Synopsis - usermod -m could optimize the move
Category:Subcategory - utility:security

About the bug:

I just wanted to know how to rename a directory.
For moving the dir, there is a built in function ret =
move_dir(pstruct->pw_dir, dir, logname); which is defined in
usr/src/cmd/oamuser/user/movedir.c

Is there a similar function that renames a directory?

If so pls let me know. Or do we need to create a new function that renames a
directory?

-- 
~ Avinash Joshi
Blog: http://avinashtjoshi.wordpress.com/
Site: http://avinashtjoshi.googlepages.com/
-- next part --
An HTML attachment was scrubbed...
URL: 



[request-sponsor] Request Sponsor Bug : 6638873 :usermod -m could optimize the move

2008-02-12 Thread casper....@sun.com

>Avinash Joshi wrote:
>> I just wanted to know how to rename a directory.
>> For moving the dir, there is a built in function ret = 
>> move_dir(pstruct->pw_dir, dir, logname); which is defined in 
>> usr/src/cmd/oamuser/user/movedir.c
>> 
>> Is there a similar function that renames a directory?
>
>If the new name is on the same filesystem, see the rename(2) man page.


And if not, cobble something together with posix_spawn and "mv(1)".

Casper




[request-sponsor] Request Sponsor Bug : 6638873 :usermod -m could optimize the move

2008-02-12 Thread Peter Tribble
On Feb 12, 2008 4:34 PM,   wrote:
>
> >Avinash Joshi wrote:
> >> I just wanted to know how to rename a directory.
> >> For moving the dir, there is a built in function ret =
> >> move_dir(pstruct->pw_dir, dir, logname); which is defined in
> >> usr/src/cmd/oamuser/user/movedir.c
> >>
> >> Is there a similar function that renames a directory?
> >
> >If the new name is on the same filesystem, see the rename(2) man page.
>
>
> And if not, cobble something together with posix_spawn and "mv(1)".

That would be better than the current

system("cd src && find . -print | cpio -m -pd dest");

(I'm the poor schmuck who filed this bug after having to wait 15
minutes for it to do this when a simple rename would have sufficed.)

As the comments in the bug say, though, any fix ought to handle
the zfs case properly as well.

-- 
-Peter Tribble
http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/



[request-sponsor] Request Sponsor Bug : 6638873 :usermod -m could optimize the move

2008-02-12 Thread Alan Coopersmith
Avinash Joshi wrote:
> I just wanted to know how to rename a directory.
> For moving the dir, there is a built in function ret = 
> move_dir(pstruct->pw_dir, dir, logname); which is defined in 
> usr/src/cmd/oamuser/user/movedir.c
> 
> Is there a similar function that renames a directory?

If the new name is on the same filesystem, see the rename(2) man page.

-- 
-Alan Coopersmith-   alan.coopersmith at sun.com
 Sun Microsystems, Inc. - X Window System Engineering