commit 033228b444a48e852bac5762fd6c2c9db7177b94
parent 79fe633448883a144e3ded13cac19460802ea74b
Author: gottox@rootkit.lan <unknown>
Date: Mon, 14 Jan 2008 20:07:41 +0100
More verbose error handling
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sltar.c b/sltar.c
@@ -69,9 +69,10 @@ int main(int argc, char *argv[]) {
perror(fname);
break;
default:
- fputs("not supported filetype\n",stderr);
+ fprintf(stderr,"not supported filetype %c\n",b[TYPE]);
}
- chown(fname, strtoul(b + UID,0,8),strtoul(b + GID,0,8));
+ if(getuid() == 0 && chown(fname, strtoul(b + UID,0,8),strtoul(b + GID,0,8)))
+ perror(fname);
}
else if(a == 'x' && f && !fwrite(b,l > 512 ? END : l,1,f)) {
perror(fname);