diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-04-23 10:22:32 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-04-23 10:37:49 +0200 |
commit | 75ad18037955b1e787e48648a09b0016b1cdce8f (patch) | |
tree | 64294158eeee3e0944718455fa810c35c722ad28 /source3/libsmb | |
parent | bf3b2e2aee284c85ecea6a3142bc1fa5344b430a (diff) | |
download | samba-75ad18037955b1e787e48648a09b0016b1cdce8f.tar.gz samba-75ad18037955b1e787e48648a09b0016b1cdce8f.tar.bz2 samba-75ad18037955b1e787e48648a09b0016b1cdce8f.zip |
s3:libsmb: make use of BVAL() and remove ugly LARGE_SMB_OFF_T ifdef's
We rely on uint64_t for a long time now...
metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/cliquota.c | 62 |
1 files changed, 5 insertions, 57 deletions
diff --git a/source3/libsmb/cliquota.c b/source3/libsmb/cliquota.c index e05b64e686..e5c8c831b7 100644 --- a/source3/libsmb/cliquota.c +++ b/source3/libsmb/cliquota.c @@ -80,43 +80,13 @@ static bool parse_user_quota_record(const uint8_t *rdata, */ /* the used space 8 bytes (uint64_t)*/ - qt.usedspace = (uint64_t)IVAL(rdata,16); -#ifdef LARGE_SMB_OFF_T - qt.usedspace |= (((uint64_t)IVAL(rdata,20)) << 32); -#else /* LARGE_SMB_OFF_T */ - if ((IVAL(rdata,20) != 0)&& - ((qt.usedspace != 0xFFFFFFFF)|| - (IVAL(rdata,20)!=0xFFFFFFFF))) { - /* more than 32 bits? */ - return False; - } -#endif /* LARGE_SMB_OFF_T */ + qt.usedspace = BVAL(rdata,16); /* the soft quotas 8 bytes (uint64_t)*/ - qt.softlim = (uint64_t)IVAL(rdata,24); -#ifdef LARGE_SMB_OFF_T - qt.softlim |= (((uint64_t)IVAL(rdata,28)) << 32); -#else /* LARGE_SMB_OFF_T */ - if ((IVAL(rdata,28) != 0)&& - ((qt.softlim != 0xFFFFFFFF)|| - (IVAL(rdata,28)!=0xFFFFFFFF))) { - /* more than 32 bits? */ - return False; - } -#endif /* LARGE_SMB_OFF_T */ + qt.softlim = BVAL(rdata,24); /* the hard quotas 8 bytes (uint64_t)*/ - qt.hardlim = (uint64_t)IVAL(rdata,32); -#ifdef LARGE_SMB_OFF_T - qt.hardlim |= (((uint64_t)IVAL(rdata,36)) << 32); -#else /* LARGE_SMB_OFF_T */ - if ((IVAL(rdata,36) != 0)&& - ((qt.hardlim != 0xFFFFFFFF)|| - (IVAL(rdata,36)!=0xFFFFFFFF))) { - /* more than 32 bits? */ - return False; - } -#endif /* LARGE_SMB_OFF_T */ + qt.hardlim = BVAL(rdata,32); if (!sid_parse((char *)rdata+40,sid_len,&qt.sid)) { return false; @@ -421,32 +391,10 @@ NTSTATUS cli_get_fs_quota_info(struct cli_state *cli, int quota_fnum, /* unknown_1 24 NULL bytes in pdata*/ /* the soft quotas 8 bytes (uint64_t)*/ - qt.softlim = (uint64_t)IVAL(rdata,24); -#ifdef LARGE_SMB_OFF_T - qt.softlim |= (((uint64_t)IVAL(rdata,28)) << 32); -#else /* LARGE_SMB_OFF_T */ - if ((IVAL(rdata,28) != 0)&& - ((qt.softlim != 0xFFFFFFFF)|| - (IVAL(rdata,28)!=0xFFFFFFFF))) { - /* more than 32 bits? */ - status = NT_STATUS_INVALID_NETWORK_RESPONSE; - goto cleanup; - } -#endif /* LARGE_SMB_OFF_T */ + qt.softlim = BVAL(rdata,24); /* the hard quotas 8 bytes (uint64_t)*/ - qt.hardlim = (uint64_t)IVAL(rdata,32); -#ifdef LARGE_SMB_OFF_T - qt.hardlim |= (((uint64_t)IVAL(rdata,36)) << 32); -#else /* LARGE_SMB_OFF_T */ - if ((IVAL(rdata,36) != 0)&& - ((qt.hardlim != 0xFFFFFFFF)|| - (IVAL(rdata,36)!=0xFFFFFFFF))) { - /* more than 32 bits? */ - status = NT_STATUS_INVALID_NETWORK_RESPONSE; - goto cleanup; - } -#endif /* LARGE_SMB_OFF_T */ + qt.hardlim = BVAL(rdata,32); /* quota_flags 2 bytes **/ qt.qflags = SVAL(rdata,40); |