mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
* fish.c (fish_chown): Do nothing and return success if
getpwuid() or getgrgid() fails.
This commit is contained in:
parent
78ab72b19f
commit
80f37db22b
@ -1,3 +1,8 @@
|
||||
2001-07-09 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* fish.c (fish_chown): Do nothing and return success if
|
||||
getpwuid() or getgrgid() fails.
|
||||
|
||||
2001-07-05 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* README.fish: Spelling fixes.
|
||||
|
13
vfs/fish.c
13
vfs/fish.c
@ -700,9 +700,18 @@ static int
|
||||
fish_chown (vfs *me, char *path, int owner, int group)
|
||||
{
|
||||
char *sowner, *sgroup;
|
||||
struct passwd *pw;
|
||||
struct group *gr;
|
||||
PREFIX
|
||||
sowner = getpwuid( owner )->pw_name;
|
||||
sgroup = getgrgid( group )->gr_name;
|
||||
|
||||
if ((pw = getpwuid (owner)) == NULL)
|
||||
return 0;
|
||||
|
||||
if ((gr = getgrgid (group)) == NULL)
|
||||
return 0;
|
||||
|
||||
sowner = pw->pw_name;
|
||||
sgroup = gr->gr_name;
|
||||
g_snprintf(buf, sizeof(buf),
|
||||
"#CHOWN /%s /%s\n"
|
||||
"chown %s \"/%s\" 2>/dev/null\n"
|
||||
|
Loading…
Reference in New Issue
Block a user