Changeset 1599 for trunk


Ignore:
Timestamp:
Aug 21, 2010, 3:21:52 AM (14 years ago)
Author:
geofft
Message:
admof: Actually AFS likes to edit its input strings.

So drop the const qualifiers (the data is actually mutable, so this was fine,
but the cast was misleading).

Also fix a terminating null issue with the previous commit.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/common/oursrc/accountadm/admof.c

    r1598 r1599  
    4444
    4545static bool
    46 ismember(const char *user, const char *group)
     46ismember(char *user, char *group)
    4747{
    4848    int flag;
    49     if (pr_IsAMemberOf((char *)user, (char *)group, &flag) == 0)
     49    if (pr_IsAMemberOf(user, group, &flag) == 0)
    5050        return flag;
    5151    else
     
    5555/* Parse an ACL of n entries, returning the rights for user. */
    5656static int
    57 parse_rights(int n, const char **p, const char *user)
     57parse_rights(int n, const char **p, char *user)
    5858{
    5959    int rights = 0, *trights = malloc(n * sizeof(int)), i;
     
    248248#ifdef SYSADMINS
    249249    if (~rights & PRSFS_ADMINISTER) {
    250         strncpy(cell, SYSADMIN_CELL, MAXCELLCHARS - 1);
     250        snprintf(cell, MAXCELLCHARS, "%s", SYSADMIN_CELL);
    251251        if (pr_Initialize(secLevel, (char *)AFSDIR_CLIENT_ETC_DIRPATH, cell) == 0) {
    252252            if (ismember(user, SYSADMINS)) {
Note: See TracChangeset for help on using the changeset viewer.