Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libplist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwn
libplist
Commits
7ac3d681
Commit
7ac3d681
authored
Aug 31, 2008
by
Jonathan Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix afc_getattr and more error handling in ifuse.c
parent
95e588fa
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
AFC.c
src/AFC.c
+3
-2
ifuse.c
src/ifuse.c
+7
-4
No files found.
src/AFC.c
View file @
7ac3d681
...
@@ -593,7 +593,7 @@ iphone_afc_file_t afc_get_file_info(iphone_afc_client_t client, const char *path
...
@@ -593,7 +593,7 @@ iphone_afc_file_t afc_get_file_info(iphone_afc_client_t client, const char *path
*/
*/
iphone_error_t
iphone_afc_get_file_attr
(
iphone_afc_client_t
client
,
const
char
*
filename
,
struct
stat
*
stbuf
)
{
iphone_error_t
iphone_afc_get_file_attr
(
iphone_afc_client_t
client
,
const
char
*
filename
,
struct
stat
*
stbuf
)
{
i
nt
ret
=
IPHONE_E_SUCCESS
;
i
phone_error_t
ret
=
IPHONE_E_UNKNOWN_ERROR
;
if
(
!
client
||!
client
->
connection
||
!
client
->
afc_packet
||
!
stbuf
)
return
IPHONE_E_INVALID_ARG
;
if
(
!
client
||!
client
->
connection
||
!
client
->
afc_packet
||
!
stbuf
)
return
IPHONE_E_INVALID_ARG
;
memset
(
stbuf
,
0
,
sizeof
(
struct
stat
));
memset
(
stbuf
,
0
,
sizeof
(
struct
stat
));
...
@@ -608,8 +608,9 @@ iphone_error_t iphone_afc_get_file_attr ( iphone_afc_client_t client, const char
...
@@ -608,8 +608,9 @@ iphone_error_t iphone_afc_get_file_attr ( iphone_afc_client_t client, const char
stbuf
->
st_uid
=
getuid
();
stbuf
->
st_uid
=
getuid
();
stbuf
->
st_gid
=
getgid
();
stbuf
->
st_gid
=
getgid
();
iphone_afc_close_file
(
client
,
file
);
ret
=
iphone_afc_close_file
(
client
,
file
);
}
}
return
ret
;
}
}
/** Opens a file on the phone.
/** Opens a file on the phone.
...
...
src/ifuse.c
View file @
7ac3d681
...
@@ -46,7 +46,10 @@ static int ifuse_getattr(const char *path, struct stat *stbuf) {
...
@@ -46,7 +46,10 @@ static int ifuse_getattr(const char *path, struct stat *stbuf) {
int
res
=
0
;
int
res
=
0
;
iphone_afc_client_t
afc
=
fuse_get_context
()
->
private_data
;
iphone_afc_client_t
afc
=
fuse_get_context
()
->
private_data
;
iphone_afc_get_file_attr
(
afc
,
path
,
stbuf
);
iphone_error_t
ret
=
iphone_afc_get_file_attr
(
afc
,
path
,
stbuf
);
if
(
ret
!=
IPHONE_E_SUCCESS
)
res
=
-
ENOENT
;
return
res
;
return
res
;
}
}
...
@@ -253,19 +256,19 @@ int ifuse_ftruncate(const char *path, off_t size, struct fuse_file_info *fi) {
...
@@ -253,19 +256,19 @@ int ifuse_ftruncate(const char *path, off_t size, struct fuse_file_info *fi) {
int
ifuse_unlink
(
const
char
*
path
)
{
int
ifuse_unlink
(
const
char
*
path
)
{
iphone_afc_client_t
afc
=
fuse_get_context
()
->
private_data
;
iphone_afc_client_t
afc
=
fuse_get_context
()
->
private_data
;
if
(
iphone_afc_delete_file
(
afc
,
path
))
return
0
;
if
(
IPHONE_E_SUCCESS
==
iphone_afc_delete_file
(
afc
,
path
))
return
0
;
else
return
-
1
;
else
return
-
1
;
}
}
int
ifuse_rename
(
const
char
*
from
,
const
char
*
to
)
{
int
ifuse_rename
(
const
char
*
from
,
const
char
*
to
)
{
iphone_afc_client_t
afc
=
fuse_get_context
()
->
private_data
;
iphone_afc_client_t
afc
=
fuse_get_context
()
->
private_data
;
if
(
iphone_afc_rename_file
(
afc
,
from
,
to
))
return
0
;
if
(
IPHONE_E_SUCCESS
==
iphone_afc_rename_file
(
afc
,
from
,
to
))
return
0
;
else
return
-
1
;
else
return
-
1
;
}
}
int
ifuse_mkdir
(
const
char
*
dir
,
mode_t
ignored
)
{
int
ifuse_mkdir
(
const
char
*
dir
,
mode_t
ignored
)
{
iphone_afc_client_t
afc
=
fuse_get_context
()
->
private_data
;
iphone_afc_client_t
afc
=
fuse_get_context
()
->
private_data
;
if
(
iphone_afc_mkdir
(
afc
,
dir
))
return
0
;
if
(
IPHONE_E_SUCCESS
==
iphone_afc_mkdir
(
afc
,
dir
))
return
0
;
else
return
-
1
;
else
return
-
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment