Changeset 26 for trunk/samba/source/smbd/quotas.c
- Timestamp:
- Apr 10, 2007, 7:27:38 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/samba/source/smbd/quotas.c
r1 r26 239 239 return(False); 240 240 241 become_root _uid_only();241 become_root(); 242 242 243 243 if (strcmp(mnt->mnt_type, "xfs")==0) { … … 252 252 } 253 253 254 unbecome_root _uid_only();254 unbecome_root(); 255 255 256 256 /* Use softlimit to determine disk space, except when it has been exceeded */ … … 656 656 return(False) ; 657 657 658 become_root _uid_only();658 become_root(); 659 659 660 660 #if defined(SUNOS5) … … 663 663 DEBUG(5,("disk_quotas: looking for mountpath (NFS) \"%s\"\n", mnt.mnt_special)); 664 664 retval = nfs_quotas(mnt.mnt_special, euser_id, bsize, dfree, dsize); 665 unbecome _root_uid_only();665 unbecome(); 666 666 return retval; 667 667 } … … 669 669 DEBUG(5,("disk_quotas: looking for quotas file \"%s\"\n", name)); 670 670 if((file=sys_open(name, O_RDONLY,0))<0) { 671 unbecome_root _uid_only();671 unbecome_root(); 672 672 return(False); 673 673 } … … 682 682 #endif 683 683 684 unbecome_root _uid_only();684 unbecome_root(); 685 685 686 686 if (ret < 0) { … … 842 842 843 843 euser_id=geteuid(); 844 become_root _uid_only();844 become_root(); 845 845 846 846 /* Use softlimit to determine disk space, except when it has been exceeded */ … … 852 852 r=quotactl (Q_GETQUOTA, mnt->mnt_fsname, euser_id, (caddr_t) &D); 853 853 854 unbecome_root _uid_only();854 unbecome_root(); 855 855 856 856 if (r==-1) … … 883 883 r=quotactl (Q_XGETQUOTA, mnt->mnt_fsname, euser_id, (caddr_t) &F); 884 884 885 unbecome_root _uid_only();885 unbecome_root(); 886 886 887 887 if (r==-1) … … 917 917 else 918 918 { 919 unbecome_root _uid_only();919 unbecome_root(); 920 920 return(False); 921 921 } … … 937 937 #define dqb_fhardlimit dqb_ihardlimit 938 938 #define dqb_fsoftlimit dqb_isoftlimit 939 #ifdef _AIXVERSION_530 940 #include <sys/statfs.h> 941 #include <sys/vmount.h> 942 #endif /* AIX 5.3 */ 939 943 #else /* !__FreeBSD__ && !AIX && !__OpenBSD__ && !__DragonFly__ */ 940 944 #include <sys/quota.h> … … 1181 1185 #endif 1182 1186 1183 become_root _uid_only();1187 become_root(); 1184 1188 1185 1189 #if defined(__FreeBSD__) || defined(__DragonFly__) … … 1187 1191 BOOL retval; 1188 1192 retval = nfs_quotas(mnts[i].f_mntfromname,euser_id,bsize,dfree,dsize); 1189 unbecome_root _uid_only();1193 unbecome_root(); 1190 1194 return retval; 1191 1195 } … … 1201 1205 } 1202 1206 1203 unbecome_root _uid_only();1207 unbecome_root(); 1204 1208 } 1205 1209 #elif defined(AIX) 1206 1210 /* AIX has both USER and GROUP quotas: 1207 1211 Get the USER quota (ohnielse@fysik.dtu.dk) */ 1212 #ifdef _AIXVERSION_530 1213 { 1214 struct statfs statbuf; 1215 quota64_t user_quota; 1216 if (statfs(path,&statbuf) != 0) 1217 return False; 1218 if(statbuf.f_vfstype == MNT_J2) 1219 { 1220 /* For some reason we need to be root for jfs2 */ 1221 become_root(); 1222 r = quotactl(path,QCMD(Q_J2GETQUOTA,USRQUOTA),euser_id,(char *) &user_quota); 1223 unbecome_root(); 1224 /* Copy results to old struct to let the following code work as before */ 1225 D.dqb_curblocks = user_quota.bused; 1226 D.dqb_bsoftlimit = user_quota.bsoft; 1227 D.dqb_bhardlimit = user_quota.bhard; 1228 } 1229 else if(statbuf.f_vfstype == MNT_JFS) 1230 { 1231 #endif /* AIX 5.3 */ 1208 1232 save_re_uid(); 1209 1233 if (set_re_uid() != 0) … … 1211 1235 r= quotactl(path,QCMD(Q_GETQUOTA,USRQUOTA),euser_id,(char *) &D); 1212 1236 restore_re_uid(); 1237 #ifdef _AIXVERSION_530 1238 } 1239 else 1240 r = 1; /* Fail for other FS-types */ 1241 } 1242 #endif /* AIX 5.3 */ 1213 1243 #else /* !__FreeBSD__ && !AIX && !__OpenBSD__ && !__DragonFly__ */ 1214 1244 r=quotactl(Q_GETQUOTA, dev_disk, euser_id, &D);
Note:
See TracChangeset
for help on using the changeset viewer.