[hackers] [sltar] More verbose error handling || gottox

From: <hg_AT_suckless.org>
Date: Sun, 11 Nov 2012 17:23:50 +0100 (CET)

changeset: 24:be86af4effe7
parent: 22:18021ed2100c
user: gottox_AT_rootkit.lan
date: Mon Jan 14 20:07:41 2008 +0100
files: sltar.c
description:
More verbose error handling


diff -r 18021ed2100c -r be86af4effe7 sltar.c
--- a/sltar.c Thu Dec 27 19:35:50 2007 +0100
+++ b/sltar.c Mon Jan 14 20:07:41 2008 +0100
_AT_@ -69,9 +69,10 @@
                                         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);
Received on Sun Nov 11 2012 - 17:23:50 CET

This archive was generated by hypermail 2.3.0 : Sun Nov 11 2012 - 17:24:45 CET