diff options
author | jbj <devnull@localhost> | 2002-06-23 19:47:08 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-06-23 19:47:08 +0000 |
commit | 13d177beb233e111b3ede3edc1340747433a7556 (patch) | |
tree | bbc977014bf90f658b0181792ea42aad52b449d6 /rpmio/ugid.c | |
parent | 05cb73a7ee762065339393057d421613866e0418 (diff) | |
download | rpm-13d177beb233e111b3ede3edc1340747433a7556.tar.gz rpm-13d177beb233e111b3ede3edc1340747433a7556.tar.bz2 rpm-13d177beb233e111b3ede3edc1340747433a7556.zip |
Add boundswrite annotations everywhere.
CVS patchset: 5522
CVS date: 2002/06/23 19:47:08
Diffstat (limited to 'rpmio/ugid.c')
-rw-r--r-- | rpmio/ugid.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/rpmio/ugid.c b/rpmio/ugid.c index 4126f4268..697574a27 100644 --- a/rpmio/ugid.c +++ b/rpmio/ugid.c @@ -26,7 +26,9 @@ int unameToUid(const char * thisUname, uid_t * uid) lastUnameLen = 0; return -1; } else if (strcmp(thisUname, "root") == 0) { +/*@-boundswrite@*/ *uid = 0; +/*@=boundswrite@*/ return 0; } @@ -38,7 +40,9 @@ int unameToUid(const char * thisUname, uid_t * uid) lastUnameAlloced = thisUnameLen + 10; lastUname = xrealloc(lastUname, lastUnameAlloced); /* XXX memory leak */ } +/*@-boundswrite@*/ strcpy(lastUname, thisUname); +/*@=boundswrite@*/ pwent = getpwnam(thisUname); if (pwent == NULL) { @@ -52,7 +56,9 @@ int unameToUid(const char * thisUname, uid_t * uid) lastUid = pwent->pw_uid; } +/*@-boundswrite@*/ *uid = lastUid; +/*@=boundswrite@*/ return 0; } @@ -70,7 +76,9 @@ int gnameToGid(const char * thisGname, gid_t * gid) lastGnameLen = 0; return -1; } else if (strcmp(thisGname, "root") == 0) { +/*@-boundswrite@*/ *gid = 0; +/*@=boundswrite@*/ return 0; } @@ -82,7 +90,9 @@ int gnameToGid(const char * thisGname, gid_t * gid) lastGnameAlloced = thisGnameLen + 10; lastGname = xrealloc(lastGname, lastGnameAlloced); /* XXX memory leak */ } +/*@-boundswrite@*/ strcpy(lastGname, thisGname); +/*@=boundswrite@*/ grent = getgrnam(thisGname); if (grent == NULL) { @@ -95,7 +105,9 @@ int gnameToGid(const char * thisGname, gid_t * gid) lastGid = grent->gr_gid; } +/*@-boundswrite@*/ *gid = lastGid; +/*@=boundswrite@*/ return 0; } @@ -125,7 +137,9 @@ char * uidToUname(uid_t uid) lastUnameLen = len + 20; lastUname = xrealloc(lastUname, lastUnameLen); } +/*@-boundswrite@*/ strcpy(lastUname, pwent->pw_name); +/*@=boundswrite@*/ return lastUname; } @@ -156,7 +170,9 @@ char * gidToGname(gid_t gid) lastGnameLen = len + 20; lastGname = xrealloc(lastGname, lastGnameLen); } +/*@-boundswrite@*/ strcpy(lastGname, grent->gr_name); +/*@=boundswrite@*/ return lastGname; } |